I have a Windows application I'm running under Wine 20040309 that uses the serial port. It was giving error messages when it tried to open the serial port, but strace indicated that Wine wasn't even trying to open up the device I had configured.
After some poking around, I found that CreateFileW doesn't recognize this as a device:
\.\COM1
CreateFileW identifies the file as starting with backslashes and a dot, and in files/file.c:358 it uses RtlIsDosDevice to determine whether it's a DOS device name. RtlIsDosDevice returns 0, so at line 360 Wine tries to open \.\COM1 as a VxD.
A small patch (attached) to RtlIsDosDevice allows it to correctly recognize DOS device names. I'm not sure if this is the best possible fix, but with this change my application works properly.
----ScottG.
Scott W Gifford gifford@umich.edu writes:
CreateFileW identifies the file as starting with backslashes and a dot, and in files/file.c:358 it uses RtlIsDosDevice to determine whether it's a DOS device name. RtlIsDosDevice returns 0, so at line 360 Wine tries to open \.\COM1 as a VxD.
Try a more recent Wine.
Alexandre Julliard julliard@winehq.org writes:
Scott W Gifford gifford@umich.edu writes:
CreateFileW identifies the file as starting with backslashes and a dot, and in files/file.c:358 it uses RtlIsDosDevice to determine whether it's a DOS device name. RtlIsDosDevice returns 0, so at line 360 Wine tries to open \.\COM1 as a VxD.
Try a more recent Wine.
Thanks Alexandre,
It solves this problem, but now I'm frequently getting this error:
err:comm:GetCommState tcgetattr or ioctl error 'Invalid argument'
When I get it the program dies; when I don't it works fine. I didn't get this error before.
I'm still getting these errors too, although they don't interfere with the program's operation:
fixme:comm:SetupComm insize 1050 outsize 1050 unimplemented stub err:file:GetOverlappedResult lpOverlapped->hEvent was null
I'll dig into the code a bit and see if I can figure out what's going on.
-----ScottG.