Linking PDO name to a friendly name

Hello. Given an autogenerated PCI device name in the \Device tree (e.g. \Device\NTPNP_PCI0019), how can can we determine a friendly name like the one shown in device manager (e.g. NVIDIA Quadro P520). The autogenerated name appears in device manager as device property “Physical Device Object name”.

What are you going to do with the friendly name once you have it in kernel mode? Friendly name as a unique ID is problematic, it can be localized per user’s language and not necessarily as unique as you think it is.

as Doron says, unless you have a tightly controlled setup, don’t try this. remember that even on a single machine, this might vary between one user and the next depending on their regional options

I’m not using it for anything that needs to be unique, and other languages are no problem. It’s for logging purposes, I want a friendlier name than the autogen’d name of this PDO to store in my log, even a non-understandable Chinese device name is better than PCI0019. Device manager is able to do this for PCI devices, any clue how?

The friendly name comes out of the INF. It’s based on the device class, IIRC, so it’s not unique on a per device basis at all. It’s a category name. There are SetupDiXxx functions that’ll allow you to retrieve it, though I can’t remember if you can easily go from the embedded Device Object name to the Friendly Name.

Peter

1 Like

How about IoGetDeviceProperty for DevicePropertyDeviceDescription?

1 Like

One of the simplest strings that remains constant over reboots is a device interface symlink. If you are creating a device interface you already have one lying around ;).

@“Scott_Noone_(OSR)” said:
How about IoGetDeviceProperty for DevicePropertyDeviceDescription?

Thanks Scott that’s exactly what I needed. Otherwise I would have had to take the longer path of Peter’s method.