From 0d15b2a3cb8375646ccc582f74945f8b9c8bbe83 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Wed, 6 Mar 2019 14:57:58 +0100 Subject: [PATCH] [USBCCGP] Correctly stub PDO power IRP handling. --- drivers/usb/usbccgp/pdo.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/drivers/usb/usbccgp/pdo.c b/drivers/usb/usbccgp/pdo.c index bcd0acb075a..40072ace311 100644 --- a/drivers/usb/usbccgp/pdo.c +++ b/drivers/usb/usbccgp/pdo.c @@ -1070,6 +1070,30 @@ PDO_HandleInternalDeviceControl( return STATUS_NOT_IMPLEMENTED; } +NTSTATUS +PDO_HandlePower( + PDEVICE_OBJECT DeviceObject, + PIRP Irp) +{ + NTSTATUS Status; + PIO_STACK_LOCATION IoStack; + + IoStack = IoGetCurrentIrpStackLocation(Irp); + + 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; +} + NTSTATUS PDO_Dispatch( @@ -1089,10 +1113,7 @@ PDO_Dispatch( case IRP_MJ_INTERNAL_DEVICE_CONTROL: return PDO_HandleInternalDeviceControl(DeviceObject, Irp); case IRP_MJ_POWER: - PoStartNextPowerIrp(Irp); - Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_SUCCESS; + return PDO_HandlePower(DeviceObject, Irp); default: DPRINT1("PDO_Dispatch Function %x not implemented\n", IoStack->MajorFunction); Status = Irp->IoStatus.Status;