Windows: Fix devices enumeration #235
No reviewers
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi!235
Loading…
Reference in a new issue
No description provided.
Delete branch "master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Based on
https://github.com/microsoft/Windows-driver-samples/blob/master/hid/hclient/pnp.c#L32
Fixes wrong detection of the class of devices.
Fixes: #234
what are the chances we will fail to filter out a non-hid devices?
I understand that HID class GUID should do the trick, but still, this implementation been here like forever, and I'like to give it some thinking, just in case.
@ -309,14 +309,16 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shorstruct hid_device_info *root = NULL; /* return object */remove it completely?
@ -378,32 +380,18 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shorgoto cont;}please update or remove this comment, it is outdated
@ -309,14 +309,16 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shorstruct hid_device_info *root = NULL; /* return object */What about "Make sure this device has a driver bound to it" section? This buffer is used there. I am not sure why we check it - HID device without any driver should still work, right?
@Oh, sorry, you mean
i- it is not used anymore.@ -309,14 +309,16 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shorstruct hid_device_info *root = NULL; /* return object */yeap, only
iI am not WinApi expert but because this PR is based on the code straight from Microsoft, I assume it should be correct. I also read the documentation of each changed function and indicated that it should work. If the bug I fixed by this PR was there "forever" too (and I am 100% sure it is a bug), I am confused nobody discovered it yet. But maybe some people did - there are a number of open issues in the old repository, that could be caused by this. For example:
https://github.com/signal11/hidapi/issues/290
https://github.com/signal11/hidapi/issues/221
In my use case the old code didn't work (described in #234), but it is my use case :)