ReactOS  0.4.14-dev-50-g13bb5e2
ntdd8042.h
Go to the documentation of this file.
1 /*
2  * ntdd8042.h
3  *
4  * i8042 IOCTL interface.
5  *
6  * This file is part of the w32api package.
7  *
8  * Contributors:
9  * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10  *
11  * THIS SOFTWARE IS NOT COPYRIGHTED
12  *
13  * This source code is offered for use in the public domain. You may
14  * use, modify or distribute it freely.
15  *
16  * This code is distributed in the hope that it will be useful but
17  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18  * DISCLAIMED. This includes but is not limited to warranties of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20  *
21  */
22 
23 #ifndef _NTDD8042_
24 #define _NTDD8042_
25 
26 #include "ntddkbd.h"
27 #include "ntddmou.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #define IOCTL_INTERNAL_I8042_CONTROLLER_WRITE_BUFFER \
34  CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0FF2, METHOD_NEITHER, FILE_ANY_ACCESS)
35 
36 #define IOCTL_INTERNAL_I8042_HOOK_KEYBOARD \
37  CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0FF0, METHOD_NEITHER, FILE_ANY_ACCESS)
38 
39 #define IOCTL_INTERNAL_I8042_KEYBOARD_START_INFORMATION \
40  CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0FF3, METHOD_NEITHER, FILE_ANY_ACCESS)
41 
42 #define IOCTL_INTERNAL_I8042_KEYBOARD_WRITE_BUFFER \
43  CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0FF1, METHOD_NEITHER, FILE_ANY_ACCESS)
44 
45 #define IOCTL_INTERNAL_I8042_HOOK_MOUSE \
46  CTL_CODE(FILE_DEVICE_MOUSE, 0x0FF0, METHOD_NEITHER, FILE_ANY_ACCESS)
47 
48 #define IOCTL_INTERNAL_I8042_MOUSE_START_INFORMATION \
49  CTL_CODE(FILE_DEVICE_MOUSE, 0x0FF3, METHOD_NEITHER, FILE_ANY_ACCESS)
50 
51 #define IOCTL_INTERNAL_I8042_MOUSE_WRITE_BUFFER \
52  CTL_CODE(FILE_DEVICE_MOUSE, 0x0FF1, METHOD_NEITHER, FILE_ANY_ACCESS)
53 
54 #define I8042_POWER_SYS_BUTTON 0x0001
55 #define I8042_SLEEP_SYS_BUTTON 0x0002
56 #define I8042_WAKE_SYS_BUTTON 0x0004
57 #define I8042_SYS_BUTTONS (I8042_POWER_SYS_BUTTON | \
58  I8042_SLEEP_SYS_BUTTON | \
59  I8042_WAKE_SYS_BUTTON)
60 
61 typedef enum _TRANSMIT_STATE {
62  Idle = 0,
65 
66 typedef struct _OUTPUT_PACKET {
72 
73 typedef enum _KEYBOARD_SCAN_STATE {
78 
79 typedef enum _MOUSE_STATE {
87 
88 typedef enum _MOUSE_RESET_SUBSTATE {
129 
135 
136 typedef VOID
138  IN PVOID Context,
139  IN UCHAR Value);
140 
141 typedef VOID
143  IN PVOID Context);
144 
145 typedef NTSTATUS
147  IN PVOID Context,
148  OUT PUCHAR Value,
149  IN BOOLEAN WaitForACK);
150 
151 typedef NTSTATUS
153  IN PVOID Context,
154  IN UCHAR Value,
155  IN BOOLEAN WaitForACK);
156 
157 
158 typedef NTSTATUS
160  IN PVOID InitializationContext,
161  IN PVOID SynchFuncContext,
164  OUT PBOOLEAN TurnTranslationOn);
165 
166 typedef BOOLEAN
168  PVOID IsrContext,
169  PKEYBOARD_INPUT_DATA CurrentInput,
170  POUTPUT_PACKET CurrentOutput,
171  UCHAR StatusByte,
172  PUCHAR Byte,
173  PBOOLEAN ContinueProcessing,
174  PKEYBOARD_SCAN_STATE ScanState);
175 
184 
185 typedef BOOLEAN
187  PVOID IsrContext,
188  PMOUSE_INPUT_DATA CurrentInput,
189  POUTPUT_PACKET CurrentOutput,
190  UCHAR StatusByte,
191  PUCHAR Byte,
192  PBOOLEAN ContinueProcessing,
193  PMOUSE_STATE MouseState,
194  PMOUSE_RESET_SUBSTATE ResetSubState);
195 
203 
204 #ifdef __cplusplus
205 }
206 #endif
207 
208 #endif /* _NTDD8042_ */
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
#define IN
Definition: typedefs.h:38
IN PI8042_ISR_WRITE_PORT IsrWritePort
Definition: ntdd8042.h:180
unsigned char Byte
Definition: zconf.h:391
struct _INTERNAL_I8042_START_INFORMATION * PINTERNAL_I8042_START_INFORMATION
unsigned char * PUCHAR
Definition: retypes.h:3
BOOL WINAPI ReadPort(_In_ HANDLE hPort, _Out_writes_bytes_(cbBuffer) LPBYTE pBuffer, _In_ DWORD cbBuffer, _Out_ LPDWORD pcbRead)
enum _MOUSE_STATE MOUSE_STATE
struct _INTERNAL_I8042_HOOK_KEYBOARD * PINTERNAL_I8042_HOOK_KEYBOARD
struct _INTERNAL_I8042_HOOK_KEYBOARD INTERNAL_I8042_HOOK_KEYBOARD
VOID(NTAPI * PI8042_ISR_WRITE_PORT)(IN PVOID Context, IN UCHAR Value)
Definition: ntdd8042.h:137
VOID(NTAPI * PI8042_QUEUE_PACKET)(IN PVOID Context)
Definition: ntdd8042.h:142
struct _INTERNAL_I8042_START_INFORMATION INTERNAL_I8042_START_INFORMATION
OUT PI8042_KEYBOARD_ISR IsrRoutine
Definition: ntdd8042.h:179
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
Definition: ntdd8042.h:75
enum _MOUSE_STATE * PMOUSE_STATE
enum _MOUSE_RESET_SUBSTATE * PMOUSE_RESET_SUBSTATE
unsigned char BOOLEAN
ULONG CurrentByte
Definition: ntdd8042.h:68
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
Definition: ntdd8042.h:62
TRANSMIT_STATE State
Definition: ntdd8042.h:70
PUCHAR Bytes
Definition: ntdd8042.h:67
_MOUSE_RESET_SUBSTATE
Definition: ntdd8042.h:88
enum _MOUSE_RESET_SUBSTATE MOUSE_RESET_SUBSTATE
_TRANSMIT_STATE
Definition: ntdd8042.h:61
NTSTATUS(NTAPI * PI8042_KEYBOARD_INITIALIZATION_ROUTINE)(IN PVOID InitializationContext, IN PVOID SynchFuncContext, IN PI8042_SYNCH_READ_PORT ReadPort, IN PI8042_SYNCH_WRITE_PORT WritePort, OUT PBOOLEAN TurnTranslationOn)
Definition: ntdd8042.h:159
_MOUSE_STATE
Definition: ntdd8042.h:79
unsigned char UCHAR
Definition: xmlstorage.h:181
char * PBOOLEAN
Definition: retypes.h:11
#define NTSTATUS
Definition: precomp.h:20
#define VOID
Definition: acefi.h:82
IN PI8042_QUEUE_PACKET QueueKeyboardPacket
Definition: ntdd8042.h:181
BOOLEAN(NTAPI * PI8042_MOUSE_ISR)(PVOID IsrContext, PMOUSE_INPUT_DATA CurrentInput, POUTPUT_PACKET CurrentOutput, UCHAR StatusByte, PUCHAR Byte, PBOOLEAN ContinueProcessing, PMOUSE_STATE MouseState, PMOUSE_RESET_SUBSTATE ResetSubState)
Definition: ntdd8042.h:186
Definition: ntdd8042.h:76
enum _KEYBOARD_SCAN_STATE KEYBOARD_SCAN_STATE
NTSTATUS(NTAPI * PI8042_SYNCH_READ_PORT)(IN PVOID Context, OUT PUCHAR Value, IN BOOLEAN WaitForACK)
Definition: ntdd8042.h:146
enum _TRANSMIT_STATE TRANSMIT_STATE
struct _OUTPUT_PACKET OUTPUT_PACKET
BOOL WINAPI WritePort(_In_ HANDLE hPort, _In_reads_bytes_(cbBuf) LPBYTE pBuffer, _In_ DWORD cbBuf, _Out_ LPDWORD pcbWritten)
OUT PI8042_MOUSE_ISR IsrRoutine
Definition: ntdd8042.h:198
#define BOOLEAN
Definition: pedump.c:73
#define OUT
Definition: typedefs.h:39
struct tagContext Context
Definition: acpixf.h:1024
unsigned int ULONG
Definition: retypes.h:1
_KEYBOARD_SCAN_STATE
Definition: ntdd8042.h:73
NTSTATUS(NTAPI * PI8042_SYNCH_WRITE_PORT)(IN PVOID Context, IN UCHAR Value, IN BOOLEAN WaitForACK)
Definition: ntdd8042.h:152
enum _KEYBOARD_SCAN_STATE * PKEYBOARD_SCAN_STATE
BOOLEAN(NTAPI * PI8042_KEYBOARD_ISR)(PVOID IsrContext, PKEYBOARD_INPUT_DATA CurrentInput, POUTPUT_PACKET CurrentOutput, UCHAR StatusByte, PUCHAR Byte, PBOOLEAN ContinueProcessing, PKEYBOARD_SCAN_STATE ScanState)
Definition: ntdd8042.h:167
struct _INTERNAL_I8042_HOOK_MOUSE INTERNAL_I8042_HOOK_MOUSE
IN PI8042_QUEUE_PACKET QueueMousePacket
Definition: ntdd8042.h:200
OUT PI8042_KEYBOARD_INITIALIZATION_ROUTINE InitializationRoutine
Definition: ntdd8042.h:178
ULONG ByteCount
Definition: ntdd8042.h:69
struct _INTERNAL_I8042_HOOK_MOUSE * PINTERNAL_I8042_HOOK_MOUSE
struct _OUTPUT_PACKET * POUTPUT_PACKET
IN PI8042_ISR_WRITE_PORT IsrWritePort
Definition: ntdd8042.h:199