diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c
index 3e93b0d..16e35b0 100644
--- a/dlls/kernel32/file.c
+++ b/dlls/kernel32/file.c
@@ -455,6 +455,11 @@ BOOL WINAPI ReadFile( HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
if (status != STATUS_PENDING && bytesRead)
*bytesRead = io_status->Information;
+ if (overlapped != NULL && !status) {
+ SetLastError( RtlNtStatusToDosError(STATUS_PENDING) );
+ return TRUE;
+ }
+
if (status == STATUS_END_OF_FILE)
{
if (overlapped != NULL)
@@ -579,6 +584,11 @@ BOOL WINAPI WriteFile( HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite,
if (status != STATUS_PENDING && bytesWritten)
*bytesWritten = piosb->Information;
+ if (overlapped != NULL && !status) {
+ SetLastError( RtlNtStatusToDosError(STATUS_PENDING) );
+ return TRUE;
+ }
+
if (status && status != STATUS_TIMEOUT)
{
SetLastError( RtlNtStatusToDosError(status) );