Problem with CreateFileA on "\\\\.\\COM1"

Scott W Gifford gifford at umich.edu
Mon May 10 18:18:56 CDT 2004


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wine-dosdevice.patch
Type: text/x-patch
Size: 497 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20040510/5e31fdd6/wine-dosdevice.bin


More information about the wine-devel mailing list