OSDN Git Service

Insert removed author attribution.
[mingw/mingw-org-wsl.git] / include / ddk / kbdmou.h
1 /**
2  * @file kbdmou.h
3  * @copy 2012 MinGW.org project
4  *
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:
11  * 
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
14  * Software.
15  * 
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.
23  */
24 /* Created by Casper S. Hornstrup <chorns@users.sourceforge.net> */
25 #ifndef __KBDMOU_H
26 #define __KBDMOU_H
27 #pragma GCC system_header
28 #include <_mingw.h>
29
30 /*
31  * Structures and definitions for Keyboard/Mouse class and port drivers.
32  */
33
34 #include <ddk/ntddkbd.h>
35 #include <ddk/ntddmou.h>
36
37 #define DD_KEYBOARD_PORT_DEVICE_NAME      "\\Device\\KeyboardPort"
38 #define DD_KEYBOARD_PORT_DEVICE_NAME_U    L"\\Device\\KeyboardPort"
39 #define DD_KEYBOARD_PORT_BASE_NAME_U      L"KeyboardPort"
40 #define DD_POINTER_PORT_DEVICE_NAME       "\\Device\\PointerPort"
41 #define DD_POINTER_PORT_DEVICE_NAME_U     L"\\Device\\PointerPort"
42 #define DD_POINTER_PORT_BASE_NAME_U       L"PointerPort"
43
44 #define DD_KEYBOARD_CLASS_BASE_NAME_U     L"KeyboardClass"
45 #define DD_POINTER_CLASS_BASE_NAME_U      L"PointerClass"
46
47 #define DD_KEYBOARD_RESOURCE_CLASS_NAME_U             L"Keyboard"
48 #define DD_POINTER_RESOURCE_CLASS_NAME_U              L"Pointer"
49 #define DD_KEYBOARD_MOUSE_COMBO_RESOURCE_CLASS_NAME_U L"Keyboard/Pointer"
50
51 #define POINTER_PORTS_MAXIMUM             8
52 #define KEYBOARD_PORTS_MAXIMUM            8
53
54 #define KBDMOU_COULD_NOT_SEND_COMMAND     0x0000
55 #define KBDMOU_COULD_NOT_SEND_PARAM       0x0001
56 #define KBDMOU_NO_RESPONSE                0x0002
57 #define KBDMOU_INCORRECT_RESPONSE         0x0004
58
59 #define I8042_ERROR_VALUE_BASE            1000
60 #define INPORT_ERROR_VALUE_BASE           2000
61 #define SERIAL_MOUSE_ERROR_VALUE_BASE     3000
62
63 #define IOCTL_INTERNAL_KEYBOARD_CONNECT \
64   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS)
65
66 #define IOCTL_INTERNAL_KEYBOARD_DISCONNECT \
67   CTL_CODE(FILE_DEVICE_KEYBOARD,0x0100, METHOD_NEITHER, FILE_ANY_ACCESS)
68
69 #define IOCTL_INTERNAL_KEYBOARD_ENABLE \
70   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS)
71
72 #define IOCTL_INTERNAL_KEYBOARD_DISABLE \
73   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS)
74
75 #define IOCTL_INTERNAL_MOUSE_CONNECT \
76   CTL_CODE(FILE_DEVICE_MOUSE, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS)
77
78 #define IOCTL_INTERNAL_MOUSE_DISCONNECT \
79   CTL_CODE(FILE_DEVICE_MOUSE, 0x0100, METHOD_NEITHER, FILE_ANY_ACCESS)
80
81 #define IOCTL_INTERNAL_MOUSE_ENABLE \
82   CTL_CODE(FILE_DEVICE_MOUSE, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS)
83
84 #define IOCTL_INTERNAL_MOUSE_DISABLE \
85   CTL_CODE(FILE_DEVICE_MOUSE, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS)
86
87 typedef struct _CONNECT_DATA {
88         PDEVICE_OBJECT  ClassDeviceObject;
89         PVOID  ClassService;
90 } CONNECT_DATA, *PCONNECT_DATA;
91
92 typedef VOID
93 (STDAPICALLTYPE *PSERVICE_CALLBACK_ROUTINE)(
94   /*IN*/ PVOID NormalContext,
95   /*IN*/ PVOID SystemArgument1,
96   /*IN*/ PVOID SystemArgument2,
97   /*IN OUT*/ PVOID SystemArgument3);
98
99 #endif /* __KBDMOU_H */