Skip to content

Commit

Permalink
replace deprecated exallocatepool* APIs with their modern replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
Spruill-1 committed Jan 24, 2024
1 parent 64c1afa commit 6b44d17
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions video/KMDOD/memory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ void* __cdecl operator new(size_t Size, POOL_TYPE PoolType)

Size = (Size != 0) ? Size : 1;

void* pObject = ExAllocatePoolWithTag(PoolType, Size, BDDTAG);
// Note that ExAllocatePool2 replaces ExAllocatePool* APIs in OS's starting
// with Windows 10, version 2004. If your driver targets previous versions it
// should use ExAllocatePoolZero instead.
void* pObject = ExAllocatePool2(PoolType, Size, BDDTAG);

#if DBG
if (pObject != NULL)
Expand All @@ -44,7 +47,7 @@ void* __cdecl operator new[](size_t Size, POOL_TYPE PoolType)

Size = (Size != 0) ? Size : 1;

void* pObject = ExAllocatePoolWithTag(PoolType, Size, BDDTAG);
void* pObject = ExAllocatePool2(PoolType, Size, BDDTAG);

#if DBG
if (pObject != NULL)
Expand Down

0 comments on commit 6b44d17

Please sign in to comment.