SERIALCOMM Population

Hello Everybody,

I was wondering when the ‘HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM’
registry key is populated in windows XP. I have made a driver that checks
this key to get the device name of a serial port on the system. During
normal operation (not during boot up).my driver does not encounter any
errors because the key is already populated. But during boot up when I
enumerate the contents of this key, there is no data. I tried adding a
dependency on my driver on the serial & serenum devices but it seems the key
is not populated also… I was wondering if there is any way to resolve this
or is there any other way to get a device name from the com port number.
BTW. My driver works correctly in windows 2000…

Best regards,

Rikki Tamayo

This sounds to me like it won’t always work under 2000 either. It seems
like you have already given some consideration to the idea that it might
just be luck that your driver is loading before/after the serial driver.
Have you verified this for sure with WINDBG or SoftIce? I think you’ll
be more likely to see such a problem with a USB to Serial bridge device.

Even when Windows is ‘running’ the port assignments in that key will
change on-the-fly if device manager is used to update the assignments.
Therefore the assignment is only valid when you read it.

Another way may be able to find the assigning is via the Symbolic link
for the port name itself. But this is unlikely to behave any
differently. All port implementations I can recall including my our own
create this at the same time as the SERIALCOMM key.

BR,
Rob Linegar
Software Engineer
Data Encryption Systems Limited
www.des.co.uk | www.deslock.com


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of softdev
Sent: 04 January 2005 06:48
To: Windows System Software Devs Interest List
Subject: [ntdev] SERIALCOMM Population

Hello Everybody,

I was wondering when the
‘HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM’ registry key is
populated in windows XP. I have made a driver that checks this key to
get the device name of a serial port on the system. During normal
operation (not during boot up).my driver does not encounter any errors
because the key is already populated. But during boot up when I
enumerate the contents of this key, there is no data. I tried adding a
dependency on my driver on the serial & serenum devices but it seems the
key is not populated also… I was wondering if there is any way to
resolve this or is there any other way to get a device name from the com
port number. BTW. My driver works correctly in windows 2000…

Best regards,

Rikki Tamayo


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Instead of reading the key, you should register for device interface notifications on the serial device interface guid (via IoRegisterPlugPlayNotification). When you register, you can specify to be notified of already existing interfaces which covers interfaces already registered before you register for the notification. The guid you want to use is in ntddser.h, GUID_DEVINTERFACE_COMPORT. This will work on win2k and forward.

d


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of softdev
Sent: Monday, January 03, 2005 10:48 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] SERIALCOMM Population

Hello Everybody,

I was wondering when the ‘HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM’ registry key is populated in windows XP. I have made a driver that checks this key to get the device name of a serial port on the system. ?During normal operation (not during boot up).my driver does not encounter any errors because the key is already populated. But during boot up when I enumerate the contents of this key, there is no data. I tried adding a dependency on my driver on the serial & serenum devices but it seems the key is not populated also… I was wondering if there is any way to resolve this or is there any other way to get a device name from the com port number. BTW. My driver works correctly in windows 2000…

Best regards,
Rikki Tamayo

Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Thank you for your information. It was very helpful. I have already modified
my driver to include IoRegisterPlugPlayNotification using the
GUID_DEVINTERFACE_COMPORT. I am successfully getting the symbolic link name
of the com port for my driver. Form the data I get in the notification
function, how ill I be able to convert the symbolic link to the Dos name of
the received com port? I can open the driver but what IOCTL will I use to
get the DOS name? Is there any documented way to get a DOS name from the
Symbolic link name?

Best regards,
Rikki Tamayo

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, January 05, 2005 1:14 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SERIALCOMM Population

Instead of reading the key, you should register for device interface
notifications on the serial device interface guid (via
IoRegisterPlugPlayNotification). When you register, you can specify to be
notified of already existing interfaces which covers interfaces already
registered before you register for the notification. The guid you want to
use is in ntddser.h, GUID_DEVINTERFACE_COMPORT. This will work on win2k and
forward.

d


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of softdev
Sent: Monday, January 03, 2005 10:48 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] SERIALCOMM Population

Hello Everybody,

I was wondering when the ‘HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM’
registry key is populated in windows XP. I have made a driver that checks
this key to get the device name of a serial port on the system. ?During
normal operation (not during boot up).my driver does not encounter any
errors because the key is already populated. But during boot up when I
enumerate the contents of this key, there is no data. I tried adding a
dependency on my driver on the serial & serenum devices but it seems the key
is not populated also… I was wondering if there is any way to resolve this
or is there any other way to get a device name from the com port number.
BTW. My driver works correctly in windows 2000…

Best regards,
Rikki Tamayo

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Why do you need the name? anyways, to get the name, open the port, query for the PDO, and then open the devnode using IoOpenDeviceRegistryKey and the serial port’s PDO. Query for the PortName value.

OR

Send IOCTL_SERENUM_GET_PORT_NAME to the port. The returned buffer will be a Unicode. I don’t think you should rely on it being null terminated though and you should also use Irp->IoSTatus.Information to treat it as a UNICODE_STRING before comparing

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of softdev
Sent: Friday, January 07, 2005 5:12 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SERIALCOMM Population

Thank you for your information. It was very helpful. I have already modified
my driver to include IoRegisterPlugPlayNotification using the
GUID_DEVINTERFACE_COMPORT. I am successfully getting the symbolic link name
of the com port for my driver. Form the data I get in the notification
function, how ill I be able to convert the symbolic link to the Dos name of
the received com port? I can open the driver but what IOCTL will I use to
get the DOS name? Is there any documented way to get a DOS name from the
Symbolic link name?

Best regards,
Rikki Tamayo

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, January 05, 2005 1:14 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SERIALCOMM Population

Instead of reading the key, you should register for device interface
notifications on the serial device interface guid (via
IoRegisterPlugPlayNotification). When you register, you can specify to be
notified of already existing interfaces which covers interfaces already
registered before you register for the notification. The guid you want to
use is in ntddser.h, GUID_DEVINTERFACE_COMPORT. This will work on win2k and
forward.

d


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of softdev
Sent: Monday, January 03, 2005 10:48 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] SERIALCOMM Population

Hello Everybody,

I was wondering when the ‘HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM’
registry key is populated in windows XP. I have made a driver that checks
this key to get the device name of a serial port on the system. ?During
normal operation (not during boot up).my driver does not encounter any
errors because the key is already populated. But during boot up when I
enumerate the contents of this key, there is no data. I tried adding a
dependency on my driver on the serial & serenum devices but it seems the key
is not populated also… I was wondering if there is any way to resolve this
or is there any other way to get a device name from the com port number.
BTW. My driver works correctly in windows 2000…

Best regards,
Rikki Tamayo

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com