Windows 我们应该用In而不是In吗?
我今天读了VS2010中的sal.h。Windows 我们应该用In而不是In吗?,windows,visual-studio-2010,visual-c++,annotations,Windows,Visual Studio 2010,Visual C++,Annotations,我今天读了VS2010中的sal.h。 我有点惊讶 // This section contains the deprecated annotations |------------|------------|---------|--------|----------|----------|---------------| | Level | Usage | Size | Output | NullTerm | Optional | Parameters | |-
我有点惊讶
// This section contains the deprecated annotations
|------------|------------|---------|--------|----------|----------|---------------|
| Level | Usage | Size | Output | NullTerm | Optional | Parameters |
|------------|------------|---------|--------|----------|----------|---------------|
| <> | <> | <> | <> | _z | <> | <> |
| _deref | _in | _ecount | _full | _nz | _opt | (size) |
| _deref_opt | _out | _bcount | _part | | | (size,length) |
| | _inout | | | | | |
| | | | | | | |
|------------|------------|---------|--------|----------|----------|---------------|
//此部分包含不推荐使用的注释
|------------|------------|---------|--------|----------|----------|---------------|
|级别|使用|大小|输出|空项|可选|参数|
|------------|------------|---------|--------|----------|----------|---------------|
|| | | | | | | | ||
||u deref|u in|u ecocount|u full|u nz|u opt|(尺寸)|
||u deref|u opt|u out|u bcount|u part||||(尺寸、长度)|
|| | | | | | ||
| | | | | | | |
|------------|------------|---------|--------|----------|----------|---------------|
我总是使用这些注释。我不敢相信他们不赞成。这是真的吗?
如果是,为什么?
从现在起,我们应该使用以下注释吗-我不熟悉:(
|--------------|----------|----------------|-----------------------------|
|用法|空|零终止|范围|
|--------------|----------|----------------|-----------------------------|
||In||||
|_Out|opt|z|[byte]cap|[c|x|](大小)|
|_Inout| | | |[byte]计数u[c| x_u](大小)|
|| | | | | ptrdiff|u cap|(ptr)|
|--------------|| | ptrdiff_count(ptr)|
||Ret||||
||Deref|ret|||||
|--------------| | | |
|_Pre|||||
|| | | | ||
|_Deref_pre|||||
|德雷夫邮政公司|
|--------------|----------|----------------|-----------------------------|
顺便说一下,SO中不存在SAL标记。如果你可以的话,请做。 看起来你应该习惯新的“属性”SAL格式,在这篇文章的中间看到红色的注释:
< /P> >这看起来像SQL…你指的是什么语言?Windows、Visual Studio和微软不是语言。我猜是MS SQL,但是|--------------|----------|----------------|-----------------------------|
| Usage | Nullness | ZeroTerminated | Extent |
|--------------|----------|----------------|-----------------------------|
| _In_ | <> | <> | <> |
| _Out_ | opt_ | z_ | [byte]cap_[c_|x_]( size ) |
| _Inout_ | | | [byte]count_[c_|x_]( size ) |
| _Deref_out_ | | | ptrdiff_cap_( ptr ) |
|--------------| | | ptrdiff_count_( ptr ) |
| _Ret_ | | | |
| _Deref_ret_ | | | |
|--------------| | | |
| _Pre_ | | | |
| _Post_ | | | |
| _Deref_pre_ | | | |
| _Deref_post_ | | | |
|--------------|----------|----------------|-----------------------------|