mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:52: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
2 changed files with 47 additions and 6 deletions
|
@ -91,14 +91,30 @@ SetSystemPowerState(BOOL fSuspend, BOOL fForce)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOL
|
BOOL
|
||||||
WINAPI
|
WINAPI
|
||||||
GetDevicePowerState(HANDLE hDevice, BOOL *pfOn)
|
GetDevicePowerState(HANDLE hDevice, BOOL *pfOn)
|
||||||
{
|
{
|
||||||
STUB;
|
DEVICE_POWER_STATE DevicePowerState;
|
||||||
return 0;
|
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
|
BOOL
|
||||||
WINAPI
|
WINAPI
|
||||||
RequestWakeupLatency(LATENCY_TIME latency)
|
RequestWakeupLatency(LATENCY_TIME latency)
|
||||||
{
|
{
|
||||||
STUB;
|
NTSTATUS Status;
|
||||||
return 0;
|
|
||||||
|
Status = NtRequestWakeupLatency(latency);
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
SetLastErrorByStatus(Status);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -86,4 +86,20 @@ ZwSetSystemPowerState(
|
||||||
IN SYSTEM_POWER_STATE MinSystemState,
|
IN SYSTEM_POWER_STATE MinSystemState,
|
||||||
IN ULONG Flags
|
IN ULONG Flags
|
||||||
);
|
);
|
||||||
|
|
||||||
|
NTSYSAPI
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
NtGetDevicePowerState(
|
||||||
|
IN HANDLE Device,
|
||||||
|
IN PDEVICE_POWER_STATE PowerState
|
||||||
|
);
|
||||||
|
|
||||||
|
NTSYSAPI
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
NtRequestWakeupLatency(
|
||||||
|
IN LATENCY_TIME latency
|
||||||
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue