Bug in Win32file WaitCommEvent ???

Mark Hammond mhammond at skippinet.com.au
Mon Nov 25 06:31:24 EST 2002


Grant Edwards wrote:
> In article <u4dE9.10391$hg1.21689 at news-server.bigpond.net.au>, Mark Hammond wrote:
> 
> 
>>>>Also much easier for me to code ;)
>>
>>>When in doubt, do whatver is simpler.
>>
>>Yes, good philosophy.
>>
>>How about I make a deal with you - I will add this support, and you
>>translate your C++ code that demonstrates the mask change into Python 
>>once this is available?  The next win32all is about due anyway.
> 
> 
> Sure.  Is the mask object returned by an overalapped read going to know how
> to turn itself into an int (analogous to the way it knows how to turn itself
> into a string), or do I need to access individual bytes and do that in
> user-code?

You will just access a "dword" attribute on the overlapped, and you get 
a Python integer back.  I decided to call it "dword" rather than "flags" 
as flags has implications best avoided.

There are no changes to the args or return type of WaitCommEvent.  If 
you pass an overlapped structure, the dword from this structure is 
passed in, and *also* returned from the WaitCommEvent function.  In this 
case, you would tend to ignore the mask value, but I see no good reason 
to special case the return value of WaitCommEvent based on if an 
overlapped object was passed.  There is also no need to pass a static in 
any case, overlapped or not - so everything seems pretty neat.

I will try and get a new win32all out soon.

Mark.





More information about the Python-list mailing list