none
How to find if parent of USB device is a hub

    Question

  • I need to find out if parent of USB device is a hub or host.
    Current plan is to use CM_Get_Parent() to get the DEVINST and use SetupDiGetDeviceInfoListDetail() to get the SP_DEVINFO_LIST_DETAIL_DATA structure, but from there I am looking for information to parse against to will tell me if the parent is a hub.

    Any pointers/hints/advice would be greatly appreciated.

    Thanks in advance,

    EB
    Thursday, September 30, 2010 9:23 PM

Answers

All replies

  • Are you working at the device level for a driver?

     


    Vote if answered or helpful, I am running for Office (joke)!

    Developer | Windows IT | Chess | Economics | Hardcore Games | Vegan | PC Reviews

    Thursday, September 30, 2010 9:56 PM
  • No, I need to do this from user mode.
    Thursday, September 30, 2010 10:18 PM
  • You will find that what you want is down in the driver level. There is no way to tell as USB is designed to be transparent to the user mode.

    This is by design as USB is meant to be generic.

    To identify if there is a hub is not possible as they are transparent as well.

     


    Vote if answered or helpful, I am running for Office (joke)!

    Developer | Windows IT | Chess | Economics | Hardcore Games | Vegan | PC Reviews

    Thursday, September 30, 2010 10:54 PM
  • Hi Bravo,

    I am writing to check the status of the issue on your side.  Would you mind letting us know the result of the suggestions? 

    Regards,
    Yi Feng Li
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.


     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, October 06, 2010 2:24 AM
    Moderator
  • Hi Yi,

     

    I had to take a couple day break from this task, but currently I am working on up the device tree from my DEVINST to find out if there is a hub in the chain.  My hope is to match against GUID_DEVINTERFACE_USB_HUB or GUID_DEVINTERFACE_USB_HOST_CONTROLLER, but given my attempts so far and what Vegan has said I am not too hopeful.  And I do want to avoid false positives on hub discovery.

    If I do find success in finding the hub I will report...

     

    Btw, is it a known issue that the forum does not email alerts?  I typically check this box, but have never received an alert and must check manually....

     

    Thanks,

    EB

    Friday, October 08, 2010 7:55 PM
  • Update:

    Right now there is a road block of linking into my library the device interface GUID for USB hubs:

    error LNK2001: unresolved external symbol _GUID_DEVINTERFACE_USB_HUB

    Here it says to include Usbiodef.h, which I have done and I have tried to add the libs used by USBVIEW sample application.  USBView seems to be capable of discerning between "root" and "external" hubs, which is what I am looking for, but I need to be able to do this from a user mode application.

     

    Any advice is appreciated.

     

    Thanks in advance,

    EB

    Friday, October 08, 2010 10:49 PM
  • Hi EchoBravo,

    Some WMI classes offer the device information directly. You may consider using WMI class, it is much easier. Please check some USB related class such as Win32_USBController, Win32_USBControllerDevice, Win32_USBHub, and Win32_ControllerHasHub to see whether they help.

    Regards,
    Yi Feng Li
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, October 13, 2010 3:47 AM
    Moderator
  • Hi Bravo,

    Would you mind letting me know the result of the suggestions? If you need further assistance, feel free to let me know. I will be more than happy to be of assistance.

    Regards,
    Yi Feng Li
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, October 15, 2010 2:51 AM
    Moderator