cstar

eli's docs

   :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

http://msdn.microsoft.com/zh-cn/library/hh916383%28v=vs.110%29.aspx

 

SAL: Microsoft source-code annotation language

相关标注在 sal.h 中定义

 

The Microsoft source-code annotation language (SAL) provides a set of annotations that you can use to describe how a function uses its parameters, the assumptions that it makes about them, and the guarantees that it makes when it finishes.

Simply stated, SAL is an inexpensive way to let the compiler check your code for you.

SAL 定义了四个基本的参数:

_In_     以只读方式向函数传递数据
_Inout_    以可读可写的方式传递数据
_Out_       向函数提供写入地址
_Outptr_    同上,但函数以指针形式返回被写入的地址

 

posted on 2014-11-13 16:08  exclm  阅读(231)  评论(0)    收藏  举报