NDIS Filter Drivers
SamllBug
2010/10/18
目录
1介绍NDIS Filter Drivers (4)
1.1Filter Drivers 特性 (4)
1.2Filter Drivers 服务 (5)
1.3Filter Drivers 类型 (5)
1.4Mandatory Filter Drivers (6)
童成语2编写NDIS Filter Drivers (7)
2.1初始化Filter Driver (7)
2.2卸载Filter Drivers (11)
2.3Filter Module 状态和操作 (12)
2.4附加Filter Module (14)
2.5分离Filter Module (18)
2.6重启和暂停Filter Module (20)
2.6.1重启Filter Module (20)
2.6.2暂停Filter Module (24)
2.7Data Bypass Mode (26)
2.8Filter Driver的选项配置 (26)
2.9Filter Module发送和接收 (27)松散的反义词
2.9.1Filter Driver的缓冲区管理 (27)
2.9.2在Filter Driver中发送数据 (28)
2.9.3在Filter Driver中取消一个发送请求 (30)
2.9.4在Filter Driver中接收数据 (31)
2.10Filter Module OID请求 (33)
2.10.1在Filter Driver中过滤OID请求 (33)
2.10.2在Filter Driver发起OID请求 (34)
2.10.3Filter Module的直接OID请求(Direct OID Request) (35)
2.11Filter Module PnP事件通知 (36)
2.12Filter Module 状态指示 (37)
3安装NDIS Filter Drivers (37)
3.1指定Filter Driver的绑定关系 (38)蒸芋头糕>工作信息简报
牛郎织女课本剧3.2Filter Driver的INF文件设置 (39)
3.2.1Monitoring Filter Driver的INF文件配置 (39)
3.2.2Modifying Filter Driver的INF文件配置 (42)
3.3Filter Driver访问配置信息 (45)
4附录 (46)
茶花的花语
4.1NET_BUFFER体系结构 (46)
4.1.1网络数据结构 (46)
4.1.2Retreat和Advance操作 (52)
4.1.3获得池句柄 (54)
4.1.4分发IRQL跟踪 (54)
4.1.5发送和接收操作 (55)
4.1.6以太网发送和接收操作 (61)
4.1.7派生NET_BUFFER_LIST结构 (62)
4.2指定NDIS版本信息 (66)
4.2.1概览NDIS支持的版本 (66)
4.2.2NDIS驱动需要支持的版本信息 (66)
4.2.3NDIS需要的版本信息 (67)
4.2.4获得NDIS版本 (67)
4.2.5NDIS 对象版本发布到WMI (67)
译者序
本文是根据DDK中相关章节翻译,本人英语水有限文中难免有翻译及写的不当之处,如果有任何问题可以通邮件联系和交流。
1介绍NDIS Filter Drivers
Filter Drivers提供了针对微端口驱动(Miniport Drivers)的过滤服务(filtering rvice),NDIS驱动栈上必须包含微端口驱动(Miniport Drivers)和协议驱动(Protocol Drivers),可选的包含Filter Drivers。更多关于NDIS驱动栈的信息可查看DDK的MSDN中的Driver Stack Management。下面列举基本的栈配置图示:
下面的应用可能就需要一个Filter Drivers来完成:
1)基于安全或其它目录的数据过滤应用
2)对网络数据进行监视,收集及统计的应用
下面的几个小节将介绍Filter Drivers的一些特性和服务。
1.1Filter Drivers 特性
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)。(原文:Becau filter drivers do not implement virtual miniports like an intermediate driver, filter 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 lect the rvices that are filtered and can be bypasd for the rvices that are not filtered. The lection of the rvices that are bypasd and the rvices that are filtered can be reconfigured dynamically.)
9)NDIS 保证有效的上下文空间,也不就是说Filter Drivers不要需要通代码COPY缓冲区来
获得上下文空间
1.2Filter Drivers 服务
Filter Drivers 提供发下服务:
1)发起一个发送请求和接收指示
2)改变数据缓冲区的顺序或对发送和接收数据进行调速
3)在一个驱动栈的接收或发送路径上更改、删除、添加数据
4)发起查询或设置OID的请求给下层驱动
5)过滤对下层驱动的OID查询或设置请求
6)过滤从下层驱动传来的OID查询和设置请求的应答
7)发起一个状态指示给上层的设备河南胡辣汤
8)过滤从下层传来的状态指示
9)管理注册表中每一个微端口适配器和其接口的参数
1.3Filter Drivers 类型
下面是两种主要类型的Filter Drivers:
1)Monitoring
这种类型可以在驱动栈上做监视行为,但是它不能在驱动栈上进行数据修改行为。
Monitoring Filter Drivers不在修改或发起数据。
2)Modifying