mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
improve legacy build
This commit is contained in:
parent
9d43cc31f2
commit
561f2ba614
@ -47,10 +47,14 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
|||||||
|
|
||||||
cfg_load();
|
cfg_load();
|
||||||
|
|
||||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WINXP)
|
PVOID(WINAPI * add_handler)(ULONG, PVECTORED_EXCEPTION_HANDLER) =
|
||||||
g_dbg_exception_handle =
|
(void*)real_GetProcAddress(GetModuleHandleA("Kernel32.dll"), "AddVectoredExceptionHandler");
|
||||||
AddVectoredExceptionHandler(1, (PVECTORED_EXCEPTION_HANDLER)dbg_vectored_exception_handler);
|
|
||||||
#endif
|
if (add_handler)
|
||||||
|
{
|
||||||
|
g_dbg_exception_handle =
|
||||||
|
add_handler(1, (PVECTORED_EXCEPTION_HANDLER)dbg_vectored_exception_handler);
|
||||||
|
}
|
||||||
|
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
@ -148,10 +152,11 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
|||||||
dinput_hook_exit();
|
dinput_hook_exit();
|
||||||
hook_exit();
|
hook_exit();
|
||||||
|
|
||||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WINXP)
|
ULONG(WINAPI* remove_handler)(PVOID) =
|
||||||
if (g_dbg_exception_handle)
|
(void*)real_GetProcAddress(GetModuleHandleA("Kernel32.dll"), "RemoveVectoredExceptionHandler");
|
||||||
RemoveVectoredExceptionHandler(g_dbg_exception_handle);
|
|
||||||
#endif
|
if (g_dbg_exception_handle && remove_handler)
|
||||||
|
remove_handler(g_dbg_exception_handle);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user