为模拟输入设备编写Windows驱动程序 [英] Writing a windows driver for an emulated input device

查看:188
本文介绍了为模拟输入设备编写Windows驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序需要充当虚拟操纵杆(想象用鼠标拖动一个正方形并将其转换为模拟操纵杆的输出),并通过网络将一些击键发送到另一台计算机,驱动程序将在该计算机上接收该输入。 / p>

我只需要支持XP,Vista和Win7。



也许无需编写驱动程序就可以完成。我尝试使用SendKey()发送击键,该键似乎有效,但不知道如何模拟模拟操纵杆。

我已经下载了VDK,正在阅读所有内容。可以找到关于这个主题的信息,但是我仍然不了解很多事情。


  1. 我应该构建内核模式或用户模式驱动程序吗?

  2. 我的驱动程序可以充当网络上的应用程序的服务器吗?

  3. 您知道可以帮助我解决此问题的好教程/书籍/示例。

谢谢

解决方案

首先您的计算机(或网络)与被控制的操纵杆设备之间将必须具有某种接口。



如果涉及到制作定制硬件来控制模拟操纵杆(例如它控制气动或液压之类的东西,而不仅仅是PC游戏操纵杆类型的东西),那么是的,您几乎肯定会需要一个驱动程序来允许网络应用程序移动(机器人手臂或其他任何东西)来移动操纵杆。



如果您能够从方程式中删除物理操纵杆,也许您可​​以编写软件来模拟操纵杆插入位置的输入(操纵杆/串行端口?),或完全模拟它(一个相当简单的驱动程序可以做到这一点)。如果操纵杆使用标准的通信接口(例如RS232),则无需编写驱动程序就可以完全做到这一点,因为存在可以处理所有这些操作的库,并且您可以设置虚拟COM端口,这些端口与您尝试与之进行通信的任何对象都没有区别。



目前您可以在驱动程序开发上买的最好的书是使用Windows驱动程序基金会开发驱动程序



Rootkit:颠覆Windows内核是另一本不错的书,但并未涵盖很多新的WDF。东东。它更多地侧重于安全性,但是在设备驱动程序上有一些很棒的章节,上面有完整的示例,以一种真正可访问的方式对其进行了分解。


My application needs to behave as a virtual joystick (imagine dragging a square with the mouse and translating that to the output of an analog joystick) and send some keystrokes over the network to another computer where the driver would receive that input.

I only need to support XP, Vista and Win7.

Maybe it can be done without writing a driver. I tried sending keystrokes with SendKey() which seemed to work but don't know how to emulate an analog joystick.

I've downloaded the VDK and been reading everything I can find on the subject but there are lots of things I still don't understand. Can you please point me in the right direction?

  1. Should I build a kernel-mode or user-mode driver?
  2. Can my driver act as a server for an app on the network?
  3. Do you know good tutorials / books / samples that can help me with this.

Thanks

解决方案

First of all you will have to have some kind of interface between your computer (or the network) and the joystick device that is being controlled.

If it involves making custom hardware to control the analog joystick (like it controls pneumatics or hydraulics or something, not just a pc game joystick type thing), then yes, you will almost certainly need a driver to allow a network app to move (the robot arm, or whatever) will move that joystick.

If you are able to remove the physical joystick from the equation, maybe you can write software that emulates the input of wherever the joystick used to plug into (a joystick/serial port?), or emulates it completely (a reasonably simple driver could do this). You could do it completely without writing a driver if the joystick used a standard communication interface (like RS232) because libraries exist that will handle all that and you can set up virtual COM ports that will be indistinguishable to whatever you are trying to communicate with.

The best book you can buy on driver development at the moment is Developing Drivers with the Windows Driver Foundation

Rootkits: Subverting the Windows Kernel is another great book, but doesn't cover a lot of the newer WDF stuff. It has more of a security focus but has a few awesome chapters on device drivers with fully spoonfed examples, breaking it down in a really accessible way.

这篇关于为模拟输入设备编写Windows驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆