Expand Minimize

MmBuildMdlForNonPagedPool routine

The MmBuildMdlForNonPagedPool routine receives an MDL that specifies a nonpaged virtual memory buffer, and updates it to describe the underlying physical pages.

Syntax


VOID MmBuildMdlForNonPagedPool(
  _Inout_  PMDLX MemoryDescriptorList
);

Parameters

MemoryDescriptorList [in, out]

A pointer to an MDL that specifies a virtual memory buffer in nonpaged memory. The caller used the IoAllocateMdl routine to create the MDL for this buffer.

Return value

None

Remarks

At entry, the specified MDL must describe a buffer in nonpaged system memory, such as memory that is allocated by the ExAllocatePoolWithTag routine with PoolType = NonPagedPool or by the MmAllocateContiguousMemorySpecifyCache routine. MmBuildMdlForNonPagedPool updates the MDL to describe the underlying physical pages.

Because the pages described by the MDL are already nonpageable and are already mapped to the system address space, drivers must not try to lock them by using the MmProbeAndLockPages routine, or to create additional system-address-space mappings by using the MmMapLockedPagesSpecifyCache routine. Similarly, drivers must not try to unlock the pages by using the MmUnlockPages routine, or to release the existing system-address-space mapping by using the MmUnmapLockedPages routine. If a driver performs any of these illegal operations on an MDL that is built by MmBuildMdlForNonPagedPool, the resulting behavior is undefined.

Passing an MDL built by MmBuildMdlForNonPagedPool to the MmGetSystemAddressForMdlSafe routine is allowed. The MmGetSystemAddressForMdlSafe call, in this case, simply returns the starting virtual address of the buffer that is described by the MDL.

A driver can use the MmMapLockedPagesSpecifyCache routine to map an MDL that is built by MmBuildMdlForNonPagedPool into user virtual address space. However, the driver must perform this operation in a way that avoids certain security issues. For more information, see MmMapLockedPagesSpecifyCache.

Requirements

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

<=DISPATCH_LEVEL

See also

ExAllocatePoolWithTag
MmAllocateContiguousMemorySpecifyCache
MmGetSystemAddressForMdlSafe
MmMapLockedPagesSpecifyCache
MmProbeAndLockPages
MmUnlockPages
MmUnmapLockedPages

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft