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.

204 lines
5.3 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. kbdmou.h
  5. Abstract:
  6. These are the structures and defines that are used in the
  7. keyboard class driver, mouse class driver, and keyboard/mouse port
  8. driver.
  9. Author:
  10. lees
  11. Revision History:
  12. --*/
  13. #ifndef _KBDMOU_
  14. #define _KBDMOU_
  15. #include <ntddkbd.h>
  16. #include <ntddmou.h>
  17. //
  18. // Define the keyboard/mouse port device name strings.
  19. //
  20. #define DD_KEYBOARD_PORT_DEVICE_NAME "\\Device\\KeyboardPort"
  21. #define DD_KEYBOARD_PORT_DEVICE_NAME_U L"\\Device\\KeyboardPort"
  22. #define DD_KEYBOARD_PORT_BASE_NAME_U L"KeyboardPort"
  23. #define DD_POINTER_PORT_DEVICE_NAME "\\Device\\PointerPort"
  24. #define DD_POINTER_PORT_DEVICE_NAME_U L"\\Device\\PointerPort"
  25. #define DD_POINTER_PORT_BASE_NAME_U L"PointerPort"
  26. //
  27. // Define the keyboard/mouse class device name strings.
  28. //
  29. #define DD_KEYBOARD_CLASS_BASE_NAME_U L"KeyboardClass"
  30. #define DD_POINTER_CLASS_BASE_NAME_U L"PointerClass"
  31. //
  32. // Define the keyboard/mouse resource class names.
  33. //
  34. #define DD_KEYBOARD_RESOURCE_CLASS_NAME_U L"Keyboard"
  35. #define DD_POINTER_RESOURCE_CLASS_NAME_U L"Pointer"
  36. #define DD_KEYBOARD_MOUSE_COMBO_RESOURCE_CLASS_NAME_U L"Keyboard/Pointer"
  37. //
  38. // Define the maximum number of pointer/keyboard port names the port driver
  39. // will use in an attempt to IoCreateDevice.
  40. //
  41. #define POINTER_PORTS_MAXIMUM 8
  42. #define KEYBOARD_PORTS_MAXIMUM 8
  43. //
  44. // Define the port connection data structure.
  45. //
  46. typedef struct _CONNECT_DATA {
  47. IN PDEVICE_OBJECT ClassDeviceObject;
  48. IN PVOID ClassService;
  49. } CONNECT_DATA, *PCONNECT_DATA;
  50. //
  51. // Define the service callback routine's structure.
  52. //
  53. typedef
  54. VOID
  55. (*PSERVICE_CALLBACK_ROUTINE) (
  56. IN PVOID NormalContext,
  57. IN PVOID SystemArgument1,
  58. IN PVOID SystemArgument2,
  59. IN OUT PVOID SystemArgument3
  60. );
  61. //
  62. // WMI structures returned by port drivers
  63. //
  64. #define KEYBOARD_PORT_WMI_STD_DATA_GUID {0x4731F89A, 0x71CB, 0x11d1, 0xA5, 0x2C, 0x00, 0xA0, 0xC9, 0x06, 0x29, 0x10}
  65. typedef struct _KEYBOARD_PORT_WMI_STD_DATA {
  66. //
  67. // Connector types
  68. //
  69. #define KEYBOARD_PORT_WMI_STD_I8042 0
  70. #define KEYBOARD_PORT_WMI_STD_SERIAL 1
  71. #define KEYBOARD_PORT_WMI_STD_USB 2
  72. ULONG ConnectorType;
  73. //
  74. // Size of data queue (number of entries)
  75. //
  76. ULONG DataQueueSize;
  77. //
  78. // The error Count
  79. //
  80. ULONG ErrorCount;
  81. //
  82. // Number of Function keys on the device.
  83. //
  84. ULONG FunctionKeys;
  85. //
  86. // Number of Indicators on the device.
  87. //
  88. ULONG Indicators;
  89. } KEYBOARD_PORT_WMI_STD_DATA, * PKEYBOARD_PORT_WMI_STD_DATA;
  90. #define POINTER_PORT_WMI_STD_DATA_GUID {0x4731F89C, 0x71CB, 0x11d1, 0xA5, 0x2C, 0x00, 0xA0, 0xC9, 0x06, 0x29, 0x10}
  91. typedef struct _POINTER_PORT_WMI_STD_DATA {
  92. //
  93. // Connector types
  94. //
  95. #define POINTER_PORT_WMI_STD_I8042 0
  96. #define POINTER_PORT_WMI_STD_SERIAL 1
  97. #define POINTER_PORT_WMI_STD_USB 2
  98. ULONG ConnectorType;
  99. //
  100. // Size of data queue (number of entries)
  101. //
  102. ULONG DataQueueSize;
  103. //
  104. // The error Count
  105. //
  106. ULONG ErrorCount;
  107. //
  108. // Number of Buttons on the pointer device
  109. //
  110. ULONG Buttons;
  111. //
  112. // Hardware Types
  113. //
  114. #define POINTER_PORT_WMI_STD_MOUSE 0
  115. #define POINTER_PORT_WMI_STD_POINTER 1
  116. #define POINTER_PORT_WMI_ABSOLUTE_POINTER 2
  117. #define POINTER_PORT_WMI_TABLET 3
  118. #define POINTER_PORT_WMI_TOUCH_SCRENE 4
  119. #define POINTER_PORT_WMI_PEN 5
  120. #define POINTER_PORT_WMI_TRACK_BALL 6
  121. #define POINTER_PORT_WMI_OTHER 0x100
  122. ULONG HardwareType;
  123. } POINTER_PORT_WMI_STD_DATA, * PPOINTER_PORT_WMI_STD_DATA;
  124. //
  125. // NtDeviceIoControlFile internal IoControlCode values for keyboard device.
  126. //
  127. #define IOCTL_INTERNAL_KEYBOARD_CONNECT CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS)
  128. #define IOCTL_INTERNAL_KEYBOARD_DISCONNECT CTL_CODE(FILE_DEVICE_KEYBOARD,0x0100, METHOD_NEITHER, FILE_ANY_ACCESS)
  129. #define IOCTL_INTERNAL_KEYBOARD_ENABLE CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS)
  130. #define IOCTL_INTERNAL_KEYBOARD_DISABLE CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS)
  131. //
  132. // NtDeviceIoControlFile internal IoControlCode values for mouse device.
  133. //
  134. #define IOCTL_INTERNAL_MOUSE_CONNECT CTL_CODE(FILE_DEVICE_MOUSE, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS)
  135. #define IOCTL_INTERNAL_MOUSE_DISCONNECT CTL_CODE(FILE_DEVICE_MOUSE, 0x0100, METHOD_NEITHER, FILE_ANY_ACCESS)
  136. #define IOCTL_INTERNAL_MOUSE_ENABLE CTL_CODE(FILE_DEVICE_MOUSE, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS)
  137. #define IOCTL_INTERNAL_MOUSE_DISABLE CTL_CODE(FILE_DEVICE_MOUSE, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS)
  138. //
  139. // Error log definitions (specific to the keyboard/mouse) for DumpData[0]
  140. // in the IO_ERROR_LOG_PACKET.
  141. //
  142. // DumpData[1] <= hardware port/register
  143. // DumpData[2] <= {command byte || expected response byte}
  144. // DumpData[3] <= {command's parameter byte || actual response byte}
  145. //
  146. //
  147. #define KBDMOU_COULD_NOT_SEND_COMMAND 0x0000
  148. #define KBDMOU_COULD_NOT_SEND_PARAM 0x0001
  149. #define KBDMOU_NO_RESPONSE 0x0002
  150. #define KBDMOU_INCORRECT_RESPONSE 0x0004
  151. //
  152. // Define the base values for the error log packet's UniqueErrorValue field.
  153. //
  154. #define I8042_ERROR_VALUE_BASE 1000
  155. #define INPORT_ERROR_VALUE_BASE 2000
  156. #define SERIAL_MOUSE_ERROR_VALUE_BASE 3000
  157. #endif // _KBDMOU_