MmProbeAndLockSelectedPages function (wdm.h)

The MmProbeAndLockSelectedPages routine probes the selected virtual memory pages, makes them resident, and locks them in memory.

Syntax

void MmProbeAndLockSelectedPages(
  [in, out] PMDL                  MemoryDescriptorList,
  [in]      PFILE_SEGMENT_ELEMENT SegmentArray,
  [in]      KPROCESSOR_MODE       AccessMode,
  [in]      LOCK_OPERATION        Operation
);

Parameters

[in, out] MemoryDescriptorList

A pointer to a memory descriptor list (MDL) that specifies a virtual memory buffer. If the routine successfully locks the pages in memory, the MDL is updated to describe the underlying physical pages.

[in] SegmentArray

A pointer to an array of buffer segments that contain the virtual memory pages.

[in] AccessMode

Specifies the access mode in which to probe the arguments, either KernelMode or UserMode.

[in] Operation

Specifies the type of operation for which the caller wants the access rights probed and the pages locked. Set this parameter to IoReadAccess, IoWriteAccess, or IoModifyAccess. IoReadAccess indicates that the driver can examine the contents of the buffer but cannot change the contents. IoWriteAccess and IoModifyAccess, which are equivalent, indicate that the driver has both read and write access to the buffer.

Return value

None

Remarks

Calls to MmProbeAndLockSelectedPages must be enclosed in a try/except block. If the pages do not support the specified operation, the routine raises the STATUS_ACCESS_VIOLATION or other exceptions. For more information, see Handling Exceptions.

Requirements

Requirement Value
Minimum supported client Available starting with Windows 2000.
Target Platform Universal
Header wdm.h
IRQL <= APC_LEVEL

See also

MmProbeAndLockPages