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);
+5
source share
1 answer

A PSTR*out parameter means that the caller passes in a buffer that receives a pointer to a string.

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

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

Presumably, it is possible to combine these concepts, for this there must be a modifier __deref_opt_out_opt.

+4

All Articles