Skip to content

Latest commit

 

History

History
115 lines (80 loc) · 5.73 KB

nf-fltkernel-fltprocessfilelock.md

File metadata and controls

115 lines (80 loc) · 5.73 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NF:fltkernel.FltProcessFileLock
FltProcessFileLock function (fltkernel.h)
The FltProcessFileLock routine processes and completes a file lock operation.
ifsk\fltprocessfilelock.htm
ifsk
11/29/2021
FltProcessFileLock function
FltApiRef_p_to_z_e4ff8145-c586-4c3c-acfa-d4c22f48a5d2.xml, FltProcessFileLock, FltProcessFileLock routine [Installable File System Drivers], fltkernel/FltProcessFileLock, ifsk.fltprocessfilelock
fltkernel.h
Fltkernel.h
Universal
Windows XP with SP2
Windows Server 2003 with SP1
FltMgr.lib
Fltmgr.sys
<= APC_LEVEL
Windows
FltProcessFileLock
fltkernel/FltProcessFileLock
APIRef
kbSyntax
DllExport
fltmgr.sys
FltProcessFileLock

FltProcessFileLock function

-description

The FltProcessFileLock routine processes and completes a file lock operation.

-parameters

-param FileLock [in]

Pointer to the FILE_LOCK structure for the file. This structure must have been initialized by a previous call to FltAllocateFileLock or FltInitializeFileLock.

-param CallbackData [in]

Pointer to the callback data (FLT_CALLBACK_DATA) structure for the IRP_MJ_LOCK_CONTROL operation.

-param Context [in, optional]

Context pointer to be used when completing the operation. This context pointer is passed to the CompleteLockCallbackDataRoutine and UnlockRoutine callback routines that the minifilter driver registered in a previous call to FltAllocateFileLock. This parameter is optional and can be NULL.

-returns

FltProcessFileLock returns one of the following.

Return code Description
FLT_PREOP_COMPLETE The Filter Manager is done with the CallbackData, which can now be completed.
FLT_PREOP_DISALLOW_FASTIO The CallbackData represents a fast I/O operation, and a minifilter driver in the stack has disallowed the fast I/O to be used for this operation. The Filter Manager does not send the operation to any minifilter drivers below the one that disallowed the operation. In this case, the Filter Manager only calls the postoperation callback routines (and CompleteLockCallbackDataRoutine callbacks) of the minifilter drivers above the minifilter driver that disallowed the fast I/O operation.
FLT_PREOP_PENDING The lock operation has been pended.

-remarks

FltProcessFileLock processes a file lock (IRP_MJ_LOCK_CONTROL) operation. The lock operation can be a fast I/O or IRP-based operation.

For unlock operations, the Filter Manager calls the UnlockRoutine callback routine that the caller registered for the FILE_LOCK structure in a previous call to FltAllocateFileLock.

When the lock operation is completed, the Filter Manager calls the CompleteLockCallbackDataRoutine (PFLT_COMPLETE_LOCK_CALLBACK_DATA_ROUTINE) completion callback routine that the caller registered for the FILE_LOCK structure in a previous call to FltAllocateFileLock.

When the CallbackData parameter passed to FltProcessFileLock represents a fast I/O operation, the callback specified in CompleteLockCallbackDataRoutine parameter of the FltAllocateFileLock routine is not invoked. Only when the I/O operation in CallbackData is an IRP, and CompleteLockCallbackDataRoutine is not NULL, will the callback routine be called.

To determine whether the CallbackData represents a fast I/O operation, use the FLT_IS_FASTIO_OPERATION macro.

To allocate and initialize a new file lock structure, call FltAllocateFileLock.

To free an initialized FILE_LOCK structure, call FltFreeFileLock.

-see-also

FILE_LOCK

FLT_CALLBACK_DATA

FLT_IS_FASTIO_OPERATION

FltAllocateFileLock

FltCheckLockForReadAccess

FltCheckLockForWriteAccess

FltFreeFileLock

FltInitializeFileLock

FltUninitializeFileLock

FsRtlProcessFileLock

IRP_MJ_LOCK_CONTROL

PFLT_COMPLETE_LOCK_CALLBACK_DATA_ROUTINE

[PUNLOCK_ROUTINE](../ntifs/nc-ntifs-punlock_routine.md