783d9a36429a0b0ac27d0090d79395d71e691411
[reactos.git] / reactos / include / psdk / driverspecs.h
1 /*
2 * PROJECT: ReactOS DDK
3 * COPYRIGHT: This file is in the Public Domain.
4 * FILE: driverspecs.h
5 * ABSTRACT: This header stubs out Driver Verifier annotations to
6 * allow drivers using them to compile with our header set.
7 */
8
9 #pragma once
10 #define DRIVERSPECS_H
11
12 #ifndef SPECSTRINGS_H
13 #include <specstrings.h>
14 #endif
15
16 #include <concurrencysal.h>
17
18 #ifdef _PREFAST_
19
20 /* IRQL annotations are only valid when included from kernelspecs.h */
21 #define _IRQL_always_function_max_(irql)
22 #define _IRQL_always_function_min_(irql)
23 #define _IRQL_is_cancel_
24 #define _IRQL_raises_(irql)
25 #define _IRQL_requires_(irql)
26 #define _IRQL_requires_max_(irql)
27 #define _IRQL_requires_max_defined
28 #define _IRQL_requires_min_(irql)
29 #define _IRQL_requires_same_
30 #define _IRQL_restores_
31 #define _IRQL_restores_global_(kind,param)
32 #define _IRQL_saves_
33 #define _IRQL_saves_global_(kind,param)
34 #define _IRQL_uses_cancel_
35 #define __drv_setsIRQL(irql)
36
37 #define _Dispatch_type_ _Function_class_
38 #define _Kernel_clear_do_init_(yesNo) _Post_ _SA_annotes1(SAL_clearDoInit,yesNo)
39 #define _Kernel_float_restored_ _Post_ _SA_annotes0(SAL_floatRestored)
40 #define _Kernel_float_saved_ _Post_ _SA_annotes0(SAL_floatSaved)
41 #define _Kernel_float_used_ _Post_ _SA_annotes0(SAL_floatUsed)
42 #define _Kernel_IoGetDmaAdapter_ _Post_ _SA_annotes0(SAL_IoGetDmaAdapter)
43 #define _Kernel_releases_resource_(kind) _Post_ _SA_annotes1(SAL_release, #kind)
44 #define _Kernel_requires_resource_held_(kind) _Pre_ _SA_annotes1(SAL_mustHold, #kind)
45 #define _Kernel_requires_resource_not_held_(kind) _Pre_ _SA_annotes1(SAL_neverHold, #kind)
46 #define _Kernel_acquires_resource_(kind) _Post_ _SA_annotes1(SAL_acquire, #kind)
47
48 #define __drv_acquiresCancelSpinLock _Acquires_nonreentrant_lock_(_Global_cancel_spin_lock_)
49 #define __drv_acquiresCriticalRegion _Acquires_lock_(_Global_critical_region_)
50 #define __drv_acquiresExclusiveResource(kind) _Acquires_nonreentrant_lock_(_Curr_)
51 #define __drv_acquiresExclusiveResourceGlobal(kind,param) _Acquires_nonreentrant_lock_(param)
52 #define __drv_acquiresPriorityRegion _Acquires_lock_(_Global_priority_region_)
53 #define __drv_acquiresResource(kind) _Acquires_lock_(_Curr_)
54 #define __drv_acquiresResourceGlobal(kind,param) _Acquires_lock_(param)
55 #define __drv_aliasesMem _Post_ _SA_annotes0(SAL_IsAliased)
56 #define __drv_allocatesMem(kind) _Post_ _SA_annotes1(SAL_NeedsRelease,__yes)
57 #define __drv_arg(expr,annotes) _At_(expr,annotes)
58 #define __drv_at(expr,annotes) _At_(expr,annotes)
59 #define __drv_callbackType(kind) _SA_annotes1(SAL_callbackType, #kind)
60 #define __drv_clearDoInit _Kernel_clear_do_init_
61 #define __drv_completionType(kindlist) _SA_annotes1(SAL_completionType, #kindlist)
62 #define __drv_constant _Literal_
63 #define __drv_defined(x) _Macro_defined_(#x)
64 #define __drv_deref(annotes) __deref _Group_(annotes)
65 #define __drv_dispatchType_other _Dispatch_type_(IRP_MJ_OTHER)
66 #define __drv_dispatchType(x) _Dispatch_type_(x)
67 #define __drv_floatRestored _Kernel_float_restored_
68 #define __drv_floatSaved _Kernel_float_saved_
69 #define __drv_floatUsed _Kernel_float_used_
70 #define __drv_formatString(kind) _SA_annotes1(SAL_IsFormatString, #kind)
71 #define __drv_freesMem(kind) _Post_ _SA_annotes1(SAL_NeedsRelease,__no)
72 #define __drv_fun(annotes) _At_(return, annotes)
73 #define __drv_functionClass _Function_class_
74 #define __drv_holdsCancelSpinLock() _Holds_resource_global_("CancelSpinLock",)
75 #define __drv_holdsCriticalRegion() _Holds_resource_global_("CriticalRegion",)
76 #define __drv_holdsPriorityRegion() _Holds_resource_global_("PriorityRegion",)
77 #define __drv_in_deref(annotes) _Pre_ __deref _Group_(annotes)
78 #define __drv_in(annotes) _Pre_ _Group_(annotes)
79 #define __drv_innerAcquiresGlobal(kind,param) _Post_ _SA_annotes2(SAL_acquireGlobal, #kind, param\t)
80 #define __drv_innerMustHoldGlobal(kind,param)
81 #define __drv_innerNeverHoldGlobal(kind,param)
82 #define __drv_innerReleasesGlobal(kind,param)
83 #define __drv_interlocked
84 #define __drv_IoGetDmaAdapter
85 #define __drv_isCancelIRQL _IRQL_is_cancel_
86 #define __drv_isObjectPointer
87 #define __drv_KMDF
88 #define __drv_maxFunctionIRQL(irql)
89 #define __drv_maxIRQL(irql)
90 #define __drv_minFunctionIRQL(irql)
91 #define __drv_minIRQL(irql)
92 #define __drv_Mode_impl(x)
93 #define __drv_mustHold(kind)
94 #define __drv_mustHoldCancelSpinLock
95 #define __drv_mustHoldCriticalRegion
96 #define __drv_mustHoldGlobal(kind,param)
97 #define __drv_mustHoldPriorityRegion
98 #define __drv_NDIS
99 #define __drv_neverHold(kind)
100 #define __drv_neverHoldCancelSpinLock
101 #define __drv_neverHoldCriticalRegion
102 #define __drv_neverHoldGlobal(kind,param)
103 #define __drv_neverHoldPriorityRegion
104 #define __drv_nonConstant
105 #define __drv_notInTry
106 #define __drv_notPointer
107 #define __drv_out_deref(annotes)
108 #define __drv_out(annotes)
109 #define __drv_preferredFunction(func,why)
110 #define __drv_raisesIRQL(irql)
111 #define __drv_releasesCancelSpinLock
112 #define __drv_releasesCriticalRegion
113 #define __drv_releasesExclusiveResource(kind)
114 #define __drv_releasesExclusiveResourceGlobal(kind,param)
115 #define __drv_releasesPriorityRegion
116 #define __drv_releasesResource(kind)
117 #define __drv_releasesResourceGlobal(kind,param)
118 #define __drv_reportError(why)
119 #define __drv_requiresIRQL(irql)
120 #define __drv_restoresIRQL
121 #define __drv_restoresIRQLGlobal
122 #define __drv_ret(annotes)
123 #define __drv_sameIRQL
124 #define __drv_savesIRQL
125 #define __drv_savesIRQLGlobal
126 #define __drv_strictType(typename,mode)
127 #define __drv_strictTypeMatch(mode)
128 #define __drv_unit(p)
129 #define __drv_useCancelIRQL
130 #define __drv_valueIs(arglist)
131 #define __drv_WDM
132 #define __drv_when(cond,annotes)
133 #define __internal_kernel_driver
134 #define __kernel_code
135 #define __kernel_driver
136 #define __prefast_operator_new_null
137 #define __prefast_operator_new_throws
138 #define __user_code
139 #define __user_driver
140 #define ___drv_unit_internal_kernel_driver
141 #define ___drv_unit_kernel_code
142 #define ___drv_unit_kernel_driver
143 #define ___drv_unit_user_code
144 #define ___drv_unit_user_driver
145
146 __ANNOTATION(SAL_neverHold(_In_ char *);)
147 __ANNOTATION(SAL_acquire(_In_ char *);)
148 __ANNOTATION(SAL_floatUsed(void);)
149 __ANNOTATION(SAL_floatSaved(void);)
150 __ANNOTATION(SAL_floatRestored(void);)
151 __ANNOTATION(SAL_clearDoInit(enum __SAL_YesNo);)
152 __ANNOTATION(SAL_maxIRQL(__int64);)
153 __ANNOTATION(SAL_IsAliased(void);)
154 __ANNOTATION(SAL_NeedsRelease(enum __SAL_YesNo);)
155 __ANNOTATION(SAL_mustHold(_In_ char *);)
156 __ANNOTATION(SAL_release(_In_ char *);)
157 __ANNOTATION(SAL_IoGetDmaAdapter(void);)
158
159 #else
160
161 /* Dummys */
162 #define _Dispatch_type_(type)
163 #define _IRQL_always_function_max_(irql)
164 #define _IRQL_always_function_min_(irql)
165 #define _IRQL_is_cancel_
166 #define _IRQL_raises_(irql)
167 #define _IRQL_requires_(irql)
168 #define _IRQL_requires_max_(irql)
169 #define _IRQL_requires_min_(irql)
170 #define _IRQL_requires_same_
171 #define _IRQL_restores_
172 #define _IRQL_restores_global_(kind,param)
173 #define _IRQL_saves_
174 #define _IRQL_saves_global_(kind,param)
175 #define _IRQL_uses_cancel_
176 #define _Kernel_clear_do_init_(yesNo)
177 #define _Kernel_float_restored_
178 #define _Kernel_float_saved_
179 #define _Kernel_float_used_
180 #define _Kernel_IoGetDmaAdapter_
181 #define _Kernel_releases_resource_(kind)
182 #define _Kernel_requires_resource_held_(kind)
183 #define _Kernel_requires_resource_not_held_(kind)
184 #define _Kernel_acquires_resource_(kind)
185 #define __drv_acquiresCancelSpinLock
186 #define __drv_acquiresCriticalRegion
187 #define __drv_acquiresExclusiveResource(kind)
188 #define __drv_acquiresExclusiveResourceGlobal(kind,param)
189 #define __drv_acquiresPriorityRegion
190 #define __drv_acquiresResource(kind)
191 #define __drv_acquiresResourceGlobal(kind,param)
192 #define __drv_aliasesMem
193 #define __drv_allocatesMem(kind)
194 #define __drv_arg(expr,annotes)
195 #define __drv_at(expr,annotes)
196 #define __drv_callbackType(kind)
197 #define __drv_clearDoInit
198 #define __drv_completionType(kindlist)
199 #define __drv_constant
200 #define __drv_defined(x)
201 #define __drv_deref(annotes)
202 #define __drv_dispatchType_other
203 #define __drv_dispatchType(x)
204 #define __drv_floatRestored
205 #define __drv_floatSaved
206 #define __drv_floatUsed
207 #define __drv_formatString(kind)
208 #define __drv_freesMem(kind)
209 #define __drv_fun(annotes)
210 #define __drv_functionClass
211 #define __drv_holdsCancelSpinLock()
212 #define __drv_holdsCriticalRegion()
213 #define __drv_holdsPriorityRegion()
214 #define __drv_in_deref(annotes)
215 #define __drv_in(annotes)
216 #define __drv_innerAcquiresGlobal(kind,param)
217 #define __drv_innerMustHoldGlobal(kind,param)
218 #define __drv_innerNeverHoldGlobal(kind,param)
219 #define __drv_innerReleasesGlobal(kind,param)
220 #define __drv_interlocked
221 #define __drv_IoGetDmaAdapter
222 #define __drv_isCancelIRQL
223 #define __drv_isObjectPointer
224 #define __drv_KMDF
225 #define __drv_maxFunctionIRQL(irql)
226 #define __drv_maxIRQL(irql)
227 #define __drv_minFunctionIRQL(irql)
228 #define __drv_minIRQL(irql)
229 #define __drv_Mode_impl(x)
230 #define __drv_mustHold(kind)
231 #define __drv_mustHoldCancelSpinLock
232 #define __drv_mustHoldCriticalRegion
233 #define __drv_mustHoldGlobal(kind,param)
234 #define __drv_mustHoldPriorityRegion
235 #define __drv_NDIS
236 #define __drv_neverHold(kind)
237 #define __drv_neverHoldCancelSpinLock
238 #define __drv_neverHoldCriticalRegion
239 #define __drv_neverHoldGlobal(kind,param)
240 #define __drv_neverHoldPriorityRegion
241 #define __drv_nonConstant
242 #define __drv_notInTry
243 #define __drv_notPointer
244 #define __drv_out_deref(annotes)
245 #define __drv_out(annotes)
246 #define __drv_preferredFunction(func,why)
247 #define __drv_raisesIRQL(irql)
248 #define __drv_releasesCancelSpinLock
249 #define __drv_releasesCriticalRegion
250 #define __drv_releasesExclusiveResource(kind)
251 #define __drv_releasesExclusiveResourceGlobal(kind,param)
252 #define __drv_releasesPriorityRegion
253 #define __drv_releasesResource(kind)
254 #define __drv_releasesResourceGlobal(kind,param)
255 #define __drv_reportError(why)
256 #define __drv_requiresIRQL(irql)
257 #define __drv_restoresIRQL
258 #define __drv_restoresIRQLGlobal
259 #define __drv_ret(annotes)
260 #define __drv_sameIRQL
261 #define __drv_savesIRQL
262 #define __drv_savesIRQLGlobal
263 #define __drv_setsIRQL(irql)
264 #define __drv_strictType(typename,mode)
265 #define __drv_strictTypeMatch(mode)
266 #define __drv_unit(p)
267 #define __drv_useCancelIRQL
268 #define __drv_valueIs(arglist)
269 #define __drv_WDM
270 #define __drv_when(cond,annotes)
271 #define __internal_kernel_driver
272 #define __kernel_code
273 #define __kernel_driver
274 #define __prefast_operator_new_null
275 #define __prefast_operator_new_throws
276 #define __user_code
277 #define __user_driver
278 #define ___drv_unit_internal_kernel_driver
279 #define ___drv_unit_kernel_code
280 #define ___drv_unit_kernel_driver
281 #define ___drv_unit_user_code
282 #define ___drv_unit_user_driver
283
284 #endif
285