mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-20 15:40:32 +00:00
Handle case where the log path has more that MAX_PATH characters
This commit is contained in:
parent
f400116bcd
commit
adeb4fe02f
@ -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…
x
Reference in New Issue
Block a user