Windows Device Manager and Hardware IDs

I am curious how the Windows Device Manager gets the hardware IDs for the device even though the device driver has not yet been loaded for the device. Does anyone know how Windows talks about this?

On a related note, I'm interested in supporting language localization for the software we write; is it possible for a device and / or driver to communicate its friendly name and description locally? Is there a common practice for this?

Thank you for your time.

0


a source to share


4 answers


First, to understand the order in which the drivers are loaded, it is recommended that you switch Device Manager to View | Devices are online.

As you may have noticed, the devices are located below their bus driver. For PCI devices, this will be the "PCI bus". For USB devices, this will be their USB hub. Each bus driver has a different idea of ​​how identifier strings should be formatted:

  • Device Instance ID
  • Equipment identifiers
  • Compatible identifiers
  • Location, etc.

He returns them in response to the IRP_MN_QUERY_ID

( BusQueryInstanceID

, BusQueryHardwareIDs

, BusQueryCompatibleIDs

) and IRP_MN_QUERY_DEVICE_TEXT

( DeviceTextDescription

, DeviceTextLocationInformation

, etc.)

Of course, since the bus driver has enumerated the devices (ie created the child devices you see), in the first place (via any standard interface suitable for the bus, such as "Get device / line descriptor" on USB) it knows their vendor ID, product ID, etc.



Currently, the device driver does not need to be loaded. In fact, it cannot be downloaded. Device IDs are exactly what instructs the PnP system which driver matches a device.

As for localization:

Unlike the IRP_MN_QUERY_ID

one that provides opaque strings for device mapping, the information was IRP_MN_QUERY_DEVICE_TEXT

really meant to be localized. For this purpose, you get the requested locale identifier (LCID) in the input ( Parameters.QueryDeviceText.LocaleId

).

[As Alphaneo pointed out, the USB hub driver can pass this LCID to the USB device (as part of the Get String descriptor request), hoping that the USB device itself has localized strings.]

+5


a source


The top-level process is called enumeration. Most modern device buses support a mechanism that allows the OS to query buses and determine which devices are connected to the bus.

The PCI bus family supports all enumerations. The PCI bus has a special

The device ID uniquely identifies the device on the bus and allows the OS to find the correct driver for that device.



Other buses, including USB and FireWire, have enumeration strategies.

+1


a source


A device ID is a combination of information provided from a device. For example, for a USB device, the string is based on the VID and PID (Vendor ID and Product ID). Now this is not possible if the driver is not loaded. For at least some drivers, the bus driver must be loaded for the OS to get the device ID.

Now, for language support, I think there is QUERY_LANG for the WDM driver or something else, I don't remember properly, alternatively some devices like USB have language ID support. This language identifier identifies the language of the product descriptor string.

+1


a source


Please note that there is a difference between the hardware ID / serial number and the true unique hardware ID. Perhaps this will explain it better: http://www.soft.tahionic.com/download-hdd_id/hardware%20ID%20programmer%27s%20DLL.html

+1


a source







All Articles