[PR #14822] Consolidate NTSTATUS and remove INLINE_NSTATUS_FROM_WIN32 #30269

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

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

State: closed
Merged: Yes


This PR makes the following project-wide changes/replacements as a first step in
cleaning up our use of NTSTATUS.

  • Rewriting any uses of NTSTATUS_FROM_WIN32 that were vulnerable to multiple evaluation bugs
    • This is required because the macro version of NTSTATUS_FROM_WIN32 evaluates its argument twice
  • Removing all our local redefinitions of NTSTATUS in favor of that of winternl.h
    • Because of this, we got to (had to?) remove some old transclusions from conddkrefs.h
  • NT_SUCCESS (ours) -> SUCCEEDED_NTSTATUS (wil)
  • VERIFY_IS_TRUE(NT_SUCCESS()) (overly elaborate) -> VERIFY_NT_SUCCESS (WEX)
  • VERIFY_SUCCESS_NTSTATUS (ours) -> VERIFY_NT_SUCCESS (WEX)
  • One bad use of S_OK as an NTSTATUS -> STATUS_SUCCESS
  • Removing NTSTATUS from any projects that do not use it
**Original Pull Request:** https://github.com/microsoft/terminal/pull/14822 **State:** closed **Merged:** Yes --- This PR makes the following project-wide changes/replacements as a first step in cleaning up our use of `NTSTATUS`. * Rewriting any uses of `NTSTATUS_FROM_WIN32` that were vulnerable to multiple evaluation bugs * This is required because the macro version of `NTSTATUS_FROM_WIN32` evaluates its argument twice * Removing all our local redefinitions of `NTSTATUS` in favor of that of `winternl.h` * Because of this, we got to (had to?) remove some old transclusions from `conddkrefs.h` * `NT_SUCCESS` (ours) -> `SUCCEEDED_NTSTATUS` (wil) * `VERIFY_IS_TRUE(NT_SUCCESS())` (overly elaborate) -> `VERIFY_NT_SUCCESS` (WEX) * `VERIFY_SUCCESS_NTSTATUS` (ours) -> `VERIFY_NT_SUCCESS` (WEX) * One bad use of S_OK as an NTSTATUS -> `STATUS_SUCCESS` * Removing `NTSTATUS` from any projects that do not use it
claunia added the pull-request label 2026-01-31 09:39:41 +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#30269