MCPcopy Create free account
hub / github.com/HoShiMin/Kernel-Bridge / AllocFromPool

Function AllocFromPool

Kernel-Bridge/API/MemoryUtils.cpp:21–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20 _IRQL_requires_max_(DISPATCH_LEVEL)
21 PVOID AllocFromPool(SIZE_T Bytes, BOOLEAN FillByZeroes) {
22 if (!Bytes) return NULL;
23 VOID* CONST Address = ExAllocatePoolWithTag(
24 ExDefaultNonPagedPoolType,
25 Bytes,
26 PoolTag
27 );
28 if (!Address) return NULL;
29 *static_cast<PUCHAR>(Address) = 0x00;
30 *(static_cast<PUCHAR>(Address) + Bytes - 1) = 0x00;
31 if (FillByZeroes) RtlZeroMemory(Address, Bytes);
32 return Address;
33 }
34
35 _IRQL_requires_max_(DISPATCH_LEVEL)
36 PVOID AllocFromPoolExecutable(SIZE_T Bytes) {

Callers 9

AllocFunction · 0.85
OnConnectInternalMethod · 0.85
AllocAnsiStringFunction · 0.85
AllocWideStringFunction · 0.85
AllocArrayFunction · 0.85
QueueUserApcFunction · 0.85
KbAllocKernelMemoryFunction · 0.85
KbGetThreadContextFunction · 0.85
KbSetThreadContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected