-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathpotypes.h
149 lines (128 loc) · 3.02 KB
/
potypes.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
/*++ NDK Version: 0098
Copyright (c) Alex Ionescu. All rights reserved.
Header Name:
potypes.h
Abstract:
Type definitions for the Power Subystem
Author:
Alex Ionescu ([email protected]) - Updated - 27-Feb-2006
--*/
#ifndef _POTYPES_H
#define _POTYPES_H
//
// Dependencies
//
#include <..\ndk\umtypes.h>
#ifndef NTOS_MODE_USER
#include <ntpoapi.h>
#endif
//
// Docking states
//
typedef enum _SYSTEM_DOCK_STATE
{
SystemDockStateUnknown,
SystemUndocked,
SystemDocked
} SYSTEM_DOCK_STATE, *PSYSTEM_DOCK_STATE;
#ifndef NTOS_MODE_USER
//
// Processor Power State Data
//
struct _PROCESSOR_POWER_STATE;
typedef
VOID
(FASTCALL *PPROCESSOR_IDLE_FUNCTION)(
struct _PROCESSOR_POWER_STATE *PState);
typedef struct _PROCESSOR_PERF_STATE {
UCHAR PercentFrequency;
UCHAR MinCapacity;
USHORT Power;
UCHAR IncreaseLevel;
UCHAR DecreaseLevel;
USHORT Flags;
ULONG IncreaseTime;
ULONG DecreaseTime;
ULONG IncreaseCount;
ULONG DecreaseCount;
ULONGLONG PerformanceTime;
} PROCESSOR_PERF_STATE, *PPROCESSOR_PERF_STATE;
typedef struct _PROCESSOR_POWER_STATE
{
PPROCESSOR_IDLE_FUNCTION IdleFunction;
ULONG Idle0KernelTimeLimit;
ULONG Idle0LastTime;
PVOID IdleHandlers;
PVOID IdleState;
ULONG IdleHandlersCount;
ULONGLONG LastCheck;
PROCESSOR_IDLE_TIMES IdleTimes;
ULONG IdleTime1;
ULONG PromotionCheck;
ULONG IdleTime2;
UCHAR CurrentThrottle;
UCHAR ThermalThrottleLimit;
UCHAR CurrentThrottleIndex;
UCHAR ThermalThrottleIndex;
ULONG LastKernelUserTime;
ULONG PerfIdleTime;
ULONGLONG DebugDelta;
ULONG DebugCount;
ULONG LastSysTime;
ULONGLONG TotalIdleStateTime[3];
ULONG TotalIdleTransitions[3];
ULONGLONG PreviousC3StateTime;
UCHAR KneeThrottleIndex;
UCHAR ThrottleLimitIndex;
UCHAR PerfStatesCount;
UCHAR ProcessorMinThrottle;
UCHAR ProcessorMaxThrottle;
UCHAR LastBusyPercentage;
UCHAR LastC3Percentage;
UCHAR LastAdjustedBusyPercentage;
ULONG PromotionCount;
ULONG DemotionCount;
ULONG ErrorCount;
ULONG RetryCount;
ULONG Flags;
LARGE_INTEGER PerfCounterFrequency;
ULONG PerfTickCount;
KTIMER PerfTimer;
KDPC PerfDpc;
PROCESSOR_PERF_STATE *PerfStates;
PVOID PerfSetThrottle;
ULONG LastC3KernelUserTime;
ULONG Spare1[1];
} PROCESSOR_POWER_STATE, *PPROCESSOR_POWER_STATE;
//
// Device Notification Structure
//
typedef struct _PO_DEVICE_NOTIFY
{
LIST_ENTRY Link;
PDEVICE_OBJECT TargetDevice;
UCHAR WakeNeeded;
UCHAR OrderLevel;
PDEVICE_OBJECT DeviceObject;
PVOID Node;
PUSHORT DeviceName;
PUSHORT DriverName;
ULONG ChildCount;
ULONG ActiveChild;
} PO_DEVICE_NOTIFY, *PPO_DEVICE_NOTIFY;
//
// Power IRP Queue
//
typedef struct _PO_IRP_QUEUE
{
PIRP CurrentIrp;
PIRP PendingIrpList;
} PO_IRP_QUEUE, *PPO_IRP_QUEUE;
// Power IRP Manager
typedef struct _PO_IRP_MANAGER
{
PO_IRP_QUEUE DeviceIrpQueue;
PO_IRP_QUEUE SystemIrpQueue;
} PO_IRP_MANAGER, *PPO_IRP_MANAGER;
#endif // !NTOS_MODE_USER
#endif // _POTYPES_H