WDK_VidPidQuery.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef __WDK_VIDPIDQUERY__
  2. #define __WDK_VIDPIDQUERY__
  3. /* ----------------------------------------------------------
  4. 文件名称:WDK_VidPidQuery.h
  5. 作者:秦建辉
  6. MSN:splashcn@msn.com
  7. QQ:36748897
  8. 开发环境:
  9. Visual Studio V2010
  10. WinDDK 7600.16385.1
  11. 版本历史:
  12. V1.0 2011年09月10日
  13. 结合设备安装类GUID和设备接口类GUID获取设备VIDPID
  14. 接口函数:
  15. WDK_WhoAllVidPid
  16. WDK_isExistVidPid
  17. ------------------------------------------------------------ */
  18. #pragma once
  19. #include <windows.h>
  20. #ifndef MACRO_HIDD_VIDPID
  21. #define MACRO_HIDD_VIDPID
  22. typedef struct _HIDD_VIDPID
  23. {
  24. USHORT VendorID;
  25. USHORT ProductID;
  26. } HIDD_VIDPID;
  27. #endif
  28. #ifdef __cplusplus
  29. extern "C"
  30. {
  31. #endif
  32. /*
  33. 功能:获取系统所有设备的VIDPID
  34. 入口参数:
  35. [out] pVidPid:存储返回的VIDPID,会自动过滤掉重复的VIDPID
  36. [in] iCapacity:存储单元的容量,建议为32
  37. [in] SetupClassGuid:设备安装类GUID,默认为NULL
  38. [in] InterfaceClassGuid:设备接口类GUID,默认为NULL
  39. 返回值:
  40. 获取到的VID和PID数目
  41. 优点:
  42. 直接通过设备实例ID提取VIDPID,从而无需获取设备路径来读写IO。
  43. */
  44. INT WINAPI WDK_WhoAllVidPid( HIDD_VIDPID* pVidPid, INT iCapacity, const GUID* SetupClassGuid = NULL, const GUID* InterfaceClassGuid = NULL );
  45. /*
  46. 功能:判断指定的VIDPID是否存在于列表中
  47. 入口参数:
  48. [in] VendorID:要查找的VID
  49. [in] ProductID:要查找的PID
  50. [in] pVidPid:用来检索的VIDPID库
  51. [in] iSize:VIDPID库大小
  52. 返回值:
  53. TRUE:存在
  54. FALSE:不存在
  55. */
  56. BOOL WINAPI WDK_isExistVidPid( USHORT VendorID, USHORT ProductID, const HIDD_VIDPID* pVidPid, INT iSize );
  57. #ifdef __cplusplus
  58. }
  59. #endif
  60. #endif // __WDK_VIDPIDQUERY__