PCOMPLETE_LOCK_IRP_ROUTINE callback function (ntifs.h)

A file system filter driver (legacy filter) can register a PCOMPLETE_LOCK_IRP_ROUTINE-typed routine as the filter's CompleteLockIrpRoutine callback.

Syntax

PCOMPLETE_LOCK_IRP_ROUTINE PcompleteLockIrpRoutine;

NTSTATUS PcompleteLockIrpRoutine(
  PVOID Context,
  PIRP Irp
)
{...}

Parameters

Context

[in] Context pointer that was passed to FsRtlProcessFileLock.

Irp

[in] IRP for the file lock IRP_MJ_LOCK_CONTROL request that is being completed. The lock request type will be one of the following:

  • IRP_MN_LOCK
  • IRP_MN_UNLOCK_ALL
  • IRP_MN_UNLOCK_ALL_BY_KEY
  • IRP_MN_UNLOCK_SINGLE

Return value

This routine returns STATUS_SUCCESS or an appropriate NTSTATUS value. If it returns an NTSTATUS value that is not a success code, the file lock is removed from the file.

Remarks

A file system filter driver (legacy filter) can optionally specify a PCOMPLETE_LOCK_IRP_ROUTINE-typed routine as the legacy filter's CompleteLockIrpRoutine routine for a byte-range file lock.

To specify this routine, a legacy filter passes a pointer to the routine as the CompleteLockIrpRoutine parameter for FsRtlAllocateFileLock or FsRtlInitializeFileLock.

If the legacy filter specifies a CompleteLockIrpRoutine routine for a file lock, the system calls this routine when completing an IRP_MJ_LOCK_CONTROL operation for the file lock.

Requirements

Requirement Value
Header ntifs.h
IRQL APC_LEVEL

See also

FsRtlAllocateFileLock

FsRtlCheckLockForReadAccess

FsRtlCheckLockForWriteAccess

FsRtlFreeFileLock

FsRtlInitializeFileLock

FsRtlProcessFileLock

FsRtlUninitializeFileLock

IRP_MJ_LOCK_CONTROL

PUNLOCK_ROUTINE