PathBuildRootW function (shlwapi.h)

Creates a root path from a given drive number.

Syntax

LPWSTR PathBuildRootW(
  [out] LPWSTR pszRoot,
  [in]  int    iDrive
);

Parameters

[out] pszRoot

Type: LPTSTR

A pointer to the string that receives the constructed root path. This buffer must be at least four characters in size.

[in] iDrive

Type: int

A variable of type int that indicates the desired drive number. It should be between 0 and 25.

Return value

Type: LPTSTR

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.

Remarks

Note

The shlwapi.h header defines PathBuildRoot as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header shlwapi.h
Library Shlwapi.lib
DLL Shlwapi.dll (version 4.71 or later)