diff --git a/cmake/Targets.cmake b/cmake/Targets.cmake index aa46f5c..bdbe25a 100644 --- a/cmake/Targets.cmake +++ b/cmake/Targets.cmake @@ -67,6 +67,7 @@ set(VOID_WINDOWS_MODULES Scheduler Service Sqlite + Storage System Testing TestingMock diff --git a/src/Storage/FilePort.cpp b/src/Storage/FilePort.cpp index bbb7a38..0c99b1e 100644 --- a/src/Storage/FilePort.cpp +++ b/src/Storage/FilePort.cpp @@ -268,7 +268,9 @@ inline int open(const wchar_t* path, const int flags, const int mode = 0) } return fd; } - return ::_wopen(path, flags & ~O_NOFOLLOW, mode); + // Storage files are binary: never let the CRT translate CRLF or treat + // 0x1A as EOF. + return ::_wopen(path, (flags & ~O_NOFOLLOW) | _O_BINARY, mode); } #endif // _WIN32