Blacklist Corsair device causing hang
authorJimb Esser <wasteland@gmail.com>
Sun, 14 Jul 2019 16:48:31 -0700
changeset 129419c848db04e09
parent 12940 1e6980ce45c0
child 12942 2c2adb2ebc96
Blacklist Corsair device causing hang
src/hidapi/windows/hid.c
     1.1 --- a/src/hidapi/windows/hid.c	Sat Jul 13 17:04:02 2019 -0300
     1.2 +++ b/src/hidapi/windows/hid.c	Sun Jul 14 16:48:31 2019 -0700
     1.3 @@ -296,6 +296,12 @@
     1.4  	return 0;
     1.5  }
     1.6  
     1.7 +int hid_blacklist(unsigned short vendor_id, unsigned short product_id)
     1.8 +{
     1.9 +	return vendor_id == 0x1B1C && // (Corsair)
    1.10 +		product_id == 0x1B3D; // Gaming keyboard?  Causes deadlock when asking for device details
    1.11 +}
    1.12 +
    1.13  struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned short vendor_id, unsigned short product_id)
    1.14  {
    1.15  	BOOL res;
    1.16 @@ -424,7 +430,8 @@
    1.17  		/* Check the VID/PID to see if we should add this
    1.18  		   device to the enumeration list. */
    1.19  		if ((vendor_id == 0x0 || attrib.VendorID == vendor_id) &&
    1.20 -		    (product_id == 0x0 || attrib.ProductID == product_id)) {
    1.21 +		    (product_id == 0x0 || attrib.ProductID == product_id) &&
    1.22 +			!hid_blacklist(attrib.VendorID, attrib.ProductID)) {
    1.23  
    1.24  			#define WSTR_LEN 512
    1.25  			const char *str;