| 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::guiddef::{GUID, LPCGUID}; |
| 7 |
use shared::minwindef::{DWORD, HKEY, LPBYTE, LPDWORD, PUCHAR, PULONG}; |
| 8 |
use um::winnt::HANDLE; |
| 9 |
use um::winuser::{HPOWERNOTIFY, PHPOWERNOTIFY}; |
| 10 |
extern "system" { |
| 11 |
pub fn PowerReadACValue( |
| 12 |
RootPowerKey: HKEY, |
| 13 |
SchemeGuid: *const GUID, |
| 14 |
SubGroupOfPowerSettingsGuid: *const GUID, |
| 15 |
PowerSettingGuid: *const GUID, |
| 16 |
Type: PULONG, |
| 17 |
Buffer: LPBYTE, |
| 18 |
BufferSize: LPDWORD, |
| 19 |
) -> DWORD; |
| 20 |
pub fn PowerReadDCValue( |
| 21 |
RootPowerKey: HKEY, |
| 22 |
SchemeGuid: *const GUID, |
| 23 |
SubGroupOfPowerSettingsGuid: *const GUID, |
| 24 |
PowerSettingGuid: *const GUID, |
| 25 |
Type: PULONG, |
| 26 |
Buffer: PUCHAR, |
| 27 |
BufferSize: LPDWORD, |
| 28 |
) -> DWORD; |
| 29 |
pub fn PowerWriteACValueIndex( |
| 30 |
RootPowerKey: HKEY, |
| 31 |
SchemeGuid: *const GUID, |
| 32 |
SubGroupOfPowerSettingsGuid: *const GUID, |
| 33 |
PowerSettingGuid: *const GUID, |
| 34 |
AcValueIndex: DWORD, |
| 35 |
) -> DWORD; |
| 36 |
pub fn PowerWriteDCValueIndex( |
| 37 |
RootPowerKey: HKEY, |
| 38 |
SchemeGuid: *const GUID, |
| 39 |
SubGroupOfPowerSettingsGuid: *const GUID, |
| 40 |
PowerSettingGuid: *const GUID, |
| 41 |
DcValueIndex: DWORD, |
| 42 |
) -> DWORD; |
| 43 |
pub fn PowerGetActiveScheme( |
| 44 |
UserRootPowerKey: HKEY, |
| 45 |
ActivePolicyGuid: *mut *mut GUID, |
| 46 |
) -> DWORD; |
| 47 |
pub fn PowerSetActiveScheme( |
| 48 |
UserRootPowerKey: HKEY, |
| 49 |
SchemeGuid: *const GUID, |
| 50 |
) -> DWORD; |
| 51 |
pub fn PowerSettingRegisterNotification( |
| 52 |
SettingGuid: LPCGUID, |
| 53 |
Flags: DWORD, |
| 54 |
Recipient: HANDLE, |
| 55 |
RegistrationHandle: PHPOWERNOTIFY, |
| 56 |
) -> DWORD; |
| 57 |
pub fn PowerSettingUnregisterNotification( |
| 58 |
RegistrationHandle: HPOWERNOTIFY, |
| 59 |
) -> DWORD; |
| 60 |
} |