FltOplockFsctrl - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// fltkernel.h

FLT_PREOP_CALLBACK_STATUS FLTAPI FltOplockFsctrl(
  [in] POPLOCK            Oplock,
  [in] PFLT_CALLBACK_DATA CallbackData,
  [in] ULONG              OpenCount
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-fltkernel-fltoplockfsctrl)

FltOplockFsctrl function

Description

FltOplockFsctrl performs various opportunistic lock (oplock) operations on behalf of a minifilter driver.

Parameters

Oplock [in]

Opaque oplock pointer for the file. This pointer must have been initialized by a previous call to FltInitializeOplock.

CallbackData [in]

Pointer to the FLT_CALLBACK_DATA structure for the I/O operation. This parameter is required and cannot be NULL.

OpenCount [in]

Number of user handles for the file, if an exclusive oplock is being requested. Setting a nonzero value for a level 2, R, or RH oplock request indicates that there are byte-range locks on the file. For information about oplock types, see Oplock Overview.

Return value

FltOplockFsctrl returns FLT_PREOP_PENDING for some FSCTL operations. For more information, see the reference pages for the FSCTL codes listed in the following Remarks section. Otherwise, FltOplockFsctrl returns FLT_PREOP_COMPLETE.

Remarks

A minifilter driver calls FltOplockFsctrl to perform various opportunistic lock operations for a create or file system control I/O operation.

The FLT_CALLBACK_DATA structure pointed to by the CallbackData parameter must represent an IRP-based IRP_MJ_FILE_SYSTEM_CONTROL or IRP_MJ_CREATE operation.

If the operation is an IRP_MJ_FILE_SYSTEM_CONTROL operation, FltOplockFsctrl can be used with the following FSCTL codes:

The FSCTL code is set in the FsControlCode member of the FLT_PARAMETERS structure for the operation. For more information about FsControlCode and other IRP_MJ_FILE_SYSTEM_CONTROL parameters, see FLT_PARAMETERS for IRP_MJ_FILE_SYSTEM_CONTROL.

For more information about opportunistic locks, see the Microsoft Windows SDK documentation.

If the operation is an IRP_MJ_CREATE request, FltOplockFsctrl can be used to request a pending filter opportunistic lock if all of the following conditions are true:

Filters and file systems that call this function must synchronize calls into the system-supplied oplock package. See Oplock synchronization for more information.

See also

FLT_CALLBACK_DATA

FLT_PARAMETERS for IRP_MJ_CREATE

FLT_PARAMETERS for IRP_MJ_FILE_SYSTEM_CONTROL

FSCTL_OPBATCH_ACK_CLOSE_PENDING

FSCTL_OPLOCK_BREAK_ACKNOWLEDGE

FSCTL_OPLOCK_BREAK_ACK_NO_2

FSCTL_OPLOCK_BREAK_NOTIFY

FSCTL_REQUEST_BATCH_OPLOCK

FSCTL_REQUEST_FILTER_OPLOCK

FSCTL_REQUEST_OPLOCK_LEVEL_1

FSCTL_REQUEST_OPLOCK_LEVEL_2

FltCheckOplock

FltCurrentBatchOplock

FltInitializeOplock

FltOplockIsFastIoPossible

FltUninitializeOplock

FsRtlOplockFsctrl

IRP_MJ_CREATE

IRP_MJ_FILE_SYSTEM_CONTROL