ExAllocatePoolQuotaUninitialized function (wdm.h)
The ExAllocatePoolQuotaUninitialized routine allocates pool memory, charging the quota against the current process.
This routine is a wrapper and replacement option for ExAllocatePoolWithQuotaTag. There is no difference in functionality.
Syntax
PVOID ExAllocatePoolQuotaUninitialized(
__drv_strictTypeMatch(__drv_typeExpr)POOL_TYPE PoolType,
SIZE_T NumberOfBytes,
ULONG Tag
);
Parameters
PoolType
The type of pool memory to allocate. For a description of the available pool memory types, see POOL_TYPE.
Similarly, you can modify the PoolType value by bitwise-ORing this value with the POOL_COLD_ALLOCATION flag (also defined in wdm.h
) 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.
NumberOfBytes
The number of bytes to allocate.
Tag
The pool tag to use for the allocated memory. Specify the pool tag as a non-zero character literal of one to four characters delimited by single quotation marks (for example, Tag1
). The string is usually specified in reverse order (for example, 1gaT
). Each ASCII character in the tag must be a value in the range 0x20 (space) to 0x7E (tilde). Each allocation code path should use a unique pool tag to help debuggers and verifiers identify the code path.
Return value
ExAllocatePoolQuotaUninitialized returns a pointer to the allocated pool.
If the request cannot be satisfied, ExAllocatePoolQuotaUninitialized raises an exception unless POOL_QUOTA_FAIL_INSTEAD_OF_RAISE is specified. Using POOL_QUOTA_FAIL_INSTEAD_OF_RAISE is preferred for performance reasons.
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 ExAllocatePoolUninitialized instead.
Memory that ExAllocatePoolQuotaUninitialized allocates is uninitialized. A kernel-mode driver must first zero this memory if it is going to make it visible to user-mode software (to avoid leaking potentially privileged contents)
See the Remarks section of ExAllocatePoolWithQuotaTag for additional guidance.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Requires WDK for Windows 10, version 2004. Targets Windows 7 and later versions of the Windows operating system. |
Target Platform | Universal |
Header | wdm.h (include Wdm.h, Ntddk.h, Ntifs.h) |
Library | NtosKrnl.lib |
DLL | NtosKrnl.exe |
IRQL | IRQL <= DISPATCH_LEVEL (see Remarks section) |
DDI compliance rules | HwStorPortProhibitedDDIs, SpNoWait, StorPortStartIo |