Skip to content

Latest commit

 

History

History
83 lines (62 loc) · 4.04 KB

nf-wdm-exallocatepoolquotazero.md

File metadata and controls

83 lines (62 loc) · 4.04 KB
UID title tech.root ms.date targetos description req.assembly req.construct-type req.ddi-compliance req.dll req.header req.idl req.include-header req.irql req.kmdf-ver req.lib req.max-support req.namespace req.redist req.target-min-winverclnt req.target-min-winversvr req.target-type req.type-library req.umdf-ver req.unicode-ansi topic_type api_type api_location api_name f1_keywords dev_langs
NF:wdm.ExAllocatePoolQuotaZero
ExAllocatePoolQuotaZero
kernel
01/06/2023
Windows
Learn more about: ExAllocatePoolQuotaZero
function
HwStorPortProhibitedDDIs, SpNoWait, StorPortStartIo
NtosKrnl.exe
wdm.h
Wdm.h, Ntddk.h, Ntifs.h
<= DISPATCH_LEVEL (see Remarks section)
NtosKrnl.lib
Requires WDK for Windows 10, version 2004. Targets Windows 7 and later versions of the Windows operating system.
Universal
apiref
DllExport
wdm.h
ExAllocatePoolQuotaZero
ExAllocatePoolQuotaZero
wdm/ExAllocatePoolQuotaZero
c++

-description

Caution

Microsoft is aware of an issue with ExAllocatePoolQuotaZero that can lead to an allocation not getting zeroed on Windows 10, version 1909.This issue has been fixed in a security refresh of the WDK for Windows 10, version 2004 and the Enterprise WDK (EWDK) for Windows 10, version 2004 on December 16th, 2020. For information on downloading the latest WDK, see Download the Windows Driver Kit (WDK).

This routine is a wrapper for and a recommended replacement option for ExAllocatePoolWithQuotaTag.

ExAllocatePoolQuotaZero allocates pool memory of the specified type and returns a pointer to the allocated block. It is identical to ExAllocatePoolWithQuotaTag except it zero initializes the allocated memory. If this is not desired, use ExAllocatePoolQuotaUninitialized instead.

-parameters

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

-param NumberOfBytes

The number of bytes to allocate.

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

-returns

ExAllocatePoolQuotaZero returns a pointer to the allocated pool.

If the request cannot be satisfied, ExAllocatePoolQuotaZero 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

To run on versions of Windows prior to Windows 10 version 2004, the driver must define POOL_ZERO_DOWN_LEVEL_SUPPORT and call ExInitializeDriverRuntime before calling this function.

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 ExAllocatePoolZero instead.

See the Remarks section of ExAllocatePoolWithQuotaTag for additional guidance.

-see-also

ExAllocatePoolQuotaUninitialized