- Virtual Serial Port Driver and CreateFile
- Posted by anonymous on December 2nd, 2004
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
- Posted by cristalink on December 2nd, 2004
Maybe, just "COM106"?
--
http://www.firestreamer.com - NTBACKUP to DVD and DV
"anonymous" <anonymous@discussions.microsoft.com> wrote in message
news
22DF867-BF0A-4B2E-936F-0EFBDDED2729@microsoft.com...
- Posted by cristalink on December 2nd, 2004
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
22DF867-BF0A-4B2E-936F-0EFBDDED2729@microsoft.com...
- Posted by anonymous on December 3rd, 2004
Thanks. I tried this already and worked. Why couldnt I just use
"COM106:"? This seems to work for COM1 etc. Any ideas?
"cristalink" wrote:
- Posted by cristalink on December 3rd, 2004
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...
- Posted by anonymous on December 3rd, 2004
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:
- Posted by anonymous on December 3rd, 2004
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:
- Posted by cristalink on December 3rd, 2004
Open DDK Help and search for "DosDevices com". You'll find "COM Port
Interfaces" and "Registry Settings for a Legacy COM Port". All the info is
there.
--
http://www.firestreamer.com - NTBACKUP to DVD and DV
"anonymous" <anonymous@discussions.microsoft.com> wrote in message
news:058E199C-F0C1-4B0F-8F3A-789DE732D0FF@microsoft.com...
- Posted by Doron Holan [MS] on December 3rd, 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...
- Posted by kmk on December 4th, 2004
I didnt' know. Thanks for the clarification.
/kmk
In article <OWICB7Q2EHA.1404@TK2MSFTNGP11.phx.gbl>,
doronh@nospam.microsoft.com says...
- Posted by CheckAbdoul on December 7th, 2004
See if the following KB article helps you
http://support.microsoft.com/?id=115831
--
Cheers
Check Abdoul [VC++ MVP]
-----------------------------------
"anonymous" <anonymous@discussions.microsoft.com> wrote in message
news:88F366D6-F456-4780-809F-1E26958C5FE3@microsoft.com...