- Dereference the correct device object in the power completion routine
- Fixes crash with ftdibus.sys
svn path=/trunk/; revision=57615
PREQUEST_POWER_COMPLETE CompletionRoutine;
POWER_STATE PowerState;
PVOID Context;
PREQUEST_POWER_COMPLETE CompletionRoutine;
POWER_STATE PowerState;
PVOID Context;
+ PDEVICE_OBJECT TopDeviceObject;
} REQUEST_POWER_ITEM, *PREQUEST_POWER_ITEM;
typedef struct _POWER_STATE_TRAVERSE_CONTEXT
} REQUEST_POWER_ITEM, *PREQUEST_POWER_ITEM;
typedef struct _POWER_STATE_TRAVERSE_CONTEXT
RequestPowerItem->Context,
&Irp->IoStatus);
RequestPowerItem->Context,
&Irp->IoStatus);
- ObDereferenceObject(DeviceObject);
+
+ ObDereferenceObject(RequestPowerItem->TopDeviceObject);
+ ExFreePool(Context);
return STATUS_MORE_PROCESSING_REQUIRED;
}
return STATUS_MORE_PROCESSING_REQUIRED;
}
RequestPowerItem->CompletionRoutine = CompletionFunction;
RequestPowerItem->PowerState = PowerState;
RequestPowerItem->Context = Context;
RequestPowerItem->CompletionRoutine = CompletionFunction;
RequestPowerItem->PowerState = PowerState;
RequestPowerItem->Context = Context;
+ RequestPowerItem->TopDeviceObject = TopDeviceObject;
if (pIrp != NULL)
*pIrp = Irp;
if (pIrp != NULL)
*pIrp = Irp;