Hi all,
This is a follow-up to the message I wrote a message yesterday with the subject "Wine and IrDA via Virtual Com Port", although that wasn't a good subject for the problem.
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.
Now, I'm not saying that the Wine implementation is wrong, because based on the MSDN documentation, that value should be set to a valid event handle; however, the behavior is fundamentally different from the native Win32 environment, which in my case, leads to undesirable results. Is this something that I could feasibly fix in Wine, or would it be better to try to change the implementation of the software?
Does anyone have any experience with this part of Wine? Thanks.
-- Ryan
01010011 01100101 01110010 01100101 01101110 01100100 01101001 01110000 01101001 01110100 01111001 If only all life was just this simple. :)
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/bas...
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.
On Monday 25 November 2002 06:06 am, Martin Wilck wrote:
Am Sam, 2002-11-23 um 02.11 schrieb Ryan Reading: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllp roc/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.
wth does that mean? does it mean i can just wait on the file handle as though it were an HEVENT?
Greg Turner a écrit :
On Monday 25 November 2002 06:06 am, Martin Wilck wrote:
Am Sam, 2002-11-23 um 02.11 schrieb Ryan Reading: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllp roc/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.
wth does that mean? does it mean i can just wait on the file handle as though it were an HEVENT?
I think they refer to this, but I may be wrong
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/kmarch/hh/k...
A+
On Monday 25 November 2002 02:05 pm, Eric Pouech wrote:
Greg Turner a écrit :
On Monday 25 November 2002 06:06 am, Martin Wilck wrote:
Am Sam, 2002-11-23 um 02.11 schrieb Ryan Reading: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ dllp roc/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.
wth does that mean? does it mean i can just wait on the file handle as though it were an HEVENT?
I think they refer to this, but I may be wrong
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/kmar ch/hh/kmarch/k111_9dte.asp
A+
i.e., "SYNCHRONIZE"? weird stuff, I wonder if they just conditionally map file handles to event-objects somewhere in the kernel to achieve this?
btw, what a nice, svelte API that is! good thing wine is here to bring the fun of windows programming to the world of unix -- otherwise thousands would be deprived of the joy of working with API's like that one when developing driver-level code. I guess that API is part of the NT "microkernel" eh? ;)
Am Mon, 2002-11-25 um 21.05 schrieb Eric Pouech:
wth does that mean? does it mean i can just wait on the file handle as though it were an HEVENT?
I think they refer to this, but I may be wrong
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/kmarch/hh/k...
I don't know. My interpretation was that this is equivalent to waiting on non-event handles such as pipes, comm ports, or files. I thought this "feature" was already supported by wine, although not with the overlapped semantics - I may very well be wrong here.
I have another MSDN reference here (last paragraph): http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/bas...
In any case, this feature is strongly deprecated in the Microsoft docs. They're repeating that over and over.
Martin