GetVolumesFromDriveA function

[Removable Storage Manager is no longer available as of Windows 7 and Windows Server 2008 R2.]

The GetVolumesFromDrive function retrieves the volume and drive letter for a given removable storage media drive.

Syntax

DWORD GetVolumesFromDriveA(
  LPSTR pszDriveName,
  LPSTR *VolumeNameBufferPtr,
  LPSTR *DriveLetterBufferPtr
);

Parameters

pszDriveName

The name of the removable storage media drive.

VolumeNameBufferPtr

The volume that represents the removable storage media drive.

DriveLetterBufferPtr

The drive letter that represents the removable storage media drive.

Return Value

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is one of the system error codes.

Remarks

This function assumes there will be only zero or one partitions on a removable disk, so there is at most one drive letter and one volume name.

Requirements

   
Windows version Windows Vista [desktop apps only] Windows Server 2003 [desktop apps only]
Target Platform Windows
Header ntmsapi.h
Library Ntmsapi.lib
DLL Ntmsapi.dll

See Also

GetNtmsObjectInformation

Library Control Functions