Building with MSVC gave:
warning C4267: '=': conversion from 'size_t' to 'USHORT', possible loss of data
The value here is known to be safe for the sizes involved. Add an
explicit cast to suppress the warning.
desc_req->SetupPacket.wValue = (USB_STRING_DESCRIPTOR_TYPE << 8)
| descriptor_index;
desc_req->SetupPacket.wIndex = 0;
- desc_req->SetupPacket.wLength = size - sizeof(*desc_req);
+ desc_req->SetupPacket.wLength = (USHORT) (size - sizeof(*desc_req));
if (!DeviceIoControl(hub_device,
IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION,