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.

242 lines
5.7 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ntddmou.h
  5. Abstract:
  6. This is the include file that defines all constants and types for
  7. accessing the mouse device.
  8. Author:
  9. Lee A. Smith (lees) 02-Aug-1991.
  10. Revision History:
  11. --*/
  12. #ifndef _NTDDMOU_
  13. #define _NTDDMOU_
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. //
  21. // Device Name - this string is the name of the device. It is the name
  22. // that should be passed to NtOpenFile when accessing the device.
  23. //
  24. // Note: For devices that support multiple units, it should be suffixed
  25. // with the Ascii representation of the unit number.
  26. //
  27. #define DD_MOUSE_DEVICE_NAME "\\Device\\PointerClass"
  28. #define DD_MOUSE_DEVICE_NAME_U L"\\Device\\PointerClass"
  29. //
  30. // NtDeviceIoControlFile IoControlCode values for this device.
  31. //
  32. // Warning: Remember that the low two bits of the code specify how the
  33. // buffers are passed to the driver!
  34. //
  35. #define IOCTL_MOUSE_QUERY_ATTRIBUTES CTL_CODE(FILE_DEVICE_MOUSE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
  36. #define IOCTL_MOUSE_INSERT_DATA CTL_CODE(FILE_DEVICE_MOUSE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
  37. //
  38. // Declare the GUID that represents the device interface for mice.
  39. //
  40. #ifndef FAR
  41. #define FAR
  42. #endif
  43. DEFINE_GUID( GUID_DEVINTERFACE_MOUSE, 0x378de44c, 0x56ef, 0x11d1,
  44. 0xbc, 0x8c, 0x00, 0xa0, 0xc9, 0x14, 0x05, 0xdd );
  45. //
  46. // Obsolete device interface class GUID name.
  47. // (use of above GUID_DEVINTERFACE_* name is recommended).
  48. //
  49. #define GUID_CLASS_MOUSE GUID_DEVINTERFACE_MOUSE
  50. //
  51. // NtReadFile Output Buffer record structures for this device.
  52. //
  53. typedef struct _MOUSE_INPUT_DATA {
  54. //
  55. // Unit number. E.g., for \Device\PointerPort0 the unit is '0',
  56. // for \Device\PointerPort1 the unit is '1', and so on.
  57. //
  58. USHORT UnitId;
  59. //
  60. // Indicator flags.
  61. //
  62. USHORT Flags;
  63. //
  64. // The transition state of the mouse buttons.
  65. //
  66. union {
  67. ULONG Buttons;
  68. struct {
  69. USHORT ButtonFlags;
  70. USHORT ButtonData;
  71. };
  72. };
  73. //
  74. // The raw state of the mouse buttons.
  75. //
  76. ULONG RawButtons;
  77. //
  78. // The signed relative or absolute motion in the X direction.
  79. //
  80. LONG LastX;
  81. //
  82. // The signed relative or absolute motion in the Y direction.
  83. //
  84. LONG LastY;
  85. //
  86. // Device-specific additional information for the event.
  87. //
  88. ULONG ExtraInformation;
  89. } MOUSE_INPUT_DATA, *PMOUSE_INPUT_DATA;
  90. //
  91. // Define the mouse button state indicators.
  92. //
  93. #define MOUSE_LEFT_BUTTON_DOWN 0x0001 // Left Button changed to down.
  94. #define MOUSE_LEFT_BUTTON_UP 0x0002 // Left Button changed to up.
  95. #define MOUSE_RIGHT_BUTTON_DOWN 0x0004 // Right Button changed to down.
  96. #define MOUSE_RIGHT_BUTTON_UP 0x0008 // Right Button changed to up.
  97. #define MOUSE_MIDDLE_BUTTON_DOWN 0x0010 // Middle Button changed to down.
  98. #define MOUSE_MIDDLE_BUTTON_UP 0x0020 // Middle Button changed to up.
  99. #define MOUSE_BUTTON_1_DOWN MOUSE_LEFT_BUTTON_DOWN
  100. #define MOUSE_BUTTON_1_UP MOUSE_LEFT_BUTTON_UP
  101. #define MOUSE_BUTTON_2_DOWN MOUSE_RIGHT_BUTTON_DOWN
  102. #define MOUSE_BUTTON_2_UP MOUSE_RIGHT_BUTTON_UP
  103. #define MOUSE_BUTTON_3_DOWN MOUSE_MIDDLE_BUTTON_DOWN
  104. #define MOUSE_BUTTON_3_UP MOUSE_MIDDLE_BUTTON_UP
  105. #define MOUSE_BUTTON_4_DOWN 0x0040
  106. #define MOUSE_BUTTON_4_UP 0x0080
  107. #define MOUSE_BUTTON_5_DOWN 0x0100
  108. #define MOUSE_BUTTON_5_UP 0x0200
  109. #define MOUSE_WHEEL 0x0400
  110. //
  111. // Define the mouse indicator flags.
  112. //
  113. #define MOUSE_MOVE_RELATIVE 0
  114. #define MOUSE_MOVE_ABSOLUTE 1
  115. #define MOUSE_VIRTUAL_DESKTOP 0x02 // the coordinates are mapped to the virtual desktop
  116. #define MOUSE_ATTRIBUTES_CHANGED 0x04 // requery for mouse attributes
  117. #define MOUSE_TERMSRV_SRC_SHADOW 0x100
  118. //
  119. // NtDeviceIoControlFile OutputBuffer record structures for
  120. // IOCTL_MOUSE_QUERY_ATTRIBUTES.
  121. //
  122. typedef struct _MOUSE_ATTRIBUTES {
  123. //
  124. // Mouse ID value. Used to distinguish between mouse types.
  125. //
  126. USHORT MouseIdentifier;
  127. //
  128. // Number of buttons located on the mouse.
  129. //
  130. USHORT NumberOfButtons;
  131. //
  132. // Specifies the rate at which the hardware reports mouse input
  133. // (reports per second). This may not be applicable for every mouse device.
  134. //
  135. USHORT SampleRate;
  136. //
  137. // Length of the readahead buffer, in bytes.
  138. //
  139. ULONG InputDataQueueLength;
  140. } MOUSE_ATTRIBUTES, *PMOUSE_ATTRIBUTES;
  141. //
  142. // Define the mouse identifier types.
  143. //
  144. #define MOUSE_INPORT_HARDWARE 0x0001
  145. #define MOUSE_I8042_HARDWARE 0x0002
  146. #define MOUSE_SERIAL_HARDWARE 0x0004
  147. #define BALLPOINT_I8042_HARDWARE 0x0008
  148. #define BALLPOINT_SERIAL_HARDWARE 0x0010
  149. #define WHEELMOUSE_I8042_HARDWARE 0x0020
  150. #define WHEELMOUSE_SERIAL_HARDWARE 0x0040
  151. #define MOUSE_HID_HARDWARE 0x0080
  152. #define WHEELMOUSE_HID_HARDWARE 0x0100
  153. //
  154. // Generic NtDeviceIoControlFile Input Buffer record structure for
  155. // various mouse IOCTLs.
  156. //
  157. typedef struct _MOUSE_UNIT_ID_PARAMETER {
  158. //
  159. // Unit identifier. Specifies the device unit for which this
  160. // request is intended.
  161. //
  162. USHORT UnitId;
  163. } MOUSE_UNIT_ID_PARAMETER, *PMOUSE_UNIT_ID_PARAMETER;
  164. //
  165. // Define the base values for the mouse error log packet's
  166. // UniqueErrorValue field.
  167. //
  168. #define MOUSE_ERROR_VALUE_BASE 20000
  169. #ifdef __cplusplus
  170. }
  171. #endif
  172. #endif // _NTDDMOU_