PathGetDriveNumberA function

Searches a path for a drive letter within the range of 'A' to 'Z' and returns the corresponding drive number.

Syntax

int PathGetDriveNumberA(
  LPCSTR pszPath
);

Parameters

pszPath

Type: LPCTSTR

A pointer to a null-terminated string of maximum length MAX_PATH that contains the path to be searched.

Return Value

Type: int

Returns 0 through 25 (corresponding to 'A' through 'Z') if the path has a drive letter, or -1 otherwise.

Requirements

   
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)