阅读:1275回复:4
哪位高人可以帮手 在用户模式下用什么函数可以读取系统HID设备的数据
哪位高人可以帮手
在用户模式下用什么函数可以读取系统HID设备的数据(如鼠标) 把CreateFile中的2参数GENERIC_READ|GENERIC_WRITE得到Handle是无效, 还可以用什么方法可以读取,鼠标的按键时数据 |
|
沙发#
发布于:2007-07-27 13:51
哪里有这方面的资料,可否告诉我,在网上找了好久都找不到,哪怕是一点点线索也好,请大家出手吧,
|
|
板凳#
发布于:2007-07-27 15:00
This section describes how user-mode applications and kernel-mode drivers operate HID collections.
In general, a user-mode application does the following: Calls device installation functions (SetupDiXxx functions) to find and identify a HID collection. Calls CreateFile to open a file on a HID collection. Calls HidD_Xxx HID support routines to obtain a HID collection's preparsed data and information about the HID collection. Uses IRP_MJ_READ requests to read input reports and IRP_MJ_WRITE requests to send output reports. Calls HidP_Xxx HID support routines to interpret HID reports. In general, a kernel-mode driver does the following: Finds and identifies a HID collection If the driver is a function or filter driver, it is already attached to the collection's device stack. However, if the driver is not attached to the collection's device stack, the driver can use Plug and Play notification. Uses an IRP_MJ_CREATE request to open the HID collection Uses IOCTL_HID_Xxx requests to obtain the HID collection's preparsed data and information about the HID collection Uses IRP_MJ_READ requests to read input reports and IRP_MJ_WRITE requests to send output reports Calls HidP_Xxx HID support routines to interpret HID reports For more information about operating a HID collection, see: Finding and Opening a HID Collection Enforcing a Secure Read For a HID Collection Obtaining Preparsed Data Obtaining Collection Information Handling HID Reports Freeing Resources |
|
|
地板#
发布于:2007-07-28 10:57
谢谢管理员的指点,我会试试,遇到贵人真好
|
|
地下室#
发布于:2007-07-28 11:04
现在有一个问题就是用Calls CreateFile to open a file on a HID collection.如果第二个参数设GENERIC_READ|GENERIC_WRITE,返回的句柄是无效的,如果第二个参数设为0,可以取得句柄,那第二个参数应该设置什么.
|
|