Skip to content

Clarify Raw Input buffer semantics, alignment, and handle lifetime#2190

Open
DJm00n wants to merge 6 commits into
MicrosoftDocs:docsfrom
DJm00n:patch-17
Open

Clarify Raw Input buffer semantics, alignment, and handle lifetime#2190
DJm00n wants to merge 6 commits into
MicrosoftDocs:docsfrom
DJm00n:patch-17

Conversation

@DJm00n

@DJm00n DJm00n commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

This PR clarifies previously undocumented behavior of GetRawInputBuffer and GetRawInputData.

Changes

  • Fix alignment requirement: DWORD on 32-bit, QWORD on 64-bit
  • Document that GetMessage removes WM_INPUT from the raw input queue before returning, making it invisible to GetRawInputBuffer
  • Document correct two-phase pattern: GetRawInputData(lParam) first, then GetRawInputBuffer in a loop
  • Document HRAWINPUT handle lifetime: freed on next GetMessage/PeekMessage(PM_REMOVE)
  • Fix error handling docs, pcbSize semantics, legacy HTML links

See also MicrosoftDocs/win32#2168

Updated alignment requirements and error handling details for the GetRawInputBuffer function. Clarified the behavior of the function when reading raw input messages from the queue.
@prmerger-automator

Copy link
Copy Markdown

@DJm00n : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@DJm00n DJm00n changed the title Clarify GetRawInputBuffer alignment and error handling Clarify Raw Input buffer semantics, alignment, and handle lifetime Mar 18, 2026

@GrantMeStrength GrantMeStrength left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM — accurate technical correction. Approved.

@GrantMeStrength

Copy link
Copy Markdown
Contributor

@copilot /review

@GrantMeStrength GrantMeStrength left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed ✅ — Documentation improvement looks good.

@prmerger-automator

Copy link
Copy Markdown

@DJm00n : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. @jwmsft

1 similar comment
@prmerger-automator

Copy link
Copy Markdown

@DJm00n : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. @jwmsft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants