diff options
| -rw-r--r-- | zencore/iobuffer.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/zencore/iobuffer.cpp b/zencore/iobuffer.cpp index d037d7a85..1d7d47695 100644 --- a/zencore/iobuffer.cpp +++ b/zencore/iobuffer.cpp @@ -324,7 +324,9 @@ IoBufferExtendedCore::Materialize() const if (NewMmapHandle == nullptr) { - throw std::system_error(std::error_code(::GetLastError(), std::system_category()), + int32_t Error = zen::GetLastError(); + ZEN_ERROR("CreateFileMapping failed on file '{}', {}", zen::PathFromHandle(m_FileHandle), GetSystemErrorAsString(Error)); + throw std::system_error(std::error_code(Error, std::system_category()), fmt::format("CreateFileMapping failed on file '{}'", zen::PathFromHandle(m_FileHandle))); } @@ -354,6 +356,11 @@ IoBufferExtendedCore::Materialize() const #if ZEN_PLATFORM_WINDOWS CloseHandle(NewMmapHandle); #endif // ZEN_PLATFORM_WINDOWS + ZEN_ERROR("MapViewOfFile failed (offset {:#x}, size {:#x}) file: '{}', {}", + MapOffset, + MapSize, + zen::PathFromHandle(m_FileHandle), + GetSystemErrorAsString(Error)); throw std::system_error(std::error_code(Error, std::system_category()), fmt::format("MapViewOfFile failed (offset {:#x}, size {:#x}) file: '{}'", MapOffset, |