xref: /reactos/sdk/include/ddk/kbdmou.h (revision c2c66aff)
1*c2c66affSColin Finck /*
2*c2c66affSColin Finck  * kbdmou.h
3*c2c66affSColin Finck  *
4*c2c66affSColin Finck  * Structures and definitions for Keyboard/Mouse class and port drivers.
5*c2c66affSColin Finck  *
6*c2c66affSColin Finck  * This file is part of the w32api package.
7*c2c66affSColin Finck  *
8*c2c66affSColin Finck  * Contributors:
9*c2c66affSColin Finck  *   Created by Filip Navara <xnavara@volny.cz>
10*c2c66affSColin Finck  *
11*c2c66affSColin Finck  * THIS SOFTWARE IS NOT COPYRIGHTED
12*c2c66affSColin Finck  *
13*c2c66affSColin Finck  * This source code is offered for use in the public domain. You may
14*c2c66affSColin Finck  * use, modify or distribute it freely.
15*c2c66affSColin Finck  *
16*c2c66affSColin Finck  * This code is distributed in the hope that it will be useful but
17*c2c66affSColin Finck  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18*c2c66affSColin Finck  * DISCLAIMED. This includes but is not limited to warranties of
19*c2c66affSColin Finck  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20*c2c66affSColin Finck  *
21*c2c66affSColin Finck  */
22*c2c66affSColin Finck 
23*c2c66affSColin Finck #pragma once
24*c2c66affSColin Finck 
25*c2c66affSColin Finck #define _KBDMOU_
26*c2c66affSColin Finck 
27*c2c66affSColin Finck #include <ntddkbd.h>
28*c2c66affSColin Finck #include <ntddmou.h>
29*c2c66affSColin Finck 
30*c2c66affSColin Finck #define DD_KEYBOARD_PORT_DEVICE_NAME      "\\Device\\KeyboardPort"
31*c2c66affSColin Finck #define DD_KEYBOARD_PORT_DEVICE_NAME_U    L"\\Device\\KeyboardPort"
32*c2c66affSColin Finck #define DD_KEYBOARD_PORT_BASE_NAME_U      L"KeyboardPort"
33*c2c66affSColin Finck #define DD_POINTER_PORT_DEVICE_NAME       "\\Device\\PointerPort"
34*c2c66affSColin Finck #define DD_POINTER_PORT_DEVICE_NAME_U     L"\\Device\\PointerPort"
35*c2c66affSColin Finck #define DD_POINTER_PORT_BASE_NAME_U       L"PointerPort"
36*c2c66affSColin Finck 
37*c2c66affSColin Finck #define DD_KEYBOARD_CLASS_BASE_NAME_U     L"KeyboardClass"
38*c2c66affSColin Finck #define DD_POINTER_CLASS_BASE_NAME_U      L"PointerClass"
39*c2c66affSColin Finck 
40*c2c66affSColin Finck #define DD_KEYBOARD_RESOURCE_CLASS_NAME_U             L"Keyboard"
41*c2c66affSColin Finck #define DD_POINTER_RESOURCE_CLASS_NAME_U              L"Pointer"
42*c2c66affSColin Finck #define DD_KEYBOARD_MOUSE_COMBO_RESOURCE_CLASS_NAME_U L"Keyboard/Pointer"
43*c2c66affSColin Finck 
44*c2c66affSColin Finck #define POINTER_PORTS_MAXIMUM             8
45*c2c66affSColin Finck #define KEYBOARD_PORTS_MAXIMUM            8
46*c2c66affSColin Finck 
47*c2c66affSColin Finck #define KBDMOU_COULD_NOT_SEND_COMMAND     0x0000
48*c2c66affSColin Finck #define KBDMOU_COULD_NOT_SEND_PARAM       0x0001
49*c2c66affSColin Finck #define KBDMOU_NO_RESPONSE                0x0002
50*c2c66affSColin Finck #define KBDMOU_INCORRECT_RESPONSE         0x0004
51*c2c66affSColin Finck 
52*c2c66affSColin Finck #define I8042_ERROR_VALUE_BASE            1000
53*c2c66affSColin Finck #define INPORT_ERROR_VALUE_BASE           2000
54*c2c66affSColin Finck #define SERIAL_MOUSE_ERROR_VALUE_BASE     3000
55*c2c66affSColin Finck 
56*c2c66affSColin Finck #define IOCTL_INTERNAL_KEYBOARD_CONNECT \
57*c2c66affSColin Finck   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS)
58*c2c66affSColin Finck 
59*c2c66affSColin Finck #define IOCTL_INTERNAL_KEYBOARD_DISCONNECT \
60*c2c66affSColin Finck   CTL_CODE(FILE_DEVICE_KEYBOARD,0x0100, METHOD_NEITHER, FILE_ANY_ACCESS)
61*c2c66affSColin Finck 
62*c2c66affSColin Finck #define IOCTL_INTERNAL_KEYBOARD_ENABLE \
63*c2c66affSColin Finck   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS)
64*c2c66affSColin Finck 
65*c2c66affSColin Finck #define IOCTL_INTERNAL_KEYBOARD_DISABLE \
66*c2c66affSColin Finck   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS)
67*c2c66affSColin Finck 
68*c2c66affSColin Finck #define IOCTL_INTERNAL_MOUSE_CONNECT \
69*c2c66affSColin Finck   CTL_CODE(FILE_DEVICE_MOUSE, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS)
70*c2c66affSColin Finck 
71*c2c66affSColin Finck #define IOCTL_INTERNAL_MOUSE_DISCONNECT \
72*c2c66affSColin Finck   CTL_CODE(FILE_DEVICE_MOUSE, 0x0100, METHOD_NEITHER, FILE_ANY_ACCESS)
73*c2c66affSColin Finck 
74*c2c66affSColin Finck #define IOCTL_INTERNAL_MOUSE_ENABLE \
75*c2c66affSColin Finck   CTL_CODE(FILE_DEVICE_MOUSE, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS)
76*c2c66affSColin Finck 
77*c2c66affSColin Finck #define IOCTL_INTERNAL_MOUSE_DISABLE \
78*c2c66affSColin Finck   CTL_CODE(FILE_DEVICE_MOUSE, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS)
79*c2c66affSColin Finck 
80*c2c66affSColin Finck typedef struct _CONNECT_DATA {
81*c2c66affSColin Finck   PDEVICE_OBJECT ClassDeviceObject;
82*c2c66affSColin Finck   PVOID ClassService;
83*c2c66affSColin Finck } CONNECT_DATA, *PCONNECT_DATA;
84*c2c66affSColin Finck 
85*c2c66affSColin Finck typedef VOID
86*c2c66affSColin Finck (STDAPICALLTYPE *PSERVICE_CALLBACK_ROUTINE)(
87*c2c66affSColin Finck   IN PVOID NormalContext,
88*c2c66affSColin Finck   IN PVOID SystemArgument1,
89*c2c66affSColin Finck   IN PVOID SystemArgument2,
90*c2c66affSColin Finck   IN OUT PVOID SystemArgument3);
91*c2c66affSColin Finck 
92*c2c66affSColin Finck #include <wmidata.h>
93