|
@@ -502,49 +502,49 @@ static LONG WINAPI ExceptionHandler(EXCE
|
|
|
MessageBox(NULL, _emergency_crash, _T("Fatal Application Failure"), MB_ICONERROR);
|
|
|
ExitProcess(3);
|
|
|
}
|
|
|
|
|
|
if (SaveloadCrashWithMissingNewGRFs()) {
|
|
|
static const TCHAR _saveload_crash[] =
|
|
|
_T("A serious fault condition occurred in the game. The game will shut down.\n")
|
|
|
_T("As you loaded an savegame for which you do not have the required NewGRFs\n")
|
|
|
_T("no crash information will be generated.\n");
|
|
|
MessageBox(NULL, _saveload_crash, _T("Fatal Application Failure"), MB_ICONERROR);
|
|
|
ExitProcess(3);
|
|
|
}
|
|
|
|
|
|
CrashLogWindows *log = new CrashLogWindows(ep);
|
|
|
CrashLogWindows::current = log;
|
|
|
char *buf = log->FillCrashLog(log->crashlog, lastof(log->crashlog));
|
|
|
log->WriteCrashDump(log->crashdump_filename, lastof(log->crashdump_filename));
|
|
|
log->AppendDecodedStacktrace(buf, lastof(log->crashlog));
|
|
|
log->WriteCrashLog(log->crashlog, log->crashlog_filename, lastof(log->crashlog_filename));
|
|
|
log->WriteScreenshot(log->screenshot_filename, lastof(log->screenshot_filename));
|
|
|
|
|
|
/* Close any possible log files */
|
|
|
CloseConsoleLogIfActive();
|
|
|
|
|
|
if ((_video_driver == NULL || _video_driver->HasGUI()) && _safe_esp != NULL) {
|
|
|
if ((VideoDriver::GetInstance() == NULL || VideoDriver::GetInstance()->HasGUI()) && _safe_esp != NULL) {
|
|
|
#ifdef _M_AMD64
|
|
|
ep->ContextRecord->Rip = (DWORD64)ShowCrashlogWindow;
|
|
|
ep->ContextRecord->Rsp = (DWORD64)_safe_esp;
|
|
|
#else
|
|
|
ep->ContextRecord->Eip = (DWORD)ShowCrashlogWindow;
|
|
|
ep->ContextRecord->Esp = (DWORD)_safe_esp;
|
|
|
#endif
|
|
|
return EXCEPTION_CONTINUE_EXECUTION;
|
|
|
}
|
|
|
|
|
|
CrashLog::AfterCrashLogCleanup();
|
|
|
return EXCEPTION_EXECUTE_HANDLER;
|
|
|
}
|
|
|
|
|
|
static void CDECL CustomAbort(int signal)
|
|
|
{
|
|
|
RaiseException(0xE1212012, 0, 0, NULL);
|
|
|
}
|
|
|
|
|
|
/* static */ void CrashLog::InitialiseCrashLog()
|
|
|
{
|
|
|
#ifdef _M_AMD64
|
|
|
CONTEXT ctx;
|
|
|
RtlCaptureContext(&ctx);
|