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.

133 lines
3.7 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. #include <wmidata.h>
  65. //
  66. // NtDeviceIoControlFile internal IoControlCode values for keyboard device.
  67. //
  68. #define IOCTL_INTERNAL_KEYBOARD_CONNECT CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS)
  69. #define IOCTL_INTERNAL_KEYBOARD_DISCONNECT CTL_CODE(FILE_DEVICE_KEYBOARD,0x0100, METHOD_NEITHER, FILE_ANY_ACCESS)
  70. #define IOCTL_INTERNAL_KEYBOARD_ENABLE CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS)
  71. #define IOCTL_INTERNAL_KEYBOARD_DISABLE CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS)
  72. //
  73. // NtDeviceIoControlFile internal IoControlCode values for mouse device.
  74. //
  75. #define IOCTL_INTERNAL_MOUSE_CONNECT CTL_CODE(FILE_DEVICE_MOUSE, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS)
  76. #define IOCTL_INTERNAL_MOUSE_DISCONNECT CTL_CODE(FILE_DEVICE_MOUSE, 0x0100, METHOD_NEITHER, FILE_ANY_ACCESS)
  77. #define IOCTL_INTERNAL_MOUSE_ENABLE CTL_CODE(FILE_DEVICE_MOUSE, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS)
  78. #define IOCTL_INTERNAL_MOUSE_DISABLE CTL_CODE(FILE_DEVICE_MOUSE, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS)
  79. //
  80. // Error log definitions (specific to the keyboard/mouse) for DumpData[0]
  81. // in the IO_ERROR_LOG_PACKET.
  82. //
  83. // DumpData[1] <= hardware port/register
  84. // DumpData[2] <= {command byte || expected response byte}
  85. // DumpData[3] <= {command's parameter byte || actual response byte}
  86. //
  87. //
  88. #define KBDMOU_COULD_NOT_SEND_COMMAND 0x0000
  89. #define KBDMOU_COULD_NOT_SEND_PARAM 0x0001
  90. #define KBDMOU_NO_RESPONSE 0x0002
  91. #define KBDMOU_INCORRECT_RESPONSE 0x0004
  92. //
  93. // Define the base values for the error log packet's UniqueErrorValue field.
  94. //
  95. #define I8042_ERROR_VALUE_BASE 1000
  96. #define INPORT_ERROR_VALUE_BASE 2000
  97. #define SERIAL_MOUSE_ERROR_VALUE_BASE 3000
  98. #endif // _KBDMOU_