PathCchAppendEx function (pathcch.h)
Appends one path to the end of another.
This function differs from PathCchAppend in that it allows for a longer final path to be constructed.
This function differs from PathAppend in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.
Syntax
WINPATHCCHAPI HRESULT PathCchAppendEx(
[in, out] PWSTR pszPath,
[in] size_t cchPath,
[in, optional] PCWSTR pszMore,
[in] ULONG dwFlags
);
Parameters
[in, out] pszPath
A pointer to a buffer that, on entry, contains the original path. When this function returns successfully, the buffer contains the original path plus the appended path.
[in] cchPath
The size of the buffer pointed to by pszPath, in characters.
[in, optional] pszMore
A pointer the path to append to the end of the path pointed to by pszPath. UNC paths and paths that begin with the sequence \?\ are accepted and recognized as fully-qualified paths. These paths replace the string pointed to by pszPath instead of being appended to it.
[in] dwFlags
One or more of the following flags:
Return value
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT code, including the following.
Return code | Description |
---|---|
|
Either pszPath or pszMore is NULL, cchPath is 0, or cchPath is greater than PATHCCH_MAX_CCH. |
|
The resulting string would exceed PATHCCH_MAX_CCH. |
|
The function could not allocate a buffer of the necessary size. |
Remarks
This function inserts a backslash between the two strings, if one is not already present.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 8 [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2012 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | pathcch.h |
Library | Pathcch.lib |
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for