// fltkernel.h
PFILE_LOCK FLTAPI FltAllocateFileLock(
[in, optional] PFLT_COMPLETE_LOCK_CALLBACK_DATA_ROUTINE CompleteLockCallbackDataRoutine,
[in, optional] PUNLOCK_ROUTINE UnlockRoutine
);
View the official Windows Driver Kit DDI reference
No description available.
The FltAllocateFileLock routine allocates and initializes a new FILE_LOCK structure.
CompleteLockCallbackDataRoutine
[in, optional]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.
UnlockRoutine
[in, optional]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.
FltAllocateFileLock returns a pointer to the newly allocated FILE_LOCK structure.
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.
PFLT_COMPLETE_LOCK_CALLBACK_DATA_ROUTINE