Skip to content

Latest commit

 

History

History
62 lines (45 loc) · 1.76 KB

GetDriveType.md

File metadata and controls

62 lines (45 loc) · 1.76 KB

Home

Function name : GetDriveType

Group: File Management - Library: kernel32


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


Code examples:

Displaying the drive type value
Retrieving list of available disk drives
Using the GetLogicalDriveStrings
Retrieving information about MS-DOS device names using QueryDosDevice (WinNT only)
Mapping and disconnecting network drives
Disconnecting USB Mass Storage Device programmatically
Detecting changes in connections to removable drives (VFP9)

Declaration:

UINT GetDriveType(
  LPCTSTR lpRootPathName   // root directory
);  

FoxPro declaration:

DECLARE INTEGER GetDriveType IN kernel32 STRING nDrive  

Parameters:

lpRootPathName [in] Pointer to a null-terminated string that specifies the root directory of the disk to return information about. A trailing backslash is required. If lpRootPathName is NULL, the function uses the root of the current directory


Return value:

The return value specifies the type of drive


Comments:

#DEFINE DRIVE_UNKNOWN 0  
#DEFINE DRIVE_NO_ROOT_DIR 1  
#DEFINE DRIVE_REMOVABLE 2  
#DEFINE DRIVE_FIXED 3  
#DEFINE DRIVE_REMOTE 4  
#DEFINE DRIVE_CDROM 5  
#DEFINE DRIVE_RAMDISK 6

See also: RealDriveType.