From 8fbb5372b2e934876dd2e288f73d49c4a4b690da Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 10 May 2017 11:34:48 +0300 Subject: [PATCH] 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) --- src/win32/i_main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/win32/i_main.cpp b/src/win32/i_main.cpp index bf16a87085..c82fb19694 100644 --- a/src/win32/i_main.cpp +++ b/src/win32/i_main.cpp @@ -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