GetDriveType The GetDriveType function determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive. UINT GetDriveType( LPCTSTR lpRootPathName // root directory );Value Meaning DRIVE_UNKNOWN The drive type cannot be determined. DRIVE_NO_ROOT_DIR The root path is invalid. For example, no volume is mounted at the path. DRIVE_REMOVABLE The disk can be removed from the drive. DRIVE_FIXED The disk cannot be removed from the drive. DRIVE_REMOTE The drive is a remote (network) drive. DRIVE_CDROM The drive is a CD-ROM drive. DRIVE_RAMDISK The drive is a RAM disk.
有人提诗在上头 UINT GetDriveType( LPCTSTR lpRootPathName // root directory );Value Meaning DRIVE_UNKNOWN The drive type cannot be determined. DRIVE_NO_ROOT_DIR The root path is invalid. For example, no volume is mounted at the path. DRIVE_REMOVABLE The disk can be removed from the drive. DRIVE_FIXED The disk cannot be removed from the drive. DRIVE_REMOTE The drive is a remote (network) drive. DRIVE_CDROM The drive is a CD-ROM drive. DRIVE_RAMDISK The drive is a RAM disk. 不过GetDriveType("f:")==DRIVE_REMOVABLE //可移动存储设备? 好象是软盘来的。USB 是不是另有值呢? 其实USB的驱动必须是WDM模型,功能设备对象FDO和物理设备对象PDO。一硬件仅一个PDO。通过GUID 来表示设备。 GUID ClassGuid=UsbDeiceName—CLAA—GUID 用Hdebice打开打不开就知道是不是USB了。
The GetDriveType function determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive. UINT GetDriveType(
LPCTSTR lpRootPathName // root directory
);Value Meaning
DRIVE_UNKNOWN The drive type cannot be determined.
DRIVE_NO_ROOT_DIR The root path is invalid. For example, no volume is mounted at the path.
DRIVE_REMOVABLE The disk can be removed from the drive.
DRIVE_FIXED The disk cannot be removed from the drive.
DRIVE_REMOTE The drive is a remote (network) drive.
DRIVE_CDROM The drive is a CD-ROM drive.
DRIVE_RAMDISK The drive is a RAM disk.
GetDriveType("f:")==DRIVE_FIXED //固定硬盘。
UINT GetDriveType(
LPCTSTR lpRootPathName // root directory
);Value Meaning
DRIVE_UNKNOWN The drive type cannot be determined.
DRIVE_NO_ROOT_DIR The root path is invalid. For example, no volume is mounted at the path.
DRIVE_REMOVABLE The disk can be removed from the drive.
DRIVE_FIXED The disk cannot be removed from the drive.
DRIVE_REMOTE The drive is a remote (network) drive.
DRIVE_CDROM The drive is a CD-ROM drive.
DRIVE_RAMDISK The drive is a RAM disk. 不过GetDriveType("f:")==DRIVE_REMOVABLE //可移动存储设备?
好象是软盘来的。USB 是不是另有值呢?
其实USB的驱动必须是WDM模型,功能设备对象FDO和物理设备对象PDO。一硬件仅一个PDO。通过GUID 来表示设备。
GUID ClassGuid=UsbDeiceName—CLAA—GUID
用Hdebice打开打不开就知道是不是USB了。