From 76d4ffd8538e40e95f11c139a146afa29be093c7 Mon Sep 17 00:00:00 2001 From: "Kubicz, Filip" Date: Tue, 8 Jan 2019 15:01:06 +0100 Subject: [PATCH] Windows: enumerate simple devices 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 --- windows/hid.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/windows/hid.c b/windows/hid.c index 33fbe48c5..fdee0f2b9 100755 --- a/windows/hid.c +++ b/windows/hid.c @@ -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);