FltAllocateFileLock function (fltkernel.h)
The FltAllocateFileLock routine allocates and initializes a new FILE_LOCK structure.
Syntax
PFILE_LOCK FLTAPI FltAllocateFileLock(
[in, optional] PFLT_COMPLETE_LOCK_CALLBACK_DATA_ROUTINE CompleteLockCallbackDataRoutine,
[in, optional] PUNLOCK_ROUTINE UnlockRoutine
);
Parameters
[in, optional] CompleteLockCallbackDataRoutine
Pointer to a PFLT_COMPLETE_LOCK_CALLBACK_DATA_ROUTINE-typed callback routine to be called when an IRP_MJ_LOCK_CONTROL request is completed. This parameter is optional and can be NULL.
[in, optional] UnlockRoutine
Pointer to a PUNLOCK_ROUTINE-typed callback routine to be called when the byte range is unlocked. This parameter is optional and can be NULL.
Return value
FltAllocateFileLock returns a pointer to the newly allocated FILE_LOCK structure.
Remarks
FltAllocateFileLock allocates a new FILE_LOCK structure from paged pool and initializes it.
The returned FILE_LOCK structure can be used to lock a byte range in a file by calling FltProcessFileLock.
When the FILE_LOCK structure is no longer needed, it can be uninitialized by calling FltUninitializeFileLock. The uninitialized FILE_LOCK structure can then be initialized for reuse by calling FltInitializeFileLock.
To free an initialized FILE_LOCK structure, call FltFreeFileLock.
When the CallbackData parameter passed to FltProcessFileLock represents a fast I/O operation, the callback specified in CompleteLockCallbackDataRoutine is not invoked. Only when the I/O operation in CallbackData is an IRP, and CompleteLockCallbackDataRoutine is not NULL, will the callback routine be called.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP SP2 |
Minimum supported server | Windows Server 2003 SP1 |
Target Platform | Universal |
Header | fltkernel.h (include Fltkernel.h) |
Library | FltMgr.lib |
IRQL | <= APC_LEVEL |