Previous Next

ExAllocatePoolWithQuota

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 thread.

PVOID 
  ExAllocatePoolWithQuota(
    IN POOL_TYPE  PoolType,
    IN SIZE_T  NumberOfBytes
    );

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.

Return Value

ExAllocatePoolWithQuota returns a pointer to the allocated pool.

If the request cannot be satisfied, ExAllocatePoolWithQuota raises an exception.

Headers

Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.

Comments

This routine is called by highest-level drivers that allocate memory to satisfy a request in the context of the thread that originally made the I/O request. Lower-level drivers call ExAllocatePoolWithTag instead.

If the NumberOfBytes requested is >= PAGE_SIZE, a page-aligned buffer is allocated. Quota is not charged to the thread for allocations >= PAGE_SIZE.

Memory requests for < PAGE_SIZE are allocated within a page and do not cross page boundaries. Memory requests for < PAGE_SIZE are not necessarily page-aligned but are aligned on an 8-byte boundary.

ExAllocatePoolWithQuota raises an exception if the pool allocation fails.

Callers of ExAllocatePoolWithQuota must be running at IRQL < DISPATCH_LEVEL.

See Also

ExAllocatePoolWithTag, ExAllocatePoolWithQuotaTag, ExFreePool