Skip to content

Commit f9a446e

Browse files
authored
Add Kernel Static Assert Correct Version is Targetted (#5147)
1 parent d46ad00 commit f9a446e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/inc/quic_platform_winkernel.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,18 @@ extern uint64_t CxPlatTotalMemory;
254254
#define CXPLAT_ALLOC_NONPAGED(Size, Tag) ExAllocatePool2(POOL_FLAG_NON_PAGED | POOL_FLAG_UNINITIALIZED, Size, Tag)
255255
#define CXPLAT_FREE(Mem, Tag) ExFreePoolWithTag((void*)Mem, Tag)
256256

257+
//
258+
// If the following assert fails, then something broke and we're no longer
259+
// calling the inline version of ExAllocateFromLookasideListEx, and instead
260+
// trying to dynamically link to the more recent version of this function,
261+
// which doesn't exist down level.
262+
//
263+
// This value should be set via the projects _NT_TARGET_VERSION xml property.
264+
//
265+
CXPLAT_STATIC_ASSERT(
266+
NTDDI_VERSION == NTDDI_WIN10_FE, // 0x0A00000A
267+
"Incorrect version breaks down-level builds");
268+
257269
typedef LOOKASIDE_LIST_EX CXPLAT_POOL;
258270

259271
typedef struct DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT) CXPLAT_POOL_HEADER {

0 commit comments

Comments
 (0)