MmMapLockedPages function

The MmMapLockedPages routine is obsolete for Windows 2000 and later versions of Windows, and for Windows Me. It is supported only for WDM drivers that must run on Windows 98. Otherwise, use MmMapLockedPagesSpecifyCache.

The MmMapLockedPages routine maps the physical pages that are described by a given MDL.

Syntax

DECLSPEC_DEPRECATED_DDK NTKERNELAPI PVOID MmMapLockedPages(
  PMDL                                                                          MemoryDescriptorList,
  __drv_strictType(KPROCESSOR_MODE / enum _MODE,__drv_typeConst)KPROCESSOR_MODE AccessMode
);

Parameters

MemoryDescriptorList

Pointer to an MDL that was updated by MmProbeAndLockPages.

AccessMode

Specifies the access mode in which to map the MDL, either KernelMode or UserMode. Almost all drivers should use KernelMode.

Return Value

MmMapLockedPages returns the starting address of the mapped pages. (For NT-based operating systems prior to Windows NT 4.0 Service Pack 4 (SP4), MmMapLockedPages returns the beginning address of the first page of the mapped pages.)

Remarks

Use MmUnmapLockedPages to unmap the physical pages that were mapped by MmMapLockedPages.

If AccessMode is KernelMode and MmMapLockedPages cannot map the specified pages, the system issues a bug check. (For this reason, drivers should use MmMapLockedPagesSpecifyCache when available; that routine returns NULL on failure, rather than causing a bug check.) If AccessMode is UserMode and the specified pages cannot be mapped, the routine raises an exception. Callers that specify UserMode must wrap the call to MmMapLockedPages in a try/except block. For more information, see Handling Exceptions.

Callers of MmMapLockedPages must be running at IRQL <= DISPATCH_LEVEL if AccessMode is KernelMode. Otherwise, the caller must be running at IRQL <= APC_LEVEL.

Requirements

   
Windows version Obsolete for Windows 2000 and later versions of Windows, and for Windows Me. This routine is supported only for WDM drivers that must run on Windows 98. Otherwise, use MmMapLockedPagesSpecifyCache.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL See Remarks section.
DDI compliance rules HwStorPortProhibitedDDIs

See Also

MmGetSystemAddressForMdl

MmGetSystemAddressForMdlSafe

MmMapLockedPagesSpecifyCache

MmProbeAndLockPages

MmUnmapLockedPages