mirror of
https://github.com/reactos/reactos
synced 2025-10-05 16:02:58 +02:00
[NDK] potypes.h: Add useful macros for SYSTEM_POWER_CAPABILITIES (#8386)
Add useful macros, similar to the powrprof.dll `IsPwr*()` functions, but that are suitable when one has a `SYSTEM_POWER_CAPABILITIES` structure initialized from `NtPowerInformation(SystemPowerCapabilities)`. - `IS_PWR_SUSPEND_ALLOWED()`, equivalent to `IsPwrSuspendAllowed()`, indicating whether any of the S1, S2, S3 sleep states are supported. - `IS_PWR_HIBERNATE_ALLOWED()`, equivalent to `IsPwrHibernateAllowed()`, indicating whether the S4 sleep state is supported and the hibernation file is present. - `IS_PWR_POWEROFF_ALLOWED()`, equivalent to `IsPwrShutdownAllowed()`, indicating whether the S5 "soft-off" state is supported.
This commit is contained in:
@@ -51,6 +51,33 @@ typedef enum _SYSTEM_DOCK_STATE
|
||||
SystemDocked
|
||||
} SYSTEM_DOCK_STATE, *PSYSTEM_DOCK_STATE;
|
||||
|
||||
//
|
||||
// Some useful macros for SYSTEM_POWER_CAPABILITIES,
|
||||
// similar to the powrprof.dll IsPwr*() functions.
|
||||
//
|
||||
|
||||
/*
|
||||
* BOOLEAN WINAPI
|
||||
* IsPwrSuspendAllowed(VOID);
|
||||
*/
|
||||
#define IS_PWR_SUSPEND_ALLOWED(PowerCaps) \
|
||||
((PowerCaps)->SystemS1 || (PowerCaps)->SystemS2 || (PowerCaps)->SystemS3)
|
||||
|
||||
/*
|
||||
* BOOLEAN WINAPI
|
||||
* IsPwrHibernateAllowed(VOID);
|
||||
*/
|
||||
#define IS_PWR_HIBERNATE_ALLOWED(PowerCaps) \
|
||||
((PowerCaps)->SystemS4 && (PowerCaps)->HiberFilePresent)
|
||||
|
||||
/*
|
||||
* BOOLEAN WINAPI
|
||||
* IsPwrShutdownAllowed(VOID);
|
||||
*/
|
||||
#define IS_PWR_POWEROFF_ALLOWED(PowerCaps) \
|
||||
(!!(PowerCaps)->SystemS5)
|
||||
|
||||
|
||||
#ifndef NTOS_MODE_USER
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user