Overlapped I/O without an hEvent

Martin Wilck Martin.Wilck at Fujitsu-Siemens.com
Mon Nov 25 06:06:15 CST 2002


Am Sam, 2002-11-23 um 02.11 schrieb Ryan Reading:

> The software that I have is using Overlapped (asynchronous) I/O for
> communication of an IR port.  The software makes WriteFile(),
> ReadFile(), and GetOverlappedResult() calls.  However, before making any
> of the calls, the software does NOT initialize the hEvent member of the
> OVERLAPPED structure that is passed to the functions (it just zeroes the
> entire structure).  Apparently the Win32 implementation of this is OK,
> but it is pretty obvious that the Wine implementation will not work with
> hEvent == 0.

What we could (relatively) easily do is

1 ) Do not return an error condition if hEvent == NULL.
2 ) Handle hEvent == NULL correctly elsewhere ( in particular,
    in the async handler where the event would normally be set ).
3 ) In GetOverlappedResult(), simply skip the waiting for 
    hEvent == NULL.

This may not be enough though.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/getoverlappedresult.asp

says that for NT/2000,XP, "if the hEvent member of the OVERLAPPED
structure is NULL, the system uses the state of the hFile handle to
signal when the operation has been completed". I doubt that wine can
(easily) support this behavior, but I'm not sure.

Please tell me if you think 1-3 would suffice for you.

Martin

PS: Please use plain-text email next time.

-- 
Martin Wilck                Phone: +49 5251 8 15113
Fujitsu Siemens Computers   Fax:   +49 5251 8 20409
Heinz-Nixdorf-Ring 1	    mailto:Martin.Wilck at Fujitsu-Siemens.com
D-33106 Paderborn           http://www.fujitsu-siemens.com/primergy








More information about the wine-devel mailing list