Converts a path string into a canonical form.
This function differs from PathCchCanonicalize and PathCchCanonicalizeEx in that it returns the result on the heap. This means that the caller does not have to declare the size of the returned string and reduces stack use.
This function differs from PathCanonicalize in that it accepts paths with "\\", "\\?\" and "\\?\UNC\" prefixes.
HRESULT PathAllocCanonicalize( _In_ PCWSTR pszPathIn, _In_ unsigned long dwFlags, _Out_ PWSTR *ppszPathOut );
- pszPathIn [in]
A pointer to a buffer that contains the original string. This value cannot be NULL.
- dwFlags [in]
Either 0 or the following flag:
Allow the construction of \\?\ paths longer than MAX_PATH.
- ppszPathOut [out]
The address of a pointer to a buffer that, when this function returns successfully, receives the canonicalized path string. It is the responsibility of the caller to free this resource, when it is no longer needed, by calling the LocalFree function. This value cannot be NULL.
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
This function supports these alternate path forms:
Minimum supported client
|Windows 8 [desktop apps only]|
Minimum supported server
|Windows Server 2012 [desktop apps only]|