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 #1

Merged
merged 1 commit into from
Jun 5, 2019

Conversation

z3ntu
Copy link
Collaborator

@z3ntu z3ntu commented Jun 5, 2019

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.

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

Re-open of signal11/hidapi#335

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 libusb#44 by @pqu.

Signed-off-by: Sean Cross <sean@xobs.io>
Copy link
Member

@Qbicz Qbicz left a comment

Choose a reason for hiding this comment

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

Tested on Win7 and Win10 with mouse and keyboard. Exchanging feature reports work.

@Qbicz Qbicz merged commit f7ee9cc into libusb:master Jun 5, 2019
@z3ntu z3ntu deleted the pr_335 branch June 20, 2019 17:14
@mcuee mcuee added the Windows Related to Windows backend label Jul 18, 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.

4 participants