ntoskrnl.exe: Correctly remove the vectored exception handler.

This commit is contained in:
Alexandre Julliard 2009-02-02 16:21:25 +01:00
parent 183bb795b6
commit 5dcdb4aba3
1 changed files with 3 additions and 2 deletions

View File

@ -1166,17 +1166,18 @@ PVOID WINAPI MmGetSystemRoutineAddress(PUNICODE_STRING SystemRoutineName)
*/ */
BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
{ {
static void *handler;
LARGE_INTEGER count; LARGE_INTEGER count;
switch(reason) switch(reason)
{ {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls( inst ); DisableThreadLibraryCalls( inst );
RtlAddVectoredExceptionHandler( TRUE, vectored_handler ); handler = RtlAddVectoredExceptionHandler( TRUE, vectored_handler );
KeQueryTickCount( &count ); /* initialize the global KeTickCount */ KeQueryTickCount( &count ); /* initialize the global KeTickCount */
break; break;
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
RtlRemoveVectoredExceptionHandler( vectored_handler ); RtlRemoveVectoredExceptionHandler( handler );
break; break;
} }
return TRUE; return TRUE;