Removes all file and directory elements in a path except for the root information.
This function differs from PathStripToRoot in that it accepts paths with "\\", "\\?\" and "\\?\UNC\" prefixes.
Note This function should be used in place of PathStripToRoot to prevent the possibility of a buffer overrun.
- pszPath [in, out]
A pointer to the path string. When this function returns successfully, this string contains only the root information taken from that path.
- cchPath [in]
The size of the buffer pointed to by pszPath, in characters.
This function returns S_OK if the path was truncated, S_FALSE if the path was already just a root, or an HRESULT failure code.
Some examples of the effect of this function:
|Initial string||Final string|
Minimum supported client
|Windows 8 [desktop apps only]|
Minimum supported server
|Windows Server 2012 [desktop apps only]|
Build date: 12/16/2013