Paul Gofman : ntdll: Return STATUS_PENDING from NtReadFile() for async read in case of no buffering.

Alexandre Julliard julliard at winehq.org
Tue Feb 19 15:29:34 CST 2019


Module: wine
Branch: master
Commit: 7ce2a8e0ae3d107f7dbeeeebb4b1189d34d27827
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=7ce2a8e0ae3d107f7dbeeeebb4b1189d34d27827

Author: Paul Gofman <gofmanp at gmail.com>
Date:   Fri Feb 15 20:41:39 2019 +0300

ntdll: Return STATUS_PENDING from NtReadFile() for async read in case of no buffering.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=31954
Signed-off-by: Paul Gofman <gofmanp at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/tests/file.c | 4 ++--
 dlls/ntdll/file.c          | 3 ++-
 dlls/ntdll/tests/file.c    | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c
index c9c2dd2..18cd18d 100644
--- a/dlls/kernel32/tests/file.c
+++ b/dlls/kernel32/tests/file.c
@@ -5177,9 +5177,9 @@ static void test_overlapped_read(void)
 
     bytes_count = 0xffffffff;
     ret = ReadFile(hfile, buffer, TEST_OVERLAPPED_READ_SIZE, &bytes_count, &ov);
-    todo_wine ok(!ret && GetLastError() == ERROR_IO_PENDING,
+    ok(!ret && GetLastError() == ERROR_IO_PENDING,
             "Unexpected ReadFile result, ret %#x, GetLastError() %u.\n", ret, GetLastError());
-    todo_wine ok(!bytes_count, "Unexpected read size %u.\n", bytes_count);
+    ok(!bytes_count, "Unexpected read size %u.\n", bytes_count);
     ret = GetOverlappedResult(hfile, &ov, &bytes_count, TRUE);
     ok(ret, "Unexpected error %u.\n", GetLastError());
     ok(bytes_count == TEST_OVERLAPPED_READ_SIZE, "Unexpected read size %u.\n", bytes_count);
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index a43fe71..1cf3ae2 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -1014,7 +1014,8 @@ err:
     }
 
     if (send_completion) NTDLL_AddCompletion( hFile, cvalue, status, total );
-
+    if (async_read && (options & FILE_NO_INTERMEDIATE_BUFFERING) && status == STATUS_SUCCESS)
+        return STATUS_PENDING;
     return status;
 }
 
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 7b35569..e210a6e 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -742,7 +742,7 @@ static void read_file_test(void)
     ResetEvent(event);
     status = pNtReadFile(handle, event, apc, &apc_count, &iosb,
             aligned_buffer, sizeof(aligned_buffer), &offset, NULL);
-    todo_wine ok(status == STATUS_PENDING, "Wrong status %x.\n", status);
+    ok(status == STATUS_PENDING, "Wrong status %x.\n", status);
     WaitForSingleObject(event, 1000);
     ok(U(iosb).Status == STATUS_SUCCESS, "Wrong status %x.\n", U(iosb).Status);
     ok(iosb.Information == sizeof(aligned_buffer), "Wrong info %lu.\n", iosb.Information);




More information about the wine-cvs mailing list