Skip to content

Latest commit

 

History

History
94 lines (69 loc) · 4.06 KB

nf-shlwapi-strncata.md

File metadata and controls

94 lines (69 loc) · 4.06 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:shlwapi.StrNCatA
StrNCatA function (shlwapi.h)
Appends a specified number of characters from the beginning of one string to the end of another. (ANSI)
StrNCatA
shlwapi/StrNCatA
shell\StrNCat.htm
shell
28099350-5759-4595-8353-3452c5cf6ca8
12/05/2018
StrNCat, StrNCat function [Windows Shell], StrNCatA, StrNCatW, _win32_StrNCat, shell.StrNCat, shlwapi/StrNCat, shlwapi/StrNCatA, shlwapi/StrNCatW
shlwapi.h
Windows
Windows 2000 Professional, Windows XP [desktop apps only]
Windows 2000 Server [desktop apps only]
StrNCatW (Unicode) and StrNCatA (ANSI)
Shlwapi.lib
Shlwapi.dll (version 4.71 or later)
Windows
19H1
StrNCatA
shlwapi/StrNCatA
c++
APIRef
kbSyntax
DllExport
Shlwapi.dll
StrNCat
StrNCatA
StrNCatW

StrNCatA function

-description

Appends a specified number of characters from the beginning of one string to the end of another.

Note  Do not use this function or the StrCatN macro. See Remarks for alternative functions.
 

-parameters

-param psz1 [in, out]

Type: PTSTR

A pointer to a null-terminated string to which the function appends the characters from psz2. It must be large enough to hold the combined strings plus the terminating null character.

-param psz2

Type: PCTSTR

A pointer to the null-terminated string to be appended.

-param cchMax

Type: int

The number of characters to be appended to psz1 from the beginning of psz2.

-returns

Type: PTSTR

Returns a pointer to psz1, which holds the combined string.

-remarks

Security Warning:  Using this function incorrectly can compromise the security of your application. The first argument, psz1, must be large enough to hold psz2 and the closing '\0', otherwise a buffer overrun may occur. Buffer overruns may lead to a denial of service attack against the application if an access violation occurs. In the worst case, a buffer overrun may allow an attacker to inject executable code into your process, especially if psz1 is a stack-based buffer. Be aware that the last argument, cchMax, is the number of characters to copy into psz1, not necessarily the size of the psz1 in bytes. Consider using one of the following alternatives. StringCbCat, StringCbCatEx, StringCbCatN, StringCbCatNEx, StringCchCat, StringCchCatEx, StringCchCatN, or StringCchCatNEx. You should review Security Considerations: Microsoft Windows Shell before continuing.

Note

The shlwapi.h header defines StrNCat as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.