Revert r39517, as there is no reason for such a change: files are consistently formatted, don't belong to ntoskrnl, use tabs only for indenting and not for formatting, and formatting revisions complicate svn blame feature usage.

svn path=/trunk/; revision=39553
This commit is contained in:
Hervé Poussineau 2009-02-11 17:21:10 +00:00
parent b4f50046ff
commit 0560eef6ec
11 changed files with 3380 additions and 3295 deletions

View file

@ -13,7 +13,8 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
NTSTATUS NTAPI NTSTATUS NTAPI
i8042Create(IN PDEVICE_OBJECT DeviceObject, i8042Create(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp) IN PIRP Irp)
{ {
TRACE_(I8042PRT, "IRP_MJ_CREATE\n"); TRACE_(I8042PRT, "IRP_MJ_CREATE\n");
@ -25,7 +26,8 @@ i8042Create(IN PDEVICE_OBJECT DeviceObject,
} }
NTSTATUS NTAPI NTSTATUS NTAPI
i8042Cleanup(IN PDEVICE_OBJECT DeviceObject, i8042Cleanup(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp) IN PIRP Irp)
{ {
TRACE_(I8042PRT, "IRP_MJ_CLEANUP\n"); TRACE_(I8042PRT, "IRP_MJ_CLEANUP\n");
@ -37,7 +39,8 @@ i8042Cleanup(IN PDEVICE_OBJECT DeviceObject,
} }
NTSTATUS NTAPI NTSTATUS NTAPI
i8042Close(IN PDEVICE_OBJECT DeviceObject, i8042Close(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp) IN PIRP Irp)
{ {
TRACE_(I8042PRT, "IRP_MJ_CLOSE\n"); TRACE_(I8042PRT, "IRP_MJ_CLOSE\n");

View file

@ -23,7 +23,8 @@ static DRIVER_DISPATCH i8042InternalDeviceControl;
DRIVER_INITIALIZE DriverEntry; DRIVER_INITIALIZE DriverEntry;
NTSTATUS NTAPI NTSTATUS NTAPI
i8042AddDevice(IN PDRIVER_OBJECT DriverObject, i8042AddDevice(
IN PDRIVER_OBJECT DriverObject,
IN PDEVICE_OBJECT Pdo) IN PDEVICE_OBJECT Pdo)
{ {
PI8042_DRIVER_EXTENSION DriverExtension; PI8042_DRIVER_EXTENSION DriverExtension;
@ -90,7 +91,8 @@ cleanup:
} }
VOID NTAPI VOID NTAPI
i8042SendHookWorkItem(IN PDEVICE_OBJECT DeviceObject, i8042SendHookWorkItem(
IN PDEVICE_OBJECT DeviceObject,
IN PVOID Context) IN PVOID Context)
{ {
PI8042_HOOK_WORKITEM WorkItemData; PI8042_HOOK_WORKITEM WorkItemData;
@ -214,7 +216,8 @@ cleanup:
} }
static VOID NTAPI static VOID NTAPI
i8042StartIo(IN PDEVICE_OBJECT DeviceObject, i8042StartIo(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp) IN PIRP Irp)
{ {
PFDO_DEVICE_EXTENSION DeviceExtension; PFDO_DEVICE_EXTENSION DeviceExtension;
@ -233,10 +236,11 @@ i8042StartIo(IN PDEVICE_OBJECT DeviceObject,
} }
/* Write the current byte of the packet. Returns FALSE in case /* Write the current byte of the packet. Returns FALSE in case
* of problems. * of problems.
*/ */
static BOOLEAN static BOOLEAN
i8042PacketWrite(IN PPORT_DEVICE_EXTENSION DeviceExtension) i8042PacketWrite(
IN PPORT_DEVICE_EXTENSION DeviceExtension)
{ {
UCHAR Port = DeviceExtension->PacketPort; UCHAR Port = DeviceExtension->PacketPort;
@ -258,7 +262,8 @@ i8042PacketWrite(IN PPORT_DEVICE_EXTENSION DeviceExtension)
} }
BOOLEAN BOOLEAN
i8042PacketIsr(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042PacketIsr(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN UCHAR Output) IN UCHAR Output)
{ {
if (DeviceExtension->Packet.State == Idle) if (DeviceExtension->Packet.State == Idle)
@ -311,11 +316,12 @@ i8042PacketIsr(IN PPORT_DEVICE_EXTENSION DeviceExtension,
} }
/* /*
* This function starts a packet. It must be called with the * This function starts a packet. It must be called with the
* correct DIRQL. * correct DIRQL.
*/ */
NTSTATUS NTSTATUS
i8042StartPacket(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042StartPacket(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN PFDO_DEVICE_EXTENSION FdoDeviceExtension, IN PFDO_DEVICE_EXTENSION FdoDeviceExtension,
IN PUCHAR Bytes, IN PUCHAR Bytes,
IN ULONG ByteCount, IN ULONG ByteCount,
@ -375,7 +381,8 @@ done:
} }
static NTSTATUS NTAPI static NTSTATUS NTAPI
IrpStub(IN PDEVICE_OBJECT DeviceObject, IrpStub(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp) IN PIRP Irp)
{ {
NTSTATUS Status = Irp->IoStatus.Status; NTSTATUS Status = Irp->IoStatus.Status;
@ -387,7 +394,8 @@ IrpStub(IN PDEVICE_OBJECT DeviceObject,
} }
static NTSTATUS NTAPI static NTSTATUS NTAPI
i8042DeviceControl(IN PDEVICE_OBJECT DeviceObject, i8042DeviceControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp) IN PIRP Irp)
{ {
PFDO_DEVICE_EXTENSION DeviceExtension; PFDO_DEVICE_EXTENSION DeviceExtension;
@ -409,7 +417,8 @@ i8042DeviceControl(IN PDEVICE_OBJECT DeviceObject,
} }
static NTSTATUS NTAPI static NTSTATUS NTAPI
i8042InternalDeviceControl(IN PDEVICE_OBJECT DeviceObject, i8042InternalDeviceControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp) IN PIRP Irp)
{ {
PFDO_DEVICE_EXTENSION DeviceExtension; PFDO_DEVICE_EXTENSION DeviceExtension;
@ -458,7 +467,8 @@ i8042InternalDeviceControl(IN PDEVICE_OBJECT DeviceObject,
} }
NTSTATUS NTAPI NTSTATUS NTAPI
DriverEntry(IN PDRIVER_OBJECT DriverObject, DriverEntry(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath) IN PUNICODE_STRING RegistryPath)
{ {
PI8042_DRIVER_EXTENSION DriverExtension; PI8042_DRIVER_EXTENSION DriverExtension;

View file

@ -11,8 +11,8 @@
#include <debug.h> #include <debug.h>
/*----------------------------------------------------- /*-----------------------------------------------------
* Structures * Structures
* --------------------------------------------------*/ * --------------------------------------------------*/
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
#define I8042PRT_TAG TAG('8', '0', '4', '2') #define I8042PRT_TAG TAG('8', '0', '4', '2')
@ -209,8 +209,8 @@ typedef struct _I8042_HOOK_WORKITEM
} I8042_HOOK_WORKITEM, *PI8042_HOOK_WORKITEM; } I8042_HOOK_WORKITEM, *PI8042_HOOK_WORKITEM;
/*----------------------------------------------------- /*-----------------------------------------------------
* Some defines * Some defines
* --------------------------------------------------*/ * --------------------------------------------------*/
#define MAX(a, b) ((a) >= (b) ? (a) : (b)) #define MAX(a, b) ((a) >= (b) ? (a) : (b))
@ -219,8 +219,8 @@ typedef struct _I8042_HOOK_WORKITEM
#define KEYBOARD_WAKE_CODE 0x63 #define KEYBOARD_WAKE_CODE 0x63
/*----------------------------------------------------- /*-----------------------------------------------------
* Controller commands * Controller commands
* --------------------------------------------------*/ * --------------------------------------------------*/
#define KBD_READ_MODE 0x20 #define KBD_READ_MODE 0x20
#define KBD_WRITE_MODE 0x60 #define KBD_WRITE_MODE 0x60
@ -230,15 +230,15 @@ typedef struct _I8042_HOOK_WORKITEM
#define CTRL_WRITE_MOUSE 0xD4 #define CTRL_WRITE_MOUSE 0xD4
/*----------------------------------------------------- /*-----------------------------------------------------
* Keyboard commands * Keyboard commands
* --------------------------------------------------*/ * --------------------------------------------------*/
#define KBD_CMD_SET_LEDS 0xED #define KBD_CMD_SET_LEDS 0xED
#define KBD_CMD_GET_ID 0xF2 #define KBD_CMD_GET_ID 0xF2
/*----------------------------------------------------- /*-----------------------------------------------------
* Keyboard responses * Keyboard responses
* --------------------------------------------------*/ * --------------------------------------------------*/
#define KBD_SELF_TEST_OK 0x55 #define KBD_SELF_TEST_OK 0x55
#define KBD_ACK 0xFA #define KBD_ACK 0xFA
@ -246,8 +246,8 @@ typedef struct _I8042_HOOK_WORKITEM
#define KBD_RESEND 0xFE #define KBD_RESEND 0xFE
/*----------------------------------------------------- /*-----------------------------------------------------
* Controller status register bits * Controller status register bits
* --------------------------------------------------*/ * --------------------------------------------------*/
#define KBD_OBF 0x01 #define KBD_OBF 0x01
#define KBD_IBF 0x02 #define KBD_IBF 0x02
@ -255,8 +255,8 @@ typedef struct _I8042_HOOK_WORKITEM
#define KBD_PERR 0x80 #define KBD_PERR 0x80
/*----------------------------------------------------- /*-----------------------------------------------------
* Controller command byte bits * Controller command byte bits
* --------------------------------------------------*/ * --------------------------------------------------*/
#define CCB_KBD_INT_ENAB 0x01 #define CCB_KBD_INT_ENAB 0x01
#define CCB_MOUSE_INT_ENAB 0x02 #define CCB_MOUSE_INT_ENAB 0x02
@ -266,31 +266,31 @@ typedef struct _I8042_HOOK_WORKITEM
#define CCB_TRANSLATE 0x40 #define CCB_TRANSLATE 0x40
/*----------------------------------------------------- /*-----------------------------------------------------
* LED bits * LED bits
* --------------------------------------------------*/ * --------------------------------------------------*/
#define KBD_LED_SCROLL 0x01 #define KBD_LED_SCROLL 0x01
#define KBD_LED_NUM 0x02 #define KBD_LED_NUM 0x02
#define KBD_LED_CAPS 0x04 #define KBD_LED_CAPS 0x04
/*----------------------------------------------------- /*-----------------------------------------------------
* Mouse commands * Mouse commands
* --------------------------------------------------*/ * --------------------------------------------------*/
#define MOU_ENAB 0xF4 #define MOU_ENAB 0xF4
#define MOU_CMD_RESET 0xFF #define MOU_CMD_RESET 0xFF
/*----------------------------------------------------- /*-----------------------------------------------------
* Mouse responses * Mouse responses
* --------------------------------------------------*/ * --------------------------------------------------*/
#define MOUSE_ACK 0xFA #define MOUSE_ACK 0xFA
#define MOUSE_ERROR 0xFC #define MOUSE_ERROR 0xFC
#define MOUSE_NACK 0xFE #define MOUSE_NACK 0xFE
/*----------------------------------------------------- /*-----------------------------------------------------
* Prototypes * Prototypes
* --------------------------------------------------*/ * --------------------------------------------------*/
/* createclose.c */ /* createclose.c */
@ -305,7 +305,8 @@ DRIVER_DISPATCH i8042Close;
/* keyboard.c */ /* keyboard.c */
NTSTATUS NTAPI NTSTATUS NTAPI
i8042SynchWritePortKbd(IN PVOID Context, i8042SynchWritePortKbd(
IN PVOID Context,
IN UCHAR Value, IN UCHAR Value,
IN BOOLEAN WaitForAck); IN BOOLEAN WaitForAck);
@ -322,11 +323,13 @@ KSERVICE_ROUTINE i8042KbdInterruptService;
DRIVER_ADD_DEVICE i8042AddDevice; DRIVER_ADD_DEVICE i8042AddDevice;
BOOLEAN BOOLEAN
i8042PacketIsr(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042PacketIsr(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN UCHAR Output); IN UCHAR Output);
NTSTATUS NTSTATUS
i8042StartPacket(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042StartPacket(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN PFDO_DEVICE_EXTENSION FdoDeviceExtension, IN PFDO_DEVICE_EXTENSION FdoDeviceExtension,
IN PUCHAR Bytes, IN PUCHAR Bytes,
IN ULONG ByteCount, IN ULONG ByteCount,
@ -339,22 +342,26 @@ DRIVER_DISPATCH ForwardIrpAndForget;
DRIVER_DISPATCH ForwardIrpAndWait; DRIVER_DISPATCH ForwardIrpAndWait;
NTSTATUS NTSTATUS
DuplicateUnicodeString(IN ULONG Flags, DuplicateUnicodeString(
IN ULONG Flags,
IN PCUNICODE_STRING SourceString, IN PCUNICODE_STRING SourceString,
OUT PUNICODE_STRING DestinationString); OUT PUNICODE_STRING DestinationString);
/* mouse.c */ /* mouse.c */
VOID VOID
i8042MouHandle(IN PI8042_MOUSE_EXTENSION DeviceExtension, i8042MouHandle(
IN PI8042_MOUSE_EXTENSION DeviceExtension,
IN UCHAR Output); IN UCHAR Output);
VOID VOID
i8042MouHandleButtons(IN PI8042_MOUSE_EXTENSION DeviceExtension, i8042MouHandleButtons(
IN PI8042_MOUSE_EXTENSION DeviceExtension,
IN USHORT Mask); IN USHORT Mask);
NTSTATUS NTSTATUS
i8042MouInitialize(IN PI8042_MOUSE_EXTENSION DeviceExtension); i8042MouInitialize(
IN PI8042_MOUSE_EXTENSION DeviceExtension);
DRIVER_DISPATCH i8042MouInternalDeviceControl; DRIVER_DISPATCH i8042MouInternalDeviceControl;
@ -363,7 +370,8 @@ KSERVICE_ROUTINE i8042MouInterruptService;
/* pnp.c */ /* pnp.c */
BOOLEAN BOOLEAN
i8042ChangeMode(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042ChangeMode(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN UCHAR FlagsToDisable, IN UCHAR FlagsToDisable,
IN UCHAR FlagsToEnable); IN UCHAR FlagsToEnable);
@ -371,21 +379,25 @@ DRIVER_DISPATCH i8042Pnp;
/* ps2pp.c */ /* ps2pp.c */
VOID VOID
i8042MouHandlePs2pp(IN PI8042_MOUSE_EXTENSION DeviceExtension, i8042MouHandlePs2pp(
IN PI8042_MOUSE_EXTENSION DeviceExtension,
IN UCHAR Input); IN UCHAR Input);
/* readwrite.c */ /* readwrite.c */
VOID VOID
i8042Flush(IN PPORT_DEVICE_EXTENSION DeviceExtension); i8042Flush(
IN PPORT_DEVICE_EXTENSION DeviceExtension);
BOOLEAN BOOLEAN
i8042IsrWritePort(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042IsrWritePort(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN UCHAR Value, IN UCHAR Value,
IN UCHAR SelectCmd OPTIONAL); IN UCHAR SelectCmd OPTIONAL);
NTSTATUS NTSTATUS
i8042ReadData(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042ReadData(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN UCHAR StatusFlags, IN UCHAR StatusFlags,
OUT PUCHAR Data); OUT PUCHAR Data);
#define i8042ReadKeyboardData(DeviceExtension, Data) \ #define i8042ReadKeyboardData(DeviceExtension, Data) \
@ -394,42 +406,50 @@ i8042ReadData(IN PPORT_DEVICE_EXTENSION DeviceExtension,
i8042ReadData(DeviceExtension, MOU_OBF, Data) i8042ReadData(DeviceExtension, MOU_OBF, Data)
NTSTATUS NTSTATUS
i8042ReadDataWait(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042ReadDataWait(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
OUT PUCHAR Data); OUT PUCHAR Data);
NTSTATUS NTSTATUS
i8042ReadStatus(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042ReadStatus(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
OUT PUCHAR Status); OUT PUCHAR Status);
NTSTATUS NTAPI NTSTATUS NTAPI
i8042SynchReadPort(IN PVOID Context, i8042SynchReadPort(
IN PVOID Context,
OUT PUCHAR Value, OUT PUCHAR Value,
IN BOOLEAN WaitForAck); IN BOOLEAN WaitForAck);
NTSTATUS NTAPI NTSTATUS NTAPI
i8042SynchWritePort(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042SynchWritePort(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN UCHAR Port, IN UCHAR Port,
IN UCHAR Value, IN UCHAR Value,
IN BOOLEAN WaitForAck); IN BOOLEAN WaitForAck);
BOOLEAN BOOLEAN
i8042Write(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042Write(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN PUCHAR addr, IN PUCHAR addr,
IN UCHAR data); IN UCHAR data);
/* registry.c */ /* registry.c */
NTSTATUS NTSTATUS
ReadRegistryEntries(IN PUNICODE_STRING RegistryPath, ReadRegistryEntries(
IN PUNICODE_STRING RegistryPath,
OUT PI8042_SETTINGS Settings); OUT PI8042_SETTINGS Settings);
/* setup.c */ /* setup.c */
BOOLEAN BOOLEAN
IsFirstStageSetup(VOID); IsFirstStageSetup(
VOID);
NTSTATUS NTSTATUS
i8042AddLegacyKeyboard(IN PDRIVER_OBJECT DriverObject, i8042AddLegacyKeyboard(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath); IN PUNICODE_STRING RegistryPath);
#endif // _I8042PRT_H_ #endif // _I8042PRT_H_

View file

@ -35,7 +35,8 @@ static LOCAL_KEYBOARD_INDICATOR_TRANSLATION IndicatorTranslation = { 3, {
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
static VOID NTAPI static VOID NTAPI
i8042DebugWorkItem(IN PDEVICE_OBJECT DeviceObject, i8042DebugWorkItem(
IN PDEVICE_OBJECT DeviceObject,
IN PVOID Key) IN PVOID Key)
{ {
INFO_(I8042PRT, "Debug key: p\n", Key); INFO_(I8042PRT, "Debug key: p\n", Key);
@ -50,30 +51,31 @@ i8042DebugWorkItem(IN PDEVICE_OBJECT DeviceObject,
} }
/* /*
* These functions are callbacks for filter driver custom interrupt * These functions are callbacks for filter driver custom interrupt
* service routines. * service routines.
*/ */
/*static VOID NTAPI /*static VOID NTAPI
i8042KbdIsrWritePort( i8042KbdIsrWritePort(
IN PVOID Context, IN PVOID Context,
IN UCHAR Value) IN UCHAR Value)
{ {
PI8042_KEYBOARD_EXTENSION DeviceExtension; PI8042_KEYBOARD_EXTENSION DeviceExtension;
DeviceExtension = (PI8042_KEYBOARD_EXTENSION)Context; DeviceExtension = (PI8042_KEYBOARD_EXTENSION)Context;
if (DeviceExtension->KeyboardHook.IsrWritePort) if (DeviceExtension->KeyboardHook.IsrWritePort)
{ {
DeviceExtension->KeyboardHook.IsrWritePort( DeviceExtension->KeyboardHook.IsrWritePort(
DeviceExtension->KeyboardHook.CallContext, DeviceExtension->KeyboardHook.CallContext,
Value); Value);
} }
else else
i8042IsrWritePort(Context, Value, 0); i8042IsrWritePort(Context, Value, 0);
}*/ }*/
static VOID NTAPI static VOID NTAPI
i8042KbdQueuePacket(IN PVOID Context) i8042KbdQueuePacket(
IN PVOID Context)
{ {
PI8042_KEYBOARD_EXTENSION DeviceExtension; PI8042_KEYBOARD_EXTENSION DeviceExtension;
@ -92,25 +94,28 @@ i8042KbdQueuePacket(IN PVOID Context)
} }
/* /*
* These functions are callbacks for filter driver custom * These functions are callbacks for filter driver custom
* initialization routines. * initialization routines.
*/ */
NTSTATUS NTAPI NTSTATUS NTAPI
i8042SynchWritePortKbd(IN PVOID Context, i8042SynchWritePortKbd(
IN PVOID Context,
IN UCHAR Value, IN UCHAR Value,
IN BOOLEAN WaitForAck) IN BOOLEAN WaitForAck)
{ {
return i8042SynchWritePort((PPORT_DEVICE_EXTENSION)Context, return i8042SynchWritePort(
(PPORT_DEVICE_EXTENSION)Context,
0, 0,
Value, Value,
WaitForAck); WaitForAck);
} }
/* /*
* Process the keyboard internal device requests * Process the keyboard internal device requests
*/ */
VOID NTAPI VOID NTAPI
i8042KbdStartIo(IN PDEVICE_OBJECT DeviceObject, i8042KbdStartIo(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp) IN PIRP Irp)
{ {
PIO_STACK_LOCATION Stack; PIO_STACK_LOCATION Stack;
@ -160,7 +165,8 @@ i8042KbdStartIo(IN PDEVICE_OBJECT DeviceObject,
} }
static VOID static VOID
i8042PacketDpc(IN PPORT_DEVICE_EXTENSION DeviceExtension) i8042PacketDpc(
IN PPORT_DEVICE_EXTENSION DeviceExtension)
{ {
BOOLEAN FinishIrp = FALSE; BOOLEAN FinishIrp = FALSE;
KIRQL Irql; KIRQL Irql;
@ -197,7 +203,8 @@ i8042PacketDpc(IN PPORT_DEVICE_EXTENSION DeviceExtension)
} }
static VOID NTAPI static VOID NTAPI
i8042PowerWorkItem(IN PDEVICE_OBJECT DeviceObject, i8042PowerWorkItem(
IN PDEVICE_OBJECT DeviceObject,
IN PVOID Context) IN PVOID Context)
{ {
PI8042_KEYBOARD_EXTENSION DeviceExtension; PI8042_KEYBOARD_EXTENSION DeviceExtension;
@ -280,7 +287,8 @@ i8042PowerWorkItem(IN PDEVICE_OBJECT DeviceObject,
/* Return TRUE if it was a power key */ /* Return TRUE if it was a power key */
static BOOLEAN static BOOLEAN
HandlePowerKeys(IN PI8042_KEYBOARD_EXTENSION DeviceExtension) HandlePowerKeys(
IN PI8042_KEYBOARD_EXTENSION DeviceExtension)
{ {
PKEYBOARD_INPUT_DATA InputData; PKEYBOARD_INPUT_DATA InputData;
ULONG KeyPress; ULONG KeyPress;
@ -320,7 +328,8 @@ HandlePowerKeys(IN PI8042_KEYBOARD_EXTENSION DeviceExtension)
} }
static VOID NTAPI static VOID NTAPI
i8042KbdDpcRoutine(IN PKDPC Dpc, i8042KbdDpcRoutine(
IN PKDPC Dpc,
IN PVOID DeferredContext, IN PVOID DeferredContext,
IN PVOID SystemArgument1, IN PVOID SystemArgument1,
IN PVOID SystemArgument2) IN PVOID SystemArgument2)
@ -392,10 +401,11 @@ i8042KbdDpcRoutine(IN PKDPC Dpc,
} }
/* /*
* Runs the keyboard IOCTL dispatch. * Runs the keyboard IOCTL dispatch.
*/ */
NTSTATUS NTAPI NTSTATUS NTAPI
i8042KbdDeviceControl(IN PDEVICE_OBJECT DeviceObject, i8042KbdDeviceControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp) IN PIRP Irp)
{ {
PIO_STACK_LOCATION Stack; PIO_STACK_LOCATION Stack;
@ -493,10 +503,11 @@ i8042KbdDeviceControl(IN PDEVICE_OBJECT DeviceObject,
} }
/* /*
* Runs the keyboard IOCTL_INTERNAL dispatch. * Runs the keyboard IOCTL_INTERNAL dispatch.
*/ */
NTSTATUS NTAPI NTSTATUS NTAPI
i8042KbdInternalDeviceControl(IN PDEVICE_OBJECT DeviceObject, i8042KbdInternalDeviceControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp) IN PIRP Irp)
{ {
PIO_STACK_LOCATION Stack; PIO_STACK_LOCATION Stack;
@ -699,13 +710,14 @@ cleanup:
} }
/* /*
* Call the customization hook. The ToReturn parameter is about wether * Call the customization hook. The ToReturn parameter is about wether
* we should go on with the interrupt. The return value is what * we should go on with the interrupt. The return value is what
* we should return (indicating to the system wether someone else * we should return (indicating to the system wether someone else
* should try to handle the interrupt) * should try to handle the interrupt)
*/ */
static BOOLEAN static BOOLEAN
i8042KbdCallIsrHook(IN PI8042_KEYBOARD_EXTENSION DeviceExtension, i8042KbdCallIsrHook(
IN PI8042_KEYBOARD_EXTENSION DeviceExtension,
IN UCHAR Status, IN UCHAR Status,
IN UCHAR Input, IN UCHAR Input,
OUT PBOOLEAN ToReturn) OUT PBOOLEAN ToReturn)
@ -735,7 +747,8 @@ i8042KbdCallIsrHook(IN PI8042_KEYBOARD_EXTENSION DeviceExtension,
} }
BOOLEAN NTAPI BOOLEAN NTAPI
i8042KbdInterruptService(IN PKINTERRUPT Interrupt, i8042KbdInterruptService(
IN PKINTERRUPT Interrupt,
PVOID Context) PVOID Context)
{ {
PI8042_KEYBOARD_EXTENSION DeviceExtension; PI8042_KEYBOARD_EXTENSION DeviceExtension;

View file

@ -13,7 +13,8 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
NTSTATUS NTAPI NTSTATUS NTAPI
ForwardIrpAndWait(IN PDEVICE_OBJECT DeviceObject, ForwardIrpAndWait(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp) IN PIRP Irp)
{ {
PDEVICE_OBJECT LowerDevice = ((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice; PDEVICE_OBJECT LowerDevice = ((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
@ -27,7 +28,8 @@ ForwardIrpAndWait(IN PDEVICE_OBJECT DeviceObject,
} }
NTSTATUS NTAPI NTSTATUS NTAPI
ForwardIrpAndForget(IN PDEVICE_OBJECT DeviceObject, ForwardIrpAndForget(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp) IN PIRP Irp)
{ {
PDEVICE_OBJECT LowerDevice = ((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice; PDEVICE_OBJECT LowerDevice = ((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
@ -39,7 +41,8 @@ ForwardIrpAndForget(IN PDEVICE_OBJECT DeviceObject,
} }
NTSTATUS NTSTATUS
DuplicateUnicodeString(IN ULONG Flags, DuplicateUnicodeString(
IN ULONG Flags,
IN PCUNICODE_STRING SourceString, IN PCUNICODE_STRING SourceString,
OUT PUNICODE_STRING DestinationString) OUT PUNICODE_STRING DestinationString)
{ {

View file

@ -17,11 +17,12 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
/* /*
* These functions are callbacks for filter driver custom interrupt * These functions are callbacks for filter driver custom interrupt
* service routines. * service routines.
*/ */
static VOID NTAPI static VOID NTAPI
i8042MouIsrWritePort(IN PVOID Context, i8042MouIsrWritePort(
IN PVOID Context,
IN UCHAR Value) IN UCHAR Value)
{ {
PI8042_MOUSE_EXTENSION DeviceExtension; PI8042_MOUSE_EXTENSION DeviceExtension;
@ -39,7 +40,8 @@ i8042MouIsrWritePort(IN PVOID Context,
} }
static VOID NTAPI static VOID NTAPI
i8042MouQueuePacket(IN PVOID Context) i8042MouQueuePacket(
IN PVOID Context)
{ {
PI8042_MOUSE_EXTENSION DeviceExtension; PI8042_MOUSE_EXTENSION DeviceExtension;
@ -58,7 +60,8 @@ i8042MouQueuePacket(IN PVOID Context)
} }
VOID VOID
i8042MouHandle(IN PI8042_MOUSE_EXTENSION DeviceExtension, i8042MouHandle(
IN PI8042_MOUSE_EXTENSION DeviceExtension,
IN UCHAR Output) IN UCHAR Output)
{ {
PMOUSE_INPUT_DATA MouseInput; PMOUSE_INPUT_DATA MouseInput;
@ -176,11 +179,12 @@ i8042MouHandle(IN PI8042_MOUSE_EXTENSION DeviceExtension,
} }
/* /*
* Updates ButtonFlags according to RawButtons and a saved state; * Updates ButtonFlags according to RawButtons and a saved state;
* Only takes in account the bits that are set in Mask * Only takes in account the bits that are set in Mask
*/ */
VOID VOID
i8042MouHandleButtons(IN PI8042_MOUSE_EXTENSION DeviceExtension, i8042MouHandleButtons(
IN PI8042_MOUSE_EXTENSION DeviceExtension,
IN USHORT Mask) IN USHORT Mask)
{ {
PMOUSE_INPUT_DATA MouseInput; PMOUSE_INPUT_DATA MouseInput;
@ -209,10 +213,11 @@ i8042MouHandleButtons(IN PI8042_MOUSE_EXTENSION DeviceExtension,
} }
/* Does lastest initializations for the mouse. This method /* Does lastest initializations for the mouse. This method
* is called just before connecting the interrupt. * is called just before connecting the interrupt.
*/ */
NTSTATUS NTSTATUS
i8042MouInitialize(IN PI8042_MOUSE_EXTENSION DeviceExtension) i8042MouInitialize(
IN PI8042_MOUSE_EXTENSION DeviceExtension)
{ {
NTSTATUS Status; NTSTATUS Status;
UCHAR Value; UCHAR Value;
@ -245,7 +250,8 @@ i8042MouInitialize(IN PI8042_MOUSE_EXTENSION DeviceExtension)
} }
static VOID NTAPI static VOID NTAPI
i8042MouDpcRoutine(IN PKDPC Dpc, i8042MouDpcRoutine(
IN PKDPC Dpc,
IN PVOID DeferredContext, IN PVOID DeferredContext,
IN PVOID SystemArgument1, IN PVOID SystemArgument1,
IN PVOID SystemArgument2) IN PVOID SystemArgument2)
@ -328,11 +334,12 @@ i8042MouDpcRoutine(IN PKDPC Dpc,
} }
/* This timer DPC will be called when the mouse reset times out. /* This timer DPC will be called when the mouse reset times out.
* I'll just send the 'disable mouse port' command to the controller * I'll just send the 'disable mouse port' command to the controller
* and say the mouse doesn't exist. * and say the mouse doesn't exist.
*/ */
static VOID NTAPI static VOID NTAPI
i8042DpcRoutineMouseTimeout(IN PKDPC Dpc, i8042DpcRoutineMouseTimeout(
IN PKDPC Dpc,
IN PVOID DeferredContext, IN PVOID DeferredContext,
IN PVOID SystemArgument1, IN PVOID SystemArgument1,
IN PVOID SystemArgument2) IN PVOID SystemArgument2)
@ -359,10 +366,11 @@ i8042DpcRoutineMouseTimeout(IN PKDPC Dpc,
} }
/* /*
* Runs the mouse IOCTL_INTERNAL dispatch. * Runs the mouse IOCTL_INTERNAL dispatch.
*/ */
NTSTATUS NTAPI NTSTATUS NTAPI
i8042MouInternalDeviceControl(IN PDEVICE_OBJECT DeviceObject, i8042MouInternalDeviceControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp) IN PIRP Irp)
{ {
PIO_STACK_LOCATION Stack; PIO_STACK_LOCATION Stack;
@ -495,17 +503,18 @@ cleanup:
} }
/* Test if packets are taking too long to come in. If they do, we /* Test if packets are taking too long to come in. If they do, we
* might have gotten out of sync and should just drop what we have. * might have gotten out of sync and should just drop what we have.
* *
* If we want to be totally right, we'd also have to keep a count of * If we want to be totally right, we'd also have to keep a count of
* errors, and totally reset the mouse after too much of them (can * errors, and totally reset the mouse after too much of them (can
* happen if the user is using a KVM switch and an OS on another port * happen if the user is using a KVM switch and an OS on another port
* resets the mouse, or if the user hotplugs the mouse, or if we're just * resets the mouse, or if the user hotplugs the mouse, or if we're just
* generally unlucky). Also note the input parsing routine where we * generally unlucky). Also note the input parsing routine where we
* drop invalid input packets. * drop invalid input packets.
*/ */
static VOID static VOID
i8042MouInputTestTimeout(IN PI8042_MOUSE_EXTENSION DeviceExtension) i8042MouInputTestTimeout(
IN PI8042_MOUSE_EXTENSION DeviceExtension)
{ {
ULARGE_INTEGER Now; ULARGE_INTEGER Now;
@ -530,13 +539,14 @@ i8042MouInputTestTimeout(IN PI8042_MOUSE_EXTENSION DeviceExtension)
} }
/* /*
* Call the customization hook. The ToReturn parameter is about wether * Call the customization hook. The ToReturn parameter is about wether
* we should go on with the interrupt. The return value is what * we should go on with the interrupt. The return value is what
* we should return (indicating to the system wether someone else * we should return (indicating to the system wether someone else
* should try to handle the interrupt) * should try to handle the interrupt)
*/ */
static BOOLEAN static BOOLEAN
i8042MouCallIsrHook(IN PI8042_MOUSE_EXTENSION DeviceExtension, i8042MouCallIsrHook(
IN PI8042_MOUSE_EXTENSION DeviceExtension,
IN UCHAR Status, IN UCHAR Status,
IN UCHAR Input, IN UCHAR Input,
OUT PBOOLEAN ToReturn) OUT PBOOLEAN ToReturn)
@ -567,7 +577,8 @@ i8042MouCallIsrHook(IN PI8042_MOUSE_EXTENSION DeviceExtension,
} }
static BOOLEAN static BOOLEAN
i8042MouResetIsr(IN PI8042_MOUSE_EXTENSION DeviceExtension, i8042MouResetIsr(
IN PI8042_MOUSE_EXTENSION DeviceExtension,
IN UCHAR Status, IN UCHAR Status,
IN UCHAR Value) IN UCHAR Value)
{ {
@ -817,7 +828,8 @@ i8042MouResetIsr(IN PI8042_MOUSE_EXTENSION DeviceExtension,
} }
BOOLEAN NTAPI BOOLEAN NTAPI
i8042MouInterruptService(IN PKINTERRUPT Interrupt, i8042MouInterruptService(
IN PKINTERRUPT Interrupt,
PVOID Context) PVOID Context)
{ {
PI8042_MOUSE_EXTENSION DeviceExtension; PI8042_MOUSE_EXTENSION DeviceExtension;

View file

@ -14,25 +14,26 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
/* This is all pretty confusing. There's more than one way to /* This is all pretty confusing. There's more than one way to
* disable/enable the keyboard. You can send KBD_ENABLE to the * disable/enable the keyboard. You can send KBD_ENABLE to the
* keyboard, and it will start scanning keys. Sending KBD_DISABLE * keyboard, and it will start scanning keys. Sending KBD_DISABLE
* will disable the key scanning but also reset the parameters to * will disable the key scanning but also reset the parameters to
* defaults. * defaults.
* *
* You can also send 0xAE to the controller for enabling the * You can also send 0xAE to the controller for enabling the
* keyboard clock line and 0xAD for disabling it. Then it'll * keyboard clock line and 0xAD for disabling it. Then it'll
* automatically get turned on at the next command. The last * automatically get turned on at the next command. The last
* way is by modifying the bit that drives the clock line in the * way is by modifying the bit that drives the clock line in the
* 'command byte' of the controller. This is almost, but not quite, * 'command byte' of the controller. This is almost, but not quite,
* the same as the AE/AD thing. The difference can be used to detect * the same as the AE/AD thing. The difference can be used to detect
* some really old broken keyboard controllers which I hope won't be * some really old broken keyboard controllers which I hope won't be
* necessary. * necessary.
* *
* We change the command byte, sending KBD_ENABLE/DISABLE seems to confuse * We change the command byte, sending KBD_ENABLE/DISABLE seems to confuse
* some kvm switches. * some kvm switches.
*/ */
BOOLEAN BOOLEAN
i8042ChangeMode(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042ChangeMode(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN UCHAR FlagsToDisable, IN UCHAR FlagsToDisable,
IN UCHAR FlagsToEnable) IN UCHAR FlagsToEnable)
{ {
@ -71,7 +72,8 @@ i8042ChangeMode(IN PPORT_DEVICE_EXTENSION DeviceExtension,
} }
static NTSTATUS static NTSTATUS
i8042BasicDetect(IN PPORT_DEVICE_EXTENSION DeviceExtension) i8042BasicDetect(
IN PPORT_DEVICE_EXTENSION DeviceExtension)
{ {
NTSTATUS Status; NTSTATUS Status;
ULONG ResendIterations; ULONG ResendIterations;
@ -122,7 +124,8 @@ i8042BasicDetect(IN PPORT_DEVICE_EXTENSION DeviceExtension)
} }
static VOID static VOID
i8042DetectKeyboard(IN PPORT_DEVICE_EXTENSION DeviceExtension) i8042DetectKeyboard(
IN PPORT_DEVICE_EXTENSION DeviceExtension)
{ {
NTSTATUS Status; NTSTATUS Status;
@ -157,7 +160,8 @@ i8042DetectKeyboard(IN PPORT_DEVICE_EXTENSION DeviceExtension)
} }
static VOID static VOID
i8042DetectMouse(IN PPORT_DEVICE_EXTENSION DeviceExtension) i8042DetectMouse(
IN PPORT_DEVICE_EXTENSION DeviceExtension)
{ {
NTSTATUS Status; NTSTATUS Status;
UCHAR Value; UCHAR Value;
@ -258,7 +262,8 @@ failure:
} }
static NTSTATUS static NTSTATUS
i8042ConnectKeyboardInterrupt(IN PI8042_KEYBOARD_EXTENSION DeviceExtension) i8042ConnectKeyboardInterrupt(
IN PI8042_KEYBOARD_EXTENSION DeviceExtension)
{ {
PPORT_DEVICE_EXTENSION PortDeviceExtension; PPORT_DEVICE_EXTENSION PortDeviceExtension;
KIRQL DirqlMax; KIRQL DirqlMax;
@ -303,7 +308,8 @@ i8042ConnectKeyboardInterrupt(IN PI8042_KEYBOARD_EXTENSION DeviceExtension)
} }
static NTSTATUS static NTSTATUS
i8042ConnectMouseInterrupt(IN PI8042_MOUSE_EXTENSION DeviceExtension) i8042ConnectMouseInterrupt(
IN PI8042_MOUSE_EXTENSION DeviceExtension)
{ {
PPORT_DEVICE_EXTENSION PortDeviceExtension; PPORT_DEVICE_EXTENSION PortDeviceExtension;
KIRQL DirqlMax; KIRQL DirqlMax;
@ -365,7 +371,8 @@ cleanup:
} }
static NTSTATUS static NTSTATUS
EnableInterrupts(IN PPORT_DEVICE_EXTENSION DeviceExtension, EnableInterrupts(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN UCHAR FlagsToDisable, IN UCHAR FlagsToDisable,
IN UCHAR FlagsToEnable) IN UCHAR FlagsToEnable)
{ {
@ -388,7 +395,8 @@ EnableInterrupts(IN PPORT_DEVICE_EXTENSION DeviceExtension,
} }
static NTSTATUS static NTSTATUS
StartProcedure(IN PPORT_DEVICE_EXTENSION DeviceExtension) StartProcedure(
IN PPORT_DEVICE_EXTENSION DeviceExtension)
{ {
NTSTATUS Status; NTSTATUS Status;
UCHAR FlagsToDisable = 0; UCHAR FlagsToDisable = 0;
@ -468,7 +476,8 @@ StartProcedure(IN PPORT_DEVICE_EXTENSION DeviceExtension)
} }
static NTSTATUS static NTSTATUS
i8042PnpStartDevice(IN PDEVICE_OBJECT DeviceObject, i8042PnpStartDevice(
IN PDEVICE_OBJECT DeviceObject,
IN PCM_RESOURCE_LIST AllocatedResources, IN PCM_RESOURCE_LIST AllocatedResources,
IN PCM_RESOURCE_LIST AllocatedResourcesTranslated) IN PCM_RESOURCE_LIST AllocatedResourcesTranslated)
{ {
@ -622,7 +631,8 @@ i8042PnpStartDevice(IN PDEVICE_OBJECT DeviceObject,
} }
NTSTATUS NTAPI NTSTATUS NTAPI
i8042Pnp(IN PDEVICE_OBJECT DeviceObject, i8042Pnp(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp) IN PIRP Irp)
{ {
PIO_STACK_LOCATION Stack; PIO_STACK_LOCATION Stack;

View file

@ -14,7 +14,8 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
VOID VOID
i8042MouHandlePs2pp(IN PI8042_MOUSE_EXTENSION DeviceExtension, i8042MouHandlePs2pp(
IN PI8042_MOUSE_EXTENSION DeviceExtension,
IN UCHAR Input) IN UCHAR Input)
{ {
UCHAR PktType; UCHAR PktType;

View file

@ -16,7 +16,8 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
VOID VOID
i8042Flush(IN PPORT_DEVICE_EXTENSION DeviceExtension) i8042Flush(
IN PPORT_DEVICE_EXTENSION DeviceExtension)
{ {
UCHAR Ignore; UCHAR Ignore;
@ -34,7 +35,8 @@ i8042Flush(IN PPORT_DEVICE_EXTENSION DeviceExtension)
} }
BOOLEAN BOOLEAN
i8042IsrWritePort(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042IsrWritePort(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN UCHAR Value, IN UCHAR Value,
IN UCHAR SelectCmd OPTIONAL) IN UCHAR SelectCmd OPTIONAL)
{ {
@ -46,10 +48,11 @@ i8042IsrWritePort(IN PPORT_DEVICE_EXTENSION DeviceExtension,
} }
/* /*
* FUNCTION: Read data from port 0x60 * FUNCTION: Read data from port 0x60
*/ */
NTSTATUS NTSTATUS
i8042ReadData(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042ReadData(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN UCHAR StatusFlags, IN UCHAR StatusFlags,
OUT PUCHAR Data) OUT PUCHAR Data)
{ {
@ -74,7 +77,8 @@ i8042ReadData(IN PPORT_DEVICE_EXTENSION DeviceExtension,
} }
NTSTATUS NTSTATUS
i8042ReadStatus(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042ReadStatus(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
OUT PUCHAR Status) OUT PUCHAR Status)
{ {
ASSERT(DeviceExtension->ControlPort != NULL); ASSERT(DeviceExtension->ControlPort != NULL);
@ -83,10 +87,11 @@ i8042ReadStatus(IN PPORT_DEVICE_EXTENSION DeviceExtension,
} }
/* /*
* FUNCTION: Read data from data port * FUNCTION: Read data from data port
*/ */
NTSTATUS NTSTATUS
i8042ReadDataWait(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042ReadDataWait(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
OUT PUCHAR Data) OUT PUCHAR Data)
{ {
ULONG Counter; ULONG Counter;
@ -109,13 +114,14 @@ i8042ReadDataWait(IN PPORT_DEVICE_EXTENSION DeviceExtension,
} }
/* /*
* This one reads a value from the port; You don't have to specify * This one reads a value from the port; You don't have to specify
* which one, it'll always be from the one you talked to, so one function * which one, it'll always be from the one you talked to, so one function
* is enough this time. Note how MSDN specifies the * is enough this time. Note how MSDN specifies the
* WaitForAck parameter to be ignored. * WaitForAck parameter to be ignored.
*/ */
NTSTATUS NTAPI NTSTATUS NTAPI
i8042SynchReadPort(IN PVOID Context, i8042SynchReadPort(
IN PVOID Context,
OUT PUCHAR Value, OUT PUCHAR Value,
IN BOOLEAN WaitForAck) IN BOOLEAN WaitForAck)
{ {
@ -127,11 +133,12 @@ i8042SynchReadPort(IN PVOID Context,
} }
/* /*
* These functions are callbacks for filter driver custom * These functions are callbacks for filter driver custom
* initialization routines. * initialization routines.
*/ */
NTSTATUS NTAPI NTSTATUS NTAPI
i8042SynchWritePort(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042SynchWritePort(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN UCHAR Port, IN UCHAR Port,
IN UCHAR Value, IN UCHAR Value,
IN BOOLEAN WaitForAck) IN BOOLEAN WaitForAck)
@ -182,10 +189,11 @@ i8042SynchWritePort(IN PPORT_DEVICE_EXTENSION DeviceExtension,
} }
/* /*
* FUNCTION: Write data to a port, waiting first for it to become ready * FUNCTION: Write data to a port, waiting first for it to become ready
*/ */
BOOLEAN BOOLEAN
i8042Write(IN PPORT_DEVICE_EXTENSION DeviceExtension, i8042Write(
IN PPORT_DEVICE_EXTENSION DeviceExtension,
IN PUCHAR addr, IN PUCHAR addr,
IN UCHAR data) IN UCHAR data)
{ {

View file

@ -16,7 +16,8 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
NTSTATUS NTSTATUS
ReadRegistryEntries(IN PUNICODE_STRING RegistryPath, ReadRegistryEntries(
IN PUNICODE_STRING RegistryPath,
OUT PI8042_SETTINGS Settings) OUT PI8042_SETTINGS Settings)
{ {
RTL_QUERY_REGISTRY_TABLE Parameters[17]; RTL_QUERY_REGISTRY_TABLE Parameters[17];

View file

@ -7,8 +7,8 @@
*/ */
/* NOTE: /* NOTE:
* All this file is a big hack and should be removed one day... * All this file is a big hack and should be removed one day...
*/ */
/* INCLUDES ******************************************************************/ /* INCLUDES ******************************************************************/
@ -23,7 +23,8 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
BOOLEAN BOOLEAN
IsFirstStageSetup(VOID) IsFirstStageSetup(
VOID)
{ {
UNICODE_STRING PathU = RTL_CONSTANT_STRING(L"\\REGISTRY\\MACHINE\\SYSTEM\\Setup"); UNICODE_STRING PathU = RTL_CONSTANT_STRING(L"\\REGISTRY\\MACHINE\\SYSTEM\\Setup");
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
@ -46,7 +47,8 @@ IsFirstStageSetup(VOID)
} }
static VOID NTAPI static VOID NTAPI
SendStartDevice(IN PDRIVER_OBJECT DriverObject, SendStartDevice(
IN PDRIVER_OBJECT DriverObject,
IN PVOID Context, IN PVOID Context,
IN ULONG Count) IN ULONG Count)
{ {
@ -162,7 +164,8 @@ cleanup:
} }
static NTSTATUS static NTSTATUS
AddRegistryEntry(IN PCWSTR PortTypeName, AddRegistryEntry(
IN PCWSTR PortTypeName,
IN PUNICODE_STRING DeviceName, IN PUNICODE_STRING DeviceName,
IN PCWSTR RegistryPath) IN PCWSTR RegistryPath)
{ {
@ -208,7 +211,8 @@ cleanup:
} }
NTSTATUS NTSTATUS
i8042AddLegacyKeyboard(IN PDRIVER_OBJECT DriverObject, i8042AddLegacyKeyboard(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath) IN PUNICODE_STRING RegistryPath)
{ {
UNICODE_STRING KeyboardName = RTL_CONSTANT_STRING(L"\\Device\\KeyboardPort8042"); UNICODE_STRING KeyboardName = RTL_CONSTANT_STRING(L"\\Device\\KeyboardPort8042");