// ntifs.h
PFILE_LOCK_INFO FsRtlGetNextFileLock(
[in] PFILE_LOCK FileLock,
[in] BOOLEAN Restart
);
View the official Windows Driver Kit DDI reference
No description available.
The FsRtlGetNextFileLock routine is used to enumerate the byte-range locks that currently exist for a specified file.
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.
Restart
[in]Set to TRUE if the enumeration is to start at the beginning of the list of byte range locks. Set to FALSE if resuming the enumeration from a previous call.
To enumerate all byte-range locks for a given file, use FsRtlGetNextFileLock as follows:
for (p = FsRtlGetNextFileLock( FileLock, TRUE );
p != NULL;
p = FsRtlGetNextFileLock( FileLock, FALSE )) {
// Process the lock information pointed to by p
}
FsRtlGetNextFileLock returns a pointer to the FILE_LOCK_INFO structure for the next byte-range lock, if one exists. If there are no more byte-range locks for this file, FsRtlGetNextFileLock returns NULL.
The byte range locks are not enumerated in any particular order.
Note that because the current enumeration state is stored in the FILE_LOCK structure, callers must be careful to synchronize calls to FsRtlGetNextFileLock, and to avoid modifying any of the structures that it returns. If multiple threads attempt to use FsRtlGetNextFileLock at the same time, the results will be unpredictable, and the enumeration will not be reliably complete.