mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Handle case where the log path has more that MAX_PATH characters
This commit is contained in:
parent
f400116bcd
commit
adeb4fe02f
1 changed files with 4 additions and 1 deletions
|
@ -152,10 +152,13 @@ namespace Crash
|
|||
if (miniDumpWriteDump == NULL)
|
||||
return;
|
||||
|
||||
const std::wstring utf16Path = utf8ToUtf16(mShm->mStartup.mLogFilePath);
|
||||
std::wstring utf16Path = utf8ToUtf16(mShm->mStartup.mLogFilePath);
|
||||
if (utf16Path.empty())
|
||||
return;
|
||||
|
||||
if (utf16Path.length() > MAX_PATH)
|
||||
utf16Path = LR"(\\?\)" + utf16Path;
|
||||
|
||||
HANDLE hCrashLog = CreateFileW(utf16Path.c_str(), GENERIC_READ | GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
if (hCrashLog == NULL || hCrashLog == INVALID_HANDLE_VALUE)
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue