Commit 30cb179f authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Encode the function pointers in the vectored handler list.

parent 2497a91f
...@@ -155,6 +155,7 @@ LONG call_vectored_handlers( EXCEPTION_RECORD *rec, CONTEXT *context ) ...@@ -155,6 +155,7 @@ LONG call_vectored_handlers( EXCEPTION_RECORD *rec, CONTEXT *context )
struct list *ptr; struct list *ptr;
LONG ret = EXCEPTION_CONTINUE_SEARCH; LONG ret = EXCEPTION_CONTINUE_SEARCH;
EXCEPTION_POINTERS except_ptrs; EXCEPTION_POINTERS except_ptrs;
PVECTORED_EXCEPTION_HANDLER func;
VECTORED_HANDLER *handler, *to_free = NULL; VECTORED_HANDLER *handler, *to_free = NULL;
except_ptrs.ExceptionRecord = rec; except_ptrs.ExceptionRecord = rec;
...@@ -166,14 +167,15 @@ LONG call_vectored_handlers( EXCEPTION_RECORD *rec, CONTEXT *context ) ...@@ -166,14 +167,15 @@ LONG call_vectored_handlers( EXCEPTION_RECORD *rec, CONTEXT *context )
{ {
handler = LIST_ENTRY( ptr, VECTORED_HANDLER, entry ); handler = LIST_ENTRY( ptr, VECTORED_HANDLER, entry );
handler->count++; handler->count++;
func = RtlDecodePointer( handler->func );
RtlLeaveCriticalSection( &vectored_handlers_section ); RtlLeaveCriticalSection( &vectored_handlers_section );
RtlFreeHeap( GetProcessHeap(), 0, to_free ); RtlFreeHeap( GetProcessHeap(), 0, to_free );
to_free = NULL; to_free = NULL;
TRACE( "calling handler at %p code=%x flags=%x\n", TRACE( "calling handler at %p code=%x flags=%x\n",
handler->func, rec->ExceptionCode, rec->ExceptionFlags ); func, rec->ExceptionCode, rec->ExceptionFlags );
ret = handler->func( &except_ptrs ); ret = func( &except_ptrs );
TRACE( "handler at %p returned %x\n", handler->func, ret ); TRACE( "handler at %p returned %x\n", func, ret );
RtlEnterCriticalSection( &vectored_handlers_section ); RtlEnterCriticalSection( &vectored_handlers_section );
ptr = list_next( &vectored_handlers, ptr ); ptr = list_next( &vectored_handlers, ptr );
...@@ -226,7 +228,7 @@ PVOID WINAPI RtlAddVectoredExceptionHandler( ULONG first, PVECTORED_EXCEPTION_HA ...@@ -226,7 +228,7 @@ PVOID WINAPI RtlAddVectoredExceptionHandler( ULONG first, PVECTORED_EXCEPTION_HA
VECTORED_HANDLER *handler = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*handler) ); VECTORED_HANDLER *handler = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*handler) );
if (handler) if (handler)
{ {
handler->func = func; handler->func = RtlEncodePointer( func );
handler->count = 1; handler->count = 1;
RtlEnterCriticalSection( &vectored_handlers_section ); RtlEnterCriticalSection( &vectored_handlers_section );
if (first) list_add_head( &vectored_handlers, &handler->entry ); if (first) list_add_head( &vectored_handlers, &handler->entry );
......
...@@ -2298,6 +2298,7 @@ NTSYSAPI BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR); ...@@ -2298,6 +2298,7 @@ NTSYSAPI BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
NTSYSAPI BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR); NTSYSAPI BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
NTSYSAPI NTSTATUS WINAPI RtlCreateUserThread(HANDLE,const SECURITY_DESCRIPTOR*,BOOLEAN,PVOID,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*); NTSYSAPI NTSTATUS WINAPI RtlCreateUserThread(HANDLE,const SECURITY_DESCRIPTOR*,BOOLEAN,PVOID,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*);
NTSYSAPI void WINAPI RtlDeactivateActivationContext(DWORD,ULONG_PTR); NTSYSAPI void WINAPI RtlDeactivateActivationContext(DWORD,ULONG_PTR);
NTSYSAPI PVOID WINAPI RtlDecodePointer(PVOID);
NTSYSAPI NTSTATUS WINAPI RtlDecompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,PULONG); NTSYSAPI NTSTATUS WINAPI RtlDecompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,PULONG);
NTSYSAPI NTSTATUS WINAPI RtlDeleteAce(PACL,DWORD); NTSYSAPI NTSTATUS WINAPI RtlDeleteAce(PACL,DWORD);
NTSYSAPI NTSTATUS WINAPI RtlDeleteAtomFromAtomTable(RTL_ATOM_TABLE,RTL_ATOM); NTSYSAPI NTSTATUS WINAPI RtlDeleteAtomFromAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
...@@ -2326,6 +2327,7 @@ NTSYSAPI NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE ...@@ -2326,6 +2327,7 @@ NTSYSAPI NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE
NTSYSAPI void WINAPI RtlDumpResource(LPRTL_RWLOCK); NTSYSAPI void WINAPI RtlDumpResource(LPRTL_RWLOCK);
NTSYSAPI NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*); NTSYSAPI NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
NTSYSAPI NTSTATUS WINAPI RtlEmptyAtomTable(RTL_ATOM_TABLE,BOOLEAN); NTSYSAPI NTSTATUS WINAPI RtlEmptyAtomTable(RTL_ATOM_TABLE,BOOLEAN);
NTSYSAPI PVOID WINAPI RtlEncodePointer(PVOID);
NTSYSAPI NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *); NTSYSAPI NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
NTSYSAPI void WINAPI RtlEraseUnicodeString(UNICODE_STRING*); NTSYSAPI void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
NTSYSAPI NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*); NTSYSAPI NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment