- Implement GetDevicePowerState

- Implement RequestWakeupLatency
- Add prototypes for GetDevicePowerState and RequestWakeupLatency to pofuncs.h

svn path=/trunk/; revision=38770
This commit is contained in:
Dmitry Chapyshev 2009-01-15 16:09:03 +00:00
parent 154c781d64
commit 6dea7537bb
2 changed files with 47 additions and 6 deletions

View file

@ -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;
}
/*

View file

@ -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