kernel32: Always clear the I/O status block count before calling ntdll functions.

This commit is contained in:
Alexandre Julliard 2007-07-16 16:20:29 +02:00
parent fec5117e91
commit cd33692fa1
3 changed files with 7 additions and 0 deletions

View File

@ -376,6 +376,7 @@ BOOL WINAPI ReadFileEx(HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
offset.u.HighPart = overlapped->u.s.OffsetHigh;
io_status = (PIO_STATUS_BLOCK)overlapped;
io_status->u.Status = STATUS_PENDING;
io_status->Information = 0;
status = NtReadFile(hFile, NULL, FILE_ReadWriteApc, lpCompletionRoutine,
io_status, buffer, bytesToRead, &offset, NULL);
@ -465,6 +466,7 @@ BOOL WINAPI WriteFileEx(HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite,
io_status = (PIO_STATUS_BLOCK)overlapped;
io_status->u.Status = STATUS_PENDING;
io_status->Information = 0;
status = NtWriteFile(hFile, NULL, FILE_ReadWriteApc, lpCompletionRoutine,
io_status, buffer, bytesToWrite, &offset, NULL);

View File

@ -1332,7 +1332,10 @@ BOOL WINAPI ConnectNamedPipe(HANDLE hPipe, LPOVERLAPPED overlapped)
TRACE("(%p,%p)\n", hPipe, overlapped);
if(overlapped)
{
overlapped->Internal = STATUS_PENDING;
overlapped->InternalHigh = 0;
}
status = NtFsControlFile(hPipe, overlapped ? overlapped->hEvent : NULL, NULL, NULL,
overlapped ? (IO_STATUS_BLOCK *)overlapped : &status_block,

View File

@ -351,6 +351,8 @@ BOOL WINAPI DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode,
if (lpOverlapped)
{
lpOverlapped->Internal = STATUS_PENDING;
lpOverlapped->InternalHigh = 0;
if (HIWORD(dwIoControlCode) == FILE_DEVICE_FILE_SYSTEM)
status = NtFsControlFile(hDevice, lpOverlapped->hEvent,
NULL, NULL, (PIO_STATUS_BLOCK)lpOverlapped,