简体   繁体   English

了解__deref_out

[英]Understanding __deref_out

I am new to Windows programming and I can't seem to find any resources on understanding what this SAL annotation means. 我是Windows编程的新手,我似乎找不到任何资源来理解此SAL注释的含义。 I'm basically trying to look for examples so I know exactly what this means both for the caller and the callee. 我基本上是在尝试查找示例,以便我确切知道这对呼叫者和被呼叫者意味着什么。

The MSDN article here was of no help. 这里的MSDN文章没有帮助。

Any help would be appreciated. 任何帮助,将不胜感激。

"deref" means there's a level of indirection in the passed in pointer. “ deref”表示传入的指针中存在一个间接级别。 So instead of: 所以代替:

DWORD Function(BYTE* pBuffer);
// pBuffer is a pointer to a BYTE buffer

You might have: 你可能有:

DWORD Function(BYTE** ppBuffer);
// pBuffer is a pointer to another pointer
// To access the buffer, dereference the pointer:
// BYTE* pBuffer = *ppBuffer;

"opt" means the value is optional, that is ppBuffer may be equal to nullptr . “ opt”表示该值是可选的,即ppBuffer可以等于nullptr

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM