将过滤器驱动程序安装到现有设备
我正在学习如何编写过滤器驱动程序,并尝试在现有的 HID 驱动程序(鼠标或键盘)上安装一个过滤器驱动程序以进行练习。据我了解,我至少应该在硬件注册表项中添加一个 UpperFilters 项。还有什么我应该做的吗?
当我使用 regedit 手动将 UpperFilters 键添加到目标 USB 鼠标设备时,regedit 显示无法创建该键。我怀疑 regedit 不允许修改 Windows 提供的设备驱动程序堆栈注册表。是否有其他方法可以将过滤器驱动程序安装到现有设备堆栈?
I am learning how to write a filter driver and is trying to install one on top an existing HID driver (mouse or keyboard) for practising. From what I understand, I should at least add an UpperFilters key to the hardware registry key. Is there anything else I should do?
When I use regedit to manually add an UpperFilters key to my target USB mouse device, regedit says It cannot create the key. I am suspecting regedit disallows modification to Windows provided device driver stack registry. Is there any other methods to install my filter driver to an existing device stack?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
默认情况下,Windows 7 不允许除 SYSTEM 帐户(即甚至管理员)之外的任何人在
HKLM\SYSTEM\CurrentControlSet\Enum
层次结构下进行修改,因此添加一个UpperFilters
键手动操作特定设备并不容易。然而,从 INF 内部来说,这应该很容易。但是,如果您想过滤所有鼠标,则应将
UpperFilters
键添加到鼠标设备类 - 即添加到HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325- 11CE-BFC1-08002BE10318}
。即使在 Windows 7 上,这也应该不受阻碍,但通常您也可以通过 INF 来执行此操作。编写 INF 时,可以在 AddReg 部分,以便您的过滤器将添加到鼠标设备类上的任何其他过滤器。
Windows 7 by default disallows modifications under the
HKLM\SYSTEM\CurrentControlSet\Enum
hierarchy for anyone but the SYSTEM account (i.e. not even the Administrators), so adding anUpperFilters
key to a particular device manually isn't easy. However, from within an INF it should be easy.However, if you want to filter all mice, you should add the
UpperFilters
key to the Mouse device class -- i.e. toHKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}
. This should be unhindered even on Windows 7, but normally you do this through an INF as well.When writing the INF, you can add the FLG_ADDREG_APPEND (0x00000008) flag in the AddReg section so that your filter will be added to any other filters on the Mouse device class.
该驱动程序过滤系统上特定键盘的输入。如果要过滤插入系统的所有键盘的键盘输入,可以将此驱动程序安装为 KbdClass 过滤器驱动程序下方的类过滤器,方法是在注册表中的 KbdClass 过滤器之前添加此过滤器驱动程序的服务名称:
请参阅此页:
https://github.com/microsoft/ Windows-driver-samples/blob/1fe4cc42bedfccb97a5b2cc169f9e5306d41d0de/input/kbfiltr/README.md
This driver filters input for a particular keyboard on the system. If you want to filter keyboard inputs from all the keyboards plugged into the system, you can install this driver as a class filter below the KbdClass filter driver by adding the service name of this filter driver before the KbdClass filter in the registry at:
See this page:
https://github.com/microsoft/Windows-driver-samples/blob/1fe4cc42bedfccb97a5b2cc169f9e5306d41d0de/input/kbfiltr/README.md