PathCchStripToRoot function (pathcch.h)
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.
Syntax
WINPATHCCHAPI HRESULT PathCchStripToRoot(
[in, out] PWSTR pszPath,
[in] size_t cchPath
);
Parameters
[in, out] pszPath
A pointer to the path string. When this function returns successfully, this string contains only the root information taken from that path.
[in] cchPath
The size of the buffer pointed to by pszPath, in characters.
Return value
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.
Remarks
Some examples of the effect of this function:
Initial string | Final string |
---|---|
"C:\path1\path2\file" | "C:\" |
"\\path1\path2\path3" | "\\path1\path2" |
"\path1" | "\" |
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 8 [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2012 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | pathcch.h |
Library | Pathcch.lib |
Σχόλια
https://aka.ms/ContentUserFeedback.
Σύντομα διαθέσιμα: Καθ' όλη τη διάρκεια του 2024 θα καταργήσουμε σταδιακά τα ζητήματα GitHub ως μηχανισμό ανάδρασης για το περιεχόμενο και θα το αντικαταστήσουμε με ένα νέο σύστημα ανάδρασης. Για περισσότερες πληροφορίες, ανατρέξτε στο θέμα:Υποβολή και προβολή σχολίων για