From 832d53b3a31e3c7b7033434439f4906845e3dce7 Mon Sep 17 00:00:00 2001 From: TorinKS Date: Sat, 29 Aug 2026 10:02:27 +0300 Subject: [PATCH 1/2] feat(status): add STATUS_NOT_FOUND --- include/NtStatus.h | 5 +++++ tests/test_ntstatus.cpp | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/test_ntstatus.cpp diff --git a/include/NtStatus.h b/include/NtStatus.h index 54f6d4b..8d060d7 100644 --- a/include/NtStatus.h +++ b/include/NtStatus.h @@ -79,6 +79,11 @@ #define STATUS_SHARING_VIOLATION ((NTSTATUS)0xC0000043L) #endif +/* The requested object or entity is absent from the queried kernel-owned set. */ +#ifndef STATUS_NOT_FOUND +#define STATUS_NOT_FOUND ((NTSTATUS)0xC0000225L) +#endif + // Helper macros #ifndef NT_SUCCESS #define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0) diff --git a/tests/test_ntstatus.cpp b/tests/test_ntstatus.cpp new file mode 100644 index 0000000..1a02181 --- /dev/null +++ b/tests/test_ntstatus.cpp @@ -0,0 +1,17 @@ +/** + * @file test_ntstatus.cpp + * @brief Verifies WinKernelLite publishes NTSTATUS values used by shared code. + */ + +#include + +#include + +#include + +/** Verifies STATUS_NOT_FOUND retains the exact public WDK bit pattern. */ +TEST(NtStatusContractTest, StatusNotFoundMatchesTheWdkContract) { + EXPECT_EQ( + static_cast(STATUS_NOT_FOUND), + static_cast(0xC0000225UL)); +} From d3614c210790e49a06c17becc19b14eaf577d870 Mon Sep 17 00:00:00 2001 From: TorinKS Date: Sat, 29 Aug 2026 10:10:45 +0300 Subject: [PATCH 2/2] feat(status): add insufficient resources status --- include/NtStatus.h | 5 +++++ tests/test_ntstatus.cpp | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/include/NtStatus.h b/include/NtStatus.h index 8d060d7..e512ee7 100644 --- a/include/NtStatus.h +++ b/include/NtStatus.h @@ -47,6 +47,11 @@ #define STATUS_NO_MEMORY ((NTSTATUS)0xC0000017L) #endif +/* A kernel pool or another bounded resource cannot satisfy the request. */ +#ifndef STATUS_INSUFFICIENT_RESOURCES +#define STATUS_INSUFFICIENT_RESOURCES ((NTSTATUS)0xC000009AL) +#endif + #ifndef STATUS_ACCESS_DENIED #define STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022L) #endif diff --git a/tests/test_ntstatus.cpp b/tests/test_ntstatus.cpp index 1a02181..02b642b 100644 --- a/tests/test_ntstatus.cpp +++ b/tests/test_ntstatus.cpp @@ -15,3 +15,10 @@ TEST(NtStatusContractTest, StatusNotFoundMatchesTheWdkContract) { static_cast(STATUS_NOT_FOUND), static_cast(0xC0000225UL)); } + +/** Verifies resource-exhaustion failures retain the exact public WDK bits. */ +TEST(NtStatusContractTest, StatusInsufficientResourcesMatchesTheWdkContract) { + EXPECT_EQ( + static_cast(STATUS_INSUFFICIENT_RESOURCES), + static_cast(0xC000009AUL)); +}