阅读:1954回复:11
关于过滤驱动程序
不知大家是否看过File monitor源代码,它说它是一个Filter Dirver,并给了内部驱动程序名和外部驱动程序名:\"L\\\\DosDevice\\\\XXX\"、\"L\\\\Device\\\\XXX\".
然而在DDK中,IoCreateDevice函数中有一个DeviceName参数,其中有说到:\"Typically, only Physical Device Objects (PDOs), which are created by PnP bus drivers, are named. PnP function drivers and filter drivers should not specify a DeviceName for a Functional Device Object (FDO) or filter device object (filter DO). Naming an FDO or filter DO bypasses the PnP Manager\'s security. If a user-mode component needs a symbolic link to the device, the function or filter driver should register a device interface (see IoRegisterDeviceInterface ). If a kernel-mode component needs a legacy device name, the driver must name the FDO, but naming is not recommended\" 另外有一本书叫《Windows 2000设备驱动程序设计指南》(美 Art Baker Jerry Lozano,机械工业出版社)提到:\"虽然分层驱动程序把它们自己唯一名字暴露给设备对象,而过滤驱动程序根本没有名字。过滤器工作时把其中一个无名的设备对象连接到一个由低级驱动程序建立的设备对象\". 如此说来,File monitor 算不算是一个过滤驱动程序? |
|
|
沙发#
发布于:2002-03-13 14:57
因该是吧,DDK指的是Functional Device Object (FDO) ,功能设备驱动,我就在做一个既过滤文件有有自己设备对象的FILTER DRIVER.
|
|
板凳#
发布于:2002-03-13 17:56
它只是说出于安全的考虑,不应该为FDO及FilterDO产生设备名,并不是不能做。
|
|
|
地板#
发布于:2002-03-13 21:53
FilterMonitor 驱动程序本身建立了好几个设备对象,
其中用于和外部通讯的一个,并有外部名字供应用程序 调用。 当然也建立了过滤设备,当然,它们是没有命名的。 |
|
|
地下室#
发布于:2002-03-14 11:32
这里又有如此一说,真是越看越糊涂:
NT4DDK中对IoCreateDevice()函数中DeviceName参数的解释: DeviceName: Points to a buffer containing a zero-terminated Unicode string that names the device object. The string must be a full path name. Any device object that can be the target of an I/O request or that a higher-level driver can connect to must have a DeviceName.!!! An unnamed device object is visible only to the driver that created it or to an FSD through a volume parameter block (VPB).!!! 随便后它又解释到: Each driver must create at least one named device object by calling IoCreateDevice. Otherwise, no I/O requests can be sent to the driver. An unnamed device object is invisible to other drivers except, possibly, FSDs and to user-mode protected subsystems because a symbolic link cannot be set up for an unnamed device object. Consequently, higher-level drivers cannot attach their device objects to an unnamed device object nor can the unnamed object be the target of an IRP. 如此说来,我的FilterDevice到底要不要命名? |
|
|
5楼#
发布于:2002-05-17 09:43
to Tom_lyd:
最后你的filter命名了没有?在硬盘filter安装时有没什么特别的设置?可否赐教? |
|
|
6楼#
发布于:2002-05-17 12:07
请看这个贴子,答案尽在其中。
http://www.driverdevelop.com/forum/viewthread.php?tid=9759&PHPSESSID=6a554b8242238c4751d94111b4d25a9e |
|
|
7楼#
发布于:2002-05-17 12:58
多谢!
|
|
|
8楼#
发布于:2002-05-17 12:59
过滤驱动程序创建的设备对象可能是两种,一种是过滤设备对象,一种是为了和上层通信而创建的设备对象,对于第一种是不应该提供名称的,而第二种就必须要提供名称了!
|
|
9楼#
发布于:2002-05-17 14:30
谢谢!不知道你做过硬盘filter没?我现在有个filter,不知怎样把它挂上去。用addfilter总死机。
要写inf吗? |
|
|
10楼#
发布于:2002-05-29 13:10
已经挂上去了,是先将filter当做设备添加上去,再用addfilter加到具体硬盘上的。
不知道还有没有更加简单的方法? |
|
|
11楼#
发布于:2002-05-31 15:43
过滤驱动程序创建的过滤设备对象也是可以有设备名称的,我已经试验过了。虽然我对文档上的说明比较迷惑:)
|
|