[PATCH 1/2] kernelbase: Query FileStandardInformation instead of FileEndOfFileInformation in SetFilePointerEx().
Paul Gofman
pgofman at codeweavers.com
Fri Mar 18 07:59:04 CDT 2022
Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
These patches fix Fall in Labirinth game which is using VX Ace RPG Maker and Enigma2 (not sure if and
how those two are related). The engine introduces a virtual file system by hotpatching a number of functions.
The issues preventing game start are which these patches are fixing:
- Hooked NtQueryInformationFile doesn't understand FileEndOfFileInformation and returns success while leaving
the output data unitialized;
- Hooked NtQueryDirectoryFile gets confused by the access mask given to NtOpenFile for directory file (patch 2).
dlls/kernelbase/file.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
index 15bfe89df7a..cd6b62409ff 100644
--- a/dlls/kernelbase/file.c
+++ b/dlls/kernelbase/file.c
@@ -3629,7 +3629,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetFilePointerEx( HANDLE file, LARGE_INTEGER dista
LONGLONG pos;
IO_STATUS_BLOCK io;
FILE_POSITION_INFORMATION info;
- FILE_END_OF_FILE_INFORMATION eof;
+ FILE_STANDARD_INFORMATION eof;
switch(method)
{
@@ -3642,7 +3642,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetFilePointerEx( HANDLE file, LARGE_INTEGER dista
pos = info.CurrentByteOffset.QuadPart + distance.QuadPart;
break;
case FILE_END:
- if (NtQueryInformationFile( file, &io, &eof, sizeof(eof), FileEndOfFileInformation ))
+ if (NtQueryInformationFile( file, &io, &eof, sizeof(eof), FileStandardInformation ))
goto error;
pos = eof.EndOfFile.QuadPart + distance.QuadPart;
break;
--
2.35.1
More information about the wine-devel
mailing list