Leaked source code of windows server 2003
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.

135 lines
3.4 KiB

  1. /*++
  2. *
  3. * Component: hidserv.dll
  4. * File: hid.h
  5. * Purpose: header to support hid client capability.
  6. *
  7. * Copyright (C) Microsoft Corporation 1997,1998. All rights reserved.
  8. *
  9. * WGJ
  10. --*/
  11. #ifndef HIDEXE_H
  12. #define HIDEXE_H
  13. #include <hidsdi.h>
  14. #include <setupapi.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif /* __cplusplus */
  18. //
  19. // A structure to hold the steady state data received from the hid device.
  20. // Each time a read packet is received we fill in this structure.
  21. // Each time we wish to write to a hid device we fill in this structure.
  22. // This structure is here only for convenience. Most real applications will
  23. // have a more efficient way of moving the hid data to the read, write, and
  24. // feature routines.
  25. //
  26. typedef struct _HID_DATA {
  27. BOOLEAN IsButtonData;
  28. UCHAR Reserved;
  29. USAGE UsagePage; // The usage page for which we are looking.
  30. USHORT LinkCollection; // hidparse internal index
  31. USAGE LinkUsage; // the actual logical collection usage
  32. ULONG Status; // The last status returned from the accessor function
  33. // when updating this field.
  34. union {
  35. struct {
  36. ULONG MaxUsageLength; // Usages buffer length.
  37. PUSAGE_AND_PAGE Usages; // list of usages (buttons ``down'' on the device.
  38. PUSAGE_AND_PAGE PrevUsages; // list of usages previously ``down'' on the device.
  39. } ButtonData;
  40. struct {
  41. USAGE Usage; // The usage describing this value;
  42. USHORT Reserved;
  43. ULONG Value;
  44. LONG ScaledValue;
  45. ULONG LogicalRange;
  46. } ValueData;
  47. };
  48. } HID_DATA, *PHID_DATA;
  49. typedef struct _HID_DEVICE {
  50. struct _HID_DEVICE * pNext;
  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. HIDD_ATTRIBUTES Attributes;
  55. // PnP info
  56. DWORD DevInst; // the devnode
  57. BOOL Active; // Dead or alive?
  58. HDEVNOTIFY hNotify; // Device notification handle
  59. OVERLAPPED Overlap; // used for overlapped read.
  60. HANDLE ReadEvent; // when io pending occurs
  61. HANDLE CompletionEvent; // signals read completion.
  62. BOOL fThreadEnabled;
  63. DWORD ThreadId;
  64. HANDLE ThreadHandle;
  65. PCHAR InputReportBuffer;
  66. PHID_DATA InputData; // array of hid data structures
  67. ULONG InputDataLength; // Num elements in this array.
  68. BOOLEAN Speakers;
  69. } HID_DEVICE, *PHID_DEVICE;
  70. // pnp.c
  71. BOOL
  72. RebuildHidDeviceList (void);
  73. BOOL
  74. StartHidDevice(
  75. PHID_DEVICE pHidDevice);
  76. BOOL
  77. StopHidDevice(
  78. PHID_DEVICE pHidDevice);
  79. BOOL
  80. DestroyHidDeviceList(
  81. void);
  82. BOOL
  83. DestroyDeviceByHandle(
  84. HANDLE hDevice
  85. );
  86. // report.c
  87. BOOL
  88. Read (
  89. PHID_DEVICE HidDevice
  90. );
  91. BOOL
  92. ParseReadReport (
  93. PHID_DEVICE HidDevice
  94. );
  95. BOOL
  96. Write (
  97. PHID_DEVICE HidDevice
  98. );
  99. BOOL
  100. SetFeature (
  101. PHID_DEVICE HidDevice
  102. );
  103. BOOL
  104. GetFeature (
  105. PHID_DEVICE HidDevice
  106. );
  107. #ifdef __cplusplus
  108. }
  109. #endif /* __cplusplus */
  110. #endif