Author: janderwald Date: Thu Oct 25 14:27:02 2012 New Revision: 57615
URL: http://svn.reactos.org/svn/reactos?rev=57615&view=rev Log: [NTOSKRNL] - Dereference the correct device object in the power completion routine - Fixes crash with ftdibus.sys
Modified: trunk/reactos/ntoskrnl/po/power.c
Modified: trunk/reactos/ntoskrnl/po/power.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/po/power.c?rev=576... ============================================================================== --- trunk/reactos/ntoskrnl/po/power.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/po/power.c [iso-8859-1] Thu Oct 25 14:27:02 2012 @@ -21,6 +21,7 @@ PREQUEST_POWER_COMPLETE CompletionRoutine; POWER_STATE PowerState; PVOID Context; + PDEVICE_OBJECT TopDeviceObject; } REQUEST_POWER_ITEM, *PREQUEST_POWER_ITEM;
typedef struct _POWER_STATE_TRAVERSE_CONTEXT @@ -56,10 +57,10 @@ RequestPowerItem->Context, &Irp->IoStatus);
+ IoFreeIrp(Irp); + + ObDereferenceObject(RequestPowerItem->TopDeviceObject); ExFreePool(Context); - - IoFreeIrp(Irp); - ObDereferenceObject(DeviceObject);
return STATUS_MORE_PROCESSING_REQUIRED; } @@ -573,6 +574,7 @@ RequestPowerItem->CompletionRoutine = CompletionFunction; RequestPowerItem->PowerState = PowerState; RequestPowerItem->Context = Context; + RequestPowerItem->TopDeviceObject = TopDeviceObject;
if (pIrp != NULL) *pIrp = Irp;