KernelBasePathCchRemoveBackslash Method

Removes the trailing backslash from the end of a path string.

This function differs from PathRemoveBackslash in that it accepts paths with "\", "\?" and "\?\UNC" prefixes.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("KernelBase.dll", CharSet = CharSet.Auto, BestFitMapping = false, 
	ThrowOnUnmappableChar = true)]
public static HResult PathCchRemoveBackslash(
	StringBuilder buffer,
	uint bufferSize
)

Parameters

buffer  StringBuilder
A pointer to the path string. When this function returns successfully, the string contains the path with any trailing backslash removed.

If no trailing backslash was found, the string is unchanged.

bufferSize  UInt32
The size of the buffer pointed to by buffer, in characters.

Return Value

HResult
This function returns S_OK if the function was successful, S_FALSE if the string was a root path or if no backslash was found, or an error code otherwise.

Remarks

See Also