The MmProbeAndLockPages routine probes the specified virtual memory pages, makes them resident, and locks them in memory.
VOID
MmProbeAndLockPages(
IN OUT PMDL MemoryDescriptorList,
IN KPROCESSOR_MODE AccessMode,
IN LOCK_OPERATION Operation
);
None
Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.
The highest-level driver in a chain of layered drivers that use direct I/O calls this routine. Drivers that use buffered I/O never call MmProbeAndLockPages.
MmProbeAndLockPages performs the following operations:
MmProbeAndLockPages can be called multiple times for the same page. Each successful call to MmProbeAndLockPages for an MDL must be matched by a call to MmUnlockPages for the same MDL.
Calls to MmProbeAndLockPages must be enclosed in a try/except block. If the pages do not support the specified operation, the routine raises the STATUS_ACCESS_VIOLATION exception. For more information, see Handling Exceptions.
Callers of MmProbeAndLockPages must be running at IRQL < DISPATCH_LEVEL for pageable addresses, or at IRQL <= DISPATCH_LEVEL for nonpageable addresses.