diff options
Diffstat (limited to 'zencore/filesystem.cpp')
| -rw-r--r-- | zencore/filesystem.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/zencore/filesystem.cpp b/zencore/filesystem.cpp index 041abaf1d..e2778089b 100644 --- a/zencore/filesystem.cpp +++ b/zencore/filesystem.cpp @@ -921,6 +921,10 @@ PathFromHandle(void* NativeHandle) } const DWORD RequiredLengthIncludingNul = GetFinalPathNameByHandleW(NativeHandle, nullptr, 0, FILE_NAME_OPENED); + if (RequiredLengthIncludingNul == 0) + { + ThrowLastError(fmt::format("failed to get path from file handle {}", NativeHandle)); + } std::wstring FullPath; FullPath.resize(RequiredLengthIncludingNul - 1); |