In the file C:\Program Files (x86)\Windows Kits\8.1\Include\um\OleAuto.h
, I found the following code that I do not know how to interpret:
WINOLEAUTAPI SafeArrayAccessData(_In_ SAFEARRAY * psa,
_Outptr_result_buffer_(_Inexpressible_(psa->cbElements *
product(psa->rgsabound[0..psa->cDims-1]->cElements)))
void HUGEP** ppvData);
Note the double period within the square bracket. Is that a new operator in C++?
: two points placed immediately after a musical note or rest to indicate augmentation of its time value by three-quarters.
The dot (.) operator is used for direct member selection via object name. In other words, it is used to access the child object.
The two dots (a colon) are followed by what's called an initializer list.
Two periods ( .. ) is the range operator. You can find this in the Operators and Symbols Appendix of the Rust book. There are six flavors: Range : 1..
It appears to be a SAL annotation used to tell the static analyzer that the size of the buffer is too complex to represent using ordinary annotations:
https://msdn.microsoft.com/en-us/library/jj159527.aspx
It doesn't have to contain valid syntax, but what it contains is probably meant to succinctly illustrate to a human reader how the size of the buffer could be calculated.
If I'm to interpret it myself, I'd guess it means what the following code would yield:
DWORD CalculateInexpressibleSafeArrayDataSize(SAFEARRAY * psa)
{
DWORD cbSize = psa->cbElements;
for (int i = 0; i < psa->cDims; i++) // product()
cbSize *= psa->rgsabound[i]->cElements;
return cbSize;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With