Bug in Win32file WaitCommEvent ???
Grant Edwards
grante at visi.com
Fri Nov 22 11:40:56 EST 2002
In article <3dde5012$0$4491$a1866201 at newsreader.visi.com>, Grant Edwards wrote:
>
>> I don't have win32all, but don't you need to have the
>> OVERLAPPED struct persist as well? Isn't the event slot there
>> also used asynchronously?
>
> Yes, the OVERLAPPED struct has to be persistent. I've thought
> about using that as storage for the comm event mask value, but
> then we've got to add some sort of accessor function to
> retreive it later. The advantantage of using a 4-byte buffer
> is that the semantics stay more similar to both the Win32
> usage, and the way that data buffers work for overlapped
> read/write operations:
>
>
> rc,mask = WaitCommEvent(handle,overlapped)
> rc = WaitForSingleObject(overlapped.hevent)
> whatHappened = int(mask)
I should have mentioned that in the non-overlapped case, the
returned mask value would be an integer (same as it is now).
That way the only change is to the overlapped usage.
--
Grant Edwards grante Yow! Am I in GRADUATE
at SCHOOL yet?
visi.com
More information about the Python-list
mailing list