OpenTTD Source  12.0-beta2
crashlog_win.cpp File Reference
#include "../../stdafx.h"
#include "../../crashlog.h"
#include "win32.h"
#include "../../core/alloc_func.hpp"
#include "../../core/math_func.hpp"
#include "../../string_func.h"
#include "../../fileio_func.h"
#include "../../strings_func.h"
#include "../../gamelog.h"
#include "../../saveload/saveload.h"
#include "../../video/video_driver.hpp"
#include <windows.h>
#include <mmsystem.h>
#include <signal.h>
#include <psapi.h>
#include "../../safeguards.h"

Go to the source code of this file.

Data Structures

class  CrashLogWindows
 Windows implementation for the crash logger. More...
 
struct  DebugFileInfo
 

Macros

#define PRINTF_PTR   "0x%08X"
 

Functions

static void MakeCRCTable (uint32 *table)
 
static uint32 CalcCRC (byte *data, uint size, uint32 crc)
 
static void GetFileInfo (DebugFileInfo *dfi, const wchar_t *filename)
 
static char * PrintModuleInfo (char *output, const char *last, HMODULE mod)
 
bool CloseConsoleLogIfActive ()
 
static void ShowCrashlogWindow ()
 
static LONG WINAPI ExceptionHandler (EXCEPTION_POINTERS *ep)
 
static void CDECL CustomAbort (int signal)
 
static void SetWndSize (HWND wnd, int mode)
 
static INT_PTR CALLBACK CrashDialogFunc (HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
 

Variables

static uint32 * _crc_table
 
thread_local void * _safe_esp = nullptr
 Stack pointer for use when 'starting' the crash handler. More...
 
static bool _expanded
 
static const wchar_t _crash_desc []
 
static const wchar_t _save_succeeded []
 
static const wchar_t *const _expand_texts [] = {L"S&how report >>", L"&Hide report <<" }
 

Detailed Description

Implementation of a crashlogger for Windows

Definition in file crashlog_win.cpp.

Variable Documentation

◆ _crash_desc

const wchar_t _crash_desc[]
static
Initial value:
=
L"A serious fault condition occurred in the game. The game will shut down.\n"
L"Please send the crash information and the crash.dmp file (if any) to the developers.\n"
L"This will greatly help debugging. The correct place to do this is https://github.com/OpenTTD/OpenTTD/issues. "
L"The information contained in the report is displayed below.\n"
L"Press \"Emergency save\" to attempt saving the game. Generated file(s):\n"
L"%s"

Definition at line 640 of file crashlog_win.cpp.

◆ _safe_esp

thread_local void* _safe_esp = nullptr

Stack pointer for use when 'starting' the crash handler.

Not static as gcc's inline assembly needs it that way.

Definition at line 529 of file crashlog_win.cpp.

◆ _save_succeeded

const wchar_t _save_succeeded[]
static
Initial value:
=
L"Emergency save succeeded.\nIts location is '%s'.\n"
L"Be aware that critical parts of the internal game state may have become "
L"corrupted. The saved game is not guaranteed to work."

Definition at line 648 of file crashlog_win.cpp.