FltDecodeParameters returns pointers to the memory descriptor list (MDL) address, buffer pointer, buffer length, and desired access parameters for an I/O operation. This saves minifilter drivers from having a switch statement to find the position of these parameters in helper routines that access the MDL address, buffer pointer, buffer length, and desired access for multiple operation types.
NTSTATUS FLTAPI FltDecodeParameters( PFLT_CALLBACK_DATA CallbackData, PMDL **MdlAddressPointer, PVOID **Buffer, PULONG *Length, LOCK_OPERATION *DesiredAccess );
Pointer to the callback data (FLT_CALLBACK_DATA) structure for the I/O operation.
Pointer to a caller-supplied variable that receives a pointer to the MdlAddress (or OutputMdlAddress) member of the callback data parameter (FLT_PARAMETERS) structure (note that this member is itself a pointer). This parameter is optional and can be NULL. If the I/O operation does not have an MDL field, this parameter receives NULL.
Pointer to a caller-supplied variable that receives a pointer to the appropriate buffer member (depending on the major function code) in the callback data parameter structure (note that this member is itself a pointer).
Pointer to a caller-supplied variable that receives a pointer to the buffer length member in the callback data parameter structure. If the operation does not have a length field, this parameter receives NULL.
Pointer to a caller-supplied variable that receives the type of access that is appropriate for this type of I/O operation, one of
IoReadAccess means that the minifilter driver can examine the contents of the buffer but cannot change the contents in place.
IoModifyAccess, which are equivalent, mean that the minifilter driver has read and write access to the buffer.
FltDecodeParameters returns STATUS_SUCCESS or an appropriate NTSTATUS value such as the following:
||The callback data (FLT_CALLBACK_DATA) structure represents an I/O operation that does not have any buffer parameters. This is an error code.|
FltDecodeParameters returns pointers to the parameters for an I/O operation, rather than the parameter values, so that the caller can modify the values of the parameters if desired.
FltDecodeParameters can be used for fast I/O operations as well as IRP-based operations. It is not meaningful for file system filter (FSFilter) callback operations, because those operations do not have buffer parameters.
IOCTL and FSCTL operations can have one or two buffers, depending on the buffering method used. In cases where the operation has two buffers (and two length fields), FltDecodeParameters returns the OutputBuffer, OutputBufferLength, and/or OutputMdlAddress fields as appropriate.
Not all of the four parameters are returned for every I/O operation. For example, for an IRP_MJ_READ request, FltDecodeParameters sets the output parameters as follows.
|Header||fltkernel.h (include Fltkernel.h)|