NDIS 6.0 Filter Driver 开发资料- 01

NDIS 6.0 Filter Driver(>下载地址<)是一个NDIS轻量级的过滤驱动(NDIS Lightweight filter driver),用来替换NDIS 5示例中间层驱动中的Passthru,适用的操作系统是Windows 8 和Windows Server 2012。

微软新出的WDK 8包含了NDIS 6.0的开发包,与Microsoft Visual Studio Ultimate 2012完全整合,你可以使用Visual Studio开发环境编译驱动,或者使用 Windows Build Utility(MSBuild) 。如果开发Windows 8, Windows 7或者 Windows Vista的驱动程序,你可以使用Visual Studio或MSBuild进行编译;如果开发Windows XP的驱动程序,你只能使用WDK 7配套的MSBuild进行编译。

关于编译部分,以后再详细写。

Ndislwf驱动分析:

1. DriverEntry中,ndislwf驱动注册为NDIS 6过滤驱动。

2. 之后,NDIS为每一个底层的NDIS适配器配置连接,调用Ndislwf FilterAttach 句柄,

3. 在FilterAttach句柄的上下文环境中,Filter驱动调用NdisFAttribute来注册Filter模块,Filter驱动可以使用NdisOpenConfigurationEx来读取自己的设置,并调用NdisXXX函数。

4. FilterAttach成功返回后,NDIS使用FilterRestart句柄重启Filter,FilterRestart准备接受、发送数据的句柄。重启成功后,filter驱动应该能够启用发送、接收进程。

5. 如果必要,Ndislwf过滤驱动发送或者接收的数据包都会重新打包并发送给NDIS,交付给底层的NDIS驱动。

6. 所有发给底层NDIS驱动的数据都转发给Ndislwf过滤驱动。

7. NDIS calls FilterPause handler when NDIS needs to detach the filter from the stack or there is some configuration changes in the stack. In processing the pause request from NDIS, the Ndislwf driver waits for all its own outstanding requests to be completed before it completes the pause request.
8. NDIS calls the Ndislwf driver’s FilterDetach entry point when NDIS needs to detach a filter module from NDIS stack. FilterDetach handler should free all the memory allocation done in FilterAttach, and undo the operations it did in FilterAttach Handler.


一些资料:

Passthru例程说明_licyh:http://wenku.baidu.com/view/cc3f57343968011ca3009111.html

NDIS 中间层驱动程序(IMD)开发人员指南ndis_devguide:http://wenku.baidu.com/view/55a10838376baf1ffc4fad6b.html

驱动开发资料汇总:

http://yexin218.iteye.com/category/73148

http://yexin218.iteye.com/blog/557454


转载于:https://my.oschina.net/u/1054556/blog/137804

Filter Drivers主要包括以下特性:   1) 一个Filter Drivers实例叫Filter Module。Filter Module附加在一个适配器的微端口驱动上, 来自相同或不同Filter Drivers的多个Filter Module都可以被堆叠在一个网络适配器上   2) 在Filter Module被安装到驱动栈时,之上的协议驱动和之下的微端口驱动都不需要提供额外的支持功能   3) 因为Filter Module不像中间层驱动(intermediate driver)那样提供一个虚拟的微口,也不与某个设备对象联结,所以在微端口适配器(miniport adapter)之上的Filter Module 功能相当于一个修过过版本的微端口适配器(miniport adapter)。(原文:Because filter drivers do not implement virtual miniports like an intermediate driverfilter drivers are not associated with a device object. A miniport adapter with overlying filter modules functions as a modified version of the miniport adapter.)   4) NDIS使用配置信息来到决定一个Filter Module附加到一个网络适配器栈上的顺序   5) 在不用拆除整驱动栈的情况下,NDIS可以动态的插入、删除Filter Module或进行重新配置   6) 当NDIS重起驱动栈的时候协议驱动可以获得在栈上的Filter Module列表   7) Filter Drivers可以过滤下层网络适配器上绝大部分的通信。Filter Module不联结某特定的绑定(Filter modules are not associated with any particular binding between overlying protocol drivers and the miniport adapter.)   8) Filter Drivers 可以选择为过滤服务也可以选择为分流的不过滤服务,选择为哪一种是可以动态配置的(Filter drivers can select the services that are filtered and can be bypassed for the services that are not filtered. The selection of the services that are bypassed and the services that are filtered can be reconfigured dynamically.)   9) NDIS 保证有效的上下文空间,也不就是说Filter Drivers不要需要通代码COPY缓冲区来获得上下文空间  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值