Paul Gofman : ntdll: Return STATUS_PENDING from NtReadFile() for async read with regular file.

Alexandre Julliard julliard at winehq.org
Thu Mar 7 16:27:57 CST 2019


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

Author: Paul Gofman <gofmanp at gmail.com>
Date:   Thu Mar  7 12:28:35 2019 +0300

ntdll: Return STATUS_PENDING from NtReadFile() for async read with regular file.

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

---

 dlls/ntdll/file.c       |  2 +-
 dlls/ntdll/tests/file.c | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 7ecde56..e8775a3 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -1013,7 +1013,7 @@ err:
         if (status != STATUS_PENDING && hEvent) NtResetEvent( hEvent, NULL );
     }
 
-    ret_status = async_read && (options & FILE_NO_INTERMEDIATE_BUFFERING) && status == STATUS_SUCCESS
+    ret_status = async_read && type == FD_TYPE_FILE && status == STATUS_SUCCESS
             ? STATUS_PENDING : status;
 
     if (send_completion) NTDLL_AddCompletion( hFile, cvalue, status, total, ret_status == STATUS_PENDING );
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 5058439..d107c2e 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -635,7 +635,7 @@ static void read_file_test(void)
     offset.QuadPart = 0;
     ResetEvent( event );
     status = pNtReadFile( handle, event, apc, &apc_count, &iosb, buffer, strlen(text) + 10, &offset, NULL );
-    todo_wine ok(status == STATUS_PENDING
+    ok(status == STATUS_PENDING
             || broken(status == STATUS_SUCCESS) /* before Vista */,
             "wrong status %x.\n", status);
     if (status == STATUS_PENDING) WaitForSingleObject( event, 1000 );
@@ -4450,7 +4450,7 @@ static void test_read_write(void)
     bytes = 0xdeadbeef;
     SetLastError(0xdeadbeef);
     ret = ReadFile(hfile, buf, 0, &bytes, &ovl);
-    todo_wine ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */,
+    ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */,
             "Unexpected result, ret %#x, GetLastError() %u.\n", ret, GetLastError());
     ret = GetLastError();
     ok(bytes == 0, "bytes %u\n", bytes);
@@ -4479,7 +4479,7 @@ static void test_read_write(void)
     bytes = 0xdeadbeef;
     SetLastError(0xdeadbeef);
     ret = ReadFile(hfile, NULL, 0, &bytes, &ovl);
-    todo_wine ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */,
+    ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */,
             "Unexpected result, ret %#x, GetLastError() %u.\n", ret, GetLastError());
     ret = GetLastError();
     ok(bytes == 0, "bytes %u\n", bytes);
@@ -4524,7 +4524,7 @@ static void test_read_write(void)
     iob.Information = -1;
     offset.QuadPart = sizeof(contents);
     status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, 0, &offset, NULL);
-    todo_wine ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* before Vista */,
+    ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* before Vista */,
             "expected STATUS_PENDING, got %#x.\n", status);
     if (status == STATUS_PENDING)
     {
@@ -4550,7 +4550,7 @@ static void test_read_write(void)
     bytes = 0;
     SetLastError(0xdeadbeef);
     ret = ReadFile(hfile, buf, sizeof(buf), &bytes, &ovl);
-    todo_wine ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */,
+    ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */,
             "Unexpected result, ret %#x, GetLastError() %u.\n", ret, GetLastError());
     if (!ret)
         ok(bytes == 0, "bytes %u\n", bytes);
@@ -4598,7 +4598,7 @@ static void test_read_write(void)
     iob.Information = -1;
     offset.QuadPart = 0;
     status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL);
-    todo_wine ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* before Vista */,
+    ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* before Vista */,
             "expected STATUS_PENDING, got %#x.\n", status);
     if (status == STATUS_PENDING)
     {
@@ -4658,7 +4658,7 @@ static void test_read_write(void)
     bytes = 0;
     SetLastError(0xdeadbeef);
     ret = ReadFile(hfile, buf, sizeof(buf), &bytes, &ovl);
-    todo_wine ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */,
+    ok((!ret && GetLastError() == ERROR_IO_PENDING) || broken(ret) /* before Vista */,
             "Unexpected result %#x, GetLastError() %u.\n", ret, GetLastError());
     if (!ret)
     {




More information about the wine-cvs mailing list