Returns a size, in wide characters, of a string excluding the terminating zero, if any. The function implements the wcsnlen_s function of the ISO/IEC TR 24731-1 standard.
- Parameters
-
[in] | pszStr | is a pointer to a wide string of the returned length. The parameter may be NULL, the function returns 0 in this case. |
[in] | cchStr | is a size, in wide characters, of the buffer where the string is located. It is treated as a maximum length of the string. Thus the returned value is less or equal to cchStr. The parameter is ignored if pszStr is NULL. |
- Returns
- If the pszStr pointer is NULL, the function returns 0. Otherwise the function returns a length, in wide characters, of the string pointed to by pszStr. If the cchStr characters constitute a zero-terminated string the function behaves identically to wcsLen, returning a number of characters before the null terminator. Otherwise the function returns cchStr.
- See also
- wcsLen;
strnLen_s.