annotate attribute

The [annotate] attribute allows you to specify a SAL annotation string for the specified method, parameter, or structure field.

[ annotation(“string”0,  [, function-attribute-list] ] function-declarator ;
[ [function-attribute-list] ] type-specifier [pointer-declarator] function-name(
    [ annotation(“string”) [ , parameter-attribute-list ] ] type-specifier [declarator]
    , ...);

Parameters

string

Specified SAL annotation string.

function-attribute-list

Specifies zero or more attributes that apply to the function. Valid function attributes include [callback]; the pointer attributes [ref], [unique], or [ptr]; and the usage attributes [string], [ignore], and [context_handle]. Multiple attributes must be separated by commas.

function-declarator

Specifies the type specifier, function name, and parameter list for the function.

type-specifier

Specifies a base_type, [struct], union, or [enum] type or type identifier. An optional storage specification can precede type-specifier.

pointer-declarator

Specifies zero or more pointer declarators. A pointer declarator is the same as a pointer declarator used in C; it is constructed from the * designator, modifiers such as far, and the qualifier [const].

function-name

Specifies the name of the remote procedure.

parameter-attribute-list

Specifies zero or more attributes appropriate for the parameter type. Parameter attributes with the [in] attribute can also take the directional attribute [out]; the field attributes [first_is], [last_is], [length_is], [max_is], [size_is], and [switch_type]; the pointer attributes [ref], [unique], or [ptr]; and the usage attributes [context_handle] and [string]. The usage attribute [ignore] cannot be used as a parameter attribute. Multiple attributes must be separated by commas.

declarator

Specifies standard C declarators, such as identifiers, pointer declarators, and array declarators. For more information, see Array and Sized-Pointer Attributes, [arrays], and Arrays and Pointers. The parameter declarator in the function declarator, such as the parameter name, is optional.

Remarks

The [annotate] attribute allows overriding MIDL-generated SAL annotations or adding them in places where MIDL does not explicitly generate an annotation. If /sal is not specified on the command line, this attribute is ignored.

See also

General MIDL Command-line Syntax

/sal

/sal_local