[6/6] ntdll: NtReadFile should fail for overlapped IO on files if offset is negative.

Dmitry Timoshkov dmitry at baikal.ru
Fri Sep 6 03:07:17 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 c3d10cb..657d2af 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