ntoskrnl.exe: Correctly remove the vectored exception handler.
This commit is contained in:
parent
183bb795b6
commit
5dcdb4aba3
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue