45#define POWER_SYSTEM_MAXIMUM PowerSystemMaximum
133#if (NTDDI_VERSION >= NTDDI_WINXP) || !defined(_BATCLASS_)
143#define POWER_PERF_SCALE 100
144#define PERF_LEVEL_TO_PERCENT(x) (((x) * 1000) / (POWER_PERF_SCALE * 10))
145#define PERCENT_TO_PERF_LEVEL(x) (((x) * POWER_PERF_SCALE * 10) / 1000)
172#define MAX_IDLE_HANDLERS 3
196(
NTAPI *PENTER_STATE_SYSTEM_HANDLER)(
202(
NTAPI *PENTER_STATE_HANDLER)(
220(
NTAPI *PENTER_STATE_NOTIFY_HANDLER)(
242#define PROCESSOR_STATE_TYPE_PERFORMANCE 1
243#define PROCESSOR_STATE_TYPE_THROTTLE 2
345#define WINLOGON_LOCK_ON_SLEEP 0x00000001
364#if (NTDDI_VERSION < NTDDI_WINXP)
365 UCHAR ProcessorThrottleScale;
414#define POWER_ACTION_QUERY_ALLOWED 0x00000001
415#define POWER_ACTION_UI_ALLOWED 0x00000002
416#define POWER_ACTION_OVERRIDE_APPS 0x00000004
417#define POWER_ACTION_LIGHTEST_FIRST 0x10000000
418#define POWER_ACTION_LOCK_CONSOLE 0x20000000
419#define POWER_ACTION_DISABLE_WAKES 0x40000000
420#define POWER_ACTION_CRITICAL 0x80000000
423#define POWER_LEVEL_USER_NOTIFY_TEXT 0x00000001
424#define POWER_LEVEL_USER_NOTIFY_SOUND 0x00000002
425#define POWER_LEVEL_USER_NOTIFY_EXEC 0x00000004
426#define POWER_USER_NOTIFY_BUTTON 0x00000008
427#define POWER_USER_NOTIFY_SHUTDOWN 0x00000010
428#define POWER_FORCE_TRIGGER_RESET 0x80000000
430#define DISCHARGE_POLICY_CRITICAL 0
431#define DISCHARGE_POLICY_LOW 1
432#define NUM_DISCHARGE_POLICIES 4
434#define PO_THROTTLE_NONE 0
435#define PO_THROTTLE_CONSTANT 1
436#define PO_THROTTLE_DEGRADE 2
437#define PO_THROTTLE_ADAPTIVE 3
438#define PO_THROTTLE_MAXIMUM 4
#define _IRQL_requires_same_
#define _IRQL_requires_max_(irql)
#define _Function_class_(x)
#define _In_reads_bytes_opt_(size)
#define _Out_writes_bytes_opt_(size)
NTSTATUS NTAPI NtInitiatePowerAction(IN POWER_ACTION SystemAction, IN SYSTEM_POWER_STATE MinSystemState, IN ULONG Flags, IN BOOLEAN Asynchronous)
BOOLEAN NTAPI NtIsSystemResumeAutomatic(VOID)
NTSTATUS NTAPI NtSetThreadExecutionState(IN EXECUTION_STATE esFlags, OUT EXECUTION_STATE *PreviousFlags)
NTSTATUS NTAPI NtSetSystemPowerState(IN POWER_ACTION SystemAction, IN SYSTEM_POWER_STATE MinSystemState, IN ULONG Flags)
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)
_In_ SYSTEM_POWER_STATE MinSystemState
struct _POWER_STATE_NOTIFY_HANDLER * PPOWER_STATE_NOTIFY_HANDLER
#define MAX_IDLE_HANDLERS
_In_ PVOID _In_ BOOLEAN Entering
enum _POWER_STATE_HANDLER_TYPE POWER_STATE_HANDLER_TYPE
struct _PROCESSOR_IDLE_HANDLER_INFO * PPROCESSOR_IDLE_HANDLER_INFO
struct _PROCESSOR_STATE_HANDLER2 PROCESSOR_STATE_HANDLER2
enum POWER_ACTION * PPOWER_ACTION
enum _SYSTEM_POWER_STATE * PSYSTEM_POWER_STATE
_In_ SYSTEM_POWER_STATE _In_ ULONG _In_ BOOLEAN Asynchronous
NTSTATUS(FASTCALL * PSET_PROCESSOR_THROTTLE2)(IN UCHAR Throttle)
struct _PROCESSOR_STATE_HANDLER PROCESSOR_STATE_HANDLER
enum _POWER_STATE_TYPE POWER_STATE_TYPE
struct _PROCESSOR_IDLE_TIMES * PPROCESSOR_IDLE_TIMES
struct _PROCESSOR_PERF_LEVEL * PPROCESSOR_PERF_LEVEL
struct _PROCESSOR_POWER_INFORMATION PROCESSOR_POWER_INFORMATION
NTSYSCALLAPI NTSTATUS NTAPI NtRequestDeviceWakeup(_In_ HANDLE Device)
struct _POWER_STATE_HANDLER * PPOWER_STATE_HANDLER
struct _PROCESSOR_IDLE_TIMES PROCESSOR_IDLE_TIMES
NTSYSCALLAPI NTSTATUS NTAPI NtCancelDeviceWakeupRequest(_In_ HANDLE Device)
struct _PROCESSOR_STATE_HANDLER2 * PPROCESSOR_STATE_HANDLER2
struct _PROCESSOR_STATE_HANDLER * PPROCESSOR_STATE_HANDLER
union _POWER_STATE * PPOWER_STATE
struct SYSTEM_BATTERY_STATE * PSYSTEM_BATTERY_STATE
struct _PROCESSOR_PERF_STATE PROCESSOR_PERF_STATE
_In_opt_ PENTER_STATE_SYSTEM_HANDLER _In_opt_ PVOID SystemContext
struct BATTERY_REPORTING_SCALE * PBATTERY_REPORTING_SCALE
struct _PROCESSOR_IDLE_HANDLER_INFO PROCESSOR_IDLE_HANDLER_INFO
struct _POWER_STATE_NOTIFY_HANDLER POWER_STATE_NOTIFY_HANDLER
_Out_ DEVICE_POWER_STATE * State
struct SYSTEM_POWER_CAPABILITIES * PSYSTEM_POWER_CAPABILITIES
union _POWER_STATE POWER_STATE
struct _PROCESSOR_PERF_LEVEL PROCESSOR_PERF_LEVEL
enum _POWER_STATE_HANDLER_TYPE * PPOWER_STATE_HANDLER_TYPE
_Out_ EXECUTION_STATE * PreviousFlags
@ PowerActionShutdownReset
_Inout_ PPROCESSOR_IDLE_TIMES IdleTimes
enum _DEVICE_POWER_STATE * PDEVICE_POWER_STATE
enum _POWER_INFORMATION_LEVEL POWER_INFORMATION_LEVEL
struct _SYSTEM_POWER_INFORMATION * PSYSTEM_POWER_INFORMATION
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
struct _POWER_STATE_HANDLER POWER_STATE_HANDLER
struct _POWER_ACTION_POLICY * PPOWER_ACTION_POLICY
struct _PROCESSOR_PERF_STATE * PPROCESSOR_PERF_STATE
enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE
VOID(FASTCALL * PSET_PROCESSOR_THROTTLE)(IN UCHAR Throttle)
struct _POWER_ACTION_POLICY POWER_ACTION_POLICY
_In_opt_ PENTER_STATE_SYSTEM_HANDLER SystemHandler
struct _SYSTEM_POWER_INFORMATION SYSTEM_POWER_INFORMATION
@ TraceServicePowerMessage
@ TraceApplicationPowerMessage
@ SystemPowerStateNotifyHandler
@ SystemPowerStateLogging
@ SystemHiberFileInformation
@ AdministratorPowerPolicy
@ PowerShutdownNotification
@ SystemPowerCapabilities
@ SystemPowerLoggingEntry
@ ProcessorPowerPolicyCurrent
@ NotifyUserModeLegacyPowerEvent
@ VerifyProcessorPowerPolicyDc
@ PowerInformationLevelUnused1
@ VerifyProcessorPowerPolicyAc
@ PowerInformationLevelUnused0
@ PowerInformationLevelMaximum
@ SystemPowerPolicyCurrent
@ TraceApplicationPowerMessageEnd
@ SystemPowerStateHandler
_In_opt_ PENTER_STATE_SYSTEM_HANDLER _In_opt_ PVOID _In_ LONG NumberProcessors
enum _POWER_STATE_TYPE * PPOWER_STATE_TYPE
_POWER_STATE_HANDLER_TYPE
@ PowerStateShutdownReset
@ PowerStateSleeping4Firmware
NTSYSCALLAPI NTSTATUS NTAPI NtRequestWakeupLatency(_In_ LATENCY_TIME latency)
_In_opt_ PENTER_STATE_SYSTEM_HANDLER _In_opt_ PVOID _In_ LONG _In_opt_ LONG volatile * Number
struct _PROCESSOR_POWER_INFORMATION * PPROCESSOR_POWER_INFORMATION
BOOLEAN PowerButtonPresent
BOOLEAN SystemBatteriesPresent
BOOLEAN ProcessorThrottle
BOOLEAN BatteriesAreShortTerm
UCHAR ProcessorMaxThrottle
SYSTEM_POWER_STATE AcOnLineWake
BOOLEAN SleepButtonPresent
SYSTEM_POWER_STATE DefaultLowLatencyWake
SYSTEM_POWER_STATE MinDeviceWakeState
SYSTEM_POWER_STATE SoftLidWake
UCHAR ProcessorMinThrottle
SYSTEM_POWER_STATE RtcWake
POWER_STATE_HANDLER_TYPE Type
PENTER_STATE_HANDLER Handler
PENTER_STATE_NOTIFY_HANDLER Handler
PPROCESSOR_IDLE_HANDLER Handler
ULONG IdleHandlerReserved[4]
ULONGLONG PerformanceTime
PROCESSOR_IDLE_HANDLER_INFO IdleHandler[MAX_IDLE_HANDLERS]
PSET_PROCESSOR_THROTTLE2 SetPerfLevel
PROCESSOR_PERF_LEVEL PerfLevel[1]
PSET_PROCESSOR_THROTTLE SetThrottle
PROCESSOR_IDLE_HANDLER_INFO IdleHandler[MAX_IDLE_HANDLERS]
DEVICE_POWER_STATE DeviceState
SYSTEM_POWER_STATE SystemState
_Must_inspect_result_ _In_ WDFDEVICE Device
_In_ WDFREQUEST _In_ size_t OutputBufferLength
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
_Must_inspect_result_ _In_ ULONG Flags
_In_ SYSTEM_POWER_STATE SystemPowerState
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE