1 // Licensed under the Apache License, Version 2.0 2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license 3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. 4 // All files in the project carrying such notice may not be copied, modified, or distributed 5 // except according to those terms. 6 use shared::minwindef::{DWORD, ULONG}; 7 use um::winnt::{ 8 BOOLEAN, HANDLE, LONG, POWER_INFORMATION_LEVEL, POWER_PLATFORM_ROLE, 9 PSYSTEM_POWER_CAPABILITIES, PVOID, 10 }; 11 use um::winuser::{HPOWERNOTIFY, PHPOWERNOTIFY}; 12 pub type NTSTATUS = LONG; 13 extern "system" { CallNtPowerInformation( InformationLevel: POWER_INFORMATION_LEVEL, InputBuffer: PVOID, InputBufferLength: ULONG, OutputBuffer: PVOID, OutputBufferLength: ULONG, ) -> NTSTATUS14 pub fn CallNtPowerInformation( 15 InformationLevel: POWER_INFORMATION_LEVEL, 16 InputBuffer: PVOID, 17 InputBufferLength: ULONG, 18 OutputBuffer: PVOID, 19 OutputBufferLength: ULONG, 20 ) -> NTSTATUS; GetPwrCapabilities( lpspc: PSYSTEM_POWER_CAPABILITIES, ) -> BOOLEAN21 pub fn GetPwrCapabilities( 22 lpspc: PSYSTEM_POWER_CAPABILITIES, 23 ) -> BOOLEAN; PowerDeterminePlatformRoleEx( Version: ULONG, ) -> POWER_PLATFORM_ROLE24 pub fn PowerDeterminePlatformRoleEx( 25 Version: ULONG, 26 ) -> POWER_PLATFORM_ROLE; PowerRegisterSuspendResumeNotification( Flags: DWORD, Recipient: HANDLE, RegistrationHandle: PHPOWERNOTIFY, ) -> DWORD27 pub fn PowerRegisterSuspendResumeNotification( 28 Flags: DWORD, 29 Recipient: HANDLE, 30 RegistrationHandle: PHPOWERNOTIFY, 31 ) -> DWORD; PowerUnregisterSuspendResumeNotification( RegistrationHandle: HPOWERNOTIFY, ) -> DWORD32 pub fn PowerUnregisterSuspendResumeNotification( 33 RegistrationHandle: HPOWERNOTIFY, 34 ) -> DWORD; 35 } 36