Expand Minimize

FsRtlAreThereCurrentFileLocks function

The FsRtlAreThereCurrentFileLocks macro checks whether any byte range locks exist for the specified file.

Syntax


BOOLEAN FsRtlAreThereCurrentFileLocks(
  _In_  PFILE_LOCK FileLock
);

Parameters

FileLock [in]

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

Return value

FsRtlAreThereCurrentFileLocks returns TRUE if any byte-range locks have been granted for the file, FALSE otherwise.

Remarks

File systems and filter drivers often call FsRtlAreThereCurrentFileLocks from their FastIoCheckIfPossible routines.

Note  If a byte-range lock has existed since the specified file was opened, the FsRtlAreThereCurrentFileLocks routine returns TRUE, unless the relevant FILE_LOCK is reinitialized. If a lock was established, and then released, the use of FsRtlAreThereCurrentFileLocks can prevent the assignment of oplocks unnecessarily. Use FsRtlAreThereCurrentOrInProgressFileLocks to avoid this problem.

Requirements

Header

Ntifs.h (include Ntifs.h)

IRQL

Any level

See also

FsRtlAllocateFileLock
FsRtlInitializeFileLock

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft