More serial access issues

Geoffrey Hausheer winedevel9605 at phracturedblue.com
Wed Apr 14 14:05:12 CDT 2004


Well, I broke down and pulled out the oscope and rs232 breakout box to
try to figure out why my app isn't able to communicate with the device.

turns out that Rein's patch is correctly deasserting DSR, however, I am
not getting any data over the Tx pin.  And after I checked the output of
WriteFile, it is failing.

GetLastError doesn't return anything useful (a value of 997 which
FormatMessage() can't do anything with).  But some debugging led me to
determine that NtWriteFile is returning 0x103 which is STATUS_PENDING.

After that I'm somewhat lost as to what is going on.  Obvioulsy,
'register_new_async' is returning this status, which apparently happens
when wine_server_call returns 0 or STATUS_PENDING (not sure if the second
is even possible).  But about here I am getting completely confused as to
what we are trying to accomplish.

The file is opened via:
CreateFile("COM1", 0, NULL, OPEN_EXISTING, 0, NULL)
so we're not in overlapped mode.  SetCommTimeout is called with the
COMMTIMEOUTS structure containing all 0s.  All flow control is disabled
using SetCommState.  Before a write, we always call 'PurgeComm' and
ClearCommError.

In Windows, this combination results in a write always occurring when
WriteFile is called, regardless of whether there is anything connected to
the serial port.  Wine appears to be waiting for something, and I'm not
sure what.

If anyone has any ideas how I might proceed, i'd be glad to hear them.

Thanks,
.Geoff



More information about the wine-devel mailing list