Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

PathBuildRoot (shlwapi)
 
.
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

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions