Skip to content

Commit

Permalink
fix: crash dumps are sent to working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Buckminsterfullerene02 committed Jun 1, 2024
1 parent 7ce9870 commit 9a329a3
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 9a329a3

Please sign in to comment.