xref: /reactos/sdk/include/psdk/no_sal2.h (revision 682f85ad)
1 /*
2  * PROJECT:     ReactOS PSDK
3  * LICENSE:     MIT (https://spdx.org/licenses/MIT)
4  * PURPOSE:     Renders the SAL annotations for documenting APIs harmless.
5  * COPYRIGHT:   Microsoft Corporation.
6  * SOURCE:      https://github.com/microsoft/ChakraCore/blob/master/pal/inc/rt/no_sal2.h
7  */
8 //
9 // Copyright (c) Microsoft. All rights reserved.
10 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
11 //
12 
13 
14 /***
15 *       no_sal2.h - renders the SAL annotations for documenting APIs harmless.
16 *
17 
18 *
19 *Purpose:
20 *       sal.h provides a set of SAL2 annotations to describe how a function uses its
21 *       parameters - the assumptions it makes about them, and the guarantees it makes
22 *       upon finishing. This file redefines all those annotation macros to be harmless.
23 *       It is designed for use in down-level build environments where the tooling may
24 *       be unhappy with the standard SAL2 macro definitions.
25 *
26 *       [Public]
27 *
28 
29 *
30 ****/
31 
32 #ifndef _NO_SAL_2_H_
33 #define _NO_SAL_2_H_
34 
35 #undef __notnull
36 #define __notnull
37 #undef _When_
38 #define _When_(c,a)
39 #undef _At_
40 #define _At_(t,a)
41 #undef _At_buffer_
42 #define _At_buffer_(t,i,c,a)
43 #undef _Group_
44 #define _Group_(a)
45 #undef _Pre_
46 #define _Pre_
47 #undef _Post_
48 #define _Post_
49 #undef _Deref_
50 #define _Deref_
51 #undef _Null_
52 #define _Null_
53 #undef _Notnull_
54 #define _Notnull_
55 #undef _Maybenull_
56 #define _Maybenull_
57 #undef _Const_
58 #define _Const_
59 #undef _Check_return_
60 #define _Check_return_
61 #undef _Must_inspect_result_
62 #define _Must_inspect_result_
63 #undef _Pre_satisfies_
64 #define _Pre_satisfies_(e)
65 #undef _Post_satisfies_
66 #define _Post_satisfies_(e)
67 #undef _Writable_elements_
68 #define _Writable_elements_(s)
69 #undef _Writable_bytes_
70 #define _Writable_bytes_(s)
71 #undef _Readable_elements_
72 #define _Readable_elements_(s)
73 #undef _Readable_bytes_
74 #define _Readable_bytes_(s)
75 #undef _Null_terminated_
76 #define _Null_terminated_
77 #undef _NullNull_terminated_
78 #define _NullNull_terminated_
79 #undef _Valid_
80 #define _Valid_
81 #undef _Notvalid_
82 #define _Notvalid_
83 #undef _Success_
84 #define _Success_(c)
85 #undef _Return_type_success_
86 #define _Return_type_success_(c)
87 #undef _On_failure_
88 #define _On_failure_(a)
89 #undef _Always_
90 #define _Always_(a)
91 #undef _Use_decl_annotations_
92 #define _Use_decl_annotations_
93 #undef _Pre_defensive_
94 #define _Pre_defensive_
95 #undef _Post_defensive_
96 #define _Post_defensive_
97 #undef _Pre_unknown_
98 #define _Pre_unknown_
99 #undef _Acquires_lock_
100 #define _Acquires_lock_(e)
101 #undef _Releases_lock_
102 #define _Releases_lock_(e)
103 #undef _Requires_lock_held_
104 #define _Requires_lock_held_(e)
105 #undef _Requires_lock_not_held_
106 #define _Requires_lock_not_held_(e)
107 #undef _Requires_no_locks_held_
108 #define _Requires_no_locks_held_
109 #undef _Guarded_by_
110 #define _Guarded_by_(e)
111 #undef _Write_guarded_by_
112 #define _Write_guarded_by_(e)
113 #undef _Interlocked_
114 #define _Interlocked_
115 #undef _Post_same_lock_
116 #define _Post_same_lock_(e1,e2)
117 #undef _Benign_race_begin_
118 #define _Benign_race_begin_
119 #undef _Benign_race_end_
120 #define _Benign_race_end_
121 #undef _No_competing_thread_
122 #define _No_competing_thread_
123 #undef _No_competing_thread_begin_
124 #define _No_competing_thread_begin_
125 #undef _No_competing_thread_end_
126 #define _No_competing_thread_end_
127 #undef _Acquires_shared_lock_
128 #define _Acquires_shared_lock_(e)
129 #undef _Releases_shared_lock_
130 #define _Releases_shared_lock_(e)
131 #undef _Requires_shared_lock_held_
132 #define _Requires_shared_lock_held_(e)
133 #undef _Acquires_exclusive_lock_
134 #define _Acquires_exclusive_lock_(e)
135 #undef _Releases_exclusive_lock_
136 #define _Releases_exclusive_lock_(e)
137 #undef _Requires_exclusive_lock_held_
138 #define _Requires_exclusive_lock_held_(e)
139 #undef _Has_lock_kind_
140 #define _Has_lock_kind_(n)
141 #undef _Create_lock_level_
142 #define _Create_lock_level_(n)
143 #undef _Has_lock_level_
144 #define _Has_lock_level_(n)
145 #undef _Lock_level_order_
146 #define _Lock_level_order_(n1,n2)
147 #undef _Analysis_assume_lock_acquired_
148 #define _Analysis_assume_lock_acquired_(e)
149 #undef _Analysis_assume_lock_released_
150 #define _Analysis_assume_lock_released_(e)
151 #undef _Analysis_assume_lock_held_
152 #define _Analysis_assume_lock_held_(e)
153 #undef _Analysis_assume_lock_not_held_
154 #define _Analysis_assume_lock_not_held_(e)
155 #undef _Analysis_assume_same_lock_
156 #define _Analysis_assume_same_lock_(e)
157 #undef _In_
158 #define _In_
159 #undef _Out_
160 #define _Out_
161 #undef _Inout_
162 #define _Inout_
163 #undef _In_z_
164 #define _In_z_
165 #undef _Inout_z_
166 #define _Inout_z_
167 #undef _In_reads_
168 #define _In_reads_(s)
169 #undef _In_reads_bytes_
170 #define _In_reads_bytes_(s)
171 #undef _In_reads_z_
172 #define _In_reads_z_(s)
173 #undef _In_reads_or_z_
174 #define _In_reads_or_z_(s)
175 #undef _Out_writes_
176 #define _Out_writes_(s)
177 #undef _Out_writes_bytes_
178 #define _Out_writes_bytes_(s)
179 #undef _Out_writes_z_
180 #define _Out_writes_z_(s)
181 #undef _Inout_updates_
182 #define _Inout_updates_(s)
183 #undef _Inout_updates_bytes_
184 #define _Inout_updates_bytes_(s)
185 #undef _Inout_updates_z_
186 #define _Inout_updates_z_(s)
187 #undef _Out_writes_to_
188 #define _Out_writes_to_(s,c)
189 #undef _Out_writes_bytes_to_
190 #define _Out_writes_bytes_to_(s,c)
191 #undef _Out_writes_all_
192 #define _Out_writes_all_(s)
193 #undef _Out_writes_bytes_all_
194 #define _Out_writes_bytes_all_(s)
195 #undef _Inout_updates_to_
196 #define _Inout_updates_to_(s,c)
197 #undef _Inout_updates_bytes_to_
198 #define _Inout_updates_bytes_to_(s,c)
199 #undef _Inout_updates_all_
200 #define _Inout_updates_all_(s)
201 #undef _Inout_updates_bytes_all_
202 #define _Inout_updates_bytes_all_(s)
203 #undef _In_reads_to_ptr_
204 #define _In_reads_to_ptr_(p)
205 #undef _In_reads_to_ptr_z_
206 #define _In_reads_to_ptr_z_(p)
207 #undef _Out_writes_to_ptr_
208 #define _Out_writes_to_ptr_(p)
209 #undef _Out_writes_to_ptr_z_
210 #define _Out_writes_to_ptr_z_(p)
211 #undef _In_opt_
212 #define _In_opt_
213 #undef _Out_opt_
214 #define _Out_opt_
215 #undef _Inout_opt_
216 #define _Inout_opt_
217 #undef _In_opt_z_
218 #define _In_opt_z_
219 #undef _Inout_opt_z_
220 #define _Inout_opt_z_
221 #undef _In_reads_opt_
222 #define _In_reads_opt_(s)
223 #undef _In_reads_bytes_opt_
224 #define _In_reads_bytes_opt_(s)
225 #undef _Out_writes_opt_
226 #define _Out_writes_opt_(s)
227 #undef _Out_writes_bytes_opt_
228 #define _Out_writes_bytes_opt_(s)
229 #undef _Out_writes_opt_z_
230 #define _Out_writes_opt_z_(s)
231 #undef _Inout_updates_opt_
232 #define _Inout_updates_opt_(s)
233 #undef _Inout_updates_bytes_opt_
234 #define _Inout_updates_bytes_opt_(s)
235 #undef _Inout_updates_opt_z_
236 #define _Inout_updates_opt_z_(s)
237 #undef _Out_writes_to_opt_
238 #define _Out_writes_to_opt_(s,c)
239 #undef _Out_writes_bytes_to_opt_
240 #define _Out_writes_bytes_to_opt_(s,c)
241 #undef _Out_writes_all_opt_
242 #define _Out_writes_all_opt_(s)
243 #undef _Out_writes_bytes_all_opt_
244 #define _Out_writes_bytes_all_opt_(s)
245 #undef _Inout_updates_to_opt_
246 #define _Inout_updates_to_opt_(s,c)
247 #undef _Inout_updates_bytes_to_opt_
248 #define _Inout_updates_bytes_to_opt_(s,c)
249 #undef _Inout_updates_all_opt_
250 #define _Inout_updates_all_opt_(s)
251 #undef _Inout_updates_bytes_all_opt_
252 #define _Inout_updates_bytes_all_opt_(s)
253 #undef _In_reads_to_ptr_opt_
254 #define _In_reads_to_ptr_opt_(p)
255 #undef _In_reads_to_ptr_opt_z_
256 #define _In_reads_to_ptr_opt_z_(p)
257 #undef _Out_writes_to_ptr_opt_
258 #define _Out_writes_to_ptr_opt_(p)
259 #undef _Out_writes_to_ptr_opt_z_
260 #define _Out_writes_to_ptr_opt_z_(p)
261 #undef _Outptr_
262 #define _Outptr_
263 #undef _Outptr_opt_
264 #define _Outptr_opt_
265 #undef _Outptr_result_maybenull_
266 #define _Outptr_result_maybenull_
267 #undef _Outptr_opt_result_maybenull_
268 #define _Outptr_opt_result_maybenull_
269 #undef _Outptr_z_
270 #define _Outptr_z_
271 #undef _Outptr_opt_z_
272 #define _Outptr_opt_z_
273 #undef _Outptr_result_maybenull_z_
274 #define _Outptr_result_maybenull_z_
275 #undef _Outptr_opt_result_maybenull_z_
276 #define _Outptr_opt_result_maybenull_z_
277 #undef _COM_Outptr_
278 #define _COM_Outptr_
279 #undef _COM_Outptr_opt_
280 #define _COM_Outptr_opt_
281 #undef _COM_Outptr_result_maybenull_
282 #define _COM_Outptr_result_maybenull_
283 #undef _COM_Outptr_opt_result_maybenull_
284 #define _COM_Outptr_opt_result_maybenull_
285 #undef _Outptr_result_buffer_
286 #define _Outptr_result_buffer_(s)
287 #undef _Outptr_result_bytebuffer_
288 #define _Outptr_result_bytebuffer_(s)
289 #undef _Outptr_opt_result_buffer_
290 #define _Outptr_opt_result_buffer_(s)
291 #undef _Outptr_opt_result_bytebuffer_
292 #define _Outptr_opt_result_bytebuffer_(s)
293 #undef _Outptr_result_buffer_to_
294 #define _Outptr_result_buffer_to_(s,c)
295 #undef _Outptr_result_bytebuffer_to_
296 #define _Outptr_result_bytebuffer_to_(s,c)
297 #undef _Outptr_opt_result_buffer_to_
298 #define _Outptr_opt_result_buffer_to_(s,c)
299 #undef _Outptr_opt_result_bytebuffer_to_
300 #define _Outptr_opt_result_bytebuffer_to_(s,c)
301 #undef _Ret_
302 #define _Ret_
303 #undef _Ret_valid_
304 #define _Ret_valid_
305 #undef _Ret_z_
306 #define _Ret_z_
307 #undef _Ret_writes_
308 #define _Ret_writes_(s)
309 #undef _Ret_writes_bytes_
310 #define _Ret_writes_bytes_(s)
311 #undef _Ret_writes_z_
312 #define _Ret_writes_z_(s)
313 #undef _Ret_writes_to_
314 #define _Ret_writes_to_(s,c)
315 #undef _Ret_writes_bytes_to_
316 #define _Ret_writes_bytes_to_(s,c)
317 #undef _Ret_writes_maybenull_
318 #define _Ret_writes_maybenull_(s)
319 #undef _Ret_writes_bytes_maybenull_
320 #define _Ret_writes_bytes_maybenull_(s)
321 #undef _Ret_writes_to_maybenull_
322 #define _Ret_writes_to_maybenull_(s,c)
323 #undef _Ret_writes_bytes_to_maybenull_
324 #define _Ret_writes_bytes_to_maybenull_(s,c)
325 #undef _Ret_writes_maybenull_z_
326 #define _Ret_writes_maybenull_z_(s)
327 #undef _Ret_maybenull_
328 #define _Ret_maybenull_
329 #undef _Ret_maybenull_z_
330 #define _Ret_maybenull_z_
331 #undef _Field_size_
332 #define _Field_size_(s)
333 #undef _Field_size_opt_
334 #define _Field_size_opt_(s)
335 #undef _Field_size_bytes_
336 #define _Field_size_bytes_(s)
337 #undef _Field_size_bytes_opt_
338 #define _Field_size_bytes_opt_(s)
339 #undef _Field_size_part_
340 #define _Field_size_part_(s,c)
341 #undef _Field_size_part_opt_
342 #define _Field_size_part_opt_(s,c)
343 #undef _Field_size_bytes_part_
344 #define _Field_size_bytes_part_(s,c)
345 #undef _Field_size_bytes_part_opt_
346 #define _Field_size_bytes_part_opt_(s,c)
347 #undef _Field_size_full_
348 #define _Field_size_full_(s)
349 #undef _Field_size_full_opt_
350 #define _Field_size_full_opt_(s)
351 #undef _Field_size_bytes_full_
352 #define _Field_size_bytes_full_(s)
353 #undef _Field_size_bytes_full_opt_
354 #define _Field_size_bytes_full_opt_(s)
355 #undef _Printf_format_string_
356 #define _Printf_format_string_
357 #undef _Scanf_format_string_
358 #define _Scanf_format_string_
359 #undef _Scanf_s_format_string_
360 #define _Scanf_s_format_string_
361 #undef _Printf_format_string_params_
362 #define _Printf_format_string_params_(x)
363 #undef _Scanf_format_string_params_
364 #define _Scanf_format_string_params_(x)
365 #undef _Scanf_s_format_string_params_
366 #define _Scanf_s_format_string_params_(x)
367 #undef _In_range_
368 #define _In_range_(l,h)
369 #undef _Out_range_
370 #define _Out_range_(l,h)
371 #undef _Ret_range_
372 #define _Ret_range_(l,h)
373 #undef _Deref_in_range_
374 #define _Deref_in_range_(l,h)
375 #undef _Deref_out_range_
376 #define _Deref_out_range_(l,h)
377 #undef _Deref_inout_range_
378 #define _Deref_inout_range_(l,h)
379 #undef _Field_range_
380 #define _Field_range_(l,h)
381 #undef _Pre_equal_to_
382 #define _Pre_equal_to_(e)
383 #undef _Post_equal_to_
384 #define _Post_equal_to_(e)
385 #undef _Struct_size_bytes_
386 #define _Struct_size_bytes_(s)
387 #undef _Analysis_assume_
388 #define _Analysis_assume_
389 #undef _Analysis_mode_
390 #define _Analysis_mode_(m)
391 #undef _Analysis_noreturn_
392 #define _Analysis_noreturn_
393 #undef _Raises_SEH_exception_
394 #define _Raises_SEH_exception_
395 #undef _Maybe_raises_SEH_exception_
396 #define _Maybe_raises_SEH_exception_
397 #undef _Function_class_
398 #define _Function_class_(n)
399 #undef _Literal_
400 #define _Literal_
401 #undef _Notliteral_
402 #define _Notliteral_
403 #undef _Enum_is_bitflag_
404 #define _Enum_is_bitflag_
405 #undef _Strict_type_match_
406 #define _Strict_type_match_
407 #undef _Points_to_data_
408 #define _Points_to_data_
409 #undef _Interlocked_operand_
410 #define _Interlocked_operand_
411 #undef _IRQL_raises_
412 #define _IRQL_raises_(i)
413 #undef _IRQL_requires_
414 #define _IRQL_requires_(i)
415 #undef _IRQL_requires_max_
416 #define _IRQL_requires_max_(i)
417 #undef _IRQL_requires_min_
418 #define _IRQL_requires_min_(i)
419 #undef _IRQL_saves_
420 #define _IRQL_saves_
421 #undef _IRQL_saves_global_
422 #define _IRQL_saves_global_(k,s)
423 #undef _IRQL_restores_
424 #define _IRQL_restores_
425 #undef _IRQL_restores_global_
426 #define _IRQL_restores_global_(k,s)
427 #undef _IRQL_always_function_min_
428 #define _IRQL_always_function_min_(i)
429 #undef _IRQL_always_function_max_
430 #define _IRQL_always_function_max_(i)
431 #undef _IRQL_requires_same_
432 #define _IRQL_requires_same_
433 #undef _IRQL_uses_cancel_
434 #define _IRQL_uses_cancel_
435 #undef _IRQL_is_cancel_
436 #define _IRQL_is_cancel_
437 #undef _Kernel_float_saved_
438 #define _Kernel_float_saved_
439 #undef _Kernel_float_restored_
440 #define _Kernel_float_restored_
441 #undef _Kernel_float_used_
442 #define _Kernel_float_used_
443 #undef _Kernel_acquires_resource_
444 #define _Kernel_acquires_resource_(k)
445 #undef _Kernel_releases_resource_
446 #define _Kernel_releases_resource_(k)
447 #undef _Kernel_requires_resource_held_
448 #define _Kernel_requires_resource_held_(k)
449 #undef _Kernel_requires_resource_not_held_
450 #define _Kernel_requires_resource_not_held_(k)
451 #undef _Kernel_clear_do_init_
452 #define _Kernel_clear_do_init_(yn)
453 #undef _Kernel_IoGetDmaAdapter_
454 #define _Kernel_IoGetDmaAdapter_
455 #undef _Outref_
456 #define _Outref_
457 #undef _Outref_result_maybenull_
458 #define _Outref_result_maybenull_
459 #undef _Outref_result_buffer_
460 #define _Outref_result_buffer_(s)
461 #undef _Outref_result_bytebuffer_
462 #define _Outref_result_bytebuffer_(s)
463 #undef _Outref_result_buffer_to_
464 #define _Outref_result_buffer_to_(s,c)
465 #undef _Outref_result_bytebuffer_to_
466 #define _Outref_result_bytebuffer_to_(s,c)
467 #undef _Outref_result_buffer_all_
468 #define _Outref_result_buffer_all_(s)
469 #undef _Outref_result_bytebuffer_all_
470 #define _Outref_result_bytebuffer_all_(s)
471 #undef _Outref_result_buffer_maybenull_
472 #define _Outref_result_buffer_maybenull_(s)
473 #undef _Outref_result_bytebuffer_maybenull_
474 #define _Outref_result_bytebuffer_maybenull_(s)
475 #undef _Outref_result_buffer_to_maybenull_
476 #define _Outref_result_buffer_to_maybenull_(s,c)
477 #undef _Outref_result_bytebuffer_to_maybenull_
478 #define _Outref_result_bytebuffer_to_maybenull_(s,c)
479 #undef _Outref_result_buffer_all_maybenull_
480 #define _Outref_result_buffer_all_maybenull_(s)
481 #undef _Outref_result_bytebuffer_all_maybenull_
482 #define _Outref_result_bytebuffer_all_maybenull_(s)
483 #undef _In_defensive_
484 #define _In_defensive_(a)
485 #undef _Out_defensive_
486 #define _Out_defensive_(a)
487 #undef _Inout_defensive_
488 #define _Inout_defensive_(a)
489 #undef _Outptr_result_nullonfailure_
490 #define _Outptr_result_nullonfailure_
491 #undef _Outptr_opt_result_nullonfailure_
492 #define _Outptr_opt_result_nullonfailure_
493 #undef _Outref_result_nullonfailure_
494 #define _Outref_result_nullonfailure_
495 #undef _Result_nullonfailure_
496 #define _Result_nullonfailure_
497 #undef _Result_zeroonfailure_
498 #define _Result_zeroonfailure_
499 #undef _Acquires_nonreentrant_lock_
500 #define _Acquires_nonreentrant_lock_(e)
501 #undef _Releases_nonreentrant_lock_
502 #define _Releases_nonreentrant_lock_(e)
503 #undef _Reserved_
504 #define _Reserved_           _Pre_equal_to_(0) _Pre_ _Null_
505 #undef _Pre_z_
506 #define _Pre_z_              _Pre_ _Null_terminated_
507 #undef _Post_z_
508 #define _Post_z_             _Post_ _Null_terminated_
509 #undef _Prepost_z_
510 #define _Prepost_z_          _Pre_z_ _Post_z_
511 #undef _Pre_null_
512 #define _Pre_null_           _Pre_ _Null_
513 #undef _Pre_maybenull_
514 #define _Pre_maybenull_      _Pre_ _Maybenull_
515 #undef _Pre_notnull_
516 #define _Pre_notnull_        _Pre_ _Notnull_
517 #undef _Pre_valid_
518 #define _Pre_valid_          _Pre_notnull_ _Pre_ _Valid_
519 #undef _Pre_opt_valid_
520 #define _Pre_opt_valid_      _Pre_maybenull_ _Pre_ _Valid_
521 #undef _Post_valid_
522 #define _Post_valid_         _Post_ _Valid_
523 #undef _Post_invalid_
524 #define _Post_invalid_       _Post_ _Deref_ _Notvalid_
525 #undef _Post_ptr_invalid_
526 #define _Post_ptr_invalid_   _Post_ _Notvalid_
527 #undef _Pre_readable_size_
528 #define _Pre_readable_size_(s)      _Pre_ _Readable_elements_(s) _Pre_ _Valid_
529 #undef _Pre_writable_size_
530 #define _Pre_writable_size_(s)      _Pre_ _Writable_elements_(s)
531 #undef _Pre_readable_byte_size_
532 #define _Pre_readable_byte_size_(s) _Pre_ _Readable_bytes_(s) _Pre_ _Valid_
533 #undef _Pre_writable_byte_size_
534 #define _Pre_writable_byte_size_(s) _Pre_ _Writable_bytes_(s)
535 #undef _Post_readable_size_
536 #define _Post_readable_size_(s)     _Post_ _Readable_elements_(s) _Post_ _Valid_
537 #undef _Post_writable_size_
538 #define _Post_writable_size_(s)     _Post_ _Writable_elements_(s)
539 #undef _Post_readable_byte_size_
540 #define _Post_readable_byte_size_(s) _Post_ _Readable_bytes_(s) _Post_ _Valid_
541 #undef _Post_writable_byte_size_
542 #define _Post_writable_byte_size_(s) _Post_ _Writable_bytes_(s)
543 
544 #endif /* _NO_SAL_2_H_ */
545