xref: /reactos/sdk/include/psdk/specstrings.h (revision 99489553)
1 /*
2  * specstrings.h
3  *
4  * Standard Annotation Language (SAL) definitions
5  *
6  * This file is part of the ReactOS PSDK package.
7  *
8  * Contributors:
9  *   Timo Kreuzer (timo.kreuzer@reactos.org)
10  *
11  * THIS SOFTWARE IS NOT COPYRIGHTED
12  *
13  * This source code is offered for use in the public domain. You may
14  * use, modify or distribute it freely.
15  *
16  * This code is distributed in the hope that it will be useful but
17  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18  * DISCLAIMED. This includes but is not limited to warranties of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20  *
21  */
22 
23 #pragma once
24 #define SPECSTRINGS_H
25 
26 #include <sal.h>
27 #include <driverspecs.h>
28 
29 #define __field_bcount(size) __notnull __byte_writableTo(size)
30 #define __field_bcount_full(size) __notnull __byte_writableTo(size) __byte_readableTo(size)
31 #define __field_ecount(size) __notnull __elem_writableTo(size)
32 #define __post_invalid _Post_ __notvalid
33 
34 #define __deref_in
35 #define __deref_in_ecount(size)
36 #define __deref_in_bcount(size)
37 #define __deref_in_opt
38 #define __deref_in_ecount_opt(size)
39 #define __deref_in_bcount_opt(size)
40 #define __deref_opt_in
41 #define __deref_opt_in_ecount(size)
42 #define __deref_opt_in_bcount(size)
43 #define __deref_opt_in_opt
44 #define __deref_opt_in_ecount_opt(size)
45 #define __deref_opt_in_bcount_opt(size)
46 #define __out_awcount(expr,size)
47 #define __in_awcount(expr,size)
48 #define __nullnullterminated
49 #define __in_data_source(src_sym)
50 #define __kernel_entry
51 #define __range(lb,ub)
52 #define __in_bound
53 #define __out_bound
54 #define __in_range(lb,ub)
55 #define __out_range(lb,ub)
56 #define __deref_in_range(lb,ub)
57 #define __deref_out_range(lb,ub)
58 
59 #if (_MSC_VER >= 1000) && !defined(__midl) && defined(_PREFAST_)
60 
61 #define __inner_data_source(src_raw)        _SA_annotes1(SAL_untrusted_data_source,src_raw)
62 #define __out_data_source(src_sym)          _Post_ __inner_data_source(#src_sym)
63 #define __analysis_noreturn __declspec(noreturn)
64 
65 #else
66 
67 #define __out_data_source(src_sym)
68 #define __analysis_noreturn
69 
70 #endif
71 
72 #if defined(_PREFAST_) && defined(_PFT_SHOULD_CHECK_RETURN)
73 #define _Check_return_opt_ _Check_return_
74 #else
75 #define _Check_return_opt_
76 #endif
77 
78 #if defined(_PREFAST_) && defined(_PFT_SHOULD_CHECK_RETURN_WAT)
79 #define _Check_return_wat_ _Check_return_
80 #else
81 #define _Check_return_wat_
82 #endif
83