windows: Fix product string retrieval on HID composite devices

A HID composite device with three interfaces (e.g. keyboard and touch
screen built into one), with all three interfaces referencing their own
names in the interface descriptor, was reported to have an iProduct
string equal to the name of the last interface instead of the actual
product name (e.g. "TOUCH" repeated twice instead of "PRODUCT" and

This behavior differ from what for instance Microsoft USB Device Viewer
will report for the same device. This fix will make them report the same

Use HidD_GetIndexedString() instead of HidD_GetProductString(), as the
latter would otherwise return the name of the interface instead of the
iProduct string whenever the iInterface member of the
USB_INTERFACE_DESCRIPTOR structure for the interface is nonzero (see
Remarks section in the Microsoft documentation of the HID API routines).

Closes #1091
2 files changed