Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
3.0 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. hidexe.h
  5. Abstract:
  6. This module contains the declarations and definitions for use with the
  7. hid user more client sample driver.
  8. Environment:
  9. Kernel & user mode
  10. @@BEGIN_DDKSPLIT
  11. Revision History:
  12. Nov-96 : Created by Kenneth D. Ray
  13. @@END_DDKSPLIT
  14. --*/
  15. #ifndef HIDEXE_H
  16. #define HIDEXE_H
  17. #include <hidpddi.h>
  18. //
  19. //
  20. #define DIGCF_FUNCTION 0x00000010
  21. #define DIOD_FUNCTION 0x00000008
  22. #define DIREG_FUNCTION 0x00000008
  23. //
  24. // A structure to hold the steady state data received from the hid device.
  25. // Each time a read packet is received we fill in this structure.
  26. // Each time we wish to write to a hid device we fill in this structure.
  27. // This structure is here only for convenience. Most real applications will
  28. // have a more efficient way of moving the hid data to the read, write, and
  29. // feature routines.
  30. //
  31. typedef struct _HID_DATA {
  32. BOOLEAN IsButtonData;
  33. UCHAR Reserved;
  34. USAGE UsagePage; // The usage page for which we are looking.
  35. ULONG Status; // The last status returned from the accessor function
  36. // when updating this field.
  37. union {
  38. struct {
  39. ULONG MaxUsageLength; // Usages buffer length.
  40. PUSAGE Usages; // list of usages (buttons ``down'' on the device.
  41. } ButtonData;
  42. struct {
  43. USAGE Usage; // The usage describing this value;
  44. USHORT Reserved;
  45. ULONG Value;
  46. LONG ScaledValue;
  47. } ValueData;
  48. };
  49. } HID_DATA, *PHID_DATA;
  50. typedef struct _HID_DEVICE {
  51. // HANDLE HidDevice; // A file handle to the hid device.
  52. // PHIDP_PREPARSED_DATA Ppd; // The opaque parser info describing this device
  53. // HIDP_CAPS Caps; // The Capabilities of this hid device.
  54. PCHAR InputReportBuffer;
  55. PHID_DATA InputData; // array of hid data structures
  56. ULONG InputDataLength; // Num elements in this array.
  57. PHIDP_BUTTON_CAPS InputButtonCaps;
  58. PHIDP_VALUE_CAPS InputValueCaps;
  59. PCHAR OutputReportBuffer;
  60. PHID_DATA OutputData;
  61. ULONG OutputDataLength;
  62. PHIDP_BUTTON_CAPS OutputButtonCaps;
  63. PHIDP_VALUE_CAPS OutputValueCaps;
  64. PCHAR FeatureReportBuffer;
  65. PHID_DATA FeatureData;
  66. ULONG FeatureDataLength;
  67. PHIDP_BUTTON_CAPS FeatureButtonCaps;
  68. PHIDP_VALUE_CAPS FeatureValueCaps;
  69. } HID_DEVICE, *PHID_DEVICE;
  70. BOOLEAN
  71. FindKnownHidDevices (
  72. OUT PHID_DEVICE * HidDevices, // A array of struct _HID_DEVICE
  73. OUT PULONG NumberDevices // the length of this array.
  74. );
  75. BOOLEAN
  76. CloseHidDevices (
  77. OUT PHID_DEVICE * HidDevices, // A array of struct _HID_DEVICE
  78. OUT PULONG NumberDevices // the length of this array.
  79. );
  80. BOOLEAN
  81. Read (
  82. PHID_DEVICE HidDevice
  83. );
  84. BOOLEAN
  85. Write (
  86. PHID_DEVICE HidDevice
  87. );
  88. BOOLEAN
  89. SetFeature (
  90. PHID_DEVICE HidDevice
  91. );
  92. BOOLEAN
  93. GetFeature (
  94. PHID_DEVICE HidDevice
  95. );
  96. #endif