mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
Fixed 32-bit Windows crash reporter
Restored old exception handling for 32-bit Windows executable Tested on 32-bit Windows XP (previously exited without notification), 64-bit Windows 7 and 10 (previously deadlocked in system DLLs)
This commit is contained in:
parent
092b339c8f
commit
8fbb5372b2
1 changed files with 6 additions and 0 deletions
|
@ -1222,7 +1222,11 @@ LONG WINAPI CatchAllExceptions (LPEXCEPTION_POINTERS info)
|
|||
// Otherwise, put the crashing thread to sleep and signal the main thread to clean up.
|
||||
if (GetCurrentThreadId() == MainThreadID)
|
||||
{
|
||||
#ifdef _M_X64
|
||||
*info->ContextRecord = MainThreadContext;
|
||||
#else
|
||||
info->ContextRecord->Eip = (DWORD_PTR)ExitFatally;
|
||||
#endif // _M_X64
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1315,6 +1319,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE nothing, LPSTR cmdline, int n
|
|||
{
|
||||
SetUnhandledExceptionFilter (CatchAllExceptions);
|
||||
|
||||
#ifdef _M_X64
|
||||
static bool setJumpResult = false;
|
||||
RtlCaptureContext(&MainThreadContext);
|
||||
if (setJumpResult)
|
||||
|
@ -1323,6 +1328,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE nothing, LPSTR cmdline, int n
|
|||
return 0;
|
||||
}
|
||||
setJumpResult = true;
|
||||
#endif // _M_X64
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue