MmProbeAndLockPages

VOID
    MmProbeAndLockPages(

        IN OUT PMDL  MemoryDescriptorList,
        IN KPROCESSOR_MODE  AccessMode,
        IN LOCK_OPERATION  Operation
        );

MmProbeAndLockPages probes specified pages, makes them resident, and locks the physical pages mapped by the virtual address range in memory. The MDL is updated to describe the physical pages.

Parameters

MemoryDescriptorList
Points to an MDL that supplies a virtual address, byte offset, and length. The physical page portion of the MDL is updated when the pages are locked in memory.
AccessMode
Specifies the access mode in which to probe the arguments, either KernelMode or UserMode.
Operation
Specifies the type of operation for which the caller wants the access rights probed and the pages locked, one of IoReadAccess, IoWriteAccess, or IoModifyAccess.

Comments

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.

If this routine fails, an exception is raised. Any driver that calls MmProbeAndLockPages must handle such an exception.

A lower-level driver cannot attempt to pass such an exception on to a higher-level driver. It cannot assume anything about a higher-level driver’s exception handling capabilities. In particular, the driver cannot call ExRaiseStatus to pass on such an exception.

Callers of MmProbeAndLockPages must be running at IRQL < DISPATCH_LEVEL for pageable addresses, or at IRQL <= DISPATCH_LEVEL for nonpageable addresses.

See Also

MmUnlockPages