102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
dttr_crashdump.h File Reference
#include <stdbool.h>
#include <sds.h>
#include <windows.h>

Go to the source code of this file.

Typedefs

typedef bool(* DTTR_CrashDump_SymbolProvider) (HANDLE process, void *context)
 Adds process-local symbols after DbgHelp initialization and before stack walking.

Functions

void DTTR_CrashDump_SetSymbolProvider (DTTR_CrashDump_SymbolProvider provider, void *context)
 Registers a synchronous symbol provider used by crash stack formatting.
void DTTR_CrashDump_ClearSymbolProvider ()
sds DTTR_CrashDump_FormatStackTrace (HANDLE process, HANDLE thread, const CONTEXT *context)
 Formats a stack trace from a thread context. Caller frees the returned sds.
sds DTTR_CrashDump_AppendReportMessage (sds message, const char *stack_trace)
sds DTTR_CrashDump_Write (HANDLE process, DWORD pid, DWORD tid, EXCEPTION_POINTERS *exception_info)
void DTTR_CrashDump_LogAndTraceReport (const char *message)
void DTTR_CrashDump_Init (const char *dump_dir)

Typedef Documentation

◆ DTTR_CrashDump_SymbolProvider

typedef bool(* DTTR_CrashDump_SymbolProvider) (HANDLE process, void *context)

Adds process-local symbols after DbgHelp initialization and before stack walking.

Definition at line 10 of file dttr_crashdump.h.

Function Documentation

◆ DTTR_CrashDump_AppendReportMessage()

sds DTTR_CrashDump_AppendReportMessage ( sds message,
const char * stack_trace )

Definition at line 416 of file crashdump.c.

References DTTR_REPORT_SUFFIX.

Referenced by unhandled_exception_filter(), and write_child_dump().

◆ DTTR_CrashDump_ClearSymbolProvider()

void DTTR_CrashDump_ClearSymbolProvider ( )

Definition at line 53 of file crashdump.c.

References DTTR_CrashDump_SetSymbolProvider(), and NULL.

Referenced by dttr_pcdogs_crash_symbols_clear().

◆ DTTR_CrashDump_FormatStackTrace()

sds DTTR_CrashDump_FormatStackTrace ( HANDLE process,
HANDLE thread,
const CONTEXT * context )

◆ DTTR_CrashDump_Init()

void DTTR_CrashDump_Init ( const char * dump_dir)

Installs an exception filter that writes dumps under the given directory and shows a crash dialog.

Definition at line 636 of file crashdump.c.

References crash_dump_dir, DTTR_LOG_DEBUG, DTTR_LOG_ERROR, set_dump_dir(), and unhandled_exception_filter().

Referenced by DTTR_Hook_WinMainCallback(), and dttr_launcher_main().

◆ DTTR_CrashDump_LogAndTraceReport()

void DTTR_CrashDump_LogAndTraceReport ( const char * message)

Definition at line 486 of file crashdump.c.

References DTTR_LOG_ERROR.

Referenced by unhandled_exception_filter(), and write_child_dump().

◆ DTTR_CrashDump_SetSymbolProvider()

void DTTR_CrashDump_SetSymbolProvider ( DTTR_CrashDump_SymbolProvider provider,
void * context )

Registers a synchronous symbol provider used by crash stack formatting.

Definition at line 43 of file crashdump.c.

References crash_symbol_provider, crash_symbol_provider_context, enter_dbghelp_lock(), and leave_dbghelp_lock().

Referenced by DTTR_CrashDump_ClearSymbolProvider(), and dttr_pcdogs_crash_symbols_register().

◆ DTTR_CrashDump_Write()

sds DTTR_CrashDump_Write ( HANDLE process,
DWORD pid,
DWORD tid,
EXCEPTION_POINTERS * exception_info )

Writes a process minidump and returns the dump filename. The caller should free the returned sds.

Definition at line 428 of file crashdump.c.

References BOOL, crash_dump_dir, DTTR_LOG_ERROR, DTTR_LOG_INFO, DWORD, enter_dbghelp_lock(), FALSE, leave_dbghelp_lock(), minidump_type(), NULL, and st.

Referenced by dttr_sidecar_write_exception_report(), unhandled_exception_filter(), and write_child_dump().