mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
[NTOS:PO]
- Send power IRPs to the top of the device stack instead of the PDO CORE-10110 #resolve svn path=/trunk/; revision=72017
This commit is contained in:
parent
7bd6365632
commit
cb6e26b3db
1 changed files with 16 additions and 2 deletions
|
@ -153,6 +153,7 @@ PopQuerySystemPowerStateTraverse(PDEVICE_NODE DeviceNode,
|
||||||
PVOID Context)
|
PVOID Context)
|
||||||
{
|
{
|
||||||
PPOWER_STATE_TRAVERSE_CONTEXT PowerStateContext = Context;
|
PPOWER_STATE_TRAVERSE_CONTEXT PowerStateContext = Context;
|
||||||
|
PDEVICE_OBJECT TopDeviceObject;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT("PopQuerySystemPowerStateTraverse(%p, %p)\n", DeviceNode, Context);
|
DPRINT("PopQuerySystemPowerStateTraverse(%p, %p)\n", DeviceNode, Context);
|
||||||
|
@ -163,13 +164,16 @@ PopQuerySystemPowerStateTraverse(PDEVICE_NODE DeviceNode,
|
||||||
if (DeviceNode->Flags & DNF_LEGACY_DRIVER)
|
if (DeviceNode->Flags & DNF_LEGACY_DRIVER)
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
||||||
Status = PopSendQuerySystemPowerState(DeviceNode->PhysicalDeviceObject,
|
TopDeviceObject = IoGetAttachedDeviceReference(DeviceNode->PhysicalDeviceObject);
|
||||||
|
|
||||||
|
Status = PopSendQuerySystemPowerState(TopDeviceObject,
|
||||||
PowerStateContext->SystemPowerState,
|
PowerStateContext->SystemPowerState,
|
||||||
PowerStateContext->PowerAction);
|
PowerStateContext->PowerAction);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Device '%wZ' failed IRP_MN_QUERY_POWER\n", &DeviceNode->InstancePath);
|
DPRINT1("Device '%wZ' failed IRP_MN_QUERY_POWER\n", &DeviceNode->InstancePath);
|
||||||
}
|
}
|
||||||
|
ObDereferenceObject(TopDeviceObject);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -183,6 +187,7 @@ PopSetSystemPowerStateTraverse(PDEVICE_NODE DeviceNode,
|
||||||
PVOID Context)
|
PVOID Context)
|
||||||
{
|
{
|
||||||
PPOWER_STATE_TRAVERSE_CONTEXT PowerStateContext = Context;
|
PPOWER_STATE_TRAVERSE_CONTEXT PowerStateContext = Context;
|
||||||
|
PDEVICE_OBJECT TopDeviceObject;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT("PopSetSystemPowerStateTraverse(%p, %p)\n", DeviceNode, Context);
|
DPRINT("PopSetSystemPowerStateTraverse(%p, %p)\n", DeviceNode, Context);
|
||||||
|
@ -196,7 +201,14 @@ PopSetSystemPowerStateTraverse(PDEVICE_NODE DeviceNode,
|
||||||
if (DeviceNode->Flags & DNF_LEGACY_DRIVER)
|
if (DeviceNode->Flags & DNF_LEGACY_DRIVER)
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
||||||
Status = PopSendSetSystemPowerState(DeviceNode->PhysicalDeviceObject,
|
TopDeviceObject = IoGetAttachedDeviceReference(DeviceNode->PhysicalDeviceObject);
|
||||||
|
if (TopDeviceObject == PowerStateContext->PowerDevice)
|
||||||
|
{
|
||||||
|
ObDereferenceObject(TopDeviceObject);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = PopSendSetSystemPowerState(TopDeviceObject,
|
||||||
PowerStateContext->SystemPowerState,
|
PowerStateContext->SystemPowerState,
|
||||||
PowerStateContext->PowerAction);
|
PowerStateContext->PowerAction);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
@ -204,6 +216,8 @@ PopSetSystemPowerStateTraverse(PDEVICE_NODE DeviceNode,
|
||||||
DPRINT1("Device '%wZ' failed IRP_MN_SET_POWER\n", &DeviceNode->InstancePath);
|
DPRINT1("Device '%wZ' failed IRP_MN_SET_POWER\n", &DeviceNode->InstancePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ObDereferenceObject(TopDeviceObject);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
return Status;
|
return Status;
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue