Commit 84ae4b93 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

kernel32: Always set bytes written in WriteFile.

parent c47c74e5
...@@ -577,8 +577,8 @@ BOOL WINAPI WriteFile( HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite, ...@@ -577,8 +577,8 @@ BOOL WINAPI WriteFile( HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite,
status = piosb->u.Status; status = piosb->u.Status;
} }
if (status != STATUS_PENDING && bytesWritten) if (bytesWritten)
*bytesWritten = piosb->Information; *bytesWritten = overlapped && status ? 0 : piosb->Information;
if (status && status != STATUS_TIMEOUT) if (status && status != STATUS_TIMEOUT)
{ {
......
...@@ -2767,7 +2767,7 @@ static void _overlapped_write_async(unsigned line, HANDLE writer, void *buf, DWO ...@@ -2767,7 +2767,7 @@ static void _overlapped_write_async(unsigned line, HANDLE writer, void *buf, DWO
overlapped->hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); overlapped->hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
res = WriteFile(writer, buf, size, &written_bytes, overlapped); res = WriteFile(writer, buf, size, &written_bytes, overlapped);
ok_(__FILE__,line)(!res && GetLastError() == ERROR_IO_PENDING, "WriteFile returned %x(%u)\n", res, GetLastError()); ok_(__FILE__,line)(!res && GetLastError() == ERROR_IO_PENDING, "WriteFile returned %x(%u)\n", res, GetLastError());
todo_wine ok_(__FILE__,line)(!written_bytes, "written_bytes = %u\n", written_bytes); ok_(__FILE__,line)(!written_bytes, "written_bytes = %u\n", written_bytes);
_test_not_signaled(line, overlapped->hEvent); _test_not_signaled(line, overlapped->hEvent);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment