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