2014-01-02 11:11:12 +00:00
|
|
|
#ifndef _I8042PRT_PCH_
|
|
|
|
#define _I8042PRT_PCH_
|
2013-12-24 21:16:17 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
#include <ntifs.h>
|
2005-08-24 20:34:50 +00:00
|
|
|
#include <kbdmou.h>
|
|
|
|
#include <ntdd8042.h>
|
2005-07-24 11:59:28 +00:00
|
|
|
|
2005-05-01 20:38:29 +00:00
|
|
|
/*-----------------------------------------------------
|
2009-02-11 17:21:10 +00:00
|
|
|
* Structures
|
|
|
|
* --------------------------------------------------*/
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2009-08-24 17:12:25 +00:00
|
|
|
#define I8042PRT_TAG '2408'
|
2007-10-31 08:58:04 +00:00
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
2009-02-11 17:21:10 +00:00
|
|
|
dsStopped,
|
|
|
|
dsStarted,
|
|
|
|
dsPaused,
|
|
|
|
dsRemoved,
|
|
|
|
dsSurpriseRemoved
|
2007-10-31 08:58:04 +00:00
|
|
|
} DEVICE_STATE;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
typedef struct _I8042_SETTINGS
|
|
|
|
{
|
2009-02-11 17:21:10 +00:00
|
|
|
/* Registry settings */
|
|
|
|
ULONG KeyboardDataQueueSize; /* done */
|
|
|
|
UNICODE_STRING KeyboardDeviceBaseName;
|
|
|
|
ULONG MouseDataQueueSize; /* done */
|
|
|
|
ULONG MouseResolution;
|
|
|
|
ULONG MouseSynchIn100ns;
|
|
|
|
ULONG NumberOfButtons;
|
|
|
|
UNICODE_STRING PointerDeviceBaseName;
|
|
|
|
ULONG PollStatusIterations; /* done */
|
|
|
|
ULONG OverrideKeyboardType;
|
|
|
|
ULONG OverrideKeyboardSubtype;
|
|
|
|
ULONG PollingIterations; /* done */
|
|
|
|
ULONG PollingIterationsMaximum;
|
|
|
|
ULONG ResendIterations; /* done */
|
|
|
|
ULONG SampleRate;
|
|
|
|
ULONG CrashOnCtrlScroll; /* done */
|
2007-10-31 08:58:04 +00:00
|
|
|
} I8042_SETTINGS, *PI8042_SETTINGS;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
|
|
|
typedef enum _MOUSE_TIMEOUT_STATE
|
|
|
|
{
|
2009-02-11 17:21:10 +00:00
|
|
|
NoChange,
|
|
|
|
TimeoutStart,
|
|
|
|
TimeoutCancel
|
2005-05-01 20:38:29 +00:00
|
|
|
} MOUSE_TIMEOUT_STATE, *PMOUSE_TIMEOUT_STATE;
|
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
typedef struct _INTERRUPT_DATA
|
2005-05-01 20:38:29 +00:00
|
|
|
{
|
2009-02-11 17:21:10 +00:00
|
|
|
PKINTERRUPT Object;
|
|
|
|
ULONG Vector;
|
|
|
|
KIRQL Dirql;
|
|
|
|
KINTERRUPT_MODE InterruptMode;
|
|
|
|
BOOLEAN ShareInterrupt;
|
|
|
|
KAFFINITY Affinity;
|
2007-10-31 08:58:04 +00:00
|
|
|
} INTERRUPT_DATA, *PINTERRUPT_DATA;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
#define WHEEL_DELTA 120
|
|
|
|
|
|
|
|
struct _I8042_KEYBOARD_EXTENSION;
|
|
|
|
typedef struct _I8042_KEYBOARD_EXTENSION *PI8042_KEYBOARD_EXTENSION;
|
|
|
|
struct _I8042_MOUSE_EXTENSION;
|
|
|
|
typedef struct _I8042_MOUSE_EXTENSION *PI8042_MOUSE_EXTENSION;
|
|
|
|
|
|
|
|
/* PORT_DEVICE_EXTENSION.Flags */
|
|
|
|
#define KEYBOARD_PRESENT 0x01 /* A keyboard is attached */
|
|
|
|
#define KEYBOARD_CONNECTED 0x02 /* Keyboard received IOCTL_INTERNAL_KEYBOARD_CONNECT */
|
|
|
|
#define KEYBOARD_STARTED 0x04 /* Keyboard FDO received IRP_MN_START_DEVICE */
|
|
|
|
#define KEYBOARD_INITIALIZED 0x08 /* Keyboard interrupt is connected */
|
|
|
|
#define MOUSE_PRESENT 0x10 /* A mouse is attached */
|
|
|
|
#define MOUSE_CONNECTED 0x20 /* Mouse received IOCTL_INTERNAL_MOUSE_CONNECT */
|
|
|
|
#define MOUSE_STARTED 0x40 /* Mouse FDO received IRP_MN_START_DEVICE */
|
|
|
|
#define MOUSE_INITIALIZED 0x80 /* Mouse interrupt is connected */
|
|
|
|
|
|
|
|
typedef struct _PORT_DEVICE_EXTENSION
|
2005-05-01 20:38:29 +00:00
|
|
|
{
|
2009-02-11 17:21:10 +00:00
|
|
|
PUCHAR DataPort; /* Usually 0x60 */
|
|
|
|
PUCHAR ControlPort; /* Usually 0x64 */
|
|
|
|
I8042_SETTINGS Settings;
|
|
|
|
ULONG Flags;
|
|
|
|
|
|
|
|
PI8042_KEYBOARD_EXTENSION KeyboardExtension;
|
|
|
|
INTERRUPT_DATA KeyboardInterrupt;
|
|
|
|
PI8042_MOUSE_EXTENSION MouseExtension;
|
|
|
|
INTERRUPT_DATA MouseInterrupt;
|
|
|
|
PKINTERRUPT HighestDIRQLInterrupt;
|
|
|
|
KSPIN_LOCK SpinLock;
|
|
|
|
KIRQL HighestDirql;
|
|
|
|
|
|
|
|
OUTPUT_PACKET Packet;
|
|
|
|
ULONG PacketResends;
|
|
|
|
BOOLEAN PacketComplete;
|
|
|
|
NTSTATUS PacketResult;
|
|
|
|
UCHAR PacketBuffer[16];
|
|
|
|
UCHAR PacketPort;
|
|
|
|
|
|
|
|
PIRP CurrentIrp;
|
|
|
|
PDEVICE_OBJECT CurrentIrpDevice;
|
2007-10-31 08:58:04 +00:00
|
|
|
} PORT_DEVICE_EXTENSION, *PPORT_DEVICE_EXTENSION;
|
|
|
|
|
|
|
|
typedef struct _I8042_DRIVER_EXTENSION
|
|
|
|
{
|
2009-02-11 17:21:10 +00:00
|
|
|
UNICODE_STRING RegistryPath;
|
2007-10-31 08:58:04 +00:00
|
|
|
|
2009-02-11 17:21:10 +00:00
|
|
|
PORT_DEVICE_EXTENSION Port;
|
|
|
|
LIST_ENTRY DeviceListHead;
|
|
|
|
KSPIN_LOCK DeviceListLock;
|
2007-10-31 08:58:04 +00:00
|
|
|
} I8042_DRIVER_EXTENSION, *PI8042_DRIVER_EXTENSION;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
|
|
|
typedef enum _I8042_DEVICE_TYPE
|
|
|
|
{
|
2009-02-11 17:21:10 +00:00
|
|
|
Unknown,
|
|
|
|
Keyboard,
|
|
|
|
Mouse,
|
|
|
|
PhysicalDeviceObject
|
2005-05-01 20:38:29 +00:00
|
|
|
} I8042_DEVICE_TYPE, *PI8042_DEVICE_TYPE;
|
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
typedef struct _FDO_DEVICE_EXTENSION
|
2005-05-01 20:38:29 +00:00
|
|
|
{
|
2009-02-11 17:21:10 +00:00
|
|
|
I8042_DEVICE_TYPE Type;
|
|
|
|
// Linkage in I8042_DRIVER_EXTENSION.DeviceListHead
|
|
|
|
LIST_ENTRY ListEntry;
|
|
|
|
// Associated device object (FDO)
|
|
|
|
PDEVICE_OBJECT Fdo;
|
|
|
|
// Associated device object (PDO)
|
|
|
|
PDEVICE_OBJECT Pdo;
|
|
|
|
// Lower device object
|
|
|
|
PDEVICE_OBJECT LowerDevice;
|
|
|
|
// Current state of the driver
|
|
|
|
DEVICE_STATE PnpState;
|
|
|
|
|
|
|
|
PPORT_DEVICE_EXTENSION PortDeviceExtension;
|
2007-10-31 08:58:04 +00:00
|
|
|
} FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
typedef struct _I8042_KEYBOARD_EXTENSION
|
|
|
|
{
|
2009-02-11 17:21:10 +00:00
|
|
|
FDO_DEVICE_EXTENSION Common;
|
|
|
|
CONNECT_DATA KeyboardData;
|
|
|
|
INTERNAL_I8042_HOOK_KEYBOARD KeyboardHook; /* FIXME: IsrWritePort ignored */
|
|
|
|
KDPC DpcKeyboard;
|
|
|
|
|
2009-05-29 17:25:03 +00:00
|
|
|
KEYBOARD_ATTRIBUTES KeyboardAttributes;
|
|
|
|
|
2009-02-11 17:21:10 +00:00
|
|
|
KEYBOARD_INDICATOR_PARAMETERS KeyboardIndicators;
|
|
|
|
|
|
|
|
KEYBOARD_SCAN_STATE KeyboardScanState;
|
|
|
|
BOOLEAN KeyComplete;
|
|
|
|
PKEYBOARD_INPUT_DATA KeyboardBuffer;
|
|
|
|
ULONG KeysInBuffer;
|
|
|
|
|
|
|
|
/* Power keys items */
|
|
|
|
ULONG ReportedCaps;
|
|
|
|
ULONG NewCaps;
|
|
|
|
ULONG LastPowerKey;
|
|
|
|
UNICODE_STRING PowerInterfaceName;
|
|
|
|
PIO_WORKITEM PowerWorkItem;
|
|
|
|
PIRP PowerIrp;
|
|
|
|
|
|
|
|
/* Debug items */
|
|
|
|
ULONG ComboPosition;
|
|
|
|
PIO_WORKITEM DebugWorkItem;
|
|
|
|
BOOLEAN TabPressed;
|
2007-10-31 08:58:04 +00:00
|
|
|
} I8042_KEYBOARD_EXTENSION;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
typedef enum _I8042_MOUSE_TYPE
|
|
|
|
{
|
2009-02-11 17:21:10 +00:00
|
|
|
GenericPS2,
|
|
|
|
Intellimouse,
|
|
|
|
IntellimouseExplorer,
|
|
|
|
Ps2pp
|
2007-10-31 08:58:04 +00:00
|
|
|
} I8042_MOUSE_TYPE, *PI8042_MOUSE_TYPE;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
typedef struct _I8042_MOUSE_EXTENSION
|
|
|
|
{
|
2009-02-11 17:21:10 +00:00
|
|
|
FDO_DEVICE_EXTENSION Common;
|
|
|
|
CONNECT_DATA MouseData;
|
|
|
|
INTERNAL_I8042_HOOK_MOUSE MouseHook;
|
|
|
|
KDPC DpcMouse;
|
|
|
|
|
|
|
|
MOUSE_ATTRIBUTES MouseAttributes;
|
|
|
|
|
|
|
|
MOUSE_STATE MouseState;
|
|
|
|
BOOLEAN MouseComplete;
|
|
|
|
MOUSE_RESET_SUBSTATE MouseResetState;
|
|
|
|
PMOUSE_INPUT_DATA MouseBuffer;
|
|
|
|
ULONG MouseInBuffer;
|
|
|
|
USHORT MouseButtonState;
|
|
|
|
ULARGE_INTEGER MousePacketStartTime;
|
|
|
|
|
|
|
|
KTIMER TimerMouseTimeout;
|
|
|
|
KDPC DpcMouseTimeout;
|
|
|
|
MOUSE_TIMEOUT_STATE MouseTimeoutState;
|
|
|
|
BOOLEAN MouseTimeoutActive;
|
|
|
|
|
|
|
|
UCHAR MouseLogiBuffer[3];
|
|
|
|
I8042_MOUSE_TYPE MouseType;
|
2007-10-31 08:58:04 +00:00
|
|
|
} I8042_MOUSE_EXTENSION;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
|
|
|
typedef struct _I8042_HOOK_WORKITEM
|
|
|
|
{
|
2009-02-11 17:21:10 +00:00
|
|
|
PIO_WORKITEM WorkItem;
|
|
|
|
PIRP Irp;
|
2005-05-01 20:38:29 +00:00
|
|
|
} I8042_HOOK_WORKITEM, *PI8042_HOOK_WORKITEM;
|
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/*-----------------------------------------------------
|
2009-02-11 17:21:10 +00:00
|
|
|
* Some defines
|
|
|
|
* --------------------------------------------------*/
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
#define MAX(a, b) ((a) >= (b) ? (a) : (b))
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
#define KEYBOARD_POWER_CODE 0x5E
|
|
|
|
#define KEYBOARD_SLEEP_CODE 0x5F
|
|
|
|
#define KEYBOARD_WAKE_CODE 0x63
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/*-----------------------------------------------------
|
2009-02-11 17:21:10 +00:00
|
|
|
* Controller commands
|
|
|
|
* --------------------------------------------------*/
|
2005-05-01 20:38:29 +00:00
|
|
|
|
|
|
|
#define KBD_READ_MODE 0x20
|
|
|
|
#define KBD_WRITE_MODE 0x60
|
2008-03-31 12:40:31 +00:00
|
|
|
#define MOUSE_ENAB 0xA8
|
2005-05-01 20:38:29 +00:00
|
|
|
#define MOUSE_LINE_TEST 0xA9
|
2007-10-31 08:58:04 +00:00
|
|
|
#define CTRL_SELF_TEST 0xAA
|
2018-03-21 21:07:30 +00:00
|
|
|
#define KBD_CLK_DISABLE 0xAD
|
|
|
|
#define KBD_CLK_ENABLE 0xAE
|
2007-10-31 08:58:04 +00:00
|
|
|
#define CTRL_WRITE_MOUSE 0xD4
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/*-----------------------------------------------------
|
2009-02-11 17:21:10 +00:00
|
|
|
* Keyboard commands
|
|
|
|
* --------------------------------------------------*/
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
#define KBD_CMD_SET_LEDS 0xED
|
|
|
|
#define KBD_CMD_GET_ID 0xF2
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/*-----------------------------------------------------
|
2009-02-11 17:21:10 +00:00
|
|
|
* Keyboard responses
|
|
|
|
* --------------------------------------------------*/
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2008-03-18 12:00:29 +00:00
|
|
|
#define KBD_SELF_TEST_OK 0x55
|
2005-05-01 20:38:29 +00:00
|
|
|
#define KBD_ACK 0xFA
|
|
|
|
#define KBD_NACK 0xFC
|
|
|
|
#define KBD_RESEND 0xFE
|
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/*-----------------------------------------------------
|
2009-02-11 17:21:10 +00:00
|
|
|
* Controller status register bits
|
|
|
|
* --------------------------------------------------*/
|
2005-05-01 20:38:29 +00:00
|
|
|
|
|
|
|
#define KBD_OBF 0x01
|
|
|
|
#define KBD_IBF 0x02
|
2007-10-31 08:58:04 +00:00
|
|
|
#define MOU_OBF 0x20
|
2005-05-01 20:38:29 +00:00
|
|
|
#define KBD_PERR 0x80
|
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/*-----------------------------------------------------
|
2009-02-11 17:21:10 +00:00
|
|
|
* Controller command byte bits
|
|
|
|
* --------------------------------------------------*/
|
2007-10-31 08:58:04 +00:00
|
|
|
|
2005-10-21 20:28:05 +00:00
|
|
|
#define CCB_KBD_INT_ENAB 0x01
|
|
|
|
#define CCB_MOUSE_INT_ENAB 0x02
|
|
|
|
#define CCB_SYSTEM_FLAG 0x04
|
|
|
|
#define CCB_KBD_DISAB 0x10
|
|
|
|
#define CCB_MOUSE_DISAB 0x20
|
|
|
|
#define CCB_TRANSLATE 0x40
|
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/*-----------------------------------------------------
|
2009-02-11 17:21:10 +00:00
|
|
|
* LED bits
|
|
|
|
* --------------------------------------------------*/
|
2005-05-01 20:38:29 +00:00
|
|
|
|
|
|
|
#define KBD_LED_SCROLL 0x01
|
|
|
|
#define KBD_LED_NUM 0x02
|
|
|
|
#define KBD_LED_CAPS 0x04
|
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/*-----------------------------------------------------
|
2009-02-11 17:21:10 +00:00
|
|
|
* Mouse commands
|
|
|
|
* --------------------------------------------------*/
|
2007-10-31 08:58:04 +00:00
|
|
|
|
2008-03-31 12:40:31 +00:00
|
|
|
#define MOU_ENAB 0xF4
|
2007-10-31 08:58:04 +00:00
|
|
|
#define MOU_CMD_RESET 0xFF
|
|
|
|
|
|
|
|
/*-----------------------------------------------------
|
2009-02-11 17:21:10 +00:00
|
|
|
* Mouse responses
|
|
|
|
* --------------------------------------------------*/
|
2007-10-31 08:58:04 +00:00
|
|
|
|
2005-05-01 20:38:29 +00:00
|
|
|
#define MOUSE_ACK 0xFA
|
|
|
|
#define MOUSE_ERROR 0xFC
|
|
|
|
#define MOUSE_NACK 0xFE
|
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/*-----------------------------------------------------
|
2009-02-11 17:21:10 +00:00
|
|
|
* Prototypes
|
|
|
|
* --------------------------------------------------*/
|
2005-09-15 16:46:17 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/* createclose.c */
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
IO_WORKITEM_ROUTINE i8042SendHookWorkItem;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2014-04-27 13:33:42 +00:00
|
|
|
_Dispatch_type_(IRP_MJ_CREATE)
|
2007-10-31 08:58:04 +00:00
|
|
|
DRIVER_DISPATCH i8042Create;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2014-04-27 13:33:42 +00:00
|
|
|
_Dispatch_type_(IRP_MJ_CLEANUP)
|
2007-10-31 08:58:04 +00:00
|
|
|
DRIVER_DISPATCH i8042Cleanup;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2014-04-27 13:33:42 +00:00
|
|
|
_Dispatch_type_(IRP_MJ_CLOSE)
|
2007-10-31 08:58:04 +00:00
|
|
|
DRIVER_DISPATCH i8042Close;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/* keyboard.c */
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-11-22 11:27:17 +00:00
|
|
|
NTSTATUS NTAPI
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042SynchWritePortKbd(
|
|
|
|
IN PVOID Context,
|
|
|
|
IN UCHAR Value,
|
|
|
|
IN BOOLEAN WaitForAck);
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
DRIVER_STARTIO i8042KbdStartIo;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
DRIVER_DISPATCH i8042KbdDeviceControl;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
DRIVER_DISPATCH i8042KbdInternalDeviceControl;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
KSERVICE_ROUTINE i8042KbdInterruptService;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/* i8042prt.c */
|
2005-10-06 21:39:18 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
DRIVER_ADD_DEVICE i8042AddDevice;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
BOOLEAN
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042PacketIsr(
|
|
|
|
IN PPORT_DEVICE_EXTENSION DeviceExtension,
|
|
|
|
IN UCHAR Output);
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
NTSTATUS
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042StartPacket(
|
|
|
|
IN PPORT_DEVICE_EXTENSION DeviceExtension,
|
|
|
|
IN PFDO_DEVICE_EXTENSION FdoDeviceExtension,
|
|
|
|
IN PUCHAR Bytes,
|
|
|
|
IN ULONG ByteCount,
|
|
|
|
IN PIRP Irp);
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/* misc.c */
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
DRIVER_DISPATCH ForwardIrpAndForget;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
NTSTATUS
|
2009-02-11 17:21:10 +00:00
|
|
|
DuplicateUnicodeString(
|
|
|
|
IN ULONG Flags,
|
|
|
|
IN PCUNICODE_STRING SourceString,
|
|
|
|
OUT PUNICODE_STRING DestinationString);
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/* mouse.c */
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
VOID
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042MouHandle(
|
|
|
|
IN PI8042_MOUSE_EXTENSION DeviceExtension,
|
|
|
|
IN UCHAR Output);
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
VOID
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042MouHandleButtons(
|
|
|
|
IN PI8042_MOUSE_EXTENSION DeviceExtension,
|
|
|
|
IN USHORT Mask);
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
NTSTATUS
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042MouInitialize(
|
|
|
|
IN PI8042_MOUSE_EXTENSION DeviceExtension);
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
DRIVER_DISPATCH i8042MouInternalDeviceControl;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
KSERVICE_ROUTINE i8042MouInterruptService;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/* pnp.c */
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
BOOLEAN
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042ChangeMode(
|
|
|
|
IN PPORT_DEVICE_EXTENSION DeviceExtension,
|
|
|
|
IN UCHAR FlagsToDisable,
|
|
|
|
IN UCHAR FlagsToEnable);
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2014-04-27 13:33:42 +00:00
|
|
|
_Dispatch_type_(IRP_MJ_PNP)
|
2007-10-31 08:58:04 +00:00
|
|
|
DRIVER_DISPATCH i8042Pnp;
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/* ps2pp.c */
|
|
|
|
VOID
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042MouHandlePs2pp(
|
|
|
|
IN PI8042_MOUSE_EXTENSION DeviceExtension,
|
|
|
|
IN UCHAR Input);
|
2007-10-31 08:58:04 +00:00
|
|
|
|
|
|
|
/* readwrite.c */
|
|
|
|
|
|
|
|
VOID
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042Flush(
|
|
|
|
IN PPORT_DEVICE_EXTENSION DeviceExtension);
|
2007-10-31 08:58:04 +00:00
|
|
|
|
2008-03-31 12:40:31 +00:00
|
|
|
BOOLEAN
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042IsrWritePort(
|
|
|
|
IN PPORT_DEVICE_EXTENSION DeviceExtension,
|
|
|
|
IN UCHAR Value,
|
|
|
|
IN UCHAR SelectCmd OPTIONAL);
|
2007-10-31 08:58:04 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042ReadData(
|
|
|
|
IN PPORT_DEVICE_EXTENSION DeviceExtension,
|
|
|
|
IN UCHAR StatusFlags,
|
|
|
|
OUT PUCHAR Data);
|
2007-10-31 08:58:04 +00:00
|
|
|
#define i8042ReadKeyboardData(DeviceExtension, Data) \
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042ReadData(DeviceExtension, KBD_OBF, Data)
|
2007-10-31 08:58:04 +00:00
|
|
|
#define i8042ReadMouseData(DeviceExtension, Data) \
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042ReadData(DeviceExtension, MOU_OBF, Data)
|
2007-10-31 08:58:04 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042ReadDataWait(
|
|
|
|
IN PPORT_DEVICE_EXTENSION DeviceExtension,
|
|
|
|
OUT PUCHAR Data);
|
2007-10-31 08:58:04 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042ReadStatus(
|
|
|
|
IN PPORT_DEVICE_EXTENSION DeviceExtension,
|
|
|
|
OUT PUCHAR Status);
|
2007-10-31 08:58:04 +00:00
|
|
|
|
2007-11-22 11:27:17 +00:00
|
|
|
NTSTATUS NTAPI
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042SynchReadPort(
|
|
|
|
IN PVOID Context,
|
|
|
|
OUT PUCHAR Value,
|
|
|
|
IN BOOLEAN WaitForAck);
|
2007-10-31 08:58:04 +00:00
|
|
|
|
|
|
|
NTSTATUS NTAPI
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042SynchWritePort(
|
|
|
|
IN PPORT_DEVICE_EXTENSION DeviceExtension,
|
|
|
|
IN UCHAR Port,
|
|
|
|
IN UCHAR Value,
|
|
|
|
IN BOOLEAN WaitForAck);
|
2007-10-31 08:58:04 +00:00
|
|
|
|
|
|
|
BOOLEAN
|
2009-02-11 17:21:10 +00:00
|
|
|
i8042Write(
|
|
|
|
IN PPORT_DEVICE_EXTENSION DeviceExtension,
|
|
|
|
IN PUCHAR addr,
|
|
|
|
IN UCHAR data);
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
/* registry.c */
|
2005-05-01 20:38:29 +00:00
|
|
|
|
2007-10-31 08:58:04 +00:00
|
|
|
NTSTATUS
|
2009-02-11 17:21:10 +00:00
|
|
|
ReadRegistryEntries(
|
|
|
|
IN PUNICODE_STRING RegistryPath,
|
|
|
|
OUT PI8042_SETTINGS Settings);
|
2014-01-02 11:11:12 +00:00
|
|
|
|
2015-03-19 21:50:53 +00:00
|
|
|
/* hwhacks.c */
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
i8042InitializeHwHacks(
|
|
|
|
VOID);
|
|
|
|
|
|
|
|
enum _FLAGS
|
|
|
|
{
|
|
|
|
FL_NOLOOP = 0x01,
|
|
|
|
FL_INITHACK = 0x02,
|
|
|
|
};
|
|
|
|
|
|
|
|
extern ULONG i8042HwFlags;
|
|
|
|
|
2014-01-02 11:11:12 +00:00
|
|
|
#endif /* _I8042PRT_PCH_ */
|