From 7ea0d6215320f1b5a0f2b901690df8c2ac8f6b39 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. 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 86810d7e..bf7e2113 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);