[5/5] ntdll: NtReadFile should fail for overlapped IO on files if offset is negative. Resend.
Dmitry Timoshkov
dmitry at baikal.ru
Mon Sep 9 03:10:12 CDT 2013
Currently it relies on pread to fail if negative offset is passed.
---
dlls/ntdll/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index c49eeca..877ebe8 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -606,7 +606,7 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
if (type == FD_TYPE_FILE)
{
- if (!(options & (FILE_SYNCHRONOUS_IO_ALERT | FILE_SYNCHRONOUS_IO_NONALERT)) && !offset)
+ if (!(options & (FILE_SYNCHRONOUS_IO_ALERT | FILE_SYNCHRONOUS_IO_NONALERT)) && (!offset || offset->QuadPart < 0))
{
status = STATUS_INVALID_PARAMETER;
goto done;
--
1.8.3.4
More information about the wine-patches
mailing list