57 PowerStatus->BatteryLifePercent = (
UCHAR)((100 * Current +
Max / 2) /
Max);
61 PowerStatus->BatteryLifePercent = 100;
64 if (PowerStatus->BatteryLifePercent <= 4)
67 if (PowerStatus->BatteryLifePercent <= 32)
70 if (PowerStatus->BatteryLifePercent >= 67)
#define NT_SUCCESS(StatCode)
#define ERROR_CALL_NOT_IMPLEMENTED
BOOL WINAPI GetSystemPowerStatus(IN LPSYSTEM_POWER_STATUS PowerStatus)
BOOL WINAPI SetMessageWaitingIndicator(IN HANDLE hMsgIndicator, IN ULONG ulMsgCount)
BOOL WINAPI RequestWakeupLatency(IN LATENCY_TIME latency)
BOOL WINAPI RequestDeviceWakeup(IN HANDLE hDevice)
BOOL WINAPI SetSystemPowerState(IN BOOL fSuspend, IN BOOL fForce)
BOOL WINAPI CancelDeviceWakeupRequest(IN HANDLE hDevice)
EXECUTION_STATE WINAPI SetThreadExecutionState(EXECUTION_STATE esFlags)
return pDevice GetDevicePowerState()
NTSTATUS NTAPI NtRequestDeviceWakeup(IN HANDLE DeviceHandle)
NTSTATUS NTAPI NtCancelDeviceWakeupRequest(IN HANDLE DeviceHandle)
NTSTATUS NTAPI NtInitiatePowerAction(IN POWER_ACTION SystemAction, IN SYSTEM_POWER_STATE MinSystemState, IN ULONG Flags, IN BOOLEAN Asynchronous)
BOOLEAN NTAPI NtIsSystemResumeAutomatic(VOID)
NTSTATUS NTAPI NtRequestWakeupLatency(IN LATENCY_TIME Latency)
NTSTATUS NTAPI NtSetThreadExecutionState(IN EXECUTION_STATE esFlags, OUT EXECUTION_STATE *PreviousFlags)
NTSTATUS NTAPI NtPowerInformation(IN POWER_INFORMATION_LEVEL PowerInformationLevel, IN PVOID InputBuffer OPTIONAL, IN ULONG InputBufferLength, OUT PVOID OutputBuffer OPTIONAL, IN ULONG OutputBufferLength)
NTSTATUS NTAPI NtGetDevicePowerState(IN HANDLE Device, IN PDEVICE_POWER_STATE PowerState)
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
DWORD BaseSetLastNTError(IN NTSTATUS Status)
#define RtlZeroMemory(Destination, Length)
BOOL WINAPI IsSystemResumeAutomatic(void)
#define BATTERY_FLAG_CHARGING
#define BATTERY_LIFE_UNKNOWN
#define BATTERY_FLAG_NO_BATTERY
#define BATTERY_FLAG_CRITICAL
#define BATTERY_FLAG_HIGH
#define BATTERY_PERCENTAGE_UNKNOWN