EngAllocMem

PVOID EngAllocMem(

    ULONG fl,

    ULONG cj,

    ULONG tag

   );

EngAllocMem allocates a block of memory from the system’s paged pool, and inserts a caller-supplied tag before the allocation.

Parameters

fl
Specifies how to allocate memory. The FL_ZERO_MEMORY flag requests that the allocated memory’s contents be zero-initialized; if this flag is not set, the memory is returned uninitialized.
cj
Specifies the number of bytes to allocate.
tag
Is a four-byte allocation tag that uniquely identifies the driver doing the memory allocation.

Return Value

EngAllocMem returns a pointer to the allocated memory if the system has enough memory to satisfy the request; otherwise, it returns a null pointer.

Comments

The tag string should be specified in byte reversed order. The first letter must be ‘D’; the other three should be indicative of the driver name. For example, the tag string ‘ 3sD’ appears as ‘Ds3 ‘ if pool is dumped. The tag appears in any crash dump of the system that occurs.

See Also

EngFreeMem