I need to find USB Host Controller by plugged USB device. I need it to set a specific registry key for that controller which is required to fix KB928631.
I am able to get device handle and get the parent device handle using CM_Get_Parent()
function.
Unfortunately, there is no information about number of HUBs, so I don’t know how many times CM_Get_Parent()
should be called to reach the Host Controller.
Is there any Controller specific data which could be used to differentiate it from HUB?
Currently I am getting CM_DRP_LOCATION_INFORMATION
property to and determine whether the string returned by the property started by "PCI bus". If so assume that current device is Host Controller.
Is this a reliable solution?