GetDriveTypeW GetDriveTypeA should return DRIVE_RAMDISK
Status: Inactive
Brought to you by:
w77
Hello!
Thanks for wonderful application toolkit.
I write app that uses disk IO extensively (for temporary raw video files).
So I must ensure that my software does not broke SSD by wearing it out.
My software checks if provided disk drive is a RAM-drive.
To easy check (without heuristics) it uses disk label and return value of GetDriveTypeW function.
I've found that GetDriveTypeW returns DRIVE_FIXED instead DRIVE_RAMDISK.
Please assign default values for a RAM-disk:
1. return value of GetDriveTypeW to DRIVE_RAMDISK
2. return value (lpVolumeNameBuffer) of GetVolumeInformation to "RAMDISK"
Thanks!
The driver produces drives that are not necessarily ramdisks. And it's not always possible to know whether the volume will be a ramdisk or not (in case of a use of a proxy).
However, it is possible to know whether a volume belongs to Imdisk or not, with something like:
I think the driver can ask from a disk implementation for the drive type.
In most cases it is better that DRIVE_FIXED is returned so that ImDisk drives can be used to emulate fixed disk volumes. There is also a RAM disk device type in the kernel that would cause DRIVE_RAMDISK to be returned by GetDriveType, but that device type has lots of limitations and is not suitable for lots of use cases. For example, Windows refuse to format such disks, they need to be pre-loaded with a formatted file system. There are also lots of cases where Windows will refuse to use such disks for various purposes where ImDisk is currently frequently used.
So, effectively, it would break lots of things to change this and there would be very little pros but lots of cons.
Thanks for the exhaustive answer!
Now, I think the ticket can be moved to an archive.