简体   繁体   English

如何从Windows内核模式驱动程序设置键盘指示灯?

[英]How to set keyboard indicator light from windows kernel mode driver?

I want to write a kernel mode program that toggles the numlock light on the keyboard when a key is pressed. 我想编写一个内核模式程序,当按下某个键时,该程序可以切换键盘上的numlock灯。

I started by modifying the kbfiltr.c provided with the WinDDK samples, using the KbFilter_ServiceCallback routine to intercept a key and I'm trying to send an (IOCTL_KEYBOARD_SET_INDICATORS) by IRP to set the light. 我首先修改了WinDDK样本随附的WinDDK ,使用KbFilter_ServiceCallback routine来拦截密钥,然后尝试通过IRP发送(IOCTL_KEYBOARD_SET_INDICATORS)来设置灯光。

I'm quite new to driver development and I can't find how to code this properly. 我对驱动程序开发很陌生,我找不到如何正确编码的代码。

Can anyone help out by giving direction to any code examples? 任何人都可以通过指导任何代码示例来提供帮助吗?

I figured it out with information and source code provided by Microsoft at: 我通过Microsoft提供的信息和源代码来解决这个问题:

http://support.microsoft.com/kb/326315 http://support.microsoft.com/kb/326315

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM