First of all, here are the limitations:
- Should work on XP
- It is necessary to notify about the assignment of drive letters and the installation of the volume in the folder
- You cannot “wake up” a disk if it is sleeping.
- I would rather not poll the disk.
What I tried:
- Google
- I looked at WMI and the Win32_LogicalDisk class. I can determine which drives are mounted on the drive letter, but not those that are installed in the folder. The Win32_Volume * and Win32_MountPoint classes would be ideal, but not available on XP.
- I tried trying the disks with FindFirstVolume and GetVolumePathNamesForVolumeName (although I would not want to), but it seems that the disks should be deployed before it can give me the information. And again, ew, a survey.
I considered using API connections to intercept SetVolumeMountPoint and DeleteVolumeMountPoint calls, but I don't think that would catch everything, and it looks like it could be an ugly hack anyway.
So yes, I'm looking for suggestions :)
source share