Process Hacker
ntpoapi.h
Go to the documentation of this file.
1 #ifndef _NTPOAPI_H
2 #define _NTPOAPI_H
3 
4 typedef union _POWER_STATE
5 {
6  SYSTEM_POWER_STATE SystemState;
7  DEVICE_POWER_STATE DeviceState;
9 
10 typedef enum _POWER_STATE_TYPE
11 {
15 
16 #if (PHNT_VERSION >= PHNT_VISTA)
17 // wdm
19 {
20  union
21  {
22  struct
23  {
24  ULONG Reserved1 : 8;
25  ULONG TargetSystemState : 4;
27  ULONG CurrentSystemState : 4;
29  ULONG PseudoTransition : 1;
30  ULONG Reserved2 : 10;
31  };
33  };
35 #endif
36 
37 #if (PHNT_VERSION >= PHNT_WIN7)
38  // disable doxygen warning
39 // wdm
40 typedef struct _COUNTED_REASON_CONTEXT
41 {
42  ULONG Version;
43  ULONG Flags;
44  union
45  {
46  struct
47  {
48  UNICODE_STRING ResourceFileName;
49  USHORT ResourceReasonId;
50  ULONG StringCount;
51  PUNICODE_STRING _Field_size_(StringCount) ReasonStrings;
52  };
53  UNICODE_STRING SimpleString;
54  };
55 } COUNTED_REASON_CONTEXT, *PCOUNTED_REASON_CONTEXT;
57 #endif
58 
59 typedef enum
60 {
70 
71 typedef NTSTATUS (NTAPI *PENTER_STATE_SYSTEM_HANDLER)(
72  _In_ PVOID SystemContext
73  );
74 
75 typedef NTSTATUS (NTAPI *PENTER_STATE_HANDLER)(
76  _In_ PVOID Context,
77  _In_opt_ PENTER_STATE_SYSTEM_HANDLER SystemHandler,
78  _In_ PVOID SystemContext,
79  _In_ LONG NumberProcessors,
80  _In_ volatile PLONG Number
81  );
82 
83 typedef struct _POWER_STATE_HANDLER
84 {
86  BOOLEAN RtcWake;
87  UCHAR Spare[3];
89  PVOID Context;
91 
92 typedef NTSTATUS (NTAPI *PENTER_STATE_NOTIFY_HANDLER)(
93  _In_ POWER_STATE_HANDLER_TYPE State,
94  _In_ PVOID Context,
95  _In_ BOOLEAN Entering
96  );
97 
99 {
101  PVOID Context;
103 
105 {
106  ULONG Number;
107  ULONG MaxMhz;
108  ULONG CurrentMhz;
109  ULONG MhzLimit;
113 
115 {
117  ULONG Idleness;
119  UCHAR CoolingMode;
121 
122 NTSYSCALLAPI
123 NTSTATUS
124 NTAPI
126  _In_ POWER_INFORMATION_LEVEL InformationLevel,
127  _In_reads_bytes_opt_(InputBufferLength) PVOID InputBuffer,
128  _In_ ULONG InputBufferLength,
129  _Out_writes_bytes_opt_(OutputBufferLength) PVOID OutputBuffer,
130  _In_ ULONG OutputBufferLength
131  );
132 
133 NTSYSCALLAPI
134 NTSTATUS
135 NTAPI
137  _In_ EXECUTION_STATE NewFlags, // ES_* flags
138  _Out_ EXECUTION_STATE *PreviousFlags
139  );
140 
141 NTSYSCALLAPI
142 NTSTATUS
143 NTAPI
145  _In_ LATENCY_TIME latency
146  );
147 
148 NTSYSCALLAPI
149 NTSTATUS
150 NTAPI
152  _In_ POWER_ACTION SystemAction,
153  _In_ SYSTEM_POWER_STATE LightestSystemState,
154  _In_ ULONG Flags, // POWER_ACTION_* flags
155  _In_ BOOLEAN Asynchronous
156  );
157 
158 NTSYSCALLAPI
159 NTSTATUS
160 NTAPI
162  _In_ POWER_ACTION SystemAction,
163  _In_ SYSTEM_POWER_STATE LightestSystemState,
164  _In_ ULONG Flags // POWER_ACTION_* flags
165  );
166 
167 NTSYSCALLAPI
168 NTSTATUS
169 NTAPI
171  _In_ HANDLE Device,
172  _Out_ PDEVICE_POWER_STATE State
173  );
174 
175 NTSYSCALLAPI
176 BOOLEAN
177 NTAPI
179  VOID
180  );
181 
182 #endif