键盘设备对象名字为"\device\keyboardclass1",求解
Windows内核调试
键盘设备对象名字为"\device\keyboardclass1",求解
skyNirvana
2009-11-05, 20:41 下午
张老师,各位朋友晚上好,遇到个奇怪的问题,希望得到大家的帮助.先谢过.:)
先把调试信息放出:
// 列kbdclass的信息
lkd> !drvobj 8a1f32c8
Driver object (8a1f32c8) is for:
\Driver\Kbdclass
Driver Extension List: (id , addr)
Device Object list:
8a4fe558 8a4d8998
// 列8a4fe558的信息("keyboardclass1")
lkd> !devobj 8a4fe558
Device object (8a4fe558) is for:
KeyboardClass1 \Driver\Kbdclass DriverObject 8a1f32c8
Current Irp 00000000 RefCount 0 Type 0000000b Flags 00002044
Dacl e175367c DevExt 8a4fe610 DevObjExt 8a4fe6f0
ExtensionFlags (0000000000)
AttachedTo (Lower) 8a4e2238 \Driver\kbdhid
//递推keyboardclass1的再下一层
lkd> !devobj 8a4e2238
Device object (8a4e2238) is for:
\Driver\kbdhid DriverObject 8a2a6040
Current Irp 00000000 RefCount 0 Type 0000000b Flags 00002000
DevExt 8a4e22f0 DevObjExt 8a4e24b0
ExtensionFlags (0000000000)
AttachedDevice (Upper) 8a4fe558 \Driver\Kbdclass
AttachedTo (Lower) 8a357a98 \Driver\hidusb
再看 keyboardclass0的内容和它下面设备的内容
lkd> !devobj 8a4d8998
Device object (8a4d8998) is for:
KeyboardClass0 \Driver\Kbdclass DriverObject 8a1f32c8
Current Irp 00000000 RefCount 2 Type 0000000b Flags 00002044
Dacl e175367c DevExt 8a4d8a50 DevObjExt 8a4d8b30
ExtensionFlags (0000000000)
AttachedTo (Lower) 8a36cec0 \Driver\TermDD
lkd> !devobj 8a36cec0
Device object (8a36cec0) is for:
RDP_CONSOLE0 \Driver\TermDD DriverObject 8a1ac298
Current Irp 00000000 RefCount 0 Type 00000027 Flags 00000044
Dacl e175367c DevExt 8a36cf78 DevObjExt 8a36cfd0
ExtensionFlags (0000000000)
AttachedDevice (Upper) 8a4d8998 \Driver\Kbdclass
AttachedTo (Lower) 8a75bdf0 \Driver\PnpManager
两个devobj的挂接关系如下,
hidusb<-kbdhid<-keyboardclass1
PnpManager<-TermDD <-keyboardclass0
我的问题是:可以通过什么办法获取当前的输入是由keyboardclass0还是keyboardclass1来负责的呢?以前一直以为keyboardclass0都是负责的,以前写的测试程序一直都假定是这样,后来,不知装了什么程序后,今天跑了下原来的程序,发现没反应,才发现是keyboardclass1来负责输入了(硬件没改过,键盘没换过接口,删删装装了些软件)
Re: 键盘设备对象名字为"\device\keyboardclass1",求解
skyNirvana
2009-11-06, 17:01 下午
来结帖了,蒙dm朋友帮忙确定是假定的键盘类型只有ps/2,不兼容usb键盘的问题