This repository has been archived by the owner on Feb 10, 2024. It is now read-only.
forked from winsiderss/phnt
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ntpoapi.h
577 lines (534 loc) · 20.2 KB
/
ntpoapi.h
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
// POWER_INFORMATION_LEVEL
// Note: We don't use an enum for these values to minimize conflicts with the Windows SDK. (dmex)
#define SystemPowerPolicyAc 0 // SYSTEM_POWER_POLICY // GET: InputBuffer NULL. SET: InputBuffer not NULL.
#define SystemPowerPolicyDc 1 // SYSTEM_POWER_POLICY
#define VerifySystemPolicyAc 2 // SYSTEM_POWER_POLICY
#define VerifySystemPolicyDc 3 // SYSTEM_POWER_POLICY
#define SystemPowerCapabilities 4 // SYSTEM_POWER_CAPABILITIES
#define SystemBatteryState 5 // SYSTEM_BATTERY_STATE
#define SystemPowerStateHandler 6 // POWER_STATE_HANDLER // (kernel-mode only)
#define ProcessorStateHandler 7 // PROCESSOR_STATE_HANDLER // (kernel-mode only)
#define SystemPowerPolicyCurrent 8 // SYSTEM_POWER_POLICY
#define AdministratorPowerPolicy 9 // ADMINISTRATOR_POWER_POLICY
#define SystemReserveHiberFile 10 // BOOLEAN // (requires SeCreatePagefilePrivilege) // TRUE: hibernation file created. FALSE: hibernation file deleted.
#define ProcessorInformation 11 // PROCESSOR_POWER_INFORMATION
#define SystemPowerInformation 12 // SYSTEM_POWER_INFORMATION
#define ProcessorStateHandler2 13 // PROCESSOR_STATE_HANDLER2 // not implemented
#define LastWakeTime 14 // ULONGLONG // InterruptTime
#define LastSleepTime 15 // ULONGLONG // InterruptTime
#define SystemExecutionState 16 // EXECUTION_STATE // NtSetThreadExecutionState
#define SystemPowerStateNotifyHandler 17 // POWER_STATE_NOTIFY_HANDLER // (kernel-mode only)
#define ProcessorPowerPolicyAc 18 // PROCESSOR_POWER_POLICY // not implemented
#define ProcessorPowerPolicyDc 19 // PROCESSOR_POWER_POLICY // not implemented
#define VerifyProcessorPowerPolicyAc 20 // PROCESSOR_POWER_POLICY // not implemented
#define VerifyProcessorPowerPolicyDc 21 // PROCESSOR_POWER_POLICY // not implemented
#define ProcessorPowerPolicyCurrent 22 // PROCESSOR_POWER_POLICY // not implemented
#define SystemPowerStateLogging 23 // SYSTEM_POWER_STATE_DISABLE_REASON[]
#define SystemPowerLoggingEntry 24 // SYSTEM_POWER_LOGGING_ENTRY[] // (kernel-mode only)
#define SetPowerSettingValue 25 // (kernel-mode only)
#define NotifyUserPowerSetting 26 // not implemented
#define PowerInformationLevelUnused0 27 // not implemented
#define SystemMonitorHiberBootPowerOff 28 // NULL (PowerMonitorOff)
#define SystemVideoState 29 // MONITOR_DISPLAY_STATE
#define TraceApplicationPowerMessage 30 // (kernel-mode only)
#define TraceApplicationPowerMessageEnd 31 // (kernel-mode only)
#define ProcessorPerfStates 32 // (kernel-mode only)
#define ProcessorIdleStates 33 // (kernel-mode only)
#define ProcessorCap 34 // (kernel-mode only)
#define SystemWakeSource 35
#define SystemHiberFileInformation 36 // q: SYSTEM_HIBERFILE_INFORMATION
#define TraceServicePowerMessage 37
#define ProcessorLoad 38
#define PowerShutdownNotification 39 // (kernel-mode only)
#define MonitorCapabilities 40 // (kernel-mode only)
#define SessionPowerInit 41 // (kernel-mode only)
#define SessionDisplayState 42 // (kernel-mode only)
#define PowerRequestCreate 43 // in: COUNTED_REASON_CONTEXT, out: HANDLE
#define PowerRequestAction 44 // in: POWER_REQUEST_ACTION
#define GetPowerRequestList 45 // out: POWER_REQUEST_LIST
#define ProcessorInformationEx 46 // in: USHORT ProcessorGroup, out: PROCESSOR_POWER_INFORMATION
#define NotifyUserModeLegacyPowerEvent 47 // (kernel-mode only)
#define GroupPark 48 // (debug-mode boot only)
#define ProcessorIdleDomains 49 // (kernel-mode only)
#define WakeTimerList 50 // powercfg.exe /waketimers
#define SystemHiberFileSize 51 // ULONG
#define ProcessorIdleStatesHv 52 // (kernel-mode only)
#define ProcessorPerfStatesHv 53 // (kernel-mode only)
#define ProcessorPerfCapHv 54 // (kernel-mode only)
#define ProcessorSetIdle 55 // (debug-mode boot only)
#define LogicalProcessorIdling 56 // (kernel-mode only)
#define UserPresence 57 // POWER_USER_PRESENCE // not implemented
#define PowerSettingNotificationName 58
#define GetPowerSettingValue 59 // GUID
#define IdleResiliency 60 // POWER_IDLE_RESILIENCY
#define SessionRITState 61 // POWER_SESSION_RIT_STATE
#define SessionConnectNotification 62 // POWER_SESSION_WINLOGON
#define SessionPowerCleanup 63
#define SessionLockState 64 // POWER_SESSION_WINLOGON
#define SystemHiberbootState 65 // BOOLEAN // fast startup supported
#define PlatformInformation 66 // BOOLEAN // connected standby supported
#define PdcInvocation 67 // (kernel-mode only)
#define MonitorInvocation 68 // (kernel-mode only)
#define FirmwareTableInformationRegistered 69 // (kernel-mode only)
#define SetShutdownSelectedTime 70 // NULL
#define SuspendResumeInvocation 71 // (kernel-mode only)
#define PlmPowerRequestCreate 72 // in: COUNTED_REASON_CONTEXT, out: HANDLE
#define ScreenOff 73 // NULL (PowerMonitorOff)
#define CsDeviceNotification 74 // (kernel-mode only)
#define PlatformRole 75 // POWER_PLATFORM_ROLE
#define LastResumePerformance 76 // RESUME_PERFORMANCE
#define DisplayBurst 77 // NULL (PowerMonitorOn)
#define ExitLatencySamplingPercentage 78
#define RegisterSpmPowerSettings 79 // (kernel-mode only)
#define PlatformIdleStates 80 // (kernel-mode only)
#define ProcessorIdleVeto 81 // (kernel-mode only) // deprecated
#define PlatformIdleVeto 82 // (kernel-mode only) // deprecated
#define SystemBatteryStatePrecise 83 // SYSTEM_BATTERY_STATE
#define ThermalEvent 84 // THERMAL_EVENT // PowerReportThermalEvent
#define PowerRequestActionInternal 85 // POWER_REQUEST_ACTION_INTERNAL
#define BatteryDeviceState 86
#define PowerInformationInternal 87 // POWER_INFORMATION_LEVEL_INTERNAL // PopPowerInformationInternal
#define ThermalStandby 88 // NULL // shutdown with thermal standby as reason.
#define SystemHiberFileType 89 // ULONG // zero ? reduced : full // powercfg.exe /h /type
#define PhysicalPowerButtonPress 90 // BOOLEAN
#define QueryPotentialDripsConstraint 91 // (kernel-mode only)
#define EnergyTrackerCreate 92
#define EnergyTrackerQuery 93
#define UpdateBlackBoxRecorder 94
#define SessionAllowExternalDmaDevices 95
#define SendSuspendResumeNotification 96 // since WIN11
#define PowerInformationLevelMaximum 97
typedef struct _PROCESSOR_POWER_INFORMATION
{
ULONG Number;
ULONG MaxMhz;
ULONG CurrentMhz;
ULONG MhzLimit;
ULONG MaxIdleState;
ULONG CurrentIdleState;
} PROCESSOR_POWER_INFORMATION, *PPROCESSOR_POWER_INFORMATION;
typedef struct _SYSTEM_POWER_INFORMATION
{
ULONG MaxIdlenessAllowed;
ULONG Idleness;
ULONG TimeRemaining;
UCHAR CoolingMode;
} SYSTEM_POWER_INFORMATION, *PSYSTEM_POWER_INFORMATION;
typedef struct _SYSTEM_HIBERFILE_INFORMATION
{
ULONG NumberOfMcbPairs;
LARGE_INTEGER Mcb[1];
} SYSTEM_HIBERFILE_INFORMATION, *PSYSTEM_HIBERFILE_INFORMATION;
#define POWER_REQUEST_CONTEXT_NOT_SPECIFIED DIAGNOSTIC_REASON_NOT_SPECIFIED
// wdm
typedef struct _COUNTED_REASON_CONTEXT
{
ULONG Version;
ULONG Flags;
union
{
struct
{
UNICODE_STRING ResourceFileName;
USHORT ResourceReasonId;
ULONG StringCount;
_Field_size_(StringCount) PUNICODE_STRING ReasonStrings;
};
UNICODE_STRING SimpleString;
};
} COUNTED_REASON_CONTEXT, *PCOUNTED_REASON_CONTEXT;
typedef enum _POWER_REQUEST_TYPE_INTERNAL // POWER_REQUEST_TYPE
{
PowerRequestDisplayRequiredInternal,
PowerRequestSystemRequiredInternal,
PowerRequestAwayModeRequiredInternal,
PowerRequestExecutionRequiredInternal, // Windows 8+
PowerRequestPerfBoostRequiredInternal, // Windows 8+
PowerRequestActiveLockScreenInternal, // Windows 10 RS1+ (reserved on Windows 8)
// Values 6 and 7 are reserved for Windows 8 only
PowerRequestInternalInvalid,
PowerRequestInternalUnknown,
PowerRequestFullScreenVideoRequired // Windows 8 only
} POWER_REQUEST_TYPE_INTERNAL;
typedef struct _POWER_REQUEST_ACTION
{
HANDLE PowerRequestHandle;
POWER_REQUEST_TYPE_INTERNAL RequestType;
BOOLEAN SetAction;
HANDLE ProcessHandle; // Windows 8+ and only for requests created via PlmPowerRequestCreate
} POWER_REQUEST_ACTION, *PPOWER_REQUEST_ACTION;
typedef union _POWER_STATE
{
SYSTEM_POWER_STATE SystemState;
DEVICE_POWER_STATE DeviceState;
} POWER_STATE, *PPOWER_STATE;
typedef enum _POWER_STATE_TYPE
{
SystemPowerState = 0,
DevicePowerState
} POWER_STATE_TYPE, *PPOWER_STATE_TYPE;
// wdm
typedef struct _SYSTEM_POWER_STATE_CONTEXT
{
union
{
struct
{
ULONG Reserved1 : 8;
ULONG TargetSystemState : 4;
ULONG EffectiveSystemState : 4;
ULONG CurrentSystemState : 4;
ULONG IgnoreHibernationPath : 1;
ULONG PseudoTransition : 1;
ULONG Reserved2 : 10;
};
ULONG ContextAsUlong;
};
} SYSTEM_POWER_STATE_CONTEXT, *PSYSTEM_POWER_STATE_CONTEXT;
typedef enum _REQUESTER_TYPE
{
KernelRequester = 0,
UserProcessRequester = 1,
UserSharedServiceRequester = 2
} REQUESTER_TYPE;
typedef struct _COUNTED_REASON_CONTEXT_RELATIVE
{
ULONG Flags;
union
{
struct
{
ULONG_PTR ResourceFileNameOffset;
USHORT ResourceReasonId;
ULONG StringCount;
ULONG_PTR SubstitutionStringsOffset;
};
ULONG_PTR SimpleStringOffset;
};
} COUNTED_REASON_CONTEXT_RELATIVE, *PCOUNTED_REASON_CONTEXT_RELATIVE;
typedef struct _DIAGNOSTIC_BUFFER
{
SIZE_T Size;
REQUESTER_TYPE CallerType;
union
{
struct
{
ULONG_PTR ProcessImageNameOffset; // PWSTR
ULONG ProcessId;
ULONG ServiceTag;
};
struct
{
ULONG_PTR DeviceDescriptionOffset; // PWSTR
ULONG_PTR DevicePathOffset; // PWSTR
};
};
ULONG_PTR ReasonOffset; // PCOUNTED_REASON_CONTEXT_RELATIVE
} DIAGNOSTIC_BUFFER, *PDIAGNOSTIC_BUFFER;
// The number of supported request types per version
#define POWER_REQUEST_SUPPORTED_TYPES_V1 3 // Windows 7
#define POWER_REQUEST_SUPPORTED_TYPES_V2 9 // Windows 8
#define POWER_REQUEST_SUPPORTED_TYPES_V3 5 // Windows 8.1 and Windows 10 TH1-TH2
#define POWER_REQUEST_SUPPORTED_TYPES_V4 6 // Windows 10 RS1+
typedef struct _POWER_REQUEST
{
union
{
struct
{
ULONG SupportedRequestMask;
ULONG PowerRequestCount[POWER_REQUEST_SUPPORTED_TYPES_V1];
DIAGNOSTIC_BUFFER DiagnosticBuffer;
} V1;
#if (NTDDI_VERSION >= NTDDI_WIN8)
struct
{
ULONG SupportedRequestMask;
ULONG PowerRequestCount[POWER_REQUEST_SUPPORTED_TYPES_V2];
DIAGNOSTIC_BUFFER DiagnosticBuffer;
} V2;
#endif
#if (NTDDI_VERSION >= NTDDI_WINBLUE)
struct
{
ULONG SupportedRequestMask;
ULONG PowerRequestCount[POWER_REQUEST_SUPPORTED_TYPES_V3];
DIAGNOSTIC_BUFFER DiagnosticBuffer;
} V3;
#endif
#if (NTDDI_VERSION >= NTDDI_WIN10_RS1)
struct
{
ULONG SupportedRequestMask;
ULONG PowerRequestCount[POWER_REQUEST_SUPPORTED_TYPES_V4];
DIAGNOSTIC_BUFFER DiagnosticBuffer;
} V4;
#endif
};
} POWER_REQUEST, *PPOWER_REQUEST;
typedef struct _POWER_REQUEST_LIST
{
ULONG_PTR Count;
ULONG_PTR PowerRequestOffsets[ANYSIZE_ARRAY]; // PPOWER_REQUEST
} POWER_REQUEST_LIST, *PPOWER_REQUEST_LIST;
typedef enum _POWER_STATE_HANDLER_TYPE
{
PowerStateSleeping1 = 0,
PowerStateSleeping2 = 1,
PowerStateSleeping3 = 2,
PowerStateSleeping4 = 3,
PowerStateShutdownOff = 4,
PowerStateShutdownReset = 5,
PowerStateSleeping4Firmware = 6,
PowerStateMaximum = 7
} POWER_STATE_HANDLER_TYPE, *PPOWER_STATE_HANDLER_TYPE;
typedef NTSTATUS (NTAPI *PENTER_STATE_SYSTEM_HANDLER)(
_In_ PVOID SystemContext
);
typedef NTSTATUS (NTAPI *PENTER_STATE_HANDLER)(
_In_ PVOID Context,
_In_opt_ PENTER_STATE_SYSTEM_HANDLER SystemHandler,
_In_ PVOID SystemContext,
_In_ LONG NumberProcessors,
_In_ LONG volatile *Number
);
typedef struct _POWER_STATE_HANDLER
{
POWER_STATE_HANDLER_TYPE Type;
BOOLEAN RtcWake;
UCHAR Spare[3];
PENTER_STATE_HANDLER Handler;
PVOID Context;
} POWER_STATE_HANDLER, *PPOWER_STATE_HANDLER;
typedef NTSTATUS (NTAPI *PENTER_STATE_NOTIFY_HANDLER)(
_In_ POWER_STATE_HANDLER_TYPE State,
_In_ PVOID Context,
_In_ BOOLEAN Entering
);
typedef struct _POWER_STATE_NOTIFY_HANDLER
{
PENTER_STATE_NOTIFY_HANDLER Handler;
PVOID Context;
} POWER_STATE_NOTIFY_HANDLER, *PPOWER_STATE_NOTIFY_HANDLER;
typedef struct _POWER_REQUEST_ACTION_INTERNAL
{
PVOID PowerRequestPointer;
POWER_REQUEST_TYPE_INTERNAL RequestType;
BOOLEAN SetAction;
} POWER_REQUEST_ACTION_INTERNAL, *PPOWER_REQUEST_ACTION_INTERNAL;
typedef enum _POWER_INFORMATION_LEVEL_INTERNAL
{
PowerInternalAcpiInterfaceRegister,
PowerInternalS0LowPowerIdleInfo, // POWER_S0_LOW_POWER_IDLE_INFO
PowerInternalReapplyBrightnessSettings,
PowerInternalUserAbsencePrediction, // POWER_USER_ABSENCE_PREDICTION
PowerInternalUserAbsencePredictionCapability, // POWER_USER_ABSENCE_PREDICTION_CAPABILITY
PowerInternalPoProcessorLatencyHint, // POWER_PROCESSOR_LATENCY_HINT
PowerInternalStandbyNetworkRequest, // POWER_STANDBY_NETWORK_REQUEST
PowerInternalDirtyTransitionInformation,
PowerInternalSetBackgroundTaskState, // POWER_SET_BACKGROUND_TASK_STATE
PowerInternalTtmOpenTerminal,
PowerInternalTtmCreateTerminal, // 10
PowerInternalTtmEvacuateDevices,
PowerInternalTtmCreateTerminalEventQueue,
PowerInternalTtmGetTerminalEvent,
PowerInternalTtmSetDefaultDeviceAssignment,
PowerInternalTtmAssignDevice,
PowerInternalTtmSetDisplayState,
PowerInternalTtmSetDisplayTimeouts,
PowerInternalBootSessionStandbyActivationInformation,
PowerInternalSessionPowerState,
PowerInternalSessionTerminalInput, // 20
PowerInternalSetWatchdog,
PowerInternalPhysicalPowerButtonPressInfoAtBoot,
PowerInternalExternalMonitorConnected,
PowerInternalHighPrecisionBrightnessSettings,
PowerInternalWinrtScreenToggle,
PowerInternalPpmQosDisable,
PowerInternalTransitionCheckpoint,
PowerInternalInputControllerState,
PowerInternalFirmwareResetReason,
PowerInternalPpmSchedulerQosSupport, // 30
PowerInternalBootStatGet,
PowerInternalBootStatSet,
PowerInternalCallHasNotReturnedWatchdog,
PowerInternalBootStatCheckIntegrity,
PowerInternalBootStatRestoreDefaults, // in: void
PowerInternalHostEsStateUpdate,
PowerInternalGetPowerActionState,
PowerInternalBootStatUnlock,
PowerInternalWakeOnVoiceState,
PowerInternalDeepSleepBlock, // 40
PowerInternalIsPoFxDevice,
PowerInternalPowerTransitionExtensionAtBoot,
PowerInternalProcessorBrandedFrequency, // in: POWER_INTERNAL_PROCESSOR_BRANDED_FREQENCY_INPUT, out: POWER_INTERNAL_PROCESSOR_BRANDED_FREQENCY_OUTPUT
PowerInternalTimeBrokerExpirationReason,
PowerInternalNotifyUserShutdownStatus,
PowerInternalPowerRequestTerminalCoreWindow,
PowerInternalProcessorIdleVeto,
PowerInternalPlatformIdleVeto,
PowerInternalIsLongPowerButtonBugcheckEnabled,
PowerInternalAutoChkCausedReboot, // 50
PowerInternalSetWakeAlarmOverride,
PowerInternalDirectedFxAddTestDevice = 53,
PowerInternalDirectedFxRemoveTestDevice,
PowerInternalDirectedFxSetMode = 56,
PowerInternalRegisterPowerPlane,
PowerInternalSetDirectedDripsFlags,
PowerInternalClearDirectedDripsFlags,
PowerInternalRetrieveHiberFileResumeContext, // 60
PowerInternalReadHiberFilePage,
PowerInternalLastBootSucceeded, // out: BOOLEAN
PowerInternalQuerySleepStudyHelperRoutineBlock,
PowerInternalDirectedDripsQueryCapabilities,
PowerInternalClearConstraints,
PowerInternalSoftParkVelocityEnabled,
PowerInternalQueryIntelPepCapabilities,
PowerInternalGetSystemIdleLoopEnablement, // since WIN11
PowerInternalGetVmPerfControlSupport,
PowerInternalGetVmPerfControlConfig, // 70
PowerInternalSleepDetailedDiagUpdate,
PowerInternalProcessorClassFrequencyBandsStats,
PowerInternalHostGlobalUserPresenceStateUpdate,
PowerInternalCpuNodeIdleIntervalStats,
PowerInternalClassIdleIntervalStats,
PowerInternalCpuNodeConcurrencyStats,
PowerInternalClassConcurrencyStats,
PowerInternalQueryProcMeasurementCapabilities,
PowerInternalQueryProcMeasurementValues,
PowerInternalPrepareForSystemInitiatedReboot, // 80
PowerInternalGetAdaptiveSessionState,
PowerInternalSetConsoleLockedState,
PowerInternalOverrideSystemInitiatedRebootState,
PowerInternalFanImpactStats,
PowerInternalFanRpmBuckets,
PowerInternalPowerBootAppDiagInfo,
PowerInternalUnregisterShutdownNotification, // since 22H1
PowerInternalManageTransitionStateRecord,
PowerInformationInternalMaximum
} POWER_INFORMATION_LEVEL_INTERNAL;
typedef enum _POWER_S0_DISCONNECTED_REASON
{
PoS0DisconnectedReasonNone,
PoS0DisconnectedReasonNonCompliantNic,
PoS0DisconnectedReasonSettingPolicy,
PoS0DisconnectedReasonEnforceDsPolicy,
PoS0DisconnectedReasonCsChecksFailed,
PoS0DisconnectedReasonSmartStandby,
PoS0DisconnectedReasonMaximum
} POWER_S0_DISCONNECTED_REASON;
typedef struct _POWER_S0_LOW_POWER_IDLE_INFO
{
POWER_S0_DISCONNECTED_REASON DisconnectedReason;
union
{
BOOLEAN Storage : 1;
BOOLEAN WiFi : 1;
BOOLEAN Mbn : 1;
BOOLEAN Ethernet : 1;
BOOLEAN Reserved : 4;
UCHAR AsUCHAR;
} CsDeviceCompliance;
union
{
BOOLEAN DisconnectInStandby : 1;
BOOLEAN EnforceDs : 1;
BOOLEAN Reserved : 6;
UCHAR AsUCHAR;
} Policy;
} POWER_S0_LOW_POWER_IDLE_INFO, *PPOWER_S0_LOW_POWER_IDLE_INFO;
typedef struct _POWER_INFORMATION_INTERNAL_HEADER
{
POWER_INFORMATION_LEVEL_INTERNAL InternalType;
ULONG Version;
} POWER_INFORMATION_INTERNAL_HEADER, *PPOWER_INFORMATION_INTERNAL_HEADER;
typedef struct _POWER_USER_ABSENCE_PREDICTION
{
POWER_INFORMATION_INTERNAL_HEADER Header;
LARGE_INTEGER ReturnTime;
} POWER_USER_ABSENCE_PREDICTION, *PPOWER_USER_ABSENCE_PREDICTION;
typedef struct _POWER_USER_ABSENCE_PREDICTION_CAPABILITY
{
BOOLEAN AbsencePredictionCapability;
} POWER_USER_ABSENCE_PREDICTION_CAPABILITY, *PPOWER_USER_ABSENCE_PREDICTION_CAPABILITY;
typedef struct _POWER_PROCESSOR_LATENCY_HINT
{
POWER_INFORMATION_INTERNAL_HEADER PowerInformationInternalHeader;
ULONG Type;
} POWER_PROCESSOR_LATENCY_HINT, *PPO_PROCESSOR_LATENCY_HINT;
typedef struct _POWER_STANDBY_NETWORK_REQUEST
{
POWER_INFORMATION_INTERNAL_HEADER PowerInformationInternalHeader;
BOOLEAN Active;
} POWER_STANDBY_NETWORK_REQUEST, *PPOWER_STANDBY_NETWORK_REQUEST;
typedef struct _POWER_SET_BACKGROUND_TASK_STATE
{
POWER_INFORMATION_INTERNAL_HEADER PowerInformationInternalHeader;
BOOLEAN Engaged;
} POWER_SET_BACKGROUND_TASK_STATE, *PPOWER_SET_BACKGROUND_TASK_STATE;
typedef struct POWER_INTERNAL_PROCESSOR_BRANDED_FREQENCY_INPUT
{
POWER_INFORMATION_LEVEL_INTERNAL InternalType;
PROCESSOR_NUMBER ProcessorNumber; // ULONG_MAX
} POWER_INTERNAL_PROCESSOR_BRANDED_FREQENCY_INPUT, *PPOWER_INTERNAL_PROCESSOR_BRANDED_FREQENCY_INPUT;
typedef struct POWER_INTERNAL_PROCESSOR_BRANDED_FREQENCY_OUTPUT
{
ULONG Version;
ULONG NominalFrequency; // if (Domain) Prcb->PowerState.CheckContext.Domain.NominalFrequency else Prcb->MHz
} POWER_INTERNAL_PROCESSOR_BRANDED_FREQENCY_OUTPUT, *PPOWER_INTERNAL_PROCESSOR_BRANDED_FREQENCY_OUTPUT;
NTSYSCALLAPI
NTSTATUS
NTAPI
NtPowerInformation(
_In_ POWER_INFORMATION_LEVEL InformationLevel,
_In_reads_bytes_opt_(InputBufferLength) PVOID InputBuffer,
_In_ ULONG InputBufferLength,
_Out_writes_bytes_opt_(OutputBufferLength) PVOID OutputBuffer,
_In_ ULONG OutputBufferLength
);
NTSYSCALLAPI
NTSTATUS
NTAPI
NtSetThreadExecutionState(
_In_ EXECUTION_STATE NewFlags, // ES_* flags
_Out_ EXECUTION_STATE *PreviousFlags
);
#if (NTDDI_VERSION < NTDDI_WIN7)
NTSYSCALLAPI
NTSTATUS
NTAPI
NtRequestWakeupLatency(
_In_ LATENCY_TIME latency
);
#endif
NTSYSCALLAPI
NTSTATUS
NTAPI
NtInitiatePowerAction(
_In_ POWER_ACTION SystemAction,
_In_ SYSTEM_POWER_STATE LightestSystemState,
_In_ ULONG Flags, // POWER_ACTION_* flags
_In_ BOOLEAN Asynchronous
);
NTSYSCALLAPI
NTSTATUS
NTAPI
NtSetSystemPowerState(
_In_ POWER_ACTION SystemAction,
_In_ SYSTEM_POWER_STATE LightestSystemState,
_In_ ULONG Flags // POWER_ACTION_* flags
);
NTSYSCALLAPI
NTSTATUS
NTAPI
NtGetDevicePowerState(
_In_ HANDLE Device,
_Out_ PDEVICE_POWER_STATE State
);
NTSYSCALLAPI
BOOLEAN
NTAPI
NtIsSystemResumeAutomatic(
VOID
);