Doron
Fri Dec 03 02:04:41 CST 2004
this is documented behavior b/c these are "well known" DOS device names.
for any COM port greater then 9 you must use the \\.\COMX syntax, which is
the std way of accessing a driver name in user mode.
d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"anonymous" <anonymous@discussions.microsoft.com> wrote in message
news:88F366D6-F456-4780-809F-1E26958C5FE3@microsoft.com...
> Interesting...
>
> CreateFile seems to translate COMx: to "\??\COMx" only if single digit
> COMx: entry is used. For COMxx: or COMxxx:, it does not do the
> translation....
>
> "anonymous" wrote:
>
>> Please read my first post. The COM106 is created by my virtual
>> driver.
>>
>> Anyway, I don't know why I am not able to use "COM106:" instead of
>> "\\\\.\\COM106".
>>
>> I tried strace for NT and regmon to get a clue of whats going on.
>> Here is the output from strace.
>>
>> 95 2544 2576 NtCreateFile (0xc0100080, {24, 0, 0x40, 0, 1244852,
>> "\??\COM1"}, 0x0, 0, 0, 1, 96, 0, 0, ... 28, {status=0x0, info=0}, ) ==
>> 0x0
>> 96 2544 2576 NtClose (28, ... ) == 0x0
>>
>> 97 2544 2576 NtCreateFile (0xc0100080, {24, 12, 0x40, 0, 1244852,
>> "COM107:"}, 0x0, 0, 0, 1, 96, 0, 0, ... ) == STATUS_OBJECT_NAME_INVALID
>> 98 2544 2576 NtClose (-1, ... ) == STATUS_INVALID_HANDLE
>>
>> For "COM1:", CreateFile endsup calling NtCreateFile with "\??\COM1". But
>> for "COM107:", it does not do any translation.
>>
>> Why CreateFile is not able to translate COM107 to "\??\COM107"?
>>
>> If anybody has any insights please respond.
>>
>> Thanks
>> /kmk
>>
>> "cristalink" wrote:
>>
>> > Sorry, I am not really interested in serial ports to be sure, but
>> >
>> > \\.\com1 works fine on my pc
>> > com1 works as well
>> > com1: works, too
>> > com106 file not found
>> > com106: invalid file name
>> >
>> > So I guess there must be a symbolic link(s) pointing to \Device\Com106
>> > named
>> > Com106, Com106:, or both. I am not sure who is responsible for creation
>> > of
>> > this link. You may want to create it yourself. You may also want to
>> > wait for
>> > someone to add a comment to this thread with their opinion.
>> >
>> > --
>> >
http://www.firestreamer.com - NTBACKUP to DVD and DV
>> >
>> >
>> > "anonymous" <anonymous@discussions.microsoft.com> wrote in message
>> > news:BB11DD66-5364-43A8-9740-C0D450DA5655@microsoft.com...
>> > > Thanks. I tried this already and worked. Why couldnt I just use
>> > > "COM106:"? This seems to work for COM1 etc. Any ideas?
>> > >
>> > > "cristalink" wrote:
>> > >
>> > > > I've checked my old code and found that I use the "\\\\.\\COM1"
>> > > > syntax
>> > > > (C/C++).
>> > > >
>> > > > --
>> > > >
http://www.firestreamer.com - NTBACKUP to DVD and DV
>> > > >
>> > > >
>> > > > "anonymous" <anonymous@discussions.microsoft.com> wrote in message
>> > > > news:D22DF867-BF0A-4B2E-936F-0EFBDDED2729@microsoft.com...
>> > > > > My virtual serial port driver seems to work fine. I used lot of
>> > > > > code
>> > > > > from serial driver example in the DDK for external naming etc.
>> > > > >
>> > > > > HyperTerminal successfully opens the virtual port etc. However,
>> > > > > when
>> > > > > I try to open the port using CreateFile call
>> > (CreateFile("COM106:"...)),
>> > > > > I get an error (123).
>> > > > >
>> > > > > I use SoftICE and I had a breakpoint set in the handler for
>> > IRP_MJ_CREATE
>> > > > > but it never got hit.
>> > > > >
>> > > > > Any ideas?
>> > > > >
>> > > > > Thanks
>> > > > > /kmk
>> > > >
>> > > >
>> > > >
>> >
>> >
>> >