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: retry open_device() without r/w if it fails #335

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xobs
Copy link

@xobs xobs commented Jun 5, 2017

Modern Windows implementations don't allow opening HID devices in
READ/WRITE mode if they are claimed by the system. Examples of such
devices include keyboards and mice.

However, these devices can be opened without READ/WRITE permissions, in
order to allow sending and receiving feature reports.

If open_device() fails, retry without requesting READ/WRITE permissions.

This inverts the logic of the parameter to open_device().

It is a refactor of #44 by @pqu.

Tested on Windows 10 15063.

Signed-off-by: Sean Cross sean@xobs.io

Modern Windows implementations don't allow opening HID devices in
READ/WRITE mode if they are claimed by the system.  Examples of such
devices include keyboards and mice.

However, these devices can be opened without READ/WRITE permissions, in
order to allow sending and receiving feature reports.

If open_device() fails, retry without requesting READ/WRITE permissions.

This inverts the logic of the parameter to open_device().

It is a refactor of signal11#44 by @pqu.

Signed-off-by: Sean Cross <sean@xobs.io>
Megamouse pushed a commit to Megamouse/hidapi that referenced this pull request Jan 1, 2022
`SUBSYSTEMS` should be used instead of `SUBSYSTEM` for "usb" match.

Fixes: signal11#335
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant