1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
/*++ BUILD Version: 0001 // Increment this if a change has global effects
Copyright (c) 1995 Microsoft Corporation
Module Name:
ntpoapi.h
Abstract:
This module contains the user APIs for the NT Power Management.
Author:
Revision History:
--*/
#ifndef _NTPOAPI_
#define _NTPOAPI_
//
// Power Management user APIs
//
// begin_ntddk begin_ntifs begin_nthal begin_ntminiport
typedef enum _POWER_STATES {
PowerUnspecified = 0,
PowerUp,
PowerQuery,
PowerStandby,
PowerSuspend,
PowerHibernate,
PowerDown,
PowerDownRemove,
MaximumPowerState
} POWER_STATE, *PPOWER_STATE;
// end_ntddk end_nthal end_ntifs end_ntminiport
NTSYSAPI
NTSTATUS
NTAPI
NtSetSystemPowerState(
IN POWER_STATE SystemPowerState,
IN BOOLEAN NoResumeAlarm,
IN BOOLEAN ForcePowerDown
);
// begin_ntddk begin_nthal begin_ntminiport
typedef enum {
BatteryCurrent,
BatteryCycleCount,
BatteryDesignedChargeCapacity,
BatteryDeviceChemistry,
BatteryDeviceName,
BatteryFullChargeCapacity,
BatteryManufactureData,
BatteryManufactureName,
BatteryReportingUnits,
BatteryRemainingCapacity,
BatterySerialNumber,
BatterySuppliesSystemPower,
BatteryVoltage
} BatteryInformationLevel, *PBatterInformationLevel;
typedef struct _BATTERY_CHARGE_WAIT {
ULONG BatteryTag;
BOOLEAN ACOnLine;
BOOLEAN StatusCharging;
BOOLEAN StatusDischarging;
ULONG LowChargeMark;
ULONG HighChargeMark;
} BATTERY_CHARGE_WAIT, *PBATTERY_CHARGE_WAIT;
typedef struct _BATTERY_CHARGE {
ULONG BatteryTag;
BOOLEAN ACOnLine;
BOOLEAN StatusCharging;
BOOLEAN StatusDischarging;
ULONG EstimatedCharge;
} BATTERY_CHARGE, *PBATTERY_CHARGE;
//
// Power management IOCTLs
//
#define IOCTL_SET_RESUME \
CTL_CODE(FILE_DEVICE_BATTERY, 0, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_POWER_DOWN \
CTL_CODE(FILE_DEVICE_BATTERY, 1, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_BATTERY_QUERY_INFORMATION \
CTL_CODE(FILE_DEVICE_BATTERY, 2, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_BATTERY_CHARGE_STATUS \
CTL_CODE(FILE_DEVICE_BATTERY, 3, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_BATTERY_SET_RESUME \
CTL_CODE(FILE_DEVICE_BATTERY, 4, METHOD_BUFFERED, FILE_READ_ACCESS)
// end_ntddk end_nthal end_ntminiport
#endif // _NTPOAPI_
|