Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Fix devices enumeration #235

Merged
merged 1 commit into from
Jan 30, 2021
Merged

Windows: Fix devices enumeration #235

merged 1 commit into from
Jan 30, 2021

Conversation

jm4R
Copy link
Contributor

@jm4R jm4R commented Jan 21, 2021

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

Copy link
Member

@Youw Youw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

windows/hid.c Outdated Show resolved Hide resolved
windows/hid.c Outdated Show resolved Hide resolved
@jm4R
Copy link
Contributor Author

jm4R commented Jan 21, 2021

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.

I 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:
signal11/hidapi#290
signal11/hidapi#221

In my use case the old code didn't work (described in #234), but it is my use case :)

@mcuee mcuee added the Windows Related to Windows backend label Jan 27, 2021
@Youw Youw merged commit 3cd1742 into libusb:master Jan 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Windows Related to Windows backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows version doesn't enumerate devices when exactly one is connected
3 participants