From 5dcdb4aba3090794639c8988842898de70308597 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 2 Feb 2009 16:21:25 +0100 Subject: [PATCH] ntoskrnl.exe: Correctly remove the vectored exception handler. --- dlls/ntoskrnl.exe/ntoskrnl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index a62f02a5447..0dc9aaf32f3 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -1166,17 +1166,18 @@ PVOID WINAPI MmGetSystemRoutineAddress(PUNICODE_STRING SystemRoutineName) */ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) { + static void *handler; LARGE_INTEGER count; switch(reason) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls( inst ); - RtlAddVectoredExceptionHandler( TRUE, vectored_handler ); + handler = RtlAddVectoredExceptionHandler( TRUE, vectored_handler ); KeQueryTickCount( &count ); /* initialize the global KeTickCount */ break; case DLL_PROCESS_DETACH: - RtlRemoveVectoredExceptionHandler( vectored_handler ); + RtlRemoveVectoredExceptionHandler( handler ); break; } return TRUE;