// Global variables
static bool binary_dump = false;
static bool extra_info = false;
+static bool force_device_request = false; // For WCID descriptor queries
static const char* binary_name = NULL;
static int perr(char const *format, ...)
};
if (iface_number < 0) return;
+ // WinUSB has a limitation that forces wIndex to the interface number when issuing
+ // an Interface Request. To work around that, we can force a Device Request for
+ // the Extended Properties, assuming the device answers both equally.
+ if (force_device_request)
+ os_fd[1].recipient = LIBUSB_RECIPIENT_DEVICE;
for (i=0; i<2; i++) {
printf("\nReading %s OS Feature Descriptor (wIndex = 0x%04d):\n", os_fd[i].desc, os_fd[i].index);
case 'i':
extra_info = true;
break;
+ case 'w':
+ force_device_request = true;
+ break;
case 'b':
if ((j+1 >= argc) || (argv[j+1][0] == '-') || (argv[j+1][0] == '/')) {
printf(" Option -b requires a file name\n");
}
if ((show_help) || (argc == 1) || (argc > 7)) {
- printf("usage: %s [-h] [-d] [-i] [-k] [-b file] [-l lang] [-j] [-x] [-s] [-p] [vid:pid]\n", argv[0]);
+ printf("usage: %s [-h] [-d] [-i] [-k] [-b file] [-l lang] [-j] [-x] [-s] [-p] [-w] [vid:pid]\n", argv[0]);
printf(" -h : display usage\n");
printf(" -d : enable debug output\n");
printf(" -i : print topology and speed info\n");
printf(" -s : test Microsoft Sidewinder Precision Pro (HID)\n");
printf(" -x : test Microsoft XBox Controller Type S\n");
printf(" -l lang : language to report errors in (ISO 639-1)\n");
+ printf(" -w : force the use of device requests when querying WCID descriptors\n");
printf("If only the vid:pid is provided, xusb attempts to run the most appropriate test\n");
return 0;
}