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