From 1392bdd258f8765c26eaa83f2f035629626b8548 Mon Sep 17 00:00:00 2001 From: ZeldaZach Date: Sat, 18 Jan 2025 00:33:30 -0500 Subject: [PATCH] Fix Windows 7 Crash Dump --- cockatrice/src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cockatrice/src/main.cpp b/cockatrice/src/main.cpp index 554d89c45..3a100683b 100644 --- a/cockatrice/src/main.cpp +++ b/cockatrice/src/main.cpp @@ -92,8 +92,13 @@ LONG WINAPI CockatriceUnhandledExceptionFilter(EXCEPTION_POINTERS *exceptionPoin path /= "cockatrice.crash." + std::to_string(std::time(0)) + ".dmp"; // Create and write crash files +#ifdef UNICODE HANDLE hDumpFile = CreateFile(path.wstring().c_str(), GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); +#else + HANDLE hDumpFile = + CreateFile(path.string().c_str(), GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); +#endif MINIDUMP_EXCEPTION_INFORMATION mei; mei.ExceptionPointers = exceptionPointers;