Author: tfaber
Date: Sun Apr 27 13:33:42 2014
New Revision: 63019
URL:
http://svn.reactos.org/svn/reactos?rev=63019&view=rev
Log:
[I8042PRT]
- Fix WDK warnings and remove some unnecessary casts
Modified:
trunk/reactos/drivers/input/i8042prt/i8042prt.c
trunk/reactos/drivers/input/i8042prt/i8042prt.h
trunk/reactos/drivers/input/i8042prt/keyboard.c
trunk/reactos/drivers/input/i8042prt/misc.c
trunk/reactos/drivers/input/i8042prt/mouse.c
trunk/reactos/drivers/input/i8042prt/pnp.c
Modified: trunk/reactos/drivers/input/i8042prt/i8042prt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/i80…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/i8042prt.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/i8042prt/i8042prt.c [iso-8859-1] Sun Apr 27 13:33:42 2014
@@ -19,7 +19,9 @@
static DRIVER_STARTIO i8042StartIo;
static DRIVER_DISPATCH IrpStub;
+_Dispatch_type_(IRP_MJ_DEVICE_CONTROL)
static DRIVER_DISPATCH i8042DeviceControl;
+_Dispatch_type_(IRP_MJ_INTERNAL_DEVICE_CONTROL)
static DRIVER_DISPATCH i8042InternalDeviceControl;
DRIVER_INITIALIZE DriverEntry;
Modified: trunk/reactos/drivers/input/i8042prt/i8042prt.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/i80…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/i8042prt.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/i8042prt/i8042prt.h [iso-8859-1] Sun Apr 27 13:33:42 2014
@@ -292,10 +292,13 @@
IO_WORKITEM_ROUTINE i8042SendHookWorkItem;
+_Dispatch_type_(IRP_MJ_CREATE)
DRIVER_DISPATCH i8042Create;
+_Dispatch_type_(IRP_MJ_CLEANUP)
DRIVER_DISPATCH i8042Cleanup;
+_Dispatch_type_(IRP_MJ_CLOSE)
DRIVER_DISPATCH i8042Close;
/* keyboard.c */
@@ -371,6 +374,7 @@
IN UCHAR FlagsToDisable,
IN UCHAR FlagsToEnable);
+_Dispatch_type_(IRP_MJ_PNP)
DRIVER_DISPATCH i8042Pnp;
/* ps2pp.c */
Modified: trunk/reactos/drivers/input/i8042prt/keyboard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/key…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/keyboard.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/i8042prt/keyboard.c [iso-8859-1] Sun Apr 27 13:33:42 2014
@@ -21,6 +21,7 @@
/* GLOBALS *******************************************************************/
static IO_WORKITEM_ROUTINE i8042PowerWorkItem;
+static KDEFERRED_ROUTINE i8042KbdDpcRoutine;
/* This structure starts with the same layout as KEYBOARD_INDICATOR_TRANSLATION */
typedef struct _LOCAL_KEYBOARD_INDICATOR_TRANSLATION {
@@ -196,9 +197,10 @@
PIRP WaitingIrp;
NTSTATUS Status;
- DeviceExtension = (PI8042_KEYBOARD_EXTENSION)Context;
-
UNREFERENCED_PARAMETER(DeviceObject);
+
+ __analysis_assume(Context != NULL);
+ DeviceExtension = Context;
/* See
http://blogs.msdn.com/doronh/archive/2006/09/08/746961.aspx */
@@ -331,7 +333,8 @@
UNREFERENCED_PARAMETER(SystemArgument1);
UNREFERENCED_PARAMETER(SystemArgument2);
- DeviceExtension = (PI8042_KEYBOARD_EXTENSION)DeferredContext;
+ __analysis_assume(DeferredContext != NULL);
+ DeviceExtension = DeferredContext;
PortDeviceExtension = DeviceExtension->Common.PortDeviceExtension;
if (HandlePowerKeys(DeviceExtension))
@@ -652,9 +655,6 @@
Irp->IoStatus.Information = sizeof(KEYBOARD_ATTRIBUTES);
Status = STATUS_SUCCESS;
break;
-
- Status = STATUS_NOT_IMPLEMENTED;
- break;
}
case IOCTL_KEYBOARD_QUERY_TYPEMATIC:
{
@@ -745,9 +745,9 @@
}
/*
- * Call the customization hook. The ToReturn parameter is about wether
+ * Call the customization hook. The ToReturn parameter is about whether
* 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 whether someone else
* should try to handle the interrupt)
*/
static BOOLEAN
@@ -796,7 +796,8 @@
UNREFERENCED_PARAMETER(Interrupt);
- DeviceExtension = (PI8042_KEYBOARD_EXTENSION)Context;
+ __analysis_assume(Context != NULL);
+ DeviceExtension = Context;
PortDeviceExtension = DeviceExtension->Common.PortDeviceExtension;
InputData = DeviceExtension->KeyboardBuffer + DeviceExtension->KeysInBuffer;
Counter = PortDeviceExtension->Settings.PollStatusIterations;
Modified: trunk/reactos/drivers/input/i8042prt/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/mis…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/misc.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/i8042prt/misc.c [iso-8859-1] Sun Apr 27 13:33:42 2014
@@ -23,8 +23,9 @@
IN PVOID Context)
{
UNREFERENCED_PARAMETER(DeviceObject);
+ __analysis_assume(Context != NULL);
if (Irp->PendingReturned)
- KeSetEvent((PKEVENT)Context, IO_NO_INCREMENT, FALSE);
+ KeSetEvent(Context, IO_NO_INCREMENT, FALSE);
return STATUS_MORE_PROCESSING_REQUIRED;
}
Modified: trunk/reactos/drivers/input/i8042prt/mouse.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/mou…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/mouse.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/i8042prt/mouse.c [iso-8859-1] Sun Apr 27 13:33:42 2014
@@ -18,6 +18,8 @@
/* FUNCTIONS *****************************************************************/
+static KDEFERRED_ROUTINE i8042MouDpcRoutine;
+
/*
* These functions are callbacks for filter driver custom interrupt
* service routines.
@@ -269,7 +271,8 @@
UNREFERENCED_PARAMETER(SystemArgument1);
UNREFERENCED_PARAMETER(SystemArgument2);
- DeviceExtension = (PI8042_MOUSE_EXTENSION)DeferredContext;
+ __analysis_assume(DeferredContext != NULL);
+ DeviceExtension = DeferredContext;
PortDeviceExtension = DeviceExtension->Common.PortDeviceExtension;
switch (DeviceExtension->MouseTimeoutState)
@@ -343,6 +346,7 @@
* I'll just send the 'disable mouse port' command to the controller
* and say the mouse doesn't exist.
*/
+static KDEFERRED_ROUTINE i8042DpcRoutineMouseTimeout;
static VOID NTAPI
i8042DpcRoutineMouseTimeout(
IN PKDPC Dpc,
@@ -358,7 +362,8 @@
UNREFERENCED_PARAMETER(SystemArgument1);
UNREFERENCED_PARAMETER(SystemArgument2);
- DeviceExtension = (PI8042_MOUSE_EXTENSION)DeferredContext;
+ __analysis_assume(DeferredContext != NULL);
+ DeviceExtension = DeferredContext;
PortDeviceExtension = DeviceExtension->Common.PortDeviceExtension;
Irql = KeAcquireInterruptSpinLock(PortDeviceExtension->HighestDIRQLInterrupt);
@@ -906,7 +911,8 @@
UNREFERENCED_PARAMETER(Interrupt);
- DeviceExtension = (PI8042_MOUSE_EXTENSION)Context;
+ __analysis_assume(Context != NULL);
+ DeviceExtension = Context;
PortDeviceExtension = DeviceExtension->Common.PortDeviceExtension;
Counter = PortDeviceExtension->Settings.PollStatusIterations;
Modified: trunk/reactos/drivers/input/i8042prt/pnp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/pnp…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/pnp.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/i8042prt/pnp.c [iso-8859-1] Sun Apr 27 13:33:42 2014
@@ -112,7 +112,7 @@
}
else if (Value == KBD_RESEND)
{
- TRACE_(I8042PRT, "Resending...\n", Value);
+ TRACE_(I8042PRT, "Resending...\n");
KeStallExecutionProcessor(50);
}
else
@@ -390,7 +390,7 @@
StartProcedure(
IN PPORT_DEVICE_EXTENSION DeviceExtension)
{
- NTSTATUS Status;
+ NTSTATUS Status = STATUS_UNSUCCESSFUL;
UCHAR FlagsToDisable = 0;
UCHAR FlagsToEnable = 0;
KIRQL Irql;
@@ -495,7 +495,7 @@
PFDO_DEVICE_EXTENSION DeviceExtension;
PPORT_DEVICE_EXTENSION PortDeviceExtension;
PCM_PARTIAL_RESOURCE_DESCRIPTOR ResourceDescriptor, ResourceDescriptorTranslated;
- INTERRUPT_DATA InterruptData;
+ INTERRUPT_DATA InterruptData = { NULL };
BOOLEAN FoundDataPort = FALSE;
BOOLEAN FoundControlPort = FALSE;
BOOLEAN FoundIrq = FALSE;
@@ -685,7 +685,9 @@
PDEVICE_RELATIONS DeviceRelations;
TRACE_(I8042PRT, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS /
BusRelations\n");
- DeviceRelations = ExAllocatePool(PagedPool,
sizeof(DEVICE_RELATIONS));
+ DeviceRelations = ExAllocatePoolWithTag(PagedPool,
+ sizeof(DEVICE_RELATIONS),
+ I8042PRT_TAG);
if (DeviceRelations)
{
DeviceRelations->Count = 0;