GetDriveType

  UINT GetDriveType(lpszRootPathName)    
  LPTSTR lpszRootPathName; /* optional root path */

The GetDriveType function determines whether a disk drive is removable, fixed, CD ROM, RAM disk, or a network drive.

Parameters

lpszRootPathName

Points to a null-terminated string specifying the root directory of the disk to return information about. If lpszRootPathName is NULL, the root of the current directory is used.

Return Value

The return value specifies the type of drive. It can be one of the following values:

Value Meaning

0 The drive type cannot be determined.
1 The root directory does not exist.
DRIVE_REMOVABLE Disk can be removed from the drive.
DRIVE_FIXED Disk cannot be removed from the drive.
DRIVE_REMOTE Drive is a remote (network) drive.
DRIVE_CDROM Drive is a CD ROM drive.
DRIVE_RAMDISK Drive is a RAM disk.

Comment

The GetDriveType function may be used as either a wide-character function (where text arguments must use Unicode) or an ANSI function (where text arguments must use characters from the Windows 3.x character set installed).

See Also

GetDiskFreeSpace