GetDriveType returning DRIVE_FIXED instead of DRIVE_RAMDISK
2 posts · Closed
I use GetDriveType in my program to do automatic redirection, documented here. I expected it to return 6, which means DRIVE_RAMDISK, but what I get is 3, which means DRIVE_FIXED, which I obviously didn't expect.
I don't know why, but I suppose it has something to do with how the disk is created. What should I use to verify that R:\ is indeed a RAM disk? I use C++.
Most RAM disk applications for Windows create disks of type DRIVE_FIXED instead of DRIVE_RAMDISK for several reasons:
- Compatibility: Many applications and system processes expect fixed disks (DRIVE_FIXED) and may not function correctly or may not recognise RAM disks (DRIVE_RAMDISK). By using DRIVE_FIXED, RAM disk applications ensure broader compatibility with the software that might not be designed to interact with RAM disks specifically.
- File System Features: Fixed disks are expected to support the full range of NTFS features, such as compression, encryption, and file permissions. RAM disks marked as DRIVE_FIXED can leverage these features, providing a more consistent and feature-rich experience.
- Disk Management: Some disk management tools and utilities may not support or correctly identify DRIVE_RAMDISK types. By using DRIVE_FIXED, RAM disk applications can ensure that the disks are recognised and managed correctly by these tools.
- Backup and Restore: Backup software and other utilities often treat DRIVE_FIXED differently from other types of drives. By presenting RAM disks as DRIVE_FIXED, these applications ensure they are included in backup sets and can be restored if necessary.
- System Integration: Various system services and drivers expect fixed disks and may not function properly with other drive types. Ensuring the RAM disk is recognised as a fixed disk helps integrate it more seamlessly into the system.
Overall, the decision to present RAM disks as DRIVE_FIXED is primarily driven by the need for compatibility, feature support, and integration with existing software and system components.
I am afraid there is no direct way to verify if a specific drive letter is indeed a RAM disk or not.