/*
DRIVE_UNKNOWN
0
The drive type cannot be determined.
DRIVE_NO_ROOT_DIR
1
The root path is invalid; for example, there is no volume mounted at the specified path.
DRIVE_REMOVABLE
2
The drive has removable media; for example, a floppy drive, thumb drive, or flash card reader.
DRIVE_FIXED
3
The drive has fixed media; for example, a hard disk drive or flash drive.
DRIVE_REMOTE
4
The drive is a remote (network) drive.
DRIVE_CDROM
5
The drive is a CD-ROM drive.
DRIVE_RAMDISK
6
The drive is a RAM disk.
*/
UINT
GetDiskDriveType(
IN LPTSTR lpPath
)
{
UINT uRet = DRIVE_UNKNOWN;
TCHAR DiskDrivePath[MAX_PATH] = {0};
__try
{
if (!lpPath)
{
printf("[GetDiskDriveType] : input parameter error \n");
__leave;
}
CopyMemory(DiskDrivePath, lpPath, sizeof(TCHAR));
_tcscat_s(DiskDrivePath, MAX_PATH, _T(":\\"));
uRet = GetDriveType(DiskDrivePath);
}
__finally
{
;
}
return uRet;
}
获取一个路径所在硬盘驱动器的类型
最新推荐文章于 2021-07-29 14:10:42 发布