PathBuildRoot (shlwapi)
Last changed: johnbell149@gmail.com-202.74.138.1

.
Summary
PathBuildRoot - Creates a root path from a given drive number

C# Signature:

/// <summary>
/// Creates a root path from a given drive number
/// </summary>
/// <param name="szRoot">A pointer to the string that receives the constructed root path. This buffer must be at least four characters in size</param>
/// <param name="iDrive">A variable of type int that indicates the desired drive number. It should be between 0 and 25.</param>
/// <returns>Returns the address of the constructed root path. If the call fails for any reason (for example, an invalid drive number), szRoot is returned unchanged.</returns>
[DllImport("shlwapi.dll", EntryPoint = "PathBuildRootW",  SetLastError = True, CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.LPTStr)]
static extern string PathBuildRoot([MarshalAs(UnmanagedType.LPTStr)]szRoot As System.Text.StringBuilder,
                  iDrive As Integer);

VB.NET Signature

''' <summary>
''' Creates a root path from a given drive number
''' </summary>
''' <param name="szRoot">A pointer to the string that receives the constructed root path. This buffer must be at least four characters in size</param>
''' <param name="iDrive">A variable of type int that indicates the desired drive number. It should be between 0 and 25.</param>
''' <returns>Returns the address of the constructed root path. If the call fails for any reason (for example, an invalid drive number), szRoot is returned unchanged.</returns>
<DllImport("shlwapi.dll", EntryPoint:="PathBuildRootW",  SetLastError:=True, CharSet:=CharSet.Unicode)> _
Public Function PathBuildRoot(<MarshalAs(UnmanagedType.LPTStr)>szRoot As System.Text.StringBuilder, _
                  iDrive As Integer) as <MarshalAs(UnmanagedType.LPTStr)>String
End Function

VB Signature:

Public Declare Function PathBuildRoot Lib "shlwapi" Alias "PathBuildRootA" _
        (ByVal szRoot As String, _
         ByVal iDrive As Integer) As Long

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Documentation