Skip to content

Windows: Fix devices enumeration#235

Merged
Youw merged 1 commit intolibusb:masterfrom
jm4R:master
Jan 30, 2021
Merged

Windows: Fix devices enumeration#235
Youw merged 1 commit intolibusb:masterfrom
jm4R:master

Conversation

@jm4R
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread windows/hid.c Outdated
Comment thread windows/hid.c Outdated
@jm4R
Copy link
Copy Markdown
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