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

hid_listen on Windows with 64 endpoint size #727

Open
tmk opened this issue Apr 1, 2022 · 2 comments
Open

hid_listen on Windows with 64 endpoint size #727

tmk opened this issue Apr 1, 2022 · 2 comments
Labels

Comments

@tmk
Copy link
Owner

tmk commented Apr 1, 2022

When console endpoint size is 64 bytes hid_listen fails to display debug prints like below.
On Linux hid_listen works without problem.

Device disconnected.
Waiting for new device:
Listening:

Device disconnected.
Waiting for new device:
Listening:

Device disconnected.
Waiting for new device:
Listening:

Device disconnected.
Waiting for new device:
Listening:

Device disconnected.
Waiting for new device:
Listening:

Device disconnected.
Waiting for new device:
Listening:
@tmk
Copy link
Owner Author

tmk commented Apr 1, 2022

ReadFile() appears to require that buffer size is 65 when reading from 64-byte endpoint.
The function replies with error 1784 when using 64-byte buffer.

ERROR_INVALID_USER_BUFFER
1784 (0x6F8)
The supplied user buffer is not valid for the requested operation.

https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--1700-3999-

https://github.com/tmk/hid_listen/blob/dc2681d11e6e367aabb63ec81c936f378e7fbbd6/hid_listen.c#L34

https://github.com/tmk/hid_listen/blob/dc2681d11e6e367aabb63ec81c936f378e7fbbd6/rawhid.c#L636

tmk added a commit to tmk/hid_listen that referenced this issue Apr 1, 2022
@tmk tmk added the NOTE label Apr 13, 2022
@tmk
Copy link
Owner Author

tmk commented Apr 13, 2022

Revert to 32-byte for console EP size

b690da7

hid_listen code on TMK has been fixed but Windows binary is not available yet.

tmk/hid_listen@e586cf1

TODO: Learn Windows binary build for public distribution

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

No branches or pull requests

1 participant