StrCpyNW function (shlwapi.h)
Copies a specified number of characters from the beginning of one string to another.
PWSTR StrCpyNW(
[out] PWSTR pszDst,
[in] PCWSTR pszSrc,
int cchMax
);
[out] pszDst
Type: PTSTR
A pointer to a buffer that, when this function returns successfully, receives the copied string. This buffer must be of sufficient size to hold the copied characters. This string is not guaranteed to be null-terminated.
[in] pszSrc
Type: PCTSTR
A pointer to the null-terminated source string.
cchMax
Type: int
The number of characters to be copied, including the terminating null character.
Type: PTSTR
Returns a pointer to pszDst.
Security Warning: Using this function incorrectly can compromise the security of your application. The copied string is not guaranteed to be null-terminated. Consider using one of the following alternatives. StringCbCopy, StringCbCopyEx, StringCbCopyN, StringCbCopyNEx, StringCchCopy, StringCchCopyEx, StringCchCopyN, StringCchCopyNEx. You should review Security Considerations: Microsoft Windows Shell before continuing.
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional, Windows XP [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | shlwapi.h |
Library | Shlwapi.lib |
DLL | Shlwapi.dll (version 4.71 or later) |