diff --git a/include/NtStatus.h b/include/NtStatus.h index 54f6d4b..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 @@ -79,6 +84,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..02b642b --- /dev/null +++ b/tests/test_ntstatus.cpp @@ -0,0 +1,24 @@ +/** + * @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)); +} + +/** Verifies resource-exhaustion failures retain the exact public WDK bits. */ +TEST(NtStatusContractTest, StatusInsufficientResourcesMatchesTheWdkContract) { + EXPECT_EQ( + static_cast(STATUS_INSUFFICIENT_RESOURCES), + static_cast(0xC000009AUL)); +}