|
noexcept |
The function behaves identically to vsPrintfW except for the explicit constraints listed in the remarks.
[out] | pDest | is a pointer to the output buffer where the converted string is to be written to. |
[in] | cchDest | is a size of the output buffer, in wide characters, including the terminating zero. Unlike vsnPrintfW_s the function treats buffer overrun as an error, failing and setting the errno code to ENOBUFS. |
[in] | pszFormat | is a pointer to a zero terminated wide string defining how to interpret data, passed as additional parameters, during the 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. |
The function implements the behaviour of the vswprintf_s function that is described in the ISO/IEC TR 24731-1 standard offering security enhancements by specifying additional runtime constraints listed below.
If any of the constraints is violated the function generates an assertion and, if the execution is allowed to continue, returns a negative number for the insufficient buffer error or zero for other errors, setting corresponding errno code. If an encoding error occurred the function also returns a negative number.
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 character.
The corresponding original C function is vswprintf that has a corresponding chsvlib implementation sPrintfW.