KernelBasePathCchCombine Method
Combines two path fragments into a single path.
This function also canonicalizes any relative path elements, removing "." and ".." elements to simplify the final path.
This function differs from
PathCchCombineEx(StringBuilder, UInt32, String, String, PathOptions) in that
you are restricted to a final path of length MAX_PATH.
This function differs from PathAllocCombine in that
the caller must declare the size of the returned string, which is stored on the stack.
This function differs from
PathCombine(StringBuilder, String, String) in that
it accepts paths with "\", "\?" and "\?\UNC" prefixes.
Note: This function,
PathCchCombineEx(StringBuilder, UInt32, String, String, PathOptions), or PathAllocCombine
should be used in place of
PathCombine(StringBuilder, String, String) to prevent the possibility of a buffer overrun.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("KernelBase.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)]
public static HResult PathCchCombine(
StringBuilder pathOut,
uint pathOutSize,
string pathIn,
string more
)
<DllImportAttribute("KernelBase.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true>]
Public Shared Function PathCchCombine (
pathOut As StringBuilder,
pathOutSize As UInteger,
pathIn As String,
more As String
) As HResult
Dim pathOut As StringBuilder
Dim pathOutSize As UInteger
Dim pathIn As String
Dim more As String
Dim returnValue As HResult
returnValue = KernelBase.PathCchCombine(pathOut,
pathOutSize, pathIn, more)
public:
[DllImportAttribute(L"KernelBase.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)]
static HResult PathCchCombine(
StringBuilder^ pathOut,
unsigned int pathOutSize,
String^ pathIn,
String^ more
)
[<DllImportAttribute("KernelBase.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)>]
static member PathCchCombine :
pathOut : StringBuilder *
pathOutSize : uint32 *
pathIn : string *
more : string -> HResult
No code example is currently available or this language may not be supported.
- pathOut StringBuilder
-
A pointer to a buffer that, when this function returns successfully, receives the combined path string.
This parameter can point to the same buffer as pathIn or more.
- pathOutSize UInt32
-
The size of the buffer pointed to by pathOut, in characters.
- pathIn String
-
A pointer to the first path string.
This value can be NULL.
- more String
-
A pointer to the second path string.
If this path begins with a single backslash,
it is combined with only the root of the path pointed to by pathIn.
If this path is fully qualfied, it is copied directly to the output buffer without being combined with the other path.
This value can be NULL.
HResult
This function returns
S_OK if succeed,
or an
HResult failure code.