phase1b: add Win32k disable mitigation constant#290
Merged
Conversation
bb44689 to
2e7f5cc
Compare
Introduces a Windows-only constants/helper module exposing the PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_ALWAYS_ON mitigation flag (1 << 28 from winnt.h), which is documented in the Windows SDK but is not generated into the `windows` crate metadata. If a future `windows` crate release adds it, this module becomes redundant and can be deleted. The companion attribute identifier PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY is already available from windows::Win32::System::Threading and is used directly at call sites (cast to usize because UpdateProcThreadAttribute's dwAttribute parameter is DWORD_PTR). Provides a win32k_disable_value() helper and a unit test verifying the documented bit position. No callers yet; this prepares for AppContainer Phase 1 integration where UpdateProcThreadAttribute will apply the mitigation before the child's first user-mode instruction. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2e7f5cc to
793b93a
Compare
shschaefer
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📖 Description
Introduces a Windows-only constants/helper module exposing the
PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_ALWAYS_ONmitigation flag (1 << 28fromwinnt.h), which is documented in the Windows SDK but is not generated into thewindowscrate metadata. If a futurewindowscrate release adds it, this module becomes redundant and can be deleted.The companion attribute identifier
PROC_THREAD_ATTRIBUTE_MITIGATION_POLICYis already available fromwindows::Win32::System::Threading(theWin32_System_Threadingfeature is enabled at the workspace level), so it is used directly at call sites — cast tousizebecauseUpdateProcThreadAttribute'sdwAttributeparameter isDWORD_PTR.Provides a
win32k_disable_value()helper and a unit test verifying the documented bit position.No callers yet — this prepares for AppContainer Phase 1 integration where
UpdateProcThreadAttributewill apply the mitigation before the child's first user-mode instruction.🔗 References
Next in the downlevel-fallback stack: phase1c (#291).
🔍 Validation
cargo test -p wxc_common --lib process_mitigationpassescargo build -p wxc_commoncleanWin25H2Safe-Tests.ps1in phase5 (held)