Bug in Win32file WaitCommEvent ???

Grant Edwards grante at visi.com
Sat Nov 23 11:04:31 EST 2002


In article <THED9.3061$hg1.6331 at news-server.bigpond.net.au>, Mark Hammond wrote:

> Actually, I don't mind the idea of attaching it to the overlapped object. We
> already have the concept of attaching an object to an overlapped structure,
> so adding support for a generic "flags" 32 bit value wouldn't hurt, and 2
> bytes per Python-allocated overlapped structure wont kill anyone.
> 
> Might be overkill if this is the only case we come across, but it 
> doesn't change any semantics.  ie, the code would look like:
> 
>     rc,mask = WaitCommEvent(handle,overlapped)
>     rc = WaitForSingleObject(overlapped.hevent)
>     whatHappened = overlapped.flags

That would certainly be OK with me.

> Also much easier for me to code ;)

When in doubt, do whatver is simpler.

> Would only work for overlapped objects created via Python, but I think that
> is reasonable.  If a non Python overlapped structure is used, we pass the
> address of a static variable to ensure no one ever crashes.

I don't even know how one could use a non-Python overlapped struct.

> Sound reasonable?

Quite.

-- 
Grant Edwards                   grante             Yow!  I want DUSTIN
                                  at               HOFFMAN!! ... I want
                               visi.com            LIBRACE!! YOW!!



More information about the Python-list mailing list