seven11
驱动牛犊
驱动牛犊
  • 注册日期2007-01-22
  • 最后登录2009-11-10
  • 粉丝0
  • 关注0
  • 积分180分
  • 威望20点
  • 贡献值0点
  • 好评度19点
  • 原创分0分
  • 专家分0分
阅读:1275回复:4

哪位高人可以帮手 在用户模式下用什么函数可以读取系统HID设备的数据

楼主#
更多 发布于:2007-07-27 13:45
哪位高人可以帮手
在用户模式下用什么函数可以读取系统HID设备的数据(如鼠标)
把CreateFile中的2参数GENERIC_READ|GENERIC_WRITE得到Handle是无效,
还可以用什么方法可以读取,鼠标的按键时数据
seven11
驱动牛犊
驱动牛犊
  • 注册日期2007-01-22
  • 最后登录2009-11-10
  • 粉丝0
  • 关注0
  • 积分180分
  • 威望20点
  • 贡献值0点
  • 好评度19点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2007-07-27 13:51
哪里有这方面的资料,可否告诉我,在网上找了好久都找不到,哪怕是一点点线索也好,请大家出手吧,
znsoft
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2023-10-25
  • 粉丝300
  • 关注6
  • 积分910分
  • 威望14796点
  • 贡献值7点
  • 好评度2410点
  • 原创分5分
  • 专家分100分
  • 社区居民
  • 最爱沙发
  • 社区明星
板凳#
发布于: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
http://www.zndev.com 免费源码交换网 ----------------------------- 软件创造价值,驱动提供力量! 淡泊以明志,宁静以致远。 ---------------------------------- 勤用搜索,多查资料,先搜再问。
seven11
驱动牛犊
驱动牛犊
  • 注册日期2007-01-22
  • 最后登录2009-11-10
  • 粉丝0
  • 关注0
  • 积分180分
  • 威望20点
  • 贡献值0点
  • 好评度19点
  • 原创分0分
  • 专家分0分
地板#
发布于:2007-07-28 10:57
谢谢管理员的指点,我会试试,遇到贵人真好
seven11
驱动牛犊
驱动牛犊
  • 注册日期2007-01-22
  • 最后登录2009-11-10
  • 粉丝0
  • 关注0
  • 积分180分
  • 威望20点
  • 贡献值0点
  • 好评度19点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2007-07-28 11:04
现在有一个问题就是用Calls CreateFile to open a file on a HID collection.如果第二个参数设GENERIC_READ|GENERIC_WRITE,返回的句柄是无效的,如果第二个参数设为0,可以取得句柄,那第二个参数应该设置什么.
游客

返回顶部