PREQUEST_POWER_COMPLETE CompletionRoutine;
POWER_STATE PowerState;
PVOID Context;
+ PDEVICE_OBJECT TopDeviceObject;
} REQUEST_POWER_ITEM, *PREQUEST_POWER_ITEM;
typedef struct _POWER_STATE_TRAVERSE_CONTEXT
RequestPowerItem->Context,
&Irp->IoStatus);
- ExFreePool(Context);
-
IoFreeIrp(Irp);
- ObDereferenceObject(DeviceObject);
+
+ ObDereferenceObject(RequestPowerItem->TopDeviceObject);
+ ExFreePool(Context);
return STATUS_MORE_PROCESSING_REQUIRED;
}
RequestPowerItem->CompletionRoutine = CompletionFunction;
RequestPowerItem->PowerState = PowerState;
RequestPowerItem->Context = Context;
+ RequestPowerItem->TopDeviceObject = TopDeviceObject;
if (pIrp != NULL)
*pIrp = Irp;