FsRtlAreThereCurrentFileLocks macro (ntifs.h)

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

Syntax

void FsRtlAreThereCurrentFileLocks(
   FL
);

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.

Return value

None

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.

Requirements

Requirement Value
Target Platform Desktop
Header ntifs.h (include Ntifs.h)
IRQL Any level

See also

FsRtlAllocateFileLock

FsRtlAreThereCurrentOrInProgressFileLocks

FsRtlInitializeFileLock