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.

225 lines
8.5 KiB

  1. #ifndef __GckExtrn_h__
  2. #define __GckExtrn_h__
  3. // @doc
  4. /**********************************************************************
  5. *
  6. * @module GckExtrn.h |
  7. *
  8. * External Definitions needed to open and communicate with the driver.
  9. *
  10. * History
  11. * ----------------------------------------------------------
  12. * Mitchell S. Dernis Original
  13. *
  14. * (c) 1986-1998 Microsoft Corporation. All right reserved.
  15. *
  16. * @topic GckExtrn |
  17. * IOCTL definitions and the name of the Control Object to be used in CreateFile.
  18. *
  19. **********************************************************************/
  20. /********************************************
  21. * Driver (and Symbolic Link) Names *
  22. *********************************************/
  23. #define GCK_CONTROL_NTNAME L"\\Device\\MS_GCKERNEL"
  24. #define GCK_CONTROL_SYMNAME L"\\DosDevices\\MS_GCKERNEL"
  25. #define GCK_CONTROL_W32Name "\\\\.\\MS_GCKERNEL"
  26. /****************************************
  27. * IOCTL definitions *
  28. *****************************************/
  29. #define GCK_IOCTL_CODE(_x_) CTL_CODE( \
  30. FILE_DEVICE_UNKNOWN, \
  31. (0x0800 | _x_), \
  32. METHOD_BUFFERED, \
  33. FILE_ANY_ACCESS \
  34. )
  35. #define GCK_IOCTL_DIRECT_CODE(_x_) CTL_CODE( \
  36. FILE_DEVICE_UNKNOWN, \
  37. (0x0800 | _x_), \
  38. METHOD_OUT_DIRECT, \
  39. FILE_ANY_ACCESS \
  40. )
  41. #define IOCTL_GCK_GET_HANDLE GCK_IOCTL_CODE(0x0001)
  42. #define IOCTL_GCK_GET_CAPS GCK_IOCTL_CODE(0x0002)
  43. #define IOCTL_GCK_SEND_COMMAND GCK_IOCTL_CODE(0x0003)
  44. #define IOCTL_GCK_BACKDOOR_POLL GCK_IOCTL_DIRECT_CODE(0x0004)
  45. #define IOCTL_GCK_BEGIN_TEST_SCHEME GCK_IOCTL_CODE(0x0005)
  46. #define IOCTL_GCK_UPDATE_TEST_SCHEME GCK_IOCTL_CODE(0x0006)
  47. #define IOCTL_GCK_END_TEST_SCHEME GCK_IOCTL_CODE(0x0007)
  48. #define IOCTL_GCK_ENABLE_DEVICE GCK_IOCTL_CODE(0x0008)
  49. #define IOCTL_GCK_SET_INTERNAL_POLLING GCK_IOCTL_CODE(0x0009)
  50. #define IOCTL_GCK_ENABLE_TEST_KEYBOARD GCK_IOCTL_CODE(0x000A)
  51. #define IOCTL_GCK_NOTIFY_FF_SCHEME_CHANGE GCK_IOCTL_CODE(0x000B)
  52. #define IOCTL_GCK_END_FF_NOTIFICATION GCK_IOCTL_CODE(0x000C)
  53. #define IOCTL_GCK_GET_FF_SCHEME_DATA GCK_IOCTL_CODE(0x000D)
  54. #define IOCTL_GCK_SET_WORKINGSET GCK_IOCTL_CODE(0x000E)
  55. #define IOCTL_GCK_QUERY_PROFILESET GCK_IOCTL_CODE(0x000F)
  56. #define IOCTL_GCK_LED_BEHAVIOUR GCK_IOCTL_CODE(0x0010)
  57. #define IOCTL_GCK_TRIGGER GCK_IOCTL_CODE(0x0011)
  58. #define IOCTL_GCK_ENABLE_KEYHOOK GCK_IOCTL_CODE(0x0012)
  59. #define IOCTL_GCK_DISABLE_KEYHOOK GCK_IOCTL_CODE(0x0013)
  60. #define IOCTL_GCK_GET_KEYHOOK_DATA GCK_IOCTL_CODE(0x0014)
  61. /**********************************************************
  62. * Structures passed in IOCTLs *
  63. **********************************************************/
  64. typedef enum
  65. {
  66. GCK_POLLING_MODE_RAW = 0x00000001,
  67. GCK_POLLING_MODE_FILTERED = 0x00000002,
  68. GCK_POLLING_MODE_MOUSE = 0x00000004,
  69. GCK_POLLING_MODE_KEYBOARD = 0x00000008,
  70. } GCK_POLLING_MODES;
  71. //
  72. // @struct GCK_SET_INTERNAL_POLLING_DATA | Input structure for IOCTL_GCK_SET_INTERNAL_POLLING
  73. //
  74. typedef struct tagGCK_SET_INTERNAL_POLLING_DATA
  75. {
  76. ULONG ulHandle; //@field Handle returned from IOCTL_GCK_GET_HANDLE
  77. BOOLEAN fEnable; //@field TRUE to turn continous internal polling on, FALSE to turn it off
  78. } GCK_SET_INTERNAL_POLLING_DATA, *PGCK_SET_INTERNAL_POLLING_DATA;
  79. //
  80. // @struct GCK_SET_INTERNAL_POLLING_DATA | Input structure for IOCTL_GCK_BACKDOOR_POLL
  81. //
  82. typedef struct tagGCK_BACKDOOR_POLL_DATA
  83. {
  84. ULONG ulHandle; //@field Handle returned from IOCTL_GCK_GET_HANDLE
  85. GCK_POLLING_MODES ePollingMode; //@field TRUE for a raw poll, FALSE for filtered data (unapplied changes are active)
  86. } GCK_BACKDOOR_POLL_DATA, *PGCK_BACKDOOR_POLL_DATA;
  87. //
  88. // @struct GCK_SET_INTERNAL_POLLING_DATA | Output structure for IOCTL_GCK_BACKDOOR_POLL
  89. // if the GCK_POLLING_MODE_MOUSE was used.
  90. //
  91. typedef struct tagGCK_MOUSE_OUTPUT
  92. {
  93. char cXMickeys;
  94. char cYMickeys;
  95. char cButtons;
  96. char fDampen:1;
  97. char fClutch:1;
  98. } GCK_MOUSE_OUTPUT, *PGCK_MOUSE_OUTPUT;
  99. typedef struct tagGCK_ENABLE_TEST_KEYBOARD
  100. {
  101. ULONG ulHandle; //@field Handle returned from IOCTL_GCK_GET_HANDLE
  102. BOOLEAN fEnable; //@field TRUE for a keyboard data, FALSE for none
  103. } GCK_ENABLE_TEST_KEYBOARD, *PGCK_ENABLE_TEST_KEYBOARD;
  104. //
  105. // @struct GCK_SET_WORKINGSET | Output structure for IOCTL_GCK_SET_WORKINGSET
  106. //
  107. typedef struct tagGCK_SET_WORKINGSET
  108. {
  109. ULONG ulHandle; //@field Handle returned from IOCTL_GCK_GET_HANDLE
  110. unsigned char ucWorkingSet; //@field 0 based working set for future IOCTLs
  111. } GCK_SET_WORKINGSET, *PGCK_SET_WORKINGSET;
  112. //
  113. // @struct GCK_QUERY_PROFILESET | Input structure from IOCTL_GCK_QUERY_PROFILESET
  114. //
  115. typedef struct tagGCK_QUERY_PROFILESET
  116. {
  117. unsigned char ucActiveProfile; //@field 0 active profile, determined by slider position
  118. unsigned char ucWorkingSet; //@field 0 based working profile from previous call to GCK_IOCTL_SETWORKINGSET
  119. } GCK_QUERY_PROFILESET, *PGCK_QUERY_PROFILESET;
  120. // LED behaviour enums (non combinable!)
  121. typedef enum
  122. {
  123. GCK_LED_BEHAVIOUR_DEFAULT = 0x00,
  124. GCK_LED_BEHAVIOUR_ON = 0x01,
  125. GCK_LED_BEHAVIOUR_OFF = 0x02,
  126. GCK_LED_BEHAVIOUR_BLINK = 0x03
  127. } GCK_LED_BEHAVIOURS;
  128. //
  129. // @struct GCK_LED_BEHAVIOUR_OUT | Output structure to IOCTL_GCK_LED_BEHAVIOUR
  130. //
  131. typedef struct tagGCK_LED_BEHAVIOUR_OUT
  132. {
  133. ULONG ulHandle; //@field Handle returned from IOCTL_GCK_GET_HANDLE
  134. GCK_LED_BEHAVIOURS ucLEDBehaviour; //@field New behaviour of the LEDs
  135. ULONG ulLEDsAffected; //@field Bit mask of effected LEDs
  136. unsigned char ucShiftArray; //@field Modifier state of affected LEDs
  137. unsigned char ucBlinkRate; //@field Blink rate of entire device (0 to leave unchanged)
  138. } GCK_LED_BEHAVIOUR_OUT, *PGCK_LED_BEHAVIOUR_OUT;
  139. //
  140. // @struct GCK_LED_BEHAVIOUR_IN | Input structure from IOCTL_GCK_LED_BEHAVIOUR
  141. // This is a list of LEDs for the requested modifier state. If more than one modifier
  142. // is requested, only the lowest modifier state will report. Also not this is not the
  143. // actual state of the LEDs, but what would be the state if the requested modifier were pressed.
  144. //
  145. typedef struct tagGCK_LED_BEHAVIOUR_IN
  146. {
  147. ULONG ulLEDsOn; //@field Bit mask LEDs in the on state (does not include blinking)
  148. ULONG ulLEDsBlinking; //@field Bit mask of LEDs that are blinking (not reported as on)
  149. } GCK_LED_BEHAVIOUR_IN, *PGCK_LED_BEHAVIOUR_IN;
  150. // Trigger Type enums (non combinable!)
  151. typedef enum
  152. {
  153. GCK_TRIGGER_BUTTON = 0x00,
  154. GCK_TRIGGER_AXIS = 0x01, // Not currently availible
  155. } GCK_TRIGGER_TYPES;
  156. // Trigger SubType enums (non combinable!)
  157. typedef enum
  158. {
  159. TRIGGER_BUTTON_IMMEDIATE = 0x00,
  160. TRIGGER_ON_BUTTON_DOWN = 0x01,
  161. TRIGGER_ON_BUTTON_UP = 0x02,
  162. } GCK_TRIGGER_SUBTYPES;
  163. //
  164. // @struct GCK_TRIGGER_OUT | Output structure to IOCTL_GCK_TRIGGER
  165. // This IOCTL hangs untill the trigger happens (except for TRIGGER_IMMEDIATE)
  166. //
  167. typedef struct tagGCK_TRIGGER_OUT
  168. {
  169. ULONG ulHandle; //@field Handle returned from IOCTL_GCK_GET_HANDLE
  170. GCK_TRIGGER_TYPES ucTriggerType; //@field Type of trigger
  171. GCK_TRIGGER_SUBTYPES ucTriggerSubType; //@field Subtype of trigger
  172. ULONG ulTriggerInfo1; //@field Information for triggering (type dependant)
  173. ULONG ulTriggerInfo2; //@field Secondary info for triggering (type dependant)
  174. } GCK_TRIGGER_OUT, *PGCK_TRIGGER_OUT;
  175. /********************************************************
  176. * IOCTL's available in debug builds of the driver *
  177. *********************************************************/
  178. #define IOCTL_GCK_SET_MODULE_DBG_LEVEL GCK_IOCTL_CODE(0x1000)
  179. /********************************************************
  180. * Module IDs for setting DEBUG levels *
  181. *********************************************************/
  182. #define MODULE_GCK_CTRL_C 0x0001
  183. #define MODULE_GCK_CTRL_IOCTL_C 0x0002
  184. #define MODULE_GCK_FILTER_CPP 0x0004
  185. #define MODULE_GCK_FILTERHOOKS_CPP 0x0005
  186. #define MODULE_GCK_FLTR_C 0x0006
  187. #define MODULE_GCK_FLTR_PNP_C 0x0007
  188. #define MODULE_GCK_GCKSHELL_C 0x0008
  189. #define MODULE_GCK_REMLOCK_C 0x0009
  190. #define MODULE_GCK_SWVB_PNP_C 0x000A
  191. #define MODULE_GCK_SWVBENUM_C 0x000B
  192. #define MODULE_GCK_SWVKBD_C 0x000C
  193. #define MODULE_CIC_ACTIONS_CPP 0x1000
  194. #define MODULE_CIC_CONTROLITEMCOLLECTION_CPP 0x1001
  195. #define MODULE_CIC_CONTROLITEM_CPP 0x1002
  196. #define MODULE_CIC_DEVICEDESCRIPTIONS_CPP 0x1003
  197. #define MODULE_CIC_DUALMODE_CPP 0x1004
  198. //#define MODULE_CIC_DUMPCOMMANDBLOCK_CPP 0x1005
  199. #define MODULE_CIC_LISTASARRAY_CPP 0x1006
  200. #endif //__GckExtrn_h__