Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
ntdd8042.h
00001 /* 00002 * ntdd8042.h 00003 * 00004 * i8042 IOCTL interface. 00005 * 00006 * This file is part of the w32api package. 00007 * 00008 * Contributors: 00009 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net> 00010 * 00011 * THIS SOFTWARE IS NOT COPYRIGHTED 00012 * 00013 * This source code is offered for use in the public domain. You may 00014 * use, modify or distribute it freely. 00015 * 00016 * This code is distributed in the hope that it will be useful but 00017 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 00018 * DISCLAIMED. This includes but is not limited to warranties of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00020 * 00021 */ 00022 00023 #ifndef __NTDD8042_H 00024 #define __NTDD8042_H 00025 00026 #if __GNUC__ >=3 00027 #pragma GCC system_header 00028 #endif 00029 00030 #ifdef __cplusplus 00031 extern "C" { 00032 #endif 00033 00034 #include "ntddk.h" 00035 #include "ntddkbd.h" 00036 #include "ntddmou.h" 00037 00038 #define IOCTL_INTERNAL_I8042_CONTROLLER_WRITE_BUFFER \ 00039 CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0FF2, METHOD_NEITHER, FILE_ANY_ACCESS) 00040 00041 #define IOCTL_INTERNAL_I8042_HOOK_KEYBOARD \ 00042 CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0FF0, METHOD_NEITHER, FILE_ANY_ACCESS) 00043 00044 #define IOCTL_INTERNAL_I8042_KEYBOARD_START_INFORMATION \ 00045 CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0FF3, METHOD_NEITHER, FILE_ANY_ACCESS) 00046 00047 #define IOCTL_INTERNAL_I8042_KEYBOARD_WRITE_BUFFER \ 00048 CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0FF1, METHOD_NEITHER, FILE_ANY_ACCESS) 00049 00050 #define IOCTL_INTERNAL_I8042_HOOK_MOUSE \ 00051 CTL_CODE(FILE_DEVICE_MOUSE, 0x0FF0, METHOD_NEITHER, FILE_ANY_ACCESS) 00052 00053 #define IOCTL_INTERNAL_I8042_MOUSE_START_INFORMATION \ 00054 CTL_CODE(FILE_DEVICE_MOUSE, 0x0FF3, METHOD_NEITHER, FILE_ANY_ACCESS) 00055 00056 #define IOCTL_INTERNAL_I8042_MOUSE_WRITE_BUFFER \ 00057 CTL_CODE(FILE_DEVICE_MOUSE, 0x0FF1, METHOD_NEITHER, FILE_ANY_ACCESS) 00058 00059 #define I8042_POWER_SYS_BUTTON 0x0001 00060 #define I8042_SLEEP_SYS_BUTTON 0x0002 00061 #define I8042_WAKE_SYS_BUTTON 0x0004 00062 #define I8042_SYS_BUTTONS (I8042_POWER_SYS_BUTTON | \ 00063 I8042_SLEEP_SYS_BUTTON | \ 00064 I8042_WAKE_SYS_BUTTON) 00065 00066 typedef enum _TRANSMIT_STATE { 00067 Idle = 0, 00068 SendingBytes 00069 } TRANSMIT_STATE; 00070 00071 typedef struct _OUTPUT_PACKET { 00072 PUCHAR Bytes; 00073 ULONG CurrentByte; 00074 ULONG ByteCount; 00075 TRANSMIT_STATE State; 00076 } OUTPUT_PACKET, *POUTPUT_PACKET; 00077 00078 typedef enum _KEYBOARD_SCAN_STATE { 00079 Normal, 00080 GotE0, 00081 GotE1 00082 } KEYBOARD_SCAN_STATE, *PKEYBOARD_SCAN_STATE; 00083 00084 typedef enum _MOUSE_STATE { 00085 MouseIdle, 00086 XMovement, 00087 YMovement, 00088 ZMovement, 00089 MouseExpectingACK, 00090 MouseResetting 00091 } MOUSE_STATE, *PMOUSE_STATE; 00092 00093 typedef enum _MOUSE_RESET_SUBSTATE { 00094 ExpectingReset, 00095 ExpectingResetId, 00096 ExpectingGetDeviceIdACK, 00097 ExpectingGetDeviceIdValue, 00098 ExpectingSetResolutionDefaultACK, 00099 ExpectingSetResolutionDefaultValueACK, 00100 ExpectingSetResolutionACK, 00101 ExpectingSetResolutionValueACK, 00102 ExpectingSetScaling1to1ACK, 00103 ExpectingSetScaling1to1ACK2, 00104 ExpectingSetScaling1to1ACK3, 00105 ExpectingReadMouseStatusACK, 00106 ExpectingReadMouseStatusByte1, 00107 ExpectingReadMouseStatusByte2, 00108 ExpectingReadMouseStatusByte3, 00109 StartPnPIdDetection, 00110 ExpectingLoopSetSamplingRateACK, 00111 ExpectingLoopSetSamplingRateValueACK, 00112 ExpectingPnpIdByte1, 00113 ExpectingPnpIdByte2, 00114 ExpectingPnpIdByte3, 00115 ExpectingPnpIdByte4, 00116 ExpectingPnpIdByte5, 00117 ExpectingPnpIdByte6, 00118 ExpectingPnpIdByte7, 00119 EnableWheel, 00120 Enable5Buttons, 00121 ExpectingGetDeviceId2ACK, 00122 ExpectingGetDeviceId2Value, 00123 ExpectingSetSamplingRateACK, 00124 ExpectingSetSamplingRateValueACK, 00125 ExpectingEnableACK, 00126 ExpectingFinalResolutionACK, 00127 ExpectingFinalResolutionValueACK, 00128 ExpectingGetDeviceIdDetectACK, 00129 ExpectingGetDeviceIdDetectValue, 00130 CustomHookStateMinimum = 100, 00131 CustomHookStateMaximum = 999, 00132 I8042ReservedMinimum = 1000 00133 } MOUSE_RESET_SUBSTATE, *PMOUSE_RESET_SUBSTATE; 00134 00135 typedef struct _INTERNAL_I8042_START_INFORMATION { 00136 ULONG Size; 00137 PKINTERRUPT InterruptObject; 00138 ULONG Reserved[8]; 00139 } INTERNAL_I8042_START_INFORMATION, *PINTERNAL_I8042_START_INFORMATION; 00140 00141 typedef VOID DDKAPI 00142 (*PI8042_ISR_WRITE_PORT)( 00143 /*IN*/ PVOID Context, 00144 /*IN*/ UCHAR Value); 00145 00146 typedef VOID DDKAPI 00147 (*PI8042_QUEUE_PACKET)( 00148 /*IN*/ PVOID Context); 00149 00150 typedef NTSTATUS DDKAPI 00151 (*PI8042_SYNCH_READ_PORT) ( 00152 /*IN*/ PVOID Context, 00153 /*OUT*/ PUCHAR Value, 00154 /*IN*/ BOOLEAN WaitForACK); 00155 00156 typedef NTSTATUS DDKAPI 00157 (*PI8042_SYNCH_WRITE_PORT)( 00158 /*IN*/ PVOID Context, 00159 /*IN*/ UCHAR Value, 00160 /*IN*/ BOOLEAN WaitForACK); 00161 00162 00163 typedef NTSTATUS DDKAPI 00164 (*PI8042_KEYBOARD_INITIALIZATION_ROUTINE)( 00165 /*IN*/ PVOID InitializationContext, 00166 /*IN*/ PVOID SynchFuncContext, 00167 /*IN*/ PI8042_SYNCH_READ_PORT ReadPort, 00168 /*IN*/ PI8042_SYNCH_WRITE_PORT WritePort, 00169 /*OUT*/ PBOOLEAN TurnTranslationOn); 00170 00171 typedef BOOLEAN DDKAPI 00172 (*PI8042_KEYBOARD_ISR)( 00173 PVOID IsrContext, 00174 PKEYBOARD_INPUT_DATA CurrentInput, 00175 POUTPUT_PACKET CurrentOutput, 00176 UCHAR StatusByte, 00177 PUCHAR Byte, 00178 PBOOLEAN ContinueProcessing, 00179 PKEYBOARD_SCAN_STATE ScanState); 00180 00181 typedef struct _INTERNAL_I8042_HOOK_KEYBOARD { 00182 /*OUT*/ PVOID Context; 00183 /*OUT*/ PI8042_KEYBOARD_INITIALIZATION_ROUTINE InitializationRoutine; 00184 /*OUT*/ PI8042_KEYBOARD_ISR IsrRoutine; 00185 /*IN*/ PI8042_ISR_WRITE_PORT IsrWritePort; 00186 /*IN*/ PI8042_QUEUE_PACKET QueueKeyboardPacket; 00187 /*IN*/ PVOID CallContext; 00188 } INTERNAL_I8042_HOOK_KEYBOARD, *PINTERNAL_I8042_HOOK_KEYBOARD; 00189 00190 typedef BOOLEAN DDKAPI 00191 (*PI8042_MOUSE_ISR)( 00192 PVOID IsrContext, 00193 PMOUSE_INPUT_DATA CurrentInput, 00194 POUTPUT_PACKET CurrentOutput, 00195 UCHAR StatusByte, 00196 PUCHAR Byte, 00197 PBOOLEAN ContinueProcessing, 00198 PMOUSE_STATE MouseState, 00199 PMOUSE_RESET_SUBSTATE ResetSubState); 00200 00201 typedef struct _INTERNAL_I8042_HOOK_MOUSE { 00202 /*OUT*/ PVOID Context; 00203 /*OUT*/ PI8042_MOUSE_ISR IsrRoutine; 00204 /*IN*/ PI8042_ISR_WRITE_PORT IsrWritePort; 00205 /*IN*/ PI8042_QUEUE_PACKET QueueMousePacket; 00206 /*IN*/ PVOID CallContext; 00207 } INTERNAL_I8042_HOOK_MOUSE, *PINTERNAL_I8042_HOOK_MOUSE; 00208 00209 #ifdef __cplusplus 00210 } 00211 #endif 00212 00213 #endif /* __NTDD8042_H */
Generated on Tue Jul 12 2022 19:59:54 by
