[KBDCLASS][MOUCLASS]
authorThomas Faber <thomas.faber@reactos.org>
Sun, 6 Sep 2015 14:32:22 +0000 (14:32 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 6 Sep 2015 14:32:22 +0000 (14:32 +0000)
- Forward power IRPs to lower devices. Failing IRP_MN_SET_POWER is illegal!
CORE-10117

svn path=/trunk/; revision=69054

reactos/drivers/input/kbdclass/kbdclass.c
reactos/drivers/input/mouclass/mouclass.c

index 09967b9..d4eceda 100644 (file)
@@ -193,15 +193,18 @@ IrpStub(
        IN PIRP Irp)
 {
        NTSTATUS Status = STATUS_NOT_SUPPORTED;
+       PPORT_DEVICE_EXTENSION DeviceExtension;
 
-       if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
+       DeviceExtension = DeviceObject->DeviceExtension;
+       if (!DeviceExtension->Common.IsClassDO)
        {
                /* Forward some IRPs to lower device */
                switch (IoGetCurrentIrpStackLocation(Irp)->MajorFunction)
                {
-                       case IRP_MJ_PNP:
-                       case IRP_MJ_INTERNAL_DEVICE_CONTROL:
-                               return ForwardIrpAndForget(DeviceObject, Irp);
+                       case IRP_MJ_POWER:
+                               PoStartNextPowerIrp(Irp);
+                               IoSkipCurrentIrpStackLocation(Irp);
+                               return PoCallDriver(DeviceExtension->LowerDevice, Irp);
                        default:
                        {
                                ERR_(CLASS_NAME, "Port DO stub for major function 0x%lx\n",
index 6fb47b3..7cbac1e 100644 (file)
@@ -170,15 +170,18 @@ IrpStub(
        IN PIRP Irp)
 {
        NTSTATUS Status = STATUS_NOT_SUPPORTED;
+       PPORT_DEVICE_EXTENSION DeviceExtension;
 
-       if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
+       DeviceExtension = DeviceObject->DeviceExtension;
+       if (!DeviceExtension->Common.IsClassDO)
        {
                /* Forward some IRPs to lower device */
                switch (IoGetCurrentIrpStackLocation(Irp)->MajorFunction)
                {
-                       case IRP_MJ_PNP:
-                       case IRP_MJ_INTERNAL_DEVICE_CONTROL:
-                               return ForwardIrpAndForget(DeviceObject, Irp);
+                       case IRP_MJ_POWER:
+                               PoStartNextPowerIrp(Irp);
+                               IoSkipCurrentIrpStackLocation(Irp);
+                               return PoCallDriver(DeviceExtension->LowerDevice, Irp);
                        default:
                        {
                                ERR_(CLASS_NAME, "Port DO stub for major function 0x%lx\n",