From: Paul Gofman Subject: [PATCH 3/3] ntdll: Return STATUS_PENDING from NtReadFile() for async read in case of no buffering. Message-Id: <20190215174139.13488-3-gofmanp@gmail.com> Date: Fri, 15 Feb 2019 20:41:39 +0300 In-Reply-To: <20190215174139.13488-1-gofmanp@gmail.com> References: <20190215174139.13488-1-gofmanp@gmail.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=31954 Signed-off-by: Paul Gofman --- 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 c9c2dd24e7..18cd18d154 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 a43fe71108..1cf3ae2d05 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 7b355697f7..e210a6e280 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); -- 2.20.1