Don't trigger the dump if a debugger is attached (check with IsDebuggerPresent() ), as the debugger should handle the exception instead.
What are you using? (C++, Unity, Unreal Engine?) Do you need an automated way to upload dumps to a server ? Are you targeting Linux / Steam Deck users as well?
return EXCEPTION_EXECUTE_HANDLER;
: Calling WriteMiniDump immediately on crash is crucial. Do not attempt to run complex game logic afterward.
#include #include "steam_api.h" void MiniDumpFunction(unsigned int nExceptionCode, EXCEPTION_POINTERS *pException) // Optional: Add context like current level or memory status SteamAPI_SetMiniDumpComment("User was on Level 3 during crash."); // Write and upload the dump // 1234 is your custom build ID SteamAPI_WriteMiniDump(nExceptionCode, pException, 1234); Use code with caution. Copied to clipboard B. Hook the Handler in WinMain SteamAPI WriteMiniDump
Add additional context to the dump, such as user-specific actions taken before the crash or custom game state, before calling WriteMiniDump .
__except( SteamAPI_WriteMiniDump( GetExceptionCode(), GetExceptionInformation(), 1 ), EXCEPTION_EXECUTE_HANDLER ) Don't trigger the dump if a debugger is
SteamAPI_WriteMiniDump is a function within the that allows your application to create a Windows Minidump file ( .dmp ) when a crash occurs. This file is a snapshot of the application’s state, including: Active call stacks Loaded modules (DLLs) System information CPU register information
int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) Are you targeting Linux / Steam Deck users as well