Skip to content

Commit

Permalink
Windows: enumerate simple devices
Browse files Browse the repository at this point in the history
Right now, in hid_open it is checked if the connected devices have
"HIDClass" driver name. This is true for composite devices, but some
simple HID devices only have "Mouse" or "Keyboard" driver name.

One of devices that cannot be opened is Dell MS116t, but any mouse which
is not part of composite device can be affected.

With this change, one can enumerate and open these devices.

Signed-off-by: Kubicz, Filip <[email protected]>
  • Loading branch information
Qbicz committed Jun 7, 2019
1 parent baaec21 commit 76d4ffd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion windows/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,9 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shor
if (!res)
goto cont;

if (strcmp(driver_name, "HIDClass") == 0) {
if ((strcmp(driver_name, "HIDClass") == 0) ||
(strcmp(driver_name, "Mouse") == 0) ||
(strcmp(driver_name, "Keyboard") == 0)) {
/* See if there's a driver bound. */
res = SetupDiGetDeviceRegistryPropertyA(device_info_set, &devinfo_data,
SPDRP_DRIVER, NULL, (PBYTE)driver_name, sizeof(driver_name), NULL);
Expand Down

0 comments on commit 76d4ffd

Please sign in to comment.