Valve provides the ISteamClient::WriteMiniDump method (via steam_api.h ). The correct signature:
#include #include #include "steam/steam_api.h" // The exception filter function LONG WINAPI CustomCrashHandler(EXCEPTION_POINTERS* pExceptionInfo) std::cout << "[CRASH] Unhandled exception detected. Writing minidump..." << std::endl; // Fetch your current Steam Build ID, or use a hardcoded internal version number uint32 currentBuildId = SteamApps() ? SteamApps()->GetAppBuildId() : 0; // Call the SteamAPI function SteamAPI_WriteMiniDump( pExceptionInfo->ExceptionRecord->ExceptionCode, pExceptionInfo, currentBuildId ); // Tell Windows to terminate the process cleanly after handling return EXCEPTION_EXECUTE_HANDLER; int main() // Initialize Steamworks if (!SteamAPI_Init()) std::cout << "Steamworks initialization failed." << std::endl; return 1; // Register our crash handler with the Windows OS SetUnhandledExceptionFilter(CustomCrashHandler); // Simulate a crash (Null Pointer Dereference) int* badPointer = nullptr; *badPointer = 42; // Shutdown Steamworks (will not be reached in this example) SteamAPI_Shutdown(); return 0; Use code with caution. Where Are the Minidumps Saved?
void SteamAPI_WriteMiniDump( uint32 uUncaughtExceptionCode, void *pExceptionInfo, uint32 uBuildId ); Use code with caution. Parameter Breakdown
Do not attempt complex logic, allocations, or network calls inside the crash handler. The application state is unstable during a crash; keep the minidump call as isolated as possible.
Pass your internal version number into uBuildID . This ensures that when you view the crash on the Steamworks website, you know exactly which build triggered it without cross-referencing SVN/Git logs. SteamAPI WriteMiniDump
By the time Mara arrived, the server had restarted itself twice, each time leaving that same small crater of silence in the logs. They split duties like surgeons: Mara dug into the OS-level details, probing kernel rings and driver chatter; Eli traced the application threads, marking where execution had gone off-script. The more they waded through the ruins, the stranger the scene became. Threads that should have been parked and patient were sprinting. Memory ranges were shuffled like ill-sorted cards. There were signs of a foreign hand — something that had been inside the machine and had decided to play.
Here is a structural example of how to hook the function into a standard Windows structured exception handling (SEH) loop.
// Write mini-dump for the current process bool success = steamUtils->WriteMiniDump(GetCurrentProcessId(), NULL);
Dumps are uploaded to your Steamworks dashboard under Reports > Crash Reports . 2. Basic Syntax The function signature in steam_api.h is: The application state is unstable during a crash;
#include <steam/steamutils.h>
Instead of guessing what caused a crash, you can load the dump file into Visual Studio or WinDbg to see the exact line of code that failed.
Once the dump file is generated (usually in the same folder as your executable), you need to analyze it. Using Visual Studio Open the .dmp file in Visual Studio. Click .
Example (pseudocode; adapt to SDK and language): By the time Mara arrived, the server had
If you are not currently using this in your Steam builds, it is highly recommended to implement it.
The function only writes the file locally. To get these files from your users, you need to build a small post-crash launcher utility that checks for .dmp files on startup and prompts the user to upload them to your back-end server or bug tracker.
Once the minidump is generated, the function typically handles the upload to Steam’s servers via an HTTP API. This data is then aggregated in the Steamworks developer portal, where creators can track which crashes are most prevalent across their player base. Implementation and Workflow
They worked until the horizon lightened and the city beneath them began to wake. They drafted a patch, deployed it to a staging cluster, and then to production. Node 7 hummed differently afterward — not jubilant, but steady, as if relieved to be whole again.