// ntifs.h
typedef struct _FS_FILTER_CALLBACK_DATA {
ULONG SizeOfFsFilterCallbackData;
UCHAR Operation;
UCHAR Reserved;
struct _DEVICE_OBJECT *DeviceObject;
struct _FILE_OBJECT *FileObject;
FS_FILTER_PARAMETERS Parameters;
} FS_FILTER_CALLBACK_DATA, *PFS_FILTER_CALLBACK_DATA;
View the official Windows Driver Kit DDI referenceNo description available.
FS_FILTER_CALLBACK_DATA is the callback data structure for a FS_FILTER_CALLBACKS's FS_FILTER_CALLBACK or FS_FILTER_COMPLETION_CALLBACK operation.
SizeOfFsFilterCallbackDataSize of this structure, in bytes. Set to sizeof(FS_FILTER_CALLBACK_DATA).
OperationFile system operation for which the callback routine is to be invoked. This operation can be one of:
ReservedReserved for system use.
DeviceObjectDevice object for this operation.
FileObjectFile object for this operation.
ParametersUnion containing any operation-specific parameters. See Remarks.
is a member of the FS_FILTER_CALLBACKS structure, which is passed to FsRtlRegisterFileSystemFilterCallbacks in a file system or filter driver's DriverEntry routine.
The Parameters union is defined as follows:
typedef union _FS_FILTER_PARAMETERS {
//
// AcquireForModifiedPageWriter
//
struct {
PLARGE_INTEGER EndingOffset;
PERESOURCE *ResourceToRelease;
} AcquireForModifiedPageWriter;
//
// ReleaseForModifiedPageWriter
//
struct {
PERESOURCE ResourceToRelease;
} ReleaseForModifiedPageWriter;
//
// AcquireForSectionSynchronization
//
struct {
FS_FILTER_SECTION_SYNC_TYPE SyncType;
ULONG PageProtection;
PFS_FILTER_SECTION_SYNC_OUTPUT OutputInformation;
ULONG Flags;
} AcquireForSectionSynchronization;
//
// QueryOpen
//
struct {
PIRP Irp;
PVOID FileInformation;
PULONG Length;
FILE_INFORMATION_CLASS FileInformationClass;
NTSTATUS CompletionStatus;
} QueryOpen;
//
// Other
//
struct {
PVOID Argument1;
PVOID Argument2;
PVOID Argument3;
PVOID Argument4;
PVOID Argument5;
} Others;
} FS_FILTER_PARAMETERS, *PFS_FILTER_PARAMETERS;
Structure members of the FS_FILTER_PARAMETERS union are described as follows.
AcquireForModifiedPageWriter
ReleaseForModifiedPageWriter
AcquireForSectionSynchronization
PageProtection: Type of page protection requested for the section. Must be zero if SyncType is SyncTypeOther. Otherwise, one of the following flags, possibly ORed with PAGE_NOCACHE:
OutputInformation: An FS_FILTER_SECTION_SYNC_OUTPUT structure that contains the extended output information for the section.
Flags: When SyncType is SyncTypeCreateSection, Flags can be one of the following values:
QueryOpen
CompletionStatus: An NTSTATUS value that receives the final completion status and information about the operation. CompletionStatus can be set by the PostQueryOpen callback to fail the operation, since post callbacks have no return value. This is primarily used so the PostQueryOpen callback can return STATUS_FLT_DISALLOW_FSFILTER_IO to request fallback to the slow path. Doing so causes the I/O manager to service the request by performing an open/query/close of the file. Similarly, the PreQueryOpen callback can return STATUS_FLT_DISALLOW_FSFILTER_IO to request fallback to the slow path.
FileInformationClass: Type of information to be returned about the file, in the buffer that FileInformation points to. Device and intermediate drivers can specify any of the following FILE_INFORMATION_CLASS values. Other values cause the call to fail and should not be passed to PreQueryOpen/PostQueryOpen calls.
| FILE_INFORMATION_CLASS value | Type of information returned |
|---|---|
| FileStatInformation | A FILE_STAT_INFORMATION structure. This structure contains an access mask. For more information about access masks, see ACCESS_MASK. |
| FileStatLxInformation | A FILE_STAT_LX_INFORMATION structure. This structure contains an access mask. For more information about access masks, see ACCESS_MASK. |
| FileCaseSensitiveInformation | A FILE_CASE_SENSITIVE_INFORMATION structure. |
Others
FsRtlRegisterFileSystemFilterCallbacks