According to MSDN, the hEvent member of an OVERLAPPED structure can be NULL:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/bas... OVERLAPPED ... Members ... hEvent Handle to an event set to the signaled state when the operation has been completed. The calling process must set this member either to zero or a valid event handle before calling any overlapped functions.
A program I'm trying to run takes advantage of this, and as a result triggered a lot of these errors from Wine:
err:file:GetOverlappedResult lpOverlapped->hEvent was null
I wrote a patch that solves this, although it may not be the best solution.
If when ReadFile is called overlapped->hEvent is NULL, the patch generates a new event with CreateEventA and sets the structure member to that event. To create a unique name, it uses the hex address of the overlapped structure along with a fairly long string, which is pretty likely to be unique.
This works for the application I'm running. If this seems like a good enough solution, I can easily modify the other functions which initiate an overlapped read to do the same.
----ScottG.