ExAllocatePoolWithQuota routine
The ExAllocatePoolWithQuota routine is obsolete, and is exported only for existing driver binaries. Use ExAllocatePoolWithQuotaTag instead.
ExAllocatePoolWithQuota allocates pool memory, charging quota against the current process.
Syntax
PVOID ExAllocatePoolWithQuota( _In_ POOL_TYPE PoolType, _In_ SIZE_T NumberOfBytes );
Parameters
- PoolType [in]
-
Specifies the type of pool memory to allocate. For a description of the available pool memory types, see POOL_TYPE.
You can modify PoolType by using a bitwise OR with the POOL_COLD_ALLOCATION flag as a hint to the kernel to allocate the memory from pages that are likely to be paged out quickly. To reduce the amount of resident pool memory as much as possible, you should not reference these allocations frequently. The POOL_COLD_ALLOCATION flag is only advisory and is available for Windows XP and later versions of the Windows operating system.
- NumberOfBytes [in]
-
Specifies the number of bytes to allocate.
Return value
ExAllocatePoolWithQuota returns a pointer to the allocated pool.
If the request cannot be satisfied, ExAllocatePoolWithQuota raises an exception.
Remarks
This routine is called by highest-level drivers that allocate memory to satisfy a request in the context of the process that originally made the I/O request. Lower-level drivers call ExAllocatePoolWithTag instead.
If NumberOfBytes is PAGE_SIZE or greater, a page-aligned buffer is allocated. Quota is not charged to the process for allocations of PAGE_SIZE or greater.
Memory allocations of less than PAGE_SIZE are allocated within a page and do not cross page boundaries. Memory allocations of PAGE_SIZE or less are not necessarily page-aligned but are aligned to 8-byte boundaries in 32-bit systems and to 16-byte boundaries in 64-bit systems.
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.
Callers of ExAllocatePoolWithQuota 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 <= APC_LEVEL can specify any POOL_TYPE value, but the IRQL and environment must also be considered for determining the pool type.
Requirements
|
Target platform | |
|---|---|
|
Version |
Obsolete. This routine is exported only for existing driver binaries. Use ExAllocatePoolWithQuotaTag instead. |
|
Header |
|
|
Library |
|
|
DLL |
|
|
IRQL |
<= DISPATCH_LEVEL (see Remarks section) |
|
DDI compliance rules | HwStorPortProhibitedDDIs, SpNoWait, StorPortStartIo |
See also