Improve async i/o compatability. lpOverlapped->Internal should hold
the overlapped transfer status.
diff --git a/dlls/kernel/comm.c b/dlls/kernel/comm.c
index e15f24f..745ebb5 100644
--- a/dlls/kernel/comm.c
+++ b/dlls/kernel/comm.c
@@ -2794,7 +2794,9 @@
if(buffer)
*buffer = events;
+ lpOverlapped->Internal = STATUS_SUCCESS;
SetEvent( lpOverlapped->hEvent);
+ CloseHandle(lpOverlapped->InternalHigh);
}
/***********************************************************************
@@ -2836,14 +2838,16 @@
/* check that the overlapped structure has a valid event flag */
if ( (lpov->hEvent==0) || (lpov->hEvent == INVALID_HANDLE_VALUE) )
-{
+ {
ERR("Couldn't create Event flag for Overlapped structure\n");
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
- lpov->Internal = 0;
- lpov->InternalHigh = hFile;
+ ResetEvent(lpov->hEvent);
+
+ lpov->Internal = STATUS_PENDING;
+ lpov->InternalHigh = 0;
lpov->Offset = 0;
lpov->OffsetHigh = 0;
@@ -2861,7 +2865,7 @@
ret=server_call( REQ_CREATE_ASYNC );
- lpov->Internal = req->ov_handle;
+ lpov->InternalHigh = req->ov_handle;
}
SERVER_END_REQ;
@@ -2873,6 +2877,9 @@
return FALSE;
}
+ /* activate the overlapped operation */
+ lpov->Internal = STATUS_PENDING;
+
/* wait ourselves if the caller didn't give us an overlapped struct */
if(!lpOverlapped)
{