From 9df05ba4b65631942d006f36a4ad1d848f0bf61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sun, 12 Jul 2020 15:37:20 +0200 Subject: [PATCH] [ISAPNP] Properly stub IRP_MJ_POWER --- drivers/bus/isapnp/isapnp.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/bus/isapnp/isapnp.c b/drivers/bus/isapnp/isapnp.c index 913721b3acd..f14894de6c8 100644 --- a/drivers/bus/isapnp/isapnp.c +++ b/drivers/bus/isapnp/isapnp.c @@ -807,6 +807,28 @@ IsaAddDevice( return STATUS_SUCCESS; } +DRIVER_DISPATCH IsaPower; +NTSTATUS +NTAPI +IsaPower( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + PISAPNP_COMMON_EXTENSION DevExt = DeviceObject->DeviceExtension; + NTSTATUS Status; + + if (!DevExt->IsFdo) + { + Status = Irp->IoStatus.Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; + } + + PoStartNextPowerIrp(Irp); + IoSkipCurrentIrpStackLocation(Irp); + return PoCallDriver(((PISAPNP_FDO_EXTENSION)DevExt)->Ldo, Irp); +} + static DRIVER_DISPATCH IsaPnp; static @@ -849,6 +871,7 @@ DriverEntry( DriverObject->MajorFunction[IRP_MJ_WRITE] = IsaReadWrite; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = IsaIoctl; DriverObject->MajorFunction[IRP_MJ_PNP] = IsaPnp; + DriverObject->MajorFunction[IRP_MJ_POWER] = IsaPower; DriverObject->DriverExtension->AddDevice = IsaAddDevice; return STATUS_SUCCESS;