ShlwApiPathStripToRoot Method
Note: This API is now obsolete.
Removes all file and directory elements in a path except for the root information.
Note: Misuse of this function can lead to a buffer overrun.
We recommend the use of the safer
PathCchStripToRoot(StringBuilder, UInt32) function in its place.
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("ShlwApi.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
[ObsoleteAttribute("Misuse of this function can lead to a buffer overrun. We recommend the use of the safer NativeMethods.PathCchStripToRoot function in its place.",
false)]
public static bool PathStripToRoot(
StringBuilder path
)
<DllImportAttribute("ShlwApi.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
<ObsoleteAttribute("Misuse of this function can lead to a buffer overrun. We recommend the use of the safer NativeMethods.PathCchStripToRoot function in its place.",
false)>
Public Shared Function PathStripToRoot (
path As StringBuilder
) As Boolean
Dim path As StringBuilder
Dim returnValue As Boolean
returnValue = ShlwApi.PathStripToRoot(path)
public:
[DllImportAttribute(L"ShlwApi.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
[ObsoleteAttribute(L"Misuse of this function can lead to a buffer overrun. We recommend the use of the safer NativeMethods.PathCchStripToRoot function in its place.",
false)]
static bool PathStripToRoot(
StringBuilder^ path
)
[<DllImportAttribute("ShlwApi.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
[<ObsoleteAttribute("Misuse of this function can lead to a buffer overrun. We recommend the use of the safer NativeMethods.PathCchStripToRoot function in its place.",
false)>]
static member PathStripToRoot :
path : StringBuilder -> bool
No code example is currently available or this language may not be supported.
- path StringBuilder
-
A pointer to a null-terminated string of length MAX_PATH that contains the path to be converted.
When this function returns successfully, this string contains only the root information taken from that path.
Boolean
Returns
if a valid drive letter was found in the path, or
otherwise.