Header annotations in Windows Programming

Header annotations are added to many header files ( windows ). These are nothing but a way to specify how a function uses its parameters and returns value. This helps programmers to know if they are using Windows API in correct way. If you are using code analysis in Visual Studio then, you will see the compiler warnings  if the functions  are not used as specified by header annotations.

Header annotations are of two types.

 Buffer Annotations

These are used to specify the pointers used in the function’s. They help to detect the buffer overrun. They generally specify the size and the length of the buffer.

ex.

_bcount

_ecount

_dref

_in

_out

_inout

Advanced Annotations

This type  of annotations provides additional information about parameters and return values used in the functions.

For ex.

__nullnullterminated

__nullterminated

__callback

__checkReturn

 

Tagged with  

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>