Skip to content

HW identification

Fredrik Orderud edited this page Oct 5, 2023 · 36 revisions

Windows uses Device instance ID strings to identify individual HW devices. Device instance IDs are expressed as text strings in the following format <bus-prefix>\<device-ID>\<instance-ID>.

Windows also uses device interface paths or symbolic link name of an interface instance on the following format \\?\hid#vid_vvvv&pid_pppp&mi_mm#ssss#{gggggggg-gggg-gggg-gggg-gggggggggggg} where vvvv is the vendor ID, pppp is product ID, ssss is the USB serial string and gggg... is the device interfacce GUID. This string can be passed by CreateFile to connect to the device. Sources: CM_Get_Device_Interface_ListW Buffer argument, SP_DEVICE_INTERFACE_DETAIL_DATA_W::DevicePath, Windows USB Device Path.

Warning from Microsoft: "Device identification strings should not be parsed. They are meant only for string comparisons and should be treated as opaque strings.

Logitech Webcam example

Device tree view of multiple USB devices of the same type (Logitech HD Webcam C525):

image

The "USB Composite Device" represents the physical Webcam device, whereas the child devices are virtual devices for the individual functions offered.

Corresponding device instance IDs

Device #1:

  • Composite dev: USB\VID_046D&PID_0826\9DC49FA0
    • Speaker: USB\VID_046D&PID_0826&MI_00\6&1AC65CD4&0&0000
      • Mic: SWD\MMDEVAPI\{0.0.1.00000000}.{0F5AE081-BE5E-4B63-8153-1F0B0729AD1E}
    • Webcam: USB\VID_046D&PID_0826&MI_02\6&1AC65CD4&0&0002

Device #1:

  • Composite dev: USB\VID_046D&PID_0826\03857B50
    • Speaker: USB\VID_046D&PID_0826&MI_00\6&D2A3B0F&0&0000
      • Mic: SWD\MMDEVAPI\{0.0.1.00000000}.{9F1F4B71-D3A6-492B-B152-C579479BEB04}
    • Webcam: USB\VID_046D&PID_0826&MI_02\6&D2A3B0F&0&0002

Interpretation:

  • USB: Universal Serial Bus device type (can also be HID, PCI or SWD)
  • VID_046D: Vendor Logitech inc.
  • PID_0826: Product HD Webcam C525
  • MI_00: Multiple Interface index (to separate speaker vs. camera function)
  • \<serial>: Instance ID to distinguish devices of the same type

Links

Clone this wiki locally