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@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Paul Gofman 2019-02-15 20:41:39 +03:00 committed by Alexandre Julliard
parent 9dc63ca981
commit 7ce2a8e0ae
3 changed files with 5 additions and 4 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -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);