mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
[NTOSKRNL]
- Dereference the correct device object in the power completion routine - Fixes crash with ftdibus.sys svn path=/trunk/; revision=57615
This commit is contained in:
parent
3ab390e130
commit
d0d756519b
1 changed files with 5 additions and 3 deletions
|
@ -21,6 +21,7 @@ typedef struct _REQUEST_POWER_ITEM
|
|||
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 @@ PopRequestPowerIrpCompletion(IN PDEVICE_OBJECT DeviceObject,
|
|||
RequestPowerItem->Context,
|
||||
&Irp->IoStatus);
|
||||
|
||||
ExFreePool(Context);
|
||||
|
||||
IoFreeIrp(Irp);
|
||||
ObDereferenceObject(DeviceObject);
|
||||
|
||||
ObDereferenceObject(RequestPowerItem->TopDeviceObject);
|
||||
ExFreePool(Context);
|
||||
|
||||
return STATUS_MORE_PROCESSING_REQUIRED;
|
||||
}
|
||||
|
@ -573,6 +574,7 @@ PoRequestPowerIrp(IN PDEVICE_OBJECT DeviceObject,
|
|||
RequestPowerItem->CompletionRoutine = CompletionFunction;
|
||||
RequestPowerItem->PowerState = PowerState;
|
||||
RequestPowerItem->Context = Context;
|
||||
RequestPowerItem->TopDeviceObject = TopDeviceObject;
|
||||
|
||||
if (pIrp != NULL)
|
||||
*pIrp = Irp;
|
||||
|
|
Loading…
Reference in a new issue