本文介绍了收到TCP FIN后,FwpsStreamInjectAsync0失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 我正在编写一个WFP驱动程序,它将  通过检查和/或修改数据的用户应用程序路由所有TCP流量。所以我在流层添加了一个过滤器,标志为FWP_CALLOUT_FLAG_CONDITIONAL_ON_FLOW。

 I'm writing a WFP driver that will  route all TCP traffic through a user app which inspects and/or modifies the data. So I added a filter to the stream layer with flag FWP_CALLOUT_FLAG_CONDITIONAL_ON_FLOW.

作为第一步,我只是克隆了流每次调用classifyFn时,都会通过返回FWP_ACTION_BLOCK来阻止原始数据,然后从工作线程中注入克隆数据。

 一切正常,除了一件小事:

我在Windows 7中测试我的驱动程序使用Chrome作为浏览器。数据包被阻止并在以后成功重新注入。但是当我收到TCP FIN时似乎存在一个问题,并且存在一些属于流的数据包,并且
尚未被重新注入。  

当我收到TCP FIN时,我的标注会阻止它并强制重新注入 
剩余数据包  到流但FwpsStreamInjectAsync0失败,错误代码为STATUS_NOT_FOUND(0xc0000225)。

When I receive a TCP FIN my callout blocks it and force the reinjection of any remaining packet  to the flow but FwpsStreamInjectAsync0 fails with error code STATUS_NOT_FOUND (0xc0000225).

彻底检查了我的日志后,我意识到
flowDeleteFn
所以以后的任何再注射都会失败。 这种奇怪效果的原因是什么?是否有任何
  可以解决?

After checking thoroughly my logs I have realized that flowDeleteFn is called despite of blocking TCP FIN, so any later reinjection will fail. What could be the reason for this strange effect? Is there any work around?

感谢您的回答。

推荐答案

谢谢,

Joe


这篇关于收到TCP FIN后,FwpsStreamInjectAsync0失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 18:58