STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
sourceannotations.h
Go to the documentation of this file.
1 /***
2 *SourceAnnotations.h - Source Annotation definitions
3 *
4 * Copyright (c) Microsoft Corporation. All rights reserved.
5 *
6 *Purpose:
7 * Defines internal structures used by the Source Code analysis engine.
8 *
9 ****/
10 
11 #pragma once
12 
13 #ifndef _M_CEE_SAFE
14 
15 #ifndef _SIZE_T_DEFINED
16 #ifdef _WIN64
17 typedef unsigned __int64 size_t;
18 #else /* _WIN64 */
19 typedef unsigned int size_t;
20 #endif /* _WIN64 */
21 #define _SIZE_T_DEFINED
22 #endif /* _SIZE_T_DEFINED */
23 
24 #ifndef _WCHAR_T_DEFINED
25 typedef unsigned short wchar_t;
26 #define _WCHAR_T_DEFINED
27 #endif /* _WCHAR_T_DEFINED */
28 
29 
30 #pragma push_macro( "SA" )
31 #pragma push_macro( "REPEATABLE" )
32 
33 #ifdef __cplusplus
34 #define SA( id ) id
35 #define REPEATABLE [repeatable]
36 #else /* __cplusplus */
37 #define SA( id ) SA_##id
38 #define REPEATABLE
39 #endif /* __cplusplus */
40 
41 #ifdef __cplusplus
42 namespace vc_attributes
43 {
44 #endif /* __cplusplus */
45 
46 enum SA( YesNoMaybe )
47 {
48  // Choose values that we can detect as invalid if they are or'd together
49  SA( No ) = 0x0fff0001,
50  SA( Maybe ) = 0x0fff0010,
51  SA( Yes ) = 0x0fff0100
52 };
53 
54 typedef enum SA( YesNoMaybe ) SA( YesNoMaybe );
55 
56 enum SA( AccessType )
57 {
58  SA( NoAccess ) = 0,
59  SA( Read ) = 1,
60  SA( Write ) = 2,
61  SA( ReadWrite ) = 3
62 };
63 
64 typedef enum SA( AccessType ) SA( AccessType );
65 
66 #ifndef SAL_NO_ATTRIBUTE_DECLARATIONS
67 
69 [source_annotation_attribute( SA( All ) )]
71 {
72 #ifdef __cplusplus
73  PreAttribute();
74 #endif /* __cplusplus */
75 
76  unsigned int Deref;
77  SA( YesNoMaybe ) Valid;
78  SA( YesNoMaybe ) Null;
79  SA( YesNoMaybe ) Tainted;
80  SA( AccessType ) Access;
81  unsigned int Notref;
82  size_t ValidElementsConst;
83  size_t ValidBytesConst;
84  const wchar_t* ValidElements;
85  const wchar_t* ValidBytes;
86  const wchar_t* ValidElementsLength;
87  const wchar_t* ValidBytesLength;
88  size_t WritableElementsConst;
89  size_t WritableBytesConst;
90  const wchar_t* WritableElements;
91  const wchar_t* WritableBytes;
92  const wchar_t* WritableElementsLength;
93  const wchar_t* WritableBytesLength;
94  size_t ElementSizeConst;
95  const wchar_t* ElementSize;
96  SA( YesNoMaybe ) NullTerminated;
97  const wchar_t* Condition;
98 };
99 
101 [source_annotation_attribute( SA( All ) )]
103 {
104 #ifdef __cplusplus
105  PostAttribute();
106 #endif /* __cplusplus */
107 
108  unsigned int Deref;
109  SA( YesNoMaybe ) Valid;
110  SA( YesNoMaybe ) Null;
111  SA( YesNoMaybe ) Tainted;
112  SA( AccessType ) Access;
113  unsigned int Notref;
114  size_t ValidElementsConst;
115  size_t ValidBytesConst;
116  const wchar_t* ValidElements;
117  const wchar_t* ValidBytes;
118  const wchar_t* ValidElementsLength;
119  const wchar_t* ValidBytesLength;
120  size_t WritableElementsConst;
121  size_t WritableBytesConst;
122  const wchar_t* WritableElements;
123  const wchar_t* WritableBytes;
124  const wchar_t* WritableElementsLength;
125  const wchar_t* WritableBytesLength;
126  size_t ElementSizeConst;
127  const wchar_t* ElementSize;
128  SA( YesNoMaybe ) NullTerminated;
129  SA( YesNoMaybe ) MustCheck;
130  const wchar_t* Condition;
131 };
132 
133 [source_annotation_attribute( SA( All ) )]
135 {
136 #ifdef __cplusplus
137  FormatStringAttribute();
138 #endif /* __cplusplus */
139 
140  const wchar_t* Style;
141  const wchar_t* UnformattedAlternative;
142 };
143 
145 [source_annotation_attribute( SA( All ) )]
147 {
148 #ifdef __cplusplus
150 #endif /* __cplusplus */
151 
152  long Value;
153 };
154 
155 [source_annotation_attribute( SA( All ) )]
157 {
158 #ifdef __cplusplus
160 #endif /* __cplusplus */
161 
162  const wchar_t* Condition;
163 };
164 
166 [source_annotation_attribute( SA( All ) )]
168 {
169 #ifdef __cplusplus
171 #endif /* __cplusplus */
172  unsigned int Deref;
173 };
174 
176 [source_annotation_attribute( SA( All ) )]
178 {
179 #ifdef __cplusplus
181 #endif /* __cplusplus */
182  unsigned int Deref;
183 };
184 
186 [source_annotation_attribute( SA( All ) )]
188 {
189 #ifdef __cplusplus
191 #endif /* __cplusplus */
192  unsigned int Deref;
193  const char* MinVal;
194  const char* MaxVal;
195 };
196 
198 [source_annotation_attribute( SA( All ) )]
200 {
201 #ifdef __cplusplus
203 #endif /* __cplusplus */
204  unsigned int Deref;
205  const char* MinVal;
206  const char* MaxVal;
207 };
208 
210 [source_annotation_attribute( SA( All ) )]
212 {
213 #ifdef __cplusplus
214  DerefAttribute();
215 #endif /* __cplusplus */
216  int unused;
217 };
218 
220 [source_annotation_attribute( SA( All ) )]
222 {
223 #ifdef __cplusplus
224  NotrefAttribute();
225 #endif /* __cplusplus */
226  int unused;
227 };
228 
230 [source_annotation_attribute( SA( All ) )]
232 {
233 #ifdef __cplusplus
235 #endif /* __cplusplus */
236  wchar_t *Name;
237  wchar_t *p1;
238  wchar_t *p2;
239  wchar_t *p3;
240  wchar_t *p4;
241  wchar_t *p5;
242  wchar_t *p6;
243  wchar_t *p7;
244  wchar_t *p8;
245  wchar_t *p9;
246 };
247 
248 [source_annotation_attribute( SA( All ) )]
251 {
252 #ifdef __cplusplus
253  AtAttribute();
254 #endif /* __cplusplus */
255  wchar_t *p1;
256 };
257 
258 [source_annotation_attribute( SA( All ) )]
261 {
262 #ifdef __cplusplus
264 #endif /* __cplusplus */
265  wchar_t *p1;
266  wchar_t *p2;
267  wchar_t *p3;
268 };
269 
270 [source_annotation_attribute( SA( All ) )]
273 {
274 #ifdef __cplusplus
275  WhenAttribute();
276 #endif /* __cplusplus */
277  wchar_t *p1;
278 };
279 
280 [source_annotation_attribute( SA( All ) )]
283 {
284 #ifdef __cplusplus
286 #endif /* __cplusplus */
287  wchar_t *p1;
288 };
289 
290 [source_annotation_attribute( SA( All ) )]
293 {
294 #ifdef __cplusplus
296 #endif /* __cplusplus */
297  wchar_t *p1;
298 };
299 
300 [source_annotation_attribute( SA( All ) )]
303 {
304 #ifdef __cplusplus
305  ExceptAttribute();
306 #endif /* __cplusplus */
307  int unused;
308 };
309 
310 [source_annotation_attribute( SA( All ) )]
313 {
314 #ifdef __cplusplus
315  PreOpAttribute();
316 #endif /* __cplusplus */
317  int unused;
318 };
319 
320 [source_annotation_attribute( SA( All ) )]
323 {
324 #ifdef __cplusplus
325  PostOpAttribute();
326 #endif /* __cplusplus */
327  int unused;
328 };
329 
330 [source_annotation_attribute( SA( All ) )]
333 {
334 #ifdef __cplusplus
335  BeginAttribute();
336 #endif /* __cplusplus */
337  int unused;
338 };
339 
340 [source_annotation_attribute( SA( All ) )]
343 {
344 #ifdef __cplusplus
345  EndAttribute();
346 #endif /* __cplusplus */
347  int unused;
348 };
349 
350 #endif /* SAL_NO_ATTRIBUTE_DECLARATIONS */
351 
352 #ifdef __cplusplus
353 }; // namespace vc_attributes
354 #endif /* __cplusplus */
355 
356 #pragma pop_macro( "REPEATABLE" )
357 #pragma pop_macro( "SA" )
358 
359 #ifdef __cplusplus
360 
361 #define SA_All All
362 #define SA_Class Class
363 #define SA_Constructor Constructor
364 #define SA_Delegate Delegate
365 #define SA_Enum Enum
366 #define SA_Event Event
367 #define SA_Field Field
368 #define SA_GenericParameter GenericParameter
369 #define SA_Interface Interface
370 #define SA_Method Method
371 #define SA_Module Module
372 #define SA_Parameter Parameter
373 #define SA_Property Property
374 #define SA_ReturnValue ReturnValue
375 #define SA_Struct Struct
376 #define SA_Typedef Typedef
377 
378 typedef ::vc_attributes::YesNoMaybe SA_YesNoMaybe;
379 const ::vc_attributes::YesNoMaybe SA_Yes = ::vc_attributes::Yes;
380 const ::vc_attributes::YesNoMaybe SA_No = ::vc_attributes::No;
381 const ::vc_attributes::YesNoMaybe SA_Maybe = ::vc_attributes::Maybe;
382 
383 typedef ::vc_attributes::AccessType SA_AccessType;
384 const ::vc_attributes::AccessType SA_NoAccess = ::vc_attributes::NoAccess;
385 const ::vc_attributes::AccessType SA_Read = ::vc_attributes::Read;
386 const ::vc_attributes::AccessType SA_Write = ::vc_attributes::Write;
387 const ::vc_attributes::AccessType SA_ReadWrite = ::vc_attributes::ReadWrite;
388 
389 #ifndef SAL_NO_ATTRIBUTE_DECLARATIONS
392 typedef ::vc_attributes::FormatStringAttribute SA_FormatString;
393 typedef ::vc_attributes::InvalidCheckAttribute SA_InvalidCheck; /*???*/
394 typedef ::vc_attributes::SuccessAttribute SA_Success;
395 typedef ::vc_attributes::PreBoundAttribute SA_PreBound;
396 typedef ::vc_attributes::PostBoundAttribute SA_PostBound;
397 typedef ::vc_attributes::PreRangeAttribute SA_PreRange;
398 typedef ::vc_attributes::PostRangeAttribute SA_PostRange;
399 
400 typedef ::vc_attributes::DerefAttribute SAL_deref;
401 typedef ::vc_attributes::NotrefAttribute SAL_notref;
402 typedef ::vc_attributes::PreOpAttribute SAL_pre;
403 typedef ::vc_attributes::PostOpAttribute SAL_post;
404 typedef ::vc_attributes::ExceptAttribute SAL_except;
405 
406 typedef ::vc_attributes::AtAttribute SAL_at;
407 typedef ::vc_attributes::AtBufferAttribute SAL_at_buffer;
408 typedef ::vc_attributes::WhenAttribute SAL_when;
409 typedef ::vc_attributes::BeginAttribute SAL_begin;
410 typedef ::vc_attributes::EndAttribute SAL_end;
411 typedef ::vc_attributes::TypefixAttribute SAL_typefix;
412 typedef ::vc_attributes::AnnotesAttribute SAL_annotes;
413 typedef ::vc_attributes::ContextAttribute SAL_context;
414 
415 #endif /* SAL_NO_ATTRIBUTE_DECLARATIONS */
416 
417 #else /* __cplusplus */
418 
419 typedef struct PreAttribute SA_Pre;
420 typedef struct PreAttribute PreAttribute;
421 typedef struct PostAttribute SA_Post;
422 typedef struct PostAttribute PostAttribute;
423 typedef struct FormatStringAttribute SA_FormatString;
424 typedef struct InvalidCheckAttribute SA_InvalidCheck; /*???*/
425 typedef struct SuccessAttribute SA_Success;
426 typedef struct PreBoundAttribute SA_PreBound;
427 typedef struct PostBoundAttribute SA_PostBound;
428 typedef struct PreRangeAttribute SA_PreRange;
429 typedef struct PostRangeAttribute SA_PostRange;
430 
431 typedef struct DerefAttribute SAL_deref;
432 typedef struct NotrefAttribute SAL_notref;
433 typedef struct PreOpAttribute SAL_pre;
434 typedef struct PostOpAttribute SAL_post;
435 typedef struct ExceptAttribute SAL_except;
436 
437 typedef struct AtAttribute SAL_at;
438 typedef struct AtBufferAttribute SAL_at_buffer;
439 typedef struct WhenAttribute SAL_when;
440 typedef struct BeginAttribute SAL_begin;
441 typedef struct EndAttribute SAL_end;
442 typedef struct TypefixAttribute SAL_typefix;
443 typedef struct AnnotesAttribute SAL_annotes;
444 typedef struct ContextAttribute SAL_context;
445 
446 #endif /* __cplusplus */
447 
448 #endif /* _M_CEE_SAFE */
449 
450 #ifdef _MANAGED
451 
452 #ifdef CODE_ANALYSIS
453 #define SA_SUPPRESS_MESSAGE( category, id, ... ) [::System::Diagnostics::CodeAnalysis::SuppressMessage( category, id, __VA_ARGS__ )]
454 #define CA_SUPPRESS_MESSAGE( ... ) [System::Diagnostics::CodeAnalysis::SuppressMessage( __VA_ARGS__ )]
455 #define CA_GLOBAL_SUPPRESS_MESSAGE( ... ) [assembly:System::Diagnostics::CodeAnalysis::SuppressMessage( __VA_ARGS__ )]
456 #else /* CODE_ANALYSIS */
457 #define SA_SUPPRESS_MESSAGE( category, id, ... )
458 #define CA_SUPPRESS_MESSAGE( ... )
459 #define CA_GLOBAL_SUPPRESS_MESSAGE( ... )
460 #endif /* CODE_ANALYSIS */
461 
462 #endif /* _MANAGED */
wchar_t * p1
Definition: sourceannotations.h:255
int unused
Definition: sourceannotations.h:216
const char * MaxVal
Definition: sourceannotations.h:206
Definition: sourceannotations.h:322
int unused
Definition: sourceannotations.h:317
struct PostAttribute SA_Post
Definition: sourceannotations.h:421
Definition: sourceannotations.h:231
struct TypefixAttribute SAL_typefix
Definition: sourceannotations.h:442
struct BeginAttribute SAL_begin
Definition: sourceannotations.h:440
unsigned int Deref
Definition: sourceannotations.h:192
wchar_t * p6
Definition: sourceannotations.h:242
wchar_t * p4
Definition: sourceannotations.h:240
#define REPEATABLE
Definition: sourceannotations.h:38
wchar_t * Name
Definition: sourceannotations.h:236
struct EndAttribute SAL_end
Definition: sourceannotations.h:441
struct InvalidCheckAttribute SA_InvalidCheck
Definition: sourceannotations.h:424
struct PostRangeAttribute SA_PostRange
Definition: sourceannotations.h:429
Definition: sourceannotations.h:312
struct AtAttribute SAL_at
Definition: sourceannotations.h:437
int unused
Definition: sourceannotations.h:337
wchar_t * p9
Definition: sourceannotations.h:245
wchar_t * p1
Definition: sourceannotations.h:287
Definition: sourceannotations.h:342
struct PreOpAttribute SAL_pre
Definition: sourceannotations.h:433
struct PostBoundAttribute SA_PostBound
Definition: sourceannotations.h:427
struct FormatStringAttribute SA_FormatString
Definition: sourceannotations.h:423
struct AnnotesAttribute SAL_annotes
Definition: sourceannotations.h:443
long Value
Definition: sourceannotations.h:152
int unused
Definition: sourceannotations.h:327
Definition: sourceannotations.h:177
Definition: sourceannotations.h:292
unsigned int Deref
Definition: sourceannotations.h:204
Definition: sourceannotations.h:260
unsigned int size_t
Definition: sourceannotations.h:19
Definition: sourceannotations.h:156
unsigned int Deref
Definition: sourceannotations.h:172
Definition: sourceannotations.h:199
Definition: sourceannotations.h:332
const char * MaxVal
Definition: sourceannotations.h:194
wchar_t * p5
Definition: sourceannotations.h:241
wchar_t * p3
Definition: sourceannotations.h:239
struct SuccessAttribute SA_Success
Definition: sourceannotations.h:425
const char * MinVal
Definition: sourceannotations.h:205
struct ContextAttribute SAL_context
Definition: sourceannotations.h:444
struct PreBoundAttribute SA_PreBound
Definition: sourceannotations.h:426
wchar_t * p1
Definition: sourceannotations.h:237
const wchar_t * Condition
Definition: sourceannotations.h:162
unsigned int Deref
Definition: sourceannotations.h:182
Definition: sourceannotations.h:272
unsigned short wchar_t
Definition: sourceannotations.h:25
int unused
Definition: sourceannotations.h:307
wchar_t * p7
Definition: sourceannotations.h:243
wchar_t * p1
Definition: sourceannotations.h:297
wchar_t * p2
Definition: sourceannotations.h:238
Definition: sourceannotations.h:221
Definition: sourceannotations.h:167
Definition: sourceannotations.h:102
struct PreAttribute SA_Pre
Definition: sourceannotations.h:419
wchar_t * p1
Definition: sourceannotations.h:277
Definition: sourceannotations.h:302
struct PreRangeAttribute SA_PreRange
Definition: sourceannotations.h:428
Definition: sourceannotations.h:146
int unused
Definition: sourceannotations.h:347
wchar_t * p3
Definition: sourceannotations.h:267
struct AtBufferAttribute SAL_at_buffer
Definition: sourceannotations.h:438
Definition: sourceannotations.h:211
wchar_t * p1
Definition: sourceannotations.h:265
Definition: sourceannotations.h:187
struct PostAttribute PostAttribute
Definition: sourceannotations.h:422
wchar_t * p2
Definition: sourceannotations.h:266
wchar_t * p8
Definition: sourceannotations.h:244
struct NotrefAttribute SAL_notref
Definition: sourceannotations.h:432
struct WhenAttribute SAL_when
Definition: sourceannotations.h:439
const wchar_t * UnformattedAlternative
Definition: sourceannotations.h:141
const char * MinVal
Definition: sourceannotations.h:193
Definition: sourceannotations.h:282
Definition: sourceannotations.h:134
Definition: sourceannotations.h:250
struct PreAttribute PreAttribute
Definition: sourceannotations.h:420
#define SA(id)
Definition: sourceannotations.h:37
Definition: sourceannotations.h:70
struct ExceptAttribute SAL_except
Definition: sourceannotations.h:435
int unused
Definition: sourceannotations.h:226
struct DerefAttribute SAL_deref
Definition: sourceannotations.h:431
struct PostOpAttribute SAL_post
Definition: sourceannotations.h:434
const wchar_t * Style
Definition: sourceannotations.h:140
unsigned int Deref
Definition: sourceannotations.h:108
unsigned int Deref
Definition: sourceannotations.h:76