Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions include/NtStatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
24 changes: 24 additions & 0 deletions tests/test_ntstatus.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @file test_ntstatus.cpp
* @brief Verifies WinKernelLite publishes NTSTATUS values used by shared code.
*/

#include <gtest/gtest.h>

#include <Windows.h>

#include <WinKernelLite/NtStatus.h>

/** Verifies STATUS_NOT_FOUND retains the exact public WDK bit pattern. */
TEST(NtStatusContractTest, StatusNotFoundMatchesTheWdkContract) {
EXPECT_EQ(
static_cast<ULONG>(STATUS_NOT_FOUND),
static_cast<ULONG>(0xC0000225UL));
}

/** Verifies resource-exhaustion failures retain the exact public WDK bits. */
TEST(NtStatusContractTest, StatusInsufficientResourcesMatchesTheWdkContract) {
EXPECT_EQ(
static_cast<ULONG>(STATUS_INSUFFICIENT_RESOURCES),
static_cast<ULONG>(0xC000009AUL));
}
Loading