Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Sept/Oct 2019 Issue of The NT Insider available

Download PDF here:

It’s a particularly BIG issue, too: 40 pages of technical goodness, ranging from WDF to Minifilters. Check it out.
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

SetupDiGetDeviceRegistryProperty failed with error code 13 when getting SPDRP_UI_NUMBER.

sonusonu Member Posts: 4

SetupDiGetDeviceRegistryProperty failed with error code 13 when getting SPDRP_UI_NUMBER using SetupDiGetDeviceRegistryProperty.

How can get VIP PID and serial number for USB device.


  • SweetLowSweetLow Member Posts: 27
    1. UI means "User Interface". No relations to serial number at all.
    2. UsbView is open source.
  • sonusonu Member Posts: 4

    I am looking for serial number for USB device that is unique for each device with VID and PID and com port.

    I got COM PORT and VID PID using SetupDiGetDeviceRegistryProperty but unable to get serial number.
    please suggest if there is any way to find the all values or USB device serial number with respect to com port.

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,066

    Most of the USB serial port devices do not embed a serial number, and in that case, there is no way to uniquely identify a device.

    If you look at the Enum registry key for your device, you'll see Enum\USB\VID_xxxx&PID_xxxx. There is one subkey in that key for each device the system has seen. If the devices have a serial number, then the subkey names are the serial numbers. That way, the system can track the device no matter where it is plugged. If the subkeys have names like 6&58e4b78&0&2, then the devices do not have serial number. That string encodes the hub and the port number where the device is plugged. Every time the device is plugged into a new port, it is seen as a new device.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,066

    You might try SPDRP_HARDWAREID. That's the operating system's unique identifier, and you can't do any better.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Writing WDF Drivers 21 Oct 2019 OSR Seminar Space & ONLINE
Internals & Software Drivers 18 Nov 2019 Dulles, VA
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 27 Apr 2020 OSR Seminar Space & ONLINE