Alexandre Julliard : kernel32: Always clear the I/
O status block count before calling ntdll functions.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Jul 16 16:27:16 CDT 2007
Module: wine
Branch: master
Commit: cd33692fa176bfa5e64cd91d229f547949bdb21d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=cd33692fa176bfa5e64cd91d229f547949bdb21d
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Jul 16 16:20:29 2007 +0200
kernel32: Always clear the I/O status block count before calling ntdll functions.
---
dlls/kernel32/file.c | 2 ++
dlls/kernel32/sync.c | 3 +++
dlls/kernel32/vxd.c | 2 ++
3 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c
index 1472893..90280ad 100644
--- a/dlls/kernel32/file.c
+++ b/dlls/kernel32/file.c
@@ -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);
diff --git a/dlls/kernel32/sync.c b/dlls/kernel32/sync.c
index 7b67948..d53ab38 100644
--- a/dlls/kernel32/sync.c
+++ b/dlls/kernel32/sync.c
@@ -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,
diff --git a/dlls/kernel32/vxd.c b/dlls/kernel32/vxd.c
index 106b086..0a4e771 100644
--- a/dlls/kernel32/vxd.c
+++ b/dlls/kernel32/vxd.c
@@ -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,
More information about the wine-cvs
mailing list