mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 02:15:47 +00:00
- Implement PcRequestNewPowerState
svn path=/trunk/; revision=38723
This commit is contained in:
parent
0afaa05791
commit
db8b3ac429
2 changed files with 47 additions and 23 deletions
|
@ -36,3 +36,50 @@ PcRegisterAdapterPowerManagement(
|
||||||
DeviceExt->AdapterPowerManagement = pPower;
|
DeviceExt->AdapterPowerManagement = pPower;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
PwrCompletionCallback(
|
||||||
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
|
IN UCHAR MinorFunction,
|
||||||
|
IN POWER_STATE PowerState,
|
||||||
|
IN PVOID Context,
|
||||||
|
IN PIO_STATUS_BLOCK IoStatus)
|
||||||
|
{
|
||||||
|
KeSetEvent((PRKEVENT)Context, IO_NO_INCREMENT, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
NTSTATUS NTAPI
|
||||||
|
PcRequestNewPowerState(
|
||||||
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
|
IN DEVICE_POWER_STATE RequestedNewState)
|
||||||
|
{
|
||||||
|
KEVENT Event;
|
||||||
|
NTSTATUS Status;
|
||||||
|
POWER_STATE PowerState;
|
||||||
|
PCExtension* DeviceExt;
|
||||||
|
|
||||||
|
if (!DeviceObject || !RequestedNewState)
|
||||||
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
DeviceExt = (PCExtension*)DeviceObject->DeviceExtension;
|
||||||
|
KeInitializeEvent(&Event, SynchronizationEvent, FALSE);
|
||||||
|
|
||||||
|
PowerState.DeviceState = RequestedNewState;
|
||||||
|
PowerState.SystemState = PowerSystemUnspecified;
|
||||||
|
|
||||||
|
Status = PoRequestPowerIrp(DeviceExt->PhysicalDeviceObject, IRP_MN_SET_POWER, PowerState, PwrCompletionCallback, (PVOID)&Event, NULL);
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
KeWaitForSingleObject((PVOID)&Event, Executive, KernelMode, FALSE, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,29 +12,6 @@
|
||||||
#include "private.h"
|
#include "private.h"
|
||||||
#include <portcls.h>
|
#include <portcls.h>
|
||||||
|
|
||||||
/*
|
|
||||||
Factory Stubs
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ===============================================================
|
|
||||||
Power Management
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
NTSTATUS NTAPI
|
|
||||||
PcRequestNewPowerState(
|
|
||||||
IN PDEVICE_OBJECT pDeviceObject,
|
|
||||||
IN DEVICE_POWER_STATE RequestedNewState)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return STATUS_UNSUCCESSFUL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ===============================================================
|
/* ===============================================================
|
||||||
Properties
|
Properties
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue