MmAllocateMappingAddress function (wdm.h)

The MmAllocateMappingAddress routine reserves a range of system virtual address space of the specified size.

Syntax

PVOID MmAllocateMappingAddress(
  [in] SIZE_T NumberOfBytes,
  [in] ULONG  PoolTag
);

Parameters

[in] NumberOfBytes

Specifies the number of bytes to reserve.

[in] PoolTag

Specifies a four-character tag used to identify the buffer. Use a distinct PoolTag tag for each allocation code path. For a description of pool tags, see ExAllocatePoolWithTag.

Return value

MmAllocateMappingAddress returns a pointer to the beginning of the reserved memory buffer.

Remarks

MmAllocateMappingAddress reserves a system virtual address range for the caller to use. No physical memory is allocated for the virtual address range and the virtual memory cannot be accessed until it is mapped by the MmMapLockedPagesWithReservedMapping routine. The caller unmaps the reserved memory range by calling the MmUnmapReservedMapping routine. Finally, the caller can free the reserved range by calling MmFreeMappingAddress.

Requirements

Requirement Value
Minimum supported client Available in Windows XP and later versions of Windows.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL <=APC_LEVEL

See also

MmFreeMappingAddress

MmMapLockedPagesWithReservedMapping

MmUnmapReservedMapping