ReadFile and WriteFile in overlapped mode

Tony Bryant brd at paradise.net.nz
Thu Apr 4 16:09:20 CST 2002


On Fri, 05 Apr 2002 06:01, Jacques Gelinas wrote:
> I have been looking at those two functions and some specs. My understanding
> is that those function do not work at all in overlapped (async mode).
> Currently (latest stuff in CVS), both function handle overlap mode like
> this
>
> a)	Give it a try in synchronous mode using a combination
> 	of pread/read and pwrite/write.
>
> b)	If not enough bytes were read or written, a request
> 	is sent to wineserver to perform and asynchronous
> 	operation. This request always fail. (don't know why yet).
>
> There is two problem here. If step a succeed, no event will ever be
> generated since step be is not performed. Application doing the following
> sequence
>
> 	ReadFile
> 	..
> 	WaitOnSingleObject
>
> will wait forever. Some borland Builder classes do this
>
> My understanding is that step a should never be done and only step b.
> Is that correct ?
>
> Now, why step b is failing is another story.
>


I fixed this a while ago, but never finished submitting the patch. The
problem is that wine uses async callbacks to signal the event in the 
overlapped structure, which is a problem, because async callbacks can only
happen when WaitOnSingleObjectEx specifically allows them. The solution is to
have the wine directly trigger the event without going through the async
callback system.




More information about the wine-devel mailing list