Export (0) Print
Expand All
Expand Minimize

FsRtlGetNextFileLock routine

The FsRtlGetNextFileLock routine is used to enumerate the byte-range locks that currently exist for a specified file.

Syntax


PFILE_LOCK_INFO FsRtlGetNextFileLock(
  _In_  PFILE_LOCK FileLock,
  _In_  BOOLEAN Restart
);

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.

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
}

Return value

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.

Remarks

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.

Requirements

Header

Ntifs.h (include Ntifs.h)

Library

Ntoskrnl.lib

IRQL

<= APC_LEVEL

See also

FsRtlAreThereCurrentFileLocks
FsRtlCheckLockForReadAccess
FsRtlCheckLockForWriteAccess
FsRtlFastCheckLockForRead
FsRtlFastCheckLockForWrite
FsRtlFastLock
FsRtlFastUnlockAll
FsRtlFastUnlockAllByKey
FsRtlFastUnlockSingle
FsRtlInitializeFileLock
FsRtlProcessFileLock
FsRtlUninitializeFileLock

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft