ReactOS 0.4.16-dev-122-g325d74c
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
30extern "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
61typedef enum _TRANSMIT_STATE {
62 Idle = 0,
65
66typedef struct _OUTPUT_PACKET {
72
76 GotE1
78
79typedef enum _MOUSE_STATE {
87
129
135
136typedef VOID
139 IN UCHAR Value);
140
141typedef VOID
144
145typedef NTSTATUS
149 IN BOOLEAN WaitForACK);
150
151typedef NTSTATUS
154 IN UCHAR Value,
155 IN BOOLEAN WaitForACK);
156
157
158typedef NTSTATUS
160 IN PVOID InitializationContext,
161 IN PVOID SynchFuncContext,
164 OUT PBOOLEAN TurnTranslationOn);
165
166typedef 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
185typedef 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_ */
unsigned char BOOLEAN
#define VOID
Definition: acefi.h:82
#define NTSTATUS
Definition: precomp.h:21
unsigned char Byte
Definition: zlib.h:37
NTSTATUS(NTAPI * PI8042_SYNCH_WRITE_PORT)(IN PVOID Context, IN UCHAR Value, IN BOOLEAN WaitForACK)
Definition: ntdd8042.h:152
enum _MOUSE_STATE * PMOUSE_STATE
enum _MOUSE_RESET_SUBSTATE MOUSE_RESET_SUBSTATE
NTSTATUS(NTAPI * PI8042_SYNCH_READ_PORT)(IN PVOID Context, OUT PUCHAR Value, IN BOOLEAN WaitForACK)
Definition: ntdd8042.h:146
struct _INTERNAL_I8042_HOOK_KEYBOARD * PINTERNAL_I8042_HOOK_KEYBOARD
_KEYBOARD_SCAN_STATE
Definition: ntdd8042.h:73
@ GotE0
Definition: ntdd8042.h:75
@ Normal
Definition: ntdd8042.h:74
@ GotE1
Definition: ntdd8042.h:76
enum _MOUSE_STATE MOUSE_STATE
struct _INTERNAL_I8042_HOOK_KEYBOARD INTERNAL_I8042_HOOK_KEYBOARD
struct _INTERNAL_I8042_HOOK_MOUSE INTERNAL_I8042_HOOK_MOUSE
VOID(NTAPI * PI8042_ISR_WRITE_PORT)(IN PVOID Context, IN UCHAR Value)
Definition: ntdd8042.h:137
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
enum _MOUSE_RESET_SUBSTATE * PMOUSE_RESET_SUBSTATE
_MOUSE_STATE
Definition: ntdd8042.h:79
@ MouseResetting
Definition: ntdd8042.h:85
@ XMovement
Definition: ntdd8042.h:81
@ YMovement
Definition: ntdd8042.h:82
@ MouseExpectingACK
Definition: ntdd8042.h:84
@ ZMovement
Definition: ntdd8042.h:83
@ MouseIdle
Definition: ntdd8042.h:80
enum _TRANSMIT_STATE TRANSMIT_STATE
enum _KEYBOARD_SCAN_STATE KEYBOARD_SCAN_STATE
_MOUSE_RESET_SUBSTATE
Definition: ntdd8042.h:88
@ ExpectingGetDeviceIdDetectACK
Definition: ntdd8042.h:123
@ ExpectingPnpIdByte6
Definition: ntdd8042.h:112
@ ExpectingLoopSetSamplingRateValueACK
Definition: ntdd8042.h:106
@ ExpectingReadMouseStatusACK
Definition: ntdd8042.h:100
@ ExpectingPnpIdByte7
Definition: ntdd8042.h:113
@ ExpectingGetDeviceId2ACK
Definition: ntdd8042.h:116
@ ExpectingSetResolutionValueACK
Definition: ntdd8042.h:96
@ ExpectingReadMouseStatusByte1
Definition: ntdd8042.h:101
@ ExpectingSetScaling1to1ACK3
Definition: ntdd8042.h:99
@ ExpectingPnpIdByte1
Definition: ntdd8042.h:107
@ ExpectingPnpIdByte2
Definition: ntdd8042.h:108
@ Enable5Buttons
Definition: ntdd8042.h:115
@ I8042ReservedMinimum
Definition: ntdd8042.h:127
@ ExpectingGetDeviceIdValue
Definition: ntdd8042.h:92
@ StartPnPIdDetection
Definition: ntdd8042.h:104
@ ExpectingFinalResolutionValueACK
Definition: ntdd8042.h:122
@ ExpectingSetSamplingRateValueACK
Definition: ntdd8042.h:119
@ ExpectingPnpIdByte3
Definition: ntdd8042.h:109
@ ExpectingSetResolutionDefaultACK
Definition: ntdd8042.h:93
@ ExpectingSetScaling1to1ACK
Definition: ntdd8042.h:97
@ ExpectingReadMouseStatusByte3
Definition: ntdd8042.h:103
@ ExpectingPnpIdByte4
Definition: ntdd8042.h:110
@ ExpectingSetResolutionDefaultValueACK
Definition: ntdd8042.h:94
@ ExpectingReset
Definition: ntdd8042.h:89
@ ExpectingLoopSetSamplingRateACK
Definition: ntdd8042.h:105
@ ExpectingReadMouseStatusByte2
Definition: ntdd8042.h:102
@ ExpectingSetScaling1to1ACK2
Definition: ntdd8042.h:98
@ ExpectingGetDeviceIdDetectValue
Definition: ntdd8042.h:124
@ ExpectingPnpIdByte5
Definition: ntdd8042.h:111
@ ExpectingGetDeviceId2Value
Definition: ntdd8042.h:117
@ ExpectingSetResolutionACK
Definition: ntdd8042.h:95
@ ExpectingSetSamplingRateACK
Definition: ntdd8042.h:118
@ ExpectingGetDeviceIdACK
Definition: ntdd8042.h:91
@ ExpectingEnableACK
Definition: ntdd8042.h:120
@ CustomHookStateMinimum
Definition: ntdd8042.h:125
@ CustomHookStateMaximum
Definition: ntdd8042.h:126
@ ExpectingResetId
Definition: ntdd8042.h:90
@ ExpectingFinalResolutionACK
Definition: ntdd8042.h:121
@ EnableWheel
Definition: ntdd8042.h:114
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
struct _OUTPUT_PACKET * POUTPUT_PACKET
struct _INTERNAL_I8042_START_INFORMATION INTERNAL_I8042_START_INFORMATION
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 _OUTPUT_PACKET OUTPUT_PACKET
_TRANSMIT_STATE
Definition: ntdd8042.h:61
@ SendingBytes
Definition: ntdd8042.h:63
@ Idle
Definition: ntdd8042.h:62
enum _KEYBOARD_SCAN_STATE * PKEYBOARD_SCAN_STATE
VOID(NTAPI * PI8042_QUEUE_PACKET)(IN PVOID Context)
Definition: ntdd8042.h:142
struct _INTERNAL_I8042_HOOK_MOUSE * PINTERNAL_I8042_HOOK_MOUSE
struct _INTERNAL_I8042_START_INFORMATION * PINTERNAL_I8042_START_INFORMATION
#define BOOLEAN
Definition: pedump.c:73
BOOL WINAPI ReadPort(_In_ HANDLE hPort, _Out_writes_bytes_(cbBuffer) LPBYTE pBuffer, _In_ DWORD cbBuffer, _Out_ LPDWORD pcbRead)
BOOL WINAPI WritePort(_In_ HANDLE hPort, _In_reads_bytes_(cbBuf) LPBYTE pBuffer, _In_ DWORD cbBuf, _Out_ LPDWORD pcbWritten)
OUT PI8042_KEYBOARD_ISR IsrRoutine
Definition: ntdd8042.h:179
IN PI8042_ISR_WRITE_PORT IsrWritePort
Definition: ntdd8042.h:180
IN PI8042_QUEUE_PACKET QueueKeyboardPacket
Definition: ntdd8042.h:181
OUT PI8042_KEYBOARD_INITIALIZATION_ROUTINE InitializationRoutine
Definition: ntdd8042.h:178
OUT PI8042_MOUSE_ISR IsrRoutine
Definition: ntdd8042.h:198
IN PI8042_QUEUE_PACKET QueueMousePacket
Definition: ntdd8042.h:200
IN PI8042_ISR_WRITE_PORT IsrWritePort
Definition: ntdd8042.h:199
ULONG ByteCount
Definition: ntdd8042.h:69
ULONG CurrentByte
Definition: ntdd8042.h:68
TRANSMIT_STATE State
Definition: ntdd8042.h:70
PUCHAR Bytes
Definition: ntdd8042.h:67
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
unsigned char UCHAR
Definition: xmlstorage.h:181