KernelBasePathCchCombineEx 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
PathCchCombine(StringBuilder, UInt32, String, String) in that
it allows for a longer final path to be constructed.
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,
PathCchCombine(StringBuilder, UInt32, String, String), 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 PathCchCombineEx(
StringBuilder pathOut,
uint pathOutSize,
string pathIn,
string more,
PathOptions flags
)
<DllImportAttribute("KernelBase.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true>]
Public Shared Function PathCchCombineEx (
pathOut As StringBuilder,
pathOutSize As UInteger,
pathIn As String,
more As String,
flags As PathOptions
) As HResult
Dim pathOut As StringBuilder
Dim pathOutSize As UInteger
Dim pathIn As String
Dim more As String
Dim flags As PathOptions
Dim returnValue As HResult
returnValue = KernelBase.PathCchCombineEx(pathOut,
pathOutSize, pathIn, more, flags)
public:
[DllImportAttribute(L"KernelBase.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)]
static HResult PathCchCombineEx(
StringBuilder^ pathOut,
unsigned int pathOutSize,
String^ pathIn,
String^ more,
PathOptions flags
)
[<DllImportAttribute("KernelBase.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)>]
static member PathCchCombineEx :
pathOut : StringBuilder *
pathOutSize : uint32 *
pathIn : string *
more : string *
flags : PathOptions -> 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.
- flags PathOptions
-
Flags that determine how to combine the path.
HResult
This function returns
S_OK if succeed,
or an
HResult failure code.