CrashHandler: Fix call stack on manual dump

This commit is contained in:
Stenzek 2024-05-25 17:15:32 +10:00
parent cca7b46114
commit 8e5781266a
No known key found for this signature in database

View file

@ -61,17 +61,26 @@ static bool WriteMinidump(HMODULE hDbgHelp, HANDLE hFile, HANDLE hProcess, DWORD
if (!minidump_write_dump) if (!minidump_write_dump)
return false; return false;
MINIDUMP_EXCEPTION_INFORMATION mei; MINIDUMP_EXCEPTION_INFORMATION mei = {};
PMINIDUMP_EXCEPTION_INFORMATION mei_ptr = nullptr;
if (exception) if (exception)
{ {
mei.ThreadId = thread_id; mei.ThreadId = thread_id;
mei.ExceptionPointers = exception; mei.ExceptionPointers = exception;
mei.ClientPointers = FALSE; mei.ClientPointers = FALSE;
mei_ptr = &mei; return minidump_write_dump(hProcess, process_id, hFile, type, &mei, nullptr, nullptr);
} }
return minidump_write_dump(hProcess, process_id, hFile, type, mei_ptr, nullptr, nullptr); __try
{
RaiseException(EXCEPTION_INVALID_HANDLE, 0, 0, nullptr);
}
__except (WriteMinidump(hDbgHelp, hFile, GetCurrentProcess(), GetCurrentProcessId(), GetCurrentThreadId(),
GetExceptionInformation(), type),
EXCEPTION_EXECUTE_HANDLER)
{
}
return true;
} }
static std::wstring s_write_directory; static std::wstring s_write_directory;