From 2b3f9477216687a12f402a095d85106efc14da6a Mon Sep 17 00:00:00 2001 From: lifegpc Date: Tue, 4 Mar 2025 08:15:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DVFS=E7=B1=BB=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E8=B7=AF=E5=BE=84=E5=88=86=E9=9A=94=E7=AC=A6=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E9=80=BB=E8=BE=91=EF=BC=8C=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?SetFilePointer=E5=87=BD=E6=95=B0=E4=BB=A5=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E9=AB=98=E4=BD=8D=E7=A7=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vfs.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vfs.cpp b/vfs.cpp index 7554670..6c550f1 100644 --- a/vfs.cpp +++ b/vfs.cpp @@ -74,7 +74,7 @@ HANDLE VFS::CreateFileW(std::wstring path) { return INVALID_HANDLE_VALUE; } str = fileop::relpath(str, base_path); - str = str_util::str_replace(str, "\\", "/"); + str = str_util::str_replace(str, "/", "\\"); auto c = files.find(str); if (c == files.end()) { SetLastError(ERROR_FILE_NOT_FOUND); @@ -169,7 +169,11 @@ DWORD VFS::SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceTo SetLastError(ERROR_INVALID_HANDLE); return INVALID_SET_FILE_POINTER; } - zip_int64_t n = zip_fseek(file, lDistanceToMove, dwMoveMethod); + zip_int64_t offset = lDistanceToMove; + if (lpDistanceToMoveHigh) { + offset |= ((zip_int64_t)*lpDistanceToMoveHigh) << 32; + } + zip_int64_t n = zip_fseek(file, offset, dwMoveMethod); if (n == -1) { SetLastError(ERROR_INVALID_HANDLE); return INVALID_SET_FILE_POINTER;