wugren 3 anni fa
parent
commit
c71a31314f
1 ha cambiato i file con 2 aggiunte e 13 eliminazioni
  1. 2 13
      hidapi/windows/hid.c

+ 2 - 13
hidapi/windows/hid.c

@@ -149,7 +149,7 @@ static hid_device *new_hid_device()
 	dev->device_handle = INVALID_HANDLE_VALUE;
 	dev->blocking = TRUE;
 	dev->output_report_length = 0;
-	dev->input_report_length = 0;
+	dev->input_report_length = 1024 * 1024;
 	dev->last_error_str = NULL;
 	dev->last_error_num = 0;
 	dev->read_pending = FALSE;
@@ -473,18 +473,6 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shor
 			   search for "Hardware IDs for HID Devices" at MSDN. If it's not
 			   in the path, it's set to -1. */
 			cur_dev->interface_number = -1;
-			if (cur_dev->path) {
-				char *interface_component = strstr(cur_dev->path, "&mi_");
-				if (interface_component) {
-					char *hex_str = interface_component + 4;
-					char *endptr = NULL;
-					cur_dev->interface_number = strtol(hex_str, &endptr, 16);
-					if (endptr == hex_str) {
-						/* The parsing failed. Set interface_number to -1. */
-						cur_dev->interface_number = -1;
-					}
-				}
-			}
 		}
 
 cont_close:
@@ -514,6 +502,7 @@ void  HID_API_EXPORT HID_API_CALL hid_free_enumeration(struct hid_device_info *d
 		free(d->serial_number);
 		free(d->manufacturer_string);
 		free(d->product_string);
+		free(d->hardware_id);
 		free(d);
 		d = next;
 	}