Skip to content
Snippets Groups Projects
Commit 14404713 authored by Esme Povirk's avatar Esme Povirk Committed by Alexandre Julliard
Browse files

kernel32: Return success from ReadFileEx/WriteFileEx when I/O is pending.

parent 98215360
No related branches found
No related tags found
No related merge requests found
......@@ -352,7 +352,7 @@ BOOL WINAPI ReadFileEx(HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
status = NtReadFile(hFile, NULL, FILE_ReadWriteApc, lpCompletionRoutine,
io_status, buffer, bytesToRead, &offset, NULL);
if (status)
if (status && status != STATUS_PENDING)
{
SetLastError( RtlNtStatusToDosError(status) );
return FALSE;
......@@ -484,8 +484,12 @@ BOOL WINAPI WriteFileEx(HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite,
status = NtWriteFile(hFile, NULL, FILE_ReadWriteApc, lpCompletionRoutine,
io_status, buffer, bytesToWrite, &offset, NULL);
if (status) SetLastError( RtlNtStatusToDosError(status) );
return !status;
if (status && status != STATUS_PENDING)
{
SetLastError( RtlNtStatusToDosError(status) );
return FALSE;
}
return TRUE;
}
......
......@@ -1795,7 +1795,7 @@ static void test_readfileex_pending(void)
completion_called = 0;
ResetEvent(event);
ret = ReadFileEx(server, read_buf, sizeof(read_buf), &overlapped, completion_routine);
todo_wine ok(ret == TRUE, "ReadFileEx failed, err=%i\n", GetLastError());
ok(ret == TRUE, "ReadFileEx failed, err=%i\n", GetLastError());
ok(completion_called == 0, "completion routine called before ReadFileEx returned\n");
ret = WriteFile(client, test_string, sizeof(test_string), &num_bytes, NULL);
......@@ -1837,7 +1837,7 @@ static void test_readfileex_pending(void)
ok(completion_lpoverlapped == &overlapped, "completion called with wrong overlapped pointer\n");
}
todo_wine ok(ret == TRUE, "WriteFileEx failed, err=%i\n", err);
ok(ret == TRUE, "WriteFileEx failed, err=%i\n", err);
ok(completion_called == 0, "completion routine called but wait timed out\n");
ok(completion_errorcode == 0, "completion called with error %x\n", completion_errorcode);
ok(completion_lpoverlapped == &overlapped, "completion called with wrong overlapped pointer\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment