xref: /reactos/sdk/include/xdk/pofuncs.h (revision d7fd62d4)
1 $if (_WDMDDK_)
2 /******************************************************************************
3  *                     Power Management Support Functions                     *
4  ******************************************************************************/
5 
6 #define PoSetDeviceBusy(IdlePointer) ((void)(*(IdlePointer) = 0))
7 
8 #if (NTDDI_VERSION >= NTDDI_WIN2K)
9 
10 _IRQL_requires_max_(DISPATCH_LEVEL)
11 NTKERNELAPI
12 NTSTATUS
13 NTAPI
14 PoCallDriver(
15   _In_ struct _DEVICE_OBJECT *DeviceObject,
16   _Inout_ __drv_aliasesMem struct _IRP *Irp);
17 
18 _IRQL_requires_max_(APC_LEVEL)
19 NTKERNELAPI
20 PULONG
21 NTAPI
22 PoRegisterDeviceForIdleDetection(
23   _In_ struct _DEVICE_OBJECT *DeviceObject,
24   _In_ ULONG ConservationIdleTime,
25   _In_ ULONG PerformanceIdleTime,
26   _In_ DEVICE_POWER_STATE State);
27 
28 _IRQL_requires_max_(APC_LEVEL)
29 NTKERNELAPI
30 PVOID
31 NTAPI
32 PoRegisterSystemState(
33   _Inout_opt_ PVOID StateHandle,
34   _In_ EXECUTION_STATE Flags);
35 
36 _IRQL_requires_max_(DISPATCH_LEVEL)
37 NTKERNELAPI
38 NTSTATUS
39 NTAPI
40 PoRequestPowerIrp(
41   _In_ struct _DEVICE_OBJECT *DeviceObject,
42   _In_ UCHAR MinorFunction,
43   _In_ POWER_STATE PowerState,
44   _In_opt_ PREQUEST_POWER_COMPLETE CompletionFunction,
45   _In_opt_ __drv_aliasesMem PVOID Context,
46   _Outptr_opt_ struct _IRP **Irp);
47 
48 _IRQL_requires_max_(DISPATCH_LEVEL)
49 NTKERNELAPI
50 POWER_STATE
51 NTAPI
52 PoSetPowerState(
53   _In_ struct _DEVICE_OBJECT *DeviceObject,
54   _In_ POWER_STATE_TYPE Type,
55   _In_ POWER_STATE State);
56 
57 _IRQL_requires_max_(DISPATCH_LEVEL)
58 NTKERNELAPI
59 VOID
60 NTAPI
61 PoSetSystemState(
62   _In_ EXECUTION_STATE Flags);
63 
64 _IRQL_requires_max_(DISPATCH_LEVEL)
65 NTKERNELAPI
66 VOID
67 NTAPI
68 PoStartNextPowerIrp(
69   _Inout_ struct _IRP *Irp);
70 
71 _IRQL_requires_max_(APC_LEVEL)
72 NTKERNELAPI
73 VOID
74 NTAPI
75 PoUnregisterSystemState(
76   _Inout_ PVOID StateHandle);
77 
78 NTKERNELAPI
79 NTSTATUS
80 NTAPI
81 PoRequestShutdownEvent(
82   OUT PVOID *Event);
83 
84 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
85 $endif (_WDMDDK_)
86 
87 $if (_NTIFS_)
88 #if (NTDDI_VERSION >= NTDDI_WINXP)
89 _IRQL_requires_max_(APC_LEVEL)
90 NTKERNELAPI
91 NTSTATUS
92 NTAPI
93 PoQueueShutdownWorkItem(
94   _Inout_ __drv_aliasesMem PWORK_QUEUE_ITEM WorkItem);
95 #endif
96 $endif (_NTIFS_)
97 $if (_WDMDDK_)
98 #if (NTDDI_VERSION >= NTDDI_VISTA)
99 
100 _IRQL_requires_max_(DISPATCH_LEVEL)
101 NTKERNELAPI
102 VOID
103 NTAPI
104 PoSetSystemWake(
105   _Inout_ struct _IRP *Irp);
106 
107 _IRQL_requires_max_(DISPATCH_LEVEL)
108 NTKERNELAPI
109 BOOLEAN
110 NTAPI
111 PoGetSystemWake(
112   _In_ struct _IRP *Irp);
113 
114 _IRQL_requires_max_(APC_LEVEL)
115 // NTKERNELAPI // HACK: ntoskrnl_vista functions are statically linked thus don't need DECLSPEC_IMPORT
116 NTSTATUS
117 NTAPI
118 PoRegisterPowerSettingCallback(
119   _In_opt_ PDEVICE_OBJECT DeviceObject,
120   _In_ LPCGUID SettingGuid,
121   _In_ PPOWER_SETTING_CALLBACK Callback,
122   _In_opt_ PVOID Context,
123   _Outptr_opt_ PVOID *Handle);
124 
125 _IRQL_requires_max_(APC_LEVEL)
126 // NTKERNELAPI // HACK: ntoskrnl_vista functions are statically linked thus don't need DECLSPEC_IMPORT
127 NTSTATUS
128 NTAPI
129 PoUnregisterPowerSettingCallback(
130   _Inout_ PVOID Handle);
131 
132 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
133 
134 #if (NTDDI_VERSION >= NTDDI_VISTASP1)
135 NTKERNELAPI
136 VOID
137 NTAPI
138 PoSetDeviceBusyEx(
139   _Inout_ PULONG IdlePointer);
140 #endif /* (NTDDI_VERSION >= NTDDI_VISTASP1) */
141 
142 #if (NTDDI_VERSION >= NTDDI_WIN7)
143 
144 NTKERNELAPI
145 VOID
146 NTAPI
147 PoStartDeviceBusy(
148   _Inout_ PULONG IdlePointer);
149 
150 NTKERNELAPI
151 VOID
152 NTAPI
153 PoEndDeviceBusy(
154   _Inout_ PULONG IdlePointer);
155 
156 _IRQL_requires_max_(DISPATCH_LEVEL)
157 // NTKERNELAPI // HACK: ntoskrnl_vista functions are statically linked thus don't need DECLSPEC_IMPORT
158 BOOLEAN
159 NTAPI
160 PoQueryWatchdogTime(
161   _In_ PDEVICE_OBJECT Pdo,
162   _Out_ PULONG SecondsRemaining);
163 
164 _IRQL_requires_max_(APC_LEVEL)
165 NTKERNELAPI
166 VOID
167 NTAPI
168 PoDeletePowerRequest(
169   _Inout_ PVOID PowerRequest);
170 
171 _IRQL_requires_max_(DISPATCH_LEVEL)
172 NTKERNELAPI
173 NTSTATUS
174 NTAPI
175 PoSetPowerRequest(
176   _Inout_ PVOID PowerRequest,
177   _In_ POWER_REQUEST_TYPE Type);
178 
179 _IRQL_requires_max_(DISPATCH_LEVEL)
180 NTKERNELAPI
181 NTSTATUS
182 NTAPI
183 PoClearPowerRequest(
184   _Inout_ PVOID PowerRequest,
185   _In_ POWER_REQUEST_TYPE Type);
186 
187 _IRQL_requires_max_(APC_LEVEL)
188 NTKERNELAPI
189 NTSTATUS
190 NTAPI
191 PoCreatePowerRequest(
192   _Outptr_ PVOID *PowerRequest,
193   _In_ PDEVICE_OBJECT DeviceObject,
194   _In_opt_ PCOUNTED_REASON_CONTEXT Context);
195 
196 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
197 
198