Author: tfaber
Date: Sat May  3 11:17:57 2014
New Revision: 63127
URL: 
http://svn.reactos.org/svn/reactos?rev=63127&view=rev
Log:
[I8042PRT]
- Do not prematurely complete IRP_MN_FILTER_RESOURCE_REQUIREMENTS or
IRP_MN_QUERY_PNP_DEVICE_STATE
- Do not handle IRP_MN_QUERY_DEVICE_RELATIONS.BusRelations. We're not the bus driver!
- Correctly stub the (mandatory!) dispatch functions for IRP_MJ_POWER and
IRP_MJ_SYSTEM_CONTROL
CORE-8142 #resolve
Modified:
    trunk/reactos/drivers/input/i8042prt/i8042prt.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] Sat May  3 11:17:57
2014
@@ -23,6 +23,10 @@
 static DRIVER_DISPATCH i8042DeviceControl;
 _Dispatch_type_(IRP_MJ_INTERNAL_DEVICE_CONTROL)
 static DRIVER_DISPATCH i8042InternalDeviceControl;
+_Dispatch_type_(IRP_MJ_SYSTEM_CONTROL)
+static DRIVER_DISPATCH i8042SystemControl;
+_Dispatch_type_(IRP_MJ_POWER)
+static DRIVER_DISPATCH i8042Power;
 DRIVER_INITIALIZE DriverEntry;
 NTSTATUS NTAPI
@@ -468,6 +472,27 @@
        return Status;
 }
+static NTSTATUS NTAPI
+i8042Power(
+       IN PDEVICE_OBJECT DeviceObject,
+       IN PIRP Irp)
+{
+       PFDO_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
+       PDEVICE_OBJECT LowerDevice = DeviceExtension->LowerDevice;
+
+       PoStartNextPowerIrp(Irp);
+       IoSkipCurrentIrpStackLocation(Irp);
+       return PoCallDriver(LowerDevice, Irp);
+}
+
+static NTSTATUS NTAPI
+i8042SystemControl(
+       IN PDEVICE_OBJECT DeviceObject,
+       IN PIRP Irp)
+{
+       return ForwardIrpAndForget(DeviceObject, Irp);
+}
+
 NTSTATUS NTAPI
 DriverEntry(
        IN PDRIVER_OBJECT DriverObject,
@@ -531,6 +556,8 @@
        DriverObject->MajorFunction[IRP_MJ_CLOSE]   = i8042Close;
        DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = i8042DeviceControl;
        DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] =
i8042InternalDeviceControl;
+       DriverObject->MajorFunction[IRP_MJ_POWER]   = i8042Power;
+       DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = i8042SystemControl;
        DriverObject->MajorFunction[IRP_MJ_PNP]     = i8042Pnp;
        return STATUS_SUCCESS;
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] Sat May  3 11:17:57
2014
@@ -19,6 +19,7 @@
 /* FUNCTIONS *****************************************************************/
 static KDEFERRED_ROUTINE i8042MouDpcRoutine;
+static KDEFERRED_ROUTINE i8042DpcRoutineMouseTimeout;
 /*
  * These functions are callbacks for filter driver custom interrupt
@@ -346,7 +347,6 @@
  * 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,
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] Sat May  3 11:17:57 2014
@@ -685,21 +685,8 @@
             {
                 case BusRelations:
                 {
-                    PDEVICE_RELATIONS DeviceRelations;
-
                     TRACE_(I8042PRT, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS /
BusRelations\n");
-                    DeviceRelations = ExAllocatePoolWithTag(PagedPool,
-                                                            sizeof(DEVICE_RELATIONS),
-                                                            I8042PRT_TAG);
-                    if (DeviceRelations)
-                    {
-                        DeviceRelations->Count = 0;
-                        Information = (ULONG_PTR)DeviceRelations;
-                        Status = STATUS_SUCCESS;
-                    }
-                    else
-                        Status = STATUS_INSUFFICIENT_RESOURCES;
-                    break;
+                    return ForwardIrpAndForget(DeviceObject, Irp);
                 }
                 case RemovalRelations:
                 {
@@ -709,7 +696,6 @@
                 default:
                     ERR_(I8042PRT, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS /
Unknown type 0x%lx\n",
                         Stack->Parameters.QueryDeviceRelations.Type);
-                    ASSERT(FALSE);
                     return ForwardIrpAndForget(DeviceObject, Irp);
             }
             break;
@@ -717,17 +703,12 @@
         case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: /* (optional) 0x0d */
         {
             TRACE_(I8042PRT, "IRP_MJ_PNP /
IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
-            /* Nothing to do */
-            Status = Irp->IoStatus.Status;
-            break;
+            return ForwardIrpAndForget(DeviceObject, Irp);
         }
         case IRP_MN_QUERY_PNP_DEVICE_STATE: /* 0x14 */
         {
             TRACE_(I8042PRT, "IRP_MJ_PNP / IRP_MN_QUERY_PNP_DEVICE_STATE\n");
-            /* Nothing much to tell */
-            Information = 0;
-            Status = STATUS_SUCCESS;
-            break;
+            return ForwardIrpAndForget(DeviceObject, Irp);
         }
         default:
         {