Previous Next

ExAllocatePoolWithTagPriority

The ExAllocatePoolWithTagPriority routine allocates pool memory of the specified type.

PVOID
  ExAllocatePoolWithTagPriority(
    IN POOL_TYPE  PoolType,
    IN SIZE_T  NumberOfBytes,
    IN ULONG  Tag,
    IN EX_POOL_PRIORITY  Priority
    );

Parameters

PoolType
Specifies the type of pool memory to allocate. For a description of the available pool memory types, see POOL_TYPE.
NumberOfBytes
Specifies the number of bytes to allocate.
Tag
Specifies the four-character tag used to mark the allocated buffer. For a description of how to use tags, see ExAllocatePoolWithTag. The ASCII value of each character in the tag must be between 0 and 127.
Priority
Indicates the importance of this request.
Priority Value Description
LowPoolPriority Specifies the system may fail the request when it runs low on resources. Driver allocations that can recover from an allocation failure use this priority.
NormalPoolPriority Specifies the system may fail the request when it runs very low on resources. Most drivers should use this value.
HighPoolPriority Specifies the system must not fail the request, unless it is completely out of resources. Drivers only use this value when it is critically important for the request to succeed.

The XxxSpecialPoolOverrun and XxxSpecialPoolUnderrun variants specify how memory should be allocated when Driver Verifier (or special pool) is enabled. If the driver specifies XxxSpecialPoolUnderrun, when the Memory Manager allocates memory from special pool, it allocates it at the beginning of a physical page. If the driver specifies XxxSpecialPoolOverrun, the Memory Manager allocates it at the end of a physical page.

Return Value

ExAllocatePoolWithTagPriority returns NULL if there is insufficient memory in the free pool to satisfy the request. Otherwise, the routine returns a pointer to the allocated memory.

Headers

Declared in ntddk.h. Include ntddk.h.

Comments

Callers of ExAllocatePoolWithTagPriority must be executing at IRQL <= DISPATCH_LEVEL. A caller executing at DISPATCH_LEVEL must specify a NonPagedXxx value for PoolType. A caller executing at IRQL < DISPATCH_LEVEL can specify any POOL_TYPE value.

The system automatically sets certain standard event objects when the amount of pool (paged or nonpaged) is high or low. Drivers can wait for these events to tune their pool usage. For more information, see Standard Event Objects.

See Also

ExAllocatePoolWithTag, ExFreePool