[PR #10326] Remove CONSOLE_API_MSG::UpdateUserBufferPointers hack #27991

Open
opened 2026-01-31 09:25:36 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/10326

State: closed
Merged: Yes


Summary of the Pull Request

This commit introduces a copy constructor/operator for
_CONSOLE_API_MSG. The change is not trivial as the struct contains a
union of unnamed structs that cannot be copied using regular language
features. As such a copy operator using memcpy was implemented.
Additionally all access specifiers were removed, as those allow a C++
compiler to reorder struct members. This would break message passing.
This commit is a good opportunity to prevent such miscompilations
proactively.

Validation Steps Performed

  • Command prompts of WSL2 fish-shell and pwsh still work ✔️

Closes #10076

**Original Pull Request:** https://github.com/microsoft/terminal/pull/10326 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request This commit introduces a copy constructor/operator for `_CONSOLE_API_MSG`. The change is not trivial as the struct contains a union of unnamed structs that cannot be copied using regular language features. As such a copy operator using `memcpy` was implemented. Additionally all access specifiers were removed, as those allow a C++ compiler to reorder struct members. This would break message passing. This commit is a good opportunity to prevent such miscompilations proactively. ## Validation Steps Performed * Command prompts of WSL2 fish-shell and pwsh still work ✔️ Closes #10076
claunia added the pull-request label 2026-01-31 09:25:36 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27991