KernelBasePathCchCanonicalize Method
Converts a path string into a canonical form.
This function differs from
PathCchCanonicalizeEx(StringBuilder, UInt32, String, PathOptions) in that
you are restricted to a final path of length MAX_PATH.
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,
PathCchCanonicalizeEx(StringBuilder, UInt32, String, PathOptions), 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 PathCchCanonicalize(
StringBuilder pathOut,
uint pathOutSize,
string pathIn
)
<DllImportAttribute("KernelBase.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true>]
Public Shared Function PathCchCanonicalize (
pathOut As StringBuilder,
pathOutSize As UInteger,
pathIn As String
) As HResult
Dim pathOut As StringBuilder
Dim pathOutSize As UInteger
Dim pathIn As String
Dim returnValue As HResult
returnValue = KernelBase.PathCchCanonicalize(pathOut,
pathOutSize, pathIn)
public:
[DllImportAttribute(L"KernelBase.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)]
static HResult PathCchCanonicalize(
StringBuilder^ pathOut,
unsigned int pathOutSize,
String^ pathIn
)
[<DllImportAttribute("KernelBase.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)>]
static member PathCchCanonicalize :
pathOut : StringBuilder *
pathOutSize : uint32 *
pathIn : 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 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.
HResult
This function returns
S_OK if succeed,
or an
HResult failure code.