Add a test for ReadFile/WriteFile fault handling, make it pass under
Wine.
diff --git a/dlls/kernel/file.c b/dlls/kernel/file.c
index 342b324..d07f2cf 100644
--- a/dlls/kernel/file.c
+++ b/dlls/kernel/file.c
@@ -449,13 +449,15 @@
status = NtWriteFile(hFile, hEvent, NULL, NULL, piosb,
buffer, bytesToWrite, poffset, NULL);
+
+ if (status != STATUS_PENDING && bytesWritten)
+ *bytesWritten = piosb->Information;
+
if (status)
{
SetLastError( RtlNtStatusToDosError(status) );
return FALSE;
}
- if (bytesWritten) *bytesWritten = piosb->Information;
-
return TRUE;
}