Hi,
I’m looking for a way to ask a composite device about the number of
children it has, akin to asking a hub about its number of ports.
In the usbview sample, IOCTL_USB_GET_NODE_INFORMATION is sent to a USB hub
device (GUID_DEVINTERFACE_USB_HUB) and it retrieves information about the
USB hub it is sent to – i.e. the returned
u.HubInformation.HubDescriptor.bNumberOfPorts is its own, not its parent’s.
However, MSDN keeps using this “parent” terminology:
On output, AssociatedIrp.SystemBuffer points to a USB_NODE_INFORMATION
structure that holds information about the parent device.
Now, even if I assume MSDN is misleading about the “parent” tidbit, how do
you use IOCTL_USB_GET_NODE_INFORMATION on a composite device? MSDN suggests
you should send it to GUID_DEVINTERFACE_USB_HUB (composite devices don’t
offer this interface!). I tried sending a IOCTL_USB_GET_NODE_INFORMATION
with NodeType = UsbMIParent to a composite device through
GUID_DEVINTERFACE_USB_DEVICE (the only devinterface composite devices seem
to offer), but all I got back was an empty reply (success, BytesReturned =
0).
So how are you supposed to use this IOCTL with composite devices? It seems
to be related.
P.S. Cross-posting from
http://stackoverflow.com/questions/8425450/ioctl-usb-get-node-information-and-composite-devices