IOCTL_HID_GET_INDEXED_STRING needs to be retrieved from the lower USB level, so this patchset along with other things, implements HID USB (Class 03) function driver functionality for winebus.sys - in addition of it being HID bus driver. This allows wineusb.sys to create FDOs in winebus.sys for all its enumerated children. Those FDOs then are easily accessible and addressable by the PDOs of the HID bus driver. If there is an IOCTL_HID_GET_INDEXED_STRING request to some of the PDOs, it searches for a matching FDO from the HID USB function driver, and if there is one sends an IRP to retrieve the needed indexed string from the lower level driver. There is no strong bond between the device objects - if there is a matching FDO then it'll be used to retrieve an indexed string from its device, if not then a not supported error is returned with the upper IRP.
So, the HID USB function driver acts strictly as such - just creates FDOs for the lower USB bus driver. It doesn't create any children PDOs for the FDOs. The FDOs are solely used to retrieve data from the lower level USB devices.
There are some other small fixes and improvements.
I'm using this for the last 5-6 months, without any issues. The Simucube 2 FFB wheel uses the HID bus driver to access the hidraw interface, while the VKBSim Gunfighter joystick uses both the HID bus driver for hidraw access, and HID USB Function driver for USB raw access to retrieve various indexed strings from the device.
Here is the repository with the branch wip/IOCTL_HID_GET_INDEXED_STRING: https://gitlab.winehq.org/logos128/wine/-/tree/wip/IOCTL_HID_GET_INDEXED_STR...
Only the first three patches are related to wineusb.sys, and basically make the instanceIDs unique and easily recognizable for the upper level.