none
Device instance path for USB composite driver

    Question

  • When an USB got enumerated, Windows will create an entry in USB

    HKEY_LOCAL_MACHINE\System\ControlSet001\Enum\Usb\VID_0111&PID_1234\12345678\

    Here 12345678 is the device serial number in USB enum table.

    However when a composite device is enumerated, windows is showing some random serial number. For example if I enumerate a serial and HID it's showed as

    HKEY_LOCAL_MACHINE\System\ControlSet001\Enum\Usb\VID_0111&PID_1234&MI_00\8&265d434&0&0000 (here I am just giving an example. Actual numbers are different.

    How to interpret this number "8&265d434&0&0000"?

    How to change this number? The reason for this is, it's showing different numbers in different machines. In PC1 it's showing as 8&265d434&0&0000 and in PC2 it's showing as 7&265d434&0&0000.

    Any help on this is really appreciated.

     

    Monday, March 28, 2011 9:55 PM

Answers

  • you cannot get this value from the driver, this is intentional. there is no need for it.  the app can get the identity of the device through various user mode APIs. why do you think the driver needs the instance id?  what were you planning on doing with it in the driver code?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, March 01, 2012 7:05 PM
    Owner

All replies

  • Greetings,

    This ID that you see is called a ParentIDPrefix and is generated per machine on the fly for each device that needs a unique ID (in place of a serial number as you have referenced above).  When there isn't a serial number provided, Windows generates one for you behind the scenes.

    If you search with Regedit, you will find them all over the place. 

    So, you can't (or shouldn't) change this value once it has been assigned.  It becomes part of the device ID.  And this begs the question: If it's so unique, why does it change per port?  Meaning, you will have different ParentIDPrefix's for every port.  The PNP subsystem impresses this format upon the device ID so that it's needed.  It's kind of like a placeholder for a serial number. 

    An actual serial number is the only way around it.

    I hope this helps.


    Daniel Whitaker WDK Support Team
    Tuesday, March 29, 2011 3:03 AM
  • in addition to what daniel said, you don't interpret the entire string at all. it is an opaque string. the only thing about the string is that it is unique to that pc and will help you identify that particular device in its currently plugged in topology
    d -- This posting is provided "AS IS" with no warranties, and confers no rights.
    Tuesday, March 29, 2011 8:35 PM
    Owner
  • Kalyan979 wrote:
    >
    >When an USB got enumerated, Windows will create an entry in USB
    >
    >HKEY_LOCAL_MACHINE\System\ControlSet001\Enum\Usb\VID_0111&PID_1234\12345678\
    >
    >Here 12345678 is the device serial number in USB enum table.
     
    Don't EVER use the numbered control sets.  The numbers change when you do a
    "last known good" boot.  ALWAYS use CurrentControlSet.  That's a symbolic
    link to the proper "live" control set.  The others are just there for
    safety.
     
    >However when a composite device is enumerated, windows is showing some
    >random serial number. For example if I enumerate a serial and HID
    >it's showed as
    >
    >HKEY_LOCAL_MACHINE\System\ControlSet001\Enum\Usb\VID_0111&PID_1234&MI_00\8&265d434&0&0000 (here I am just giving an example. Actual numbers are different.
    >
    >How to interpret this number "8&265d434&0&0000"?
    >
    >How to change this number? The reason for this is, it's showing different
    >numbers in different machines. In PC1 it's showing as 8&265d434&0&0000
    >and in PC2 it's showing as 7&265d434&0&0000.
     
    You can't change this.  It's a unique identifier assigned to the device.
    Why do you care about this?
     
    (The first field in there is basically the number of "buses" between your
    device and the processor.  A USB host controller is often 5&, a hub plugged
    in to that will be 6&, the composite device will be 7&, the devices under
    it will be 8&, etc.)
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, DDK MVP Providenza & Boekelheide, Inc.
    Wednesday, March 30, 2011 6:35 AM
  • Hi Tim, 

               I have some similar issue related to Device Instance path (e.g. HID\VID_046D&PID_C018\2&8C125C6&0&0000) Can you please tell me meaning of "8&265d434&0&0000" in detail. I am working on USB driver which install USB HID device. Now i need to have the Device Instance Path which is required for my application to get to identify the device at run time. 

    I send IRP_MN_QUERY_ID to get the device id i got

    Device ID:  USB\Vid_046d&Pid_c018 and 

    InstanceID: 01  / (02 for 2nd similar device)

    but device instance path in driver information shows as "HID\VID_046D&PID_C018\2&8C125C6&0&0000" and "parent" displays "USB\Vid_046d&Pid_c018\01"

    I am using RawInput class where i got the device instance path not parent. So can you please tell me how can i get the device instance path from driver. 

    Thanks & Regards

    Bryan

    Thursday, March 01, 2012 10:40 AM
  • you cannot get this value from the driver, this is intentional. there is no need for it.  the app can get the identity of the device through various user mode APIs. why do you think the driver needs the instance id?  what were you planning on doing with it in the driver code?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, March 01, 2012 7:05 PM
    Owner