FsRtlAreThereCurrentFileLocks - NtDoc

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

void FsRtlAreThereCurrentFileLocks(
  FL
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-ntifs-fsrtlaretherecurrentfilelocks)

FsRtlAreThereCurrentFileLocks macro

Description

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

Parameters

FL

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

Remarks

This macro acts like a BOOLEAN function, returning TRUE if any byte range locks exist for the specified file or FALSE if none exist.

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

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

See also

FsRtlAllocateFileLock

FsRtlAreThereCurrentOrInProgressFileLocks

FsRtlInitializeFileLock