[PCIIDEX]
authorThomas Faber <thomas.faber@reactos.org>
Wed, 20 Jul 2016 11:49:22 +0000 (11:49 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Wed, 20 Jul 2016 11:49:22 +0000 (11:49 +0000)
- Add a stub for PciIdeXPowerDispatch
CORE-11648

svn path=/trunk/; revision=71972

reactos/drivers/storage/ide/pciidex/miniport.c

index d26300f..bb0ea2a 100644 (file)
@@ -42,6 +42,42 @@ PciIdeXForwardOrIgnore(
        }
 }
 
+_Dispatch_type_(IRP_MJ_POWER)
+static DRIVER_DISPATCH PciIdeXPowerDispatch;
+static NTSTATUS NTAPI
+PciIdeXPowerDispatch(
+       IN PDEVICE_OBJECT DeviceObject,
+       IN PIRP Irp)
+{
+       NTSTATUS Status;
+       PIO_STACK_LOCATION IoStack;
+       PDEVICE_OBJECT LowerDevice;
+
+       IoStack = IoGetCurrentIrpStackLocation(Irp);
+       if (((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
+       {
+               LowerDevice = ((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
+               PoStartNextPowerIrp(Irp);
+               IoSkipCurrentIrpStackLocation(Irp);
+               return PoCallDriver(LowerDevice, Irp);
+       }
+       else
+       {
+               switch (IoStack->MinorFunction)
+               {
+                       case IRP_MN_SET_POWER:
+                       case IRP_MN_QUERY_POWER:
+                               Irp->IoStatus.Status = STATUS_SUCCESS;
+                               break;
+               }
+               Status = Irp->IoStatus.Status;
+               PoStartNextPowerIrp(Irp);
+               IoCompleteRequest(Irp, IO_NO_INCREMENT);
+               return Status;
+       }
+}
+
+_Dispatch_type_(IRP_MJ_PNP)
 static DRIVER_DISPATCH PciIdeXPnpDispatch;
 static NTSTATUS NTAPI
 PciIdeXPnpDispatch(
@@ -83,6 +119,7 @@ PciIdeXInitialize(
 
        for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++)
                DriverObject->MajorFunction[i] = PciIdeXForwardOrIgnore;
+       DriverObject->MajorFunction[IRP_MJ_POWER] = PciIdeXPowerDispatch;
        DriverObject->MajorFunction[IRP_MJ_PNP] = PciIdeXPnpDispatch;
 
        return STATUS_SUCCESS;