Minifilter中Swapping buffers(交换缓冲)

微过滤器在实现特定操作时需要交换缓冲,例如加密或解密。《Filter Driver Developer Guide》中详细阐述了缓冲交换的规则,包括必须提供后操作回调、确保新缓冲为非分页内存、同步MDL等。微过滤器不应释放旧缓冲或MDL,而在后操作回调中应释放自分配的缓冲。
摘要由CSDN通过智能技术生成

下面的话摘自《Filter Driver Developer Guide》:

Certain minifilters need to swap the suppliedbuffer for certain operations. Consider a minifilter that implements customencryption. On a non-cached IRP_MJ_READ, it normally wishes to decrypt thecontents of the buffer that was read from the filesystem. Similarly on a write,it wishes to encrypt the contents. Take the latter case: the contents cannot beencrypted in place, because for IRP_MJ_WRITE, the maximal access to the bufferthat the minifilter can assume is IoReadAccess.

Hence the minifilter needs to supplant its ownbuffer which has read/write access, encrypt the contents of the original bufferinto the new one, and send the I/O down.

For this scenario, the Filter Manager supportsbuffer-switching. However there are a few rules to which the minifilter mustadhere:

1.     Minifilters that switch a buffer must supply a post-callback. Thisis so that the buffer can be switched back by Filter Manager a

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值