diff --git a/daemon/main.cpp b/daemon/main.cpp index d57de2de2..c0371ae0c 100644 --- a/daemon/main.cpp +++ b/daemon/main.cpp @@ -339,13 +339,16 @@ class WindowsServiceStopped LONG GenerateDump(EXCEPTION_POINTERS* pExceptionPointers) { + const DWORD flags = MiniDumpWithFullMemory | MiniDumpWithFullMemoryInfo | MiniDumpWithHandleData + | MiniDumpWithUnloadedModules | MiniDumpWithThreadInfo; + std::stringstream ss; ss << "C:\\ProgramData\\lokinet\\crash-" << llarp::time_now_ms().count() << ".dmp"; const std::string fname = ss.str(); HANDLE hDumpFile; SYSTEMTIME stLocalTime; GetLocalTime(&stLocalTime); - MINIDUMP_EXCEPTION_INFORMATION ExpParam; + MINIDUMP_EXCEPTION_INFORMATION ExpParam{}; hDumpFile = CreateFile( fname.c_str(), @@ -356,18 +359,11 @@ GenerateDump(EXCEPTION_POINTERS* pExceptionPointers) 0, 0); - ExpParam.ThreadId = GetCurrentThreadId(); ExpParam.ExceptionPointers = pExceptionPointers; ExpParam.ClientPointers = TRUE; MiniDumpWriteDump( - GetCurrentProcess(), - GetCurrentProcessId(), - hDumpFile, - MiniDumpWithDataSegs, - &ExpParam, - NULL, - NULL); + GetCurrentProcess(), GetCurrentProcessId(), hDumpFile, flags, &ExpParam, NULL, NULL); return 1; }