Serial comm overlapped IO problem

Paul Rupe prupe at myrealbox.com
Thu Jul 17 08:55:34 CDT 2003


On 17 Jul 2003, rklazes at xs4all.nl wrote:

> http://www.winehq.com/hypermail/wine-cvs/2003/07/0090.html

This one was mine. :(

>> 0009: get_serial_info( handle=0xbc )
>> 0009: get_serial_info() = 0 { readinterval=ffffffff,
>> readconst=00000000, readmult=00000000, writeconst=00000000,
>> writemult=00000000, eventmask=0000003d, commerror=00000000 }
>> 0009: set_serial_info( handle=0xbc, flags=4, readinterval=00000000,
>> readconst=00000000, readmult=00000000, writeconst=00000000,
>> writemult=00000000, eventmask=00000000, commerror=00000000 )
>> 0009: set_serial_info() = 0
>> 0009:Ret  kernel32.ClearCommError() retval=00000001 ret=6005312f
>> 0009:Call kernel32.ReadFile
>> (000000bc,407210ac,00000177,40721060,4050358c) ret=60053164
>> trace:file:ReadFile 0xbc 0x407210ac 375 0x40721060 0x4050358c 

I was looking at a similar problem yesterday with the Interact DexDrive (a 
Playstation memory card reader) software.  It does a set_serial_info with 
readinterval=ffffffff, readmult=ffffffff, readconst=5.  This of course 
causes all sorts of overflows when wineserver is computing the total 
timeout, but fixing that problem doesn't help.

> Read returns failure with GLE() == ERROR_IO_PENDING, leading to an
> error messagbox in the program.

It sounds like your app isn't expecting to do async reads at all.  Since it 
calls ClearCommError to find out how much data there is first, it probably 
wants ReadFile to block until it's read all of them.  As a hack, try 
commenting out the lines "else if (!(...)) *flags |= FD_FLAG_TIMEOUT;" from 
serial_get_info in server/serial.c.  I also hacked NtReadFile to do a quick 
non-blocking read before setting up all the async stuff.  That made 
DexPlorer work, but naturally broke everything else.

> With only the first commit, the ReadFile returns 1 (success) but no
> data.

That's good.  This is what my patch was intended to fix for sockets.

> Nowthe situations seems reversed, since accepting the error message
> the program proceeds to the next read and a new error messagebox.

I'm not sure what's happening here, but it does sound like the same problem 
I'm looking at with DexPlorer.  Hopefully someone who knows more about 
Wine's I/O can be more helpful than me.


-- 
Paul Rupe                                    "She smiled, in the end."
p r u p e @ m y r e a l b o x . c o m



More information about the wine-devel mailing list