From aa8d84c0e7315a676b13d3ef3fe364ae2c249f87 Mon Sep 17 00:00:00 2001 From: lizzie Date: Tue, 30 Dec 2025 20:08:27 +0000 Subject: [PATCH] sad --- src/common/fs/file.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/fs/file.cpp b/src/common/fs/file.cpp index 25b38d8405..bde7713078 100644 --- a/src/common/fs/file.cpp +++ b/src/common/fs/file.cpp @@ -310,7 +310,7 @@ static void PlatformUnmap(IOFile& io) { // NO IMPLEMENTATION YET #else static int PlatformMapReadOnly(IOFile& io, const wchar_t* path) { - io.file_handle = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, nullptr); + io.file_handle = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, nullptr); if (HANDLE(io.file_handle) != INVALID_HANDLE_VALUE) { io.mapping_handle = CreateFileMappingW(HANDLE(io.file_handle), nullptr, PAGE_READONLY, 0, 0, nullptr); if (io.mapping_handle) { @@ -350,13 +350,13 @@ void IOFile::Open(const fs::path& path, FileAccessMode mode, FileType type, File errno = 0; #ifdef _WIN32 // TODO: this probably can use better logic but oh well I'm not a windowser - io.file_handle = nullptr; + file_handle = nullptr; if (type == FileType::BinaryFile && mode == FileAccessMode::Read) { if (PlatformMapReadOnly(*this, path.c_str()) == -1) { LOG_ERROR(Common_Filesystem, "Error mmap'ing file: {}", path.c_str()); } } - if (io.file_handle == nullptr) { + if (file_handle == nullptr) { if (flag != FileShareFlag::ShareNone) { file = _wfsopen(path.c_str(), AccessModeToWStr(mode, type), ToWindowsFileShareFlag(flag)); } else {