FILE_LOCK structure

The operating system uses the opaque FILE_LOCK structure to support the locking of files.

Syntax

typedef struct _FILE_LOCK {
  PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine;
  PUNLOCK_ROUTINE            UnlockRoutine;
  BOOLEAN                    FastIoIsQuestionable;
  BOOLEAN                    SpareC[3];
  PVOID                      LockInformation;
  FILE_LOCK_INFO             LastReturnedLockInfo;
  PVOID                      LastReturnedLock;
  volatile LONG              LockRequestsInProgress;
} FILE_LOCK, *PFILE_LOCK;

Members

CompleteLockIrpRoutine
Reserved for system use.

UnlockRoutine
Reserved for system use.

FastIoIsQuestionable
Reserved for system use.

SpareC
Reserved for system use.

LockInformation
Reserved for system use.

LastReturnedLockInfo
Reserved for system use.

LastReturnedLock
Reserved for system use.

LockRequestsInProgress
Reserved for system use.

Remarks

File system legacy filter drivers and minifilters can use a variety of routines to create and use FILE_LOCK objects, as well as to test for read/write access to files.

After a FILE_LOCK has been initialized, routines such as FsRtlCheckLockForReadAccess, FltCheckLockForWriteAccess, and FsRtlFastCheckLockForRead can be used to determine if the file can be accessed by other threads.

Requirements

Version

Available in Microsoft Windows 2000, and later versions of the Windows operating system.

Header

Ntifs.h (include FltKernel.h or Ntifs.h)

See also

FltAllocateFileLock

FltCheckLockForReadAccess

FltCheckLockForWriteAccess

FltInitializeFileLock

FltInitializeFileLock FsRtlAllocateFileLock

FsRtlCheckLockForReadAccess

FsRtlCheckLockForWriteAccess

FsRtlFastCheckLockForRead

FsRtlFastCheckLockForWrite

FsRtlInitializeFileLock

FsRtlUninitializeFileLock