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

Is this information on the GetRawInputDeviceInfoA page a bug? #3996

Open
Wallby opened this issue May 4, 2024 · 1 comment
Open

Is this information on the GetRawInputDeviceInfoA page a bug? #3996

Wallby opened this issue May 4, 2024 · 1 comment
Labels
bug Something isn't working Pri3

Comments

@Wallby
Copy link

Wallby commented May 4, 2024

Describe the bug
The following section..

If successful, this function returns a non-negative number indicating the number of bytes copied to pData.

If pData is not large enough for the data, the function returns -1. If pData is NULL, the function returns a value of zero. In both of these cases, pcbSize is set to the minimum size required for the pData buffer.

Call GetLastError to identify any other errors.

.. says that..

  • if successful, GetRawInputDeviceInfoA returns a "non-negative number"
  • if pData == NULL.. 0 is returned
  • if pcbSize is too small.. -1 is returned
  • any other errors can be identified using GetLastError

The first and the last seem confusing. pData == NULL is "non-negative", thus I suppose that is considered success. However does "to identify any other errors" mean that there is no way to detect those errors except checking if GetLastError() != ERROR_SUCCESS? Or does it mean that any other error will also return a negative (but not -1) number and GetLastError can be used to "To get extended error information" as the CreateWindowA documentation page puts it?

To Reproduce
-

Expected behavior
The words "Call GetLastError to identify any other errors" are confusing. "To get extended error information, call GetLastError" is clearer.

Screenshots
-

Desktop (please complete the following information):
-

Smartphone (please complete the following information):
-

Additional context
-

@Wallby Wallby added the bug Something isn't working label May 4, 2024
@gewarren
Copy link
Member

@drewbatgit FYI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Pri3
Projects
None yet
Development

No branches or pull requests

2 participants