Skip to content

Commit

Permalink
Merge pull request #551 from UE4SS-RE/fix-crashdump-loc
Browse files Browse the repository at this point in the history
fix: crash dumps are sent to working directory
  • Loading branch information
narknon authored Jun 4, 2024
2 parents 664c83a + 9a329a3 commit 73d3b65
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions UE4SS/src/CrashDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
#include <chrono>
#include <string>
#include <format>
#include <filesystem>
#include <bit>

#include <UE4SSProgram.hpp>

#define NOMINMAX
#include <Windows.h>
#include <dbghelp.h>
Expand All @@ -25,7 +26,7 @@ namespace RC
LONG WINAPI ExceptionHandler(_EXCEPTION_POINTERS* exception_pointers)
{
const auto now = time_point_cast<seconds>(system_clock::now());
const std::wstring dump_path = (fs::current_path() / std::format("crash_{:%Y_%m_%d_%H_%M_%S}.dmp", now)).wstring();
const std::wstring dump_path = std::format(L"{}\\crash_{:%Y_%m_%d_%H_%M_%S}.dmp", StringType{UE4SSProgram::get_program().get_working_directory()}, now);

const HANDLE file = CreateFileW(dump_path.c_str(), GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);

Expand Down

0 comments on commit 73d3b65

Please sign in to comment.