|
noexcept |
The function behaves identically to vsnPrintfW but with security constraints.
[out] | pDest | is a pointer to the output buffer where the converted string is to be written to. A size, in wide characters, of the buffer is specified by cchDest. pDest must not be NULL. |
[in] | cchDest | is a size, in wide characters, of the output buffer. cchDest must not be zero. At most \((cchDest - 1)\) characters of the formatted string are written to the output buffer. A zero terminator is always appended to the end of the output string. |
[in] | pszFormat | is a pointer to a zero terminated string defining how to interpret data, passed as additional parameters, during construction of the output. See PrintfW_s for the definition of the format lexemes. |
[in] | ap | is a variable argument list containing data used to construct an output string according to the format. |
Unlike the sPrintfW_s function, if cchDest is less than a size required to hold the whole output string, the function will not fail but will truncate the result to fit the available space.
The vsnPrintfW_s function is equivalent to vsnPrintfW except for the following explicit runtime constraints specified by ISO/IEC TR 24731-1:
If any of the constraints is violated the function generates an assertion and, if the execution is allowed to continue, returns a negative number setting errno to EINVAL.
On error, if pDest is not null and cchDest is greater than 0 and less than RSIZE_MAX, the function sets pDest[0] to the null wide character.