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
);
| 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.
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.
Declared in ntddk.h. Include ntddk.h.
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.