Modifying the Parameters for an I/O Operation

A minifilter driver can modify the parameters for an I/O operation. For example, a minifilter driver's preoperation callback routine can redirect an I/O operation to a different volume by changing the target instance for the operation. The new target instance must be an instance of the same minifilter driver at the same altitude on another volume.

过滤驱动可以修改IO操作的参数,例如,preoperation回调函数可以修改目标实例将IO操作重定向至一个不同的卷,新的实例必须是同一个过滤驱动附载在另一个卷的实例,并且处于相同的维度。

The parameters for an I/O operation are found in the callback data (FLT_CALLBACK_DATA) structure and I/O parameter block (FLT_IO_PARAMETER_BLOCK) structure for the operation. The minifilter driver's preoperation callback routine and postoperation callback routine receive a pointer to the callback data structure for the operation in the Data input parameter. The Iopb member of the callback data structure is a pointer to an I/O parameter block structure that contains the parameters for the operation.

在回调数据结构FLT_CALLBACK_DATA及IO参数块FLT_IO_PARAMETER_BLOCK中保存着操作的参数,preoperation及postoperation回调函数的参数Data保存着操作擦数,参数Data的成员Iopb指向了IO操作参数块。

If a minifilter driver's preoperation callback routine modifies the parameters for an I/O operation, all minifilter drivers below that minifilter driver in the minifilter driver instance stack will receive the modified parameters in their preoperation and postoperation callback routines.

如果preoperation回调函数修改了IO参数,处于其之下的过滤驱动将在其的preoperation及postoperation回调函数中接收修改后的参数。

The modified parameters are not received by the current minifilter driver's postoperation callback routine or by any minifilter drivers above that minifilter driver in the minifilter driver instance stack. In all situations, a minifilter driver's preoperation and postoperation callback routines receive the same input parameter values for a given I/O operation.

请注意,当前过滤驱动及上层的过滤驱动的postoperation回调函数不会接收修改后的参数。在任何情况下,过滤驱动的preoperation及postoperation回调函数接收相同的IO操作参数。

After modifying the parameters for an I/O operation, the preoperation or postoperation callback routine must indicate that it has done so by calling FltSetCallbackDataDirty, unless it has changed the contents of the callback data structure's IoStatus field. Otherwise, the filter manager will ignore any changes to parameter values. FltSetCallbackDataDirty sets the FLTFL_CALLBACK_DATA_DIRTY flag in the callback data structure for the I/O operation. Minifilter drivers can test this flag by calling FltIsCallbackDataDirty or clear it by calling FltClearCallbackDataDirty

修改IO操作参数后,preoperation及postoperation回调函数必须调用FltSetCallbackDataDirty已表明自己修改了参数,除非是回调数据结构的IoStatus成员,否则,过滤管理器会忽略对参数的修改,FltSetCallbackDataDirty设置FLTFL_CALLBACK_DATA_DIRTY标志。过滤驱动可以调用FltIsCallbackDataDirty 测试这个标志或者FltClearCallbackDataDirty清除这个标志。

If a minifilter driver's preoperation callback routine modifies the parameters for an I/O operation, all minifilter drivers below that minifilter driver in the minifilter driver instance stack will receive the modified parameters in the Data and FltObjects input parameters to their preoperation and postoperation callback routines. (Minifilter drivers cannot directly modify the contents of the FLT_RELATED_OBJECTS structure that is pointed to by the FltObjects parameter. However, if a minifilter driver modifies the target instance or target file object for an I/O operation, the filter manager modifies the value of the corresponding Instance or FileObject member of the FLT_RELATED_OBJECTS structure that is passed to lower minifilter drivers.)

如果minifilter驱动的preoperation回调函数修改了IO参数,下层的过滤驱动将在preoperation及postoperation回调函数参数Data及FltObject接收修改后的参数。过滤驱动不能直接修改参数FltObjects 指向的FLT_RELATED_OBJECTS 数据结构,但是,如果过滤驱动修改了目标实例或者目标文件对象,过滤管理器在修改传递到下层过滤驱动FLT_RELATED_OBJECTS结构体中对应的Instance或者FileObject成员。

Although any parameter changes that a minifilter driver's preoperation callback routine makes are not received by the minifilter driver's own postoperation callback routine, a preoperation callback routine is able to pass information about changed parameters to the minifilter driver's own postoperation callback routine. If the preoperation callback routine passes the I/O operation down the stack by returning FLT_PREOP_SUCCESS_WITH_CALLBACK or FLT_PREOP_SYNCHRONIZE, it can store information about changed parameter values into a minifilter driver–defined structure that is pointed to by the CompletionContext output parameter. The filter manager passes this structure pointer in the CompletionContext input parameter to the postoperation callback routine. 

虽然过滤驱动自己postoperation回调函数不会接收修改后的参数,peroperation回调函数可以将修改的参数信息传递给postoperation回调函数,如果peroperation回调函数返回 FLT_PREOP_SUCCESS_WITH_CALLBACK or FLT_PREOP_SYNCHRONIZE,驱动可以在输出参数CompletionContext 保存驱动自定义的结构中保存参数修改过信息。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值