简体   繁体   中英

what is the difference between __deref_out_opt and __deref_opt_out?

What is the difference between the following SAL annotations?

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.

In __deref_out_opt, the string is optional (the function puts NULL in the caller-provided buffer).

In __deref_opt_out, the buffer is optional (the caller passes NULL to indicate disinterest in the output value).

Presumably, it's possible to combine these concepts, there should be a __deref_opt_out_opt modifier for that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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