mirror of
https://github.com/reactos/reactos.git
synced 2024-08-03 01:50:57 +00:00
- Implement GetDevicePowerState
- Implement RequestWakeupLatency - Add prototypes for GetDevicePowerState and RequestWakeupLatency to pofuncs.h svn path=/trunk/; revision=38770
This commit is contained in:
parent
154c781d64
commit
6dea7537bb
|
@ -91,14 +91,30 @@ SetSystemPowerState(BOOL fSuspend, BOOL fForce)
|
|||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
BOOL
|
||||
WINAPI
|
||||
GetDevicePowerState(HANDLE hDevice, BOOL *pfOn)
|
||||
{
|
||||
STUB;
|
||||
return 0;
|
||||
DEVICE_POWER_STATE DevicePowerState;
|
||||
NTSTATUS Status;
|
||||
|
||||
Status = NtGetDevicePowerState(hDevice, &DevicePowerState);
|
||||
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
if ((DevicePowerState != PowerDeviceUnspecified) &&
|
||||
(DevicePowerState != PowerDeviceD0))
|
||||
*pfOn = FALSE;
|
||||
else
|
||||
*pfOn = TRUE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
SetLastErrorByStatus(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -113,14 +129,23 @@ RequestDeviceWakeup(HANDLE hDevice)
|
|||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
BOOL
|
||||
WINAPI
|
||||
RequestWakeupLatency(LATENCY_TIME latency)
|
||||
{
|
||||
STUB;
|
||||
return 0;
|
||||
NTSTATUS Status;
|
||||
|
||||
Status = NtRequestWakeupLatency(latency);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastErrorByStatus(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -86,4 +86,20 @@ ZwSetSystemPowerState(
|
|||
IN SYSTEM_POWER_STATE MinSystemState,
|
||||
IN ULONG Flags
|
||||
);
|
||||
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
NtGetDevicePowerState(
|
||||
IN HANDLE Device,
|
||||
IN PDEVICE_POWER_STATE PowerState
|
||||
);
|
||||
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
NtRequestWakeupLatency(
|
||||
IN LATENCY_TIME latency
|
||||
);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue