문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top