ntoskrnl.exe: Correctly remove the vectored exception handler.

oldstable
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 )
{
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;