3 * @copy 2012 MinGW.org project
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
26 #pragma GCC system_header
30 * Structures and definitions for Keyboard/Mouse class and port drivers.
33 #include <ddk/ntddkbd.h>
34 #include <ddk/ntddmou.h>
36 #define DD_KEYBOARD_PORT_DEVICE_NAME "\\Device\\KeyboardPort"
37 #define DD_KEYBOARD_PORT_DEVICE_NAME_U L"\\Device\\KeyboardPort"
38 #define DD_KEYBOARD_PORT_BASE_NAME_U L"KeyboardPort"
39 #define DD_POINTER_PORT_DEVICE_NAME "\\Device\\PointerPort"
40 #define DD_POINTER_PORT_DEVICE_NAME_U L"\\Device\\PointerPort"
41 #define DD_POINTER_PORT_BASE_NAME_U L"PointerPort"
43 #define DD_KEYBOARD_CLASS_BASE_NAME_U L"KeyboardClass"
44 #define DD_POINTER_CLASS_BASE_NAME_U L"PointerClass"
46 #define DD_KEYBOARD_RESOURCE_CLASS_NAME_U L"Keyboard"
47 #define DD_POINTER_RESOURCE_CLASS_NAME_U L"Pointer"
48 #define DD_KEYBOARD_MOUSE_COMBO_RESOURCE_CLASS_NAME_U L"Keyboard/Pointer"
50 #define POINTER_PORTS_MAXIMUM 8
51 #define KEYBOARD_PORTS_MAXIMUM 8
53 #define KBDMOU_COULD_NOT_SEND_COMMAND 0x0000
54 #define KBDMOU_COULD_NOT_SEND_PARAM 0x0001
55 #define KBDMOU_NO_RESPONSE 0x0002
56 #define KBDMOU_INCORRECT_RESPONSE 0x0004
58 #define I8042_ERROR_VALUE_BASE 1000
59 #define INPORT_ERROR_VALUE_BASE 2000
60 #define SERIAL_MOUSE_ERROR_VALUE_BASE 3000
62 #define IOCTL_INTERNAL_KEYBOARD_CONNECT \
63 CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS)
65 #define IOCTL_INTERNAL_KEYBOARD_DISCONNECT \
66 CTL_CODE(FILE_DEVICE_KEYBOARD,0x0100, METHOD_NEITHER, FILE_ANY_ACCESS)
68 #define IOCTL_INTERNAL_KEYBOARD_ENABLE \
69 CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS)
71 #define IOCTL_INTERNAL_KEYBOARD_DISABLE \
72 CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS)
74 #define IOCTL_INTERNAL_MOUSE_CONNECT \
75 CTL_CODE(FILE_DEVICE_MOUSE, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS)
77 #define IOCTL_INTERNAL_MOUSE_DISCONNECT \
78 CTL_CODE(FILE_DEVICE_MOUSE, 0x0100, METHOD_NEITHER, FILE_ANY_ACCESS)
80 #define IOCTL_INTERNAL_MOUSE_ENABLE \
81 CTL_CODE(FILE_DEVICE_MOUSE, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS)
83 #define IOCTL_INTERNAL_MOUSE_DISABLE \
84 CTL_CODE(FILE_DEVICE_MOUSE, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS)
86 typedef struct _CONNECT_DATA {
87 PDEVICE_OBJECT ClassDeviceObject;
89 } CONNECT_DATA, *PCONNECT_DATA;
92 (STDAPICALLTYPE *PSERVICE_CALLBACK_ROUTINE)(
93 /*IN*/ PVOID NormalContext,
94 /*IN*/ PVOID SystemArgument1,
95 /*IN*/ PVOID SystemArgument2,
96 /*IN OUT*/ PVOID SystemArgument3);
98 #endif /* __KBDMOU_H */