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:
alexey.lysiuk 2017-05-10 11:34:48 +03:00
parent 092b339c8f
commit 8fbb5372b2

View file

@ -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