KernelBasePathCchCanonicalizeEx Method
Simplifies a path by removing navigation elements such as "." and ".." to produce a direct, well-formed path.
This function differs from
PathCchCanonicalize(StringBuilder, UInt32, String) in that
it allows for a longer final path to be constructed.
This function differs from PathAllocCanonicalize in that
the caller must declare the size of the returned string, which is stored on the stack.
This function differs from
PathCanonicalize(StringBuilder, String) in that
it accepts paths with "\", "\?" and "\?\UNC" prefixes.
Note: This function,
PathCchCanonicalize(StringBuilder, UInt32, String), or PathAllocCanonicalize
should be used in place of
PathCanonicalize(StringBuilder, 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 PathCchCanonicalizeEx(
StringBuilder pathOut,
uint pathOutSize,
string pathIn,
PathOptions flags
)
<DllImportAttribute("KernelBase.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true>]
Public Shared Function PathCchCanonicalizeEx (
pathOut As StringBuilder,
pathOutSize As UInteger,
pathIn As String,
flags As PathOptions
) As HResult
Dim pathOut As StringBuilder
Dim pathOutSize As UInteger
Dim pathIn As String
Dim flags As PathOptions
Dim returnValue As HResult
returnValue = KernelBase.PathCchCanonicalizeEx(pathOut,
pathOutSize, pathIn, flags)
public:
[DllImportAttribute(L"KernelBase.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)]
static HResult PathCchCanonicalizeEx(
StringBuilder^ pathOut,
unsigned int pathOutSize,
String^ pathIn,
PathOptions flags
)
[<DllImportAttribute("KernelBase.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)>]
static member PathCchCanonicalizeEx :
pathOut : StringBuilder *
pathOutSize : uint32 *
pathIn : 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 edited path string.
- pathOutSize UInt32
-
The size of the buffer pointed to by pathOut, in characters.
- pathIn String
-
A pointer to the original path string.
If this value is NULL, points to an empty string,
or results in an empty string once the "." and ".." elements are removed,
a single backslash is copied to the buffer pointed to by pathOut.
- flags PathOptions
-
Flags that determine how to canonicalize the path.
HResult
This function returns
S_OK if succeed,
or an
HResult failure code.