It’d have to be 9X… in
“I want to search registry to find the current com port number,But it seem
too trouble.”
Its really not that much trouble.
Under 9X the only way to do it is to look in the registry and enumerate the
serial device map key.
If you can find the elusive ‘POSUSB’ sample microsoft UK pulled a while back
all the code is in there, along with a wealth of other information you’ll
need to complete your driver.
(There is also code in there for NT too…
I’m actually finishing up the
NT Com Arbiter stuff in my multi virtual serial over USB driver as I write
this)
Rob Linegar
Software Engineer
Data Encryption Systems Limited
-----Original Message-----
From: Doron Holan [mailto:xxxxx@windows.microsoft.com]
Sent: 09 April 2003 17:42
To: NT Developers Interest List
Subject: [ntdev] RE: How to get the com port count in kernel mode
On which OS are you using CM_Create_DevNode to create the port?
d
-----Original Message-----
From: Black Lee [mailto:xxxxx@21cn.com]
Sent: Tuesday, April 08, 2003 10:02 PM
To: NT Developers Interest List
Subject: [ntdev] RE: How to get the com port count in kernel mode
Thanks for you response,
Because I have writed a com port enumerator to emum my com port.I have to
confirm there is how many com port on the system.So that my com enumerator
can
create new device node(CM_Create_DevNode) for my com port use the last com
number.for example if the system have com1 and com2,I will create the com
number is com3.Thus I have to enum all com port on system,I want to search
registry to find the current com port number,But it seem too trouble.
Do you have any advise.
Best Regards,
Black
----- Original Message -----
From: “Doron Holan”
To: “NT Developers Interest List”
Sent: Wednesday, April 09, 2003 12:14 PM
Subject: [ntdev] RE: How to get the com port count in kernel mode
This is a very unreliable method to determine the com port number you want
to expose. Consider that a modem is not plugged in when you determine the
com port number and you use the same com port number as the modem. When the
modem is plugged in, the modem no longer works. On windows 2000, if you
install under the ports device class, a unique com number will be installed
for you upon device installation. If you install under your own device
class, then there are APIs which you can call in your device installer DLL
which will give you a unique com name.
You can retrieve this com number by calling IoOpenDeviceRegistryKey in
IRP_MN_START_DEVICE to open the device instance key and then query for the
value “PortName”, which will be returned to you as a string, in the form of
“COMX”, where X is a decimal value. You don’t actually have to inspect the
value that is returned, all you need to do is append the value to
"\DosDevices" and create the symbolic link with that string.
As for win98, you are on your own. Perhaps some devs who are more familiar
with ccport know of a solution for that platform.
D
This posting is provided “AS IS” with no warranties, and confers no rights.
From: Black Lee [mailto:xxxxx@21cn.com]
Sent: Tuesday, April 08, 2003 8:48 PM
To: NT Developers Interest List
Dear All,
Anybody can point me how to get the com port count in kernel mode.I am
writing a virtual com port driver for win98 and win2000,I need to get the
curren com port number and create my com port number.If the config manager
function can used to implement it?
Any advise will be appreciated!
Best Regards,
Black
—
You are currently subscribed to ntdev as: xxxxx@21cn.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
b®¶¹®vµj®Â£‰²r¢¹®±ižj¢½u÷–²
b.ஷ&v’ׯj
mrNrzǧujy٨^j秵M±ಋ+