PnP interface notification

I want my driver to be notified whenever a serial port is being enabled.
I also need to know exactly which serial port is being enabled. Right
now, I’ve registered for PnP interface change notification on the COM
port interface, and I got notified all right. The problem is figuring
out *which* port caused the notification. In the callback routine, I
get the opaque symbolic link of the interface instance of that serial
port. On XP it looks like ??\Root#*PNP0501#PnPBIOS_14#{…}. I need
a way to go from there to the real device name, say \device\serial0 or
whatever. I’ve tried several things, the most promising being
ZwQuerySymbolicLinkObject. I give it the link, and it’s supposed to
give me the name of the device object. However, when I tried it, it
said my serial device is called \device\00000048. So, what’s the deal
with that? How can I get the device name that’s in the form of
\device\serialx, given the symbolic link to an instance of the COMPORT
interface? Any suggestion is much appreciated. Thanks!


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> a way to go from there to the real device name, say \device\serial0 or

I don’t think there is a notion of “real device names” in PnP. PnP device stacks are usually nameless. Device interface symlinks are
only names for them.
Serial stacks can have legacy names - but this is a legacy thing, intended for compatibility only.

If you want to number your devices - do it in your driver and write some kind of “get device number” or “get device GUID” IOCTL.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com