SAL 批注SAL Annotations

如果检查库的标头文件,您可能会注意一些特殊的注释,例如,_In_z_Out_z_cap_(_Size)If you examine the library header files, you may notice some unusual annotations, for example, _In_z and _Out_z_cap_(_Size). 这些是 Microsoft 源代码注释语言 (SAL) 的示例。SAL 提供一组描述函数如何使用其参数的注释,例如,它关于参数的假设以及关于完成的保证。These are examples of the Microsoft source-code annotation language (SAL), which provides a set of annotations to describe how a function uses its parameters, for example, the assumptions it makes about them and the guarantees it makes on finishing. 标头文件 <sal.h> 定义了这些注释。The header file <sal.h> defines the annotations.

有关在 Visual Studio 中使用 SAL 注释的详细信息,请参阅使用 SAL 注释减少 C/C++ 代码缺陷For more information about using SAL annotations in Visual Studio, see Using SAL Annotations to Reduce C/C++ Code Defects.

另请参阅See Also

CRT 库功能CRT Library Features