General-Purpose Annotations
The general-purpose annotations provide the analysis tools with information about the information flow between a caller and the function that is being called. This information is related to both the direction that the information flows and the size and type that can be checked to detect potential buffer overflows.
You can use the general-purpose annotations in both driver and nondriver code. General-purpose annotations are defined in Specstrings.h and described with extensive comments in Specstrings_strict.h. Both files are in the \inc\api subdirectory of the WDK.
This section provides guidelines and examples for using the general-purpose annotations and modifiers.
General-purpose annotation | Usage |
---|---|
__in__out __inout |
|
_opt_deref |
|
_ecount(size)_bcount(size) |
|
_full(size)_part(size, length) |
|
__nullterminated__nullnullterminated__possibly_notnullterminated |
|
__reserved |
|
__checkReturn |
|
__success(expr)__failure(expr) |
PFD does not interpret certain annotations such as __fallthrough, but these can still be useful when they are applied as comments in code. See the comments in Specstrings_strict.h for a complete list of annotations.
Send comments about this topic to Microsoft
Build date: 5/3/2011