简体   繁体   English

__deref_out_opt和__deref_opt_out有什么区别?

[英]what is the difference between __deref_out_opt and __deref_opt_out?

What is the difference between the following SAL annotations? 以下SAL注释有什么区别?

void foo(__deref_out_opt PSTR* bar);

void foo(__deref_opt_out PSTR* bar);

A PSTR* out parameter means the caller passes in a buffer which receives a pointer to a string. PSTR* out参数表示调用者传入缓冲区,该缓冲区接收指向字符串的指针。

In __deref_out_opt, the string is optional (the function puts NULL in the caller-provided buffer). 在__deref_out_opt中,字符串是可选的(该函数在调用者提供的缓冲区中放置NULL)。

In __deref_opt_out, the buffer is optional (the caller passes NULL to indicate disinterest in the output value). 在__deref_opt_out中,缓冲区是可选的(调用者传递NULL以指示输出值不感兴趣)。

Presumably, it's possible to combine these concepts, there should be a __deref_opt_out_opt modifier for that. 据推测,可以组合这些概念,应该有一个__deref_opt_out_opt修饰符。

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

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