Windows Mobile 6.5
A version of this page is also available for

This function returns the canonical form and the length of the canonical form of the specified path.

DWORD CeGetCanonicalPathName(
  LPCWSTR lpPathName, 
  LPWSTR lpCanonicalPathName,
  DWORD cchCanonicalPathName,
  DWORD dwReserved


[in] Pointer to the input null-terminated string of at most MAX_PATH characters in length that will be returned in canonical form. If this parameter is set to NULL, this function fails, and GetLastError returns ERROR_INVALID_PARAMETER.


[out] Optional. Pointer to a buffer that receives the canonical path. If this parameter is not set to NULL and this function succeeds, the buffer pointed to by lpCanonicalPathName contains a null-terminated string of length equal to that returned by this function.


[in] Size of the buffer pointed to by lpCanonicalPathName. If lpCanonicalPathName is not set to NULL and cchCanonicalPathName is less than the length of the canonical path, this funciton name fails, and GetLastError returns ERROR_INSUFFICIENT_BUFFER.


[in] Reserved for future use.

The length of the canonical path indicates success. If lpCanonicalPathName is not set to NULL, the canonical path is stored in lpCanonicalPathName. Zero indicates failure.

Windows Embedded CEWindows CE 5.0 and later
Windows MobileWindows Mobile Version 5.0 and later

Community Additions