First off, here are the constraints:
- Must run on XP
- Must notify of both drive letter assignments and mounting a volume to a folder
- Must not 'wake' a drive if it is sleeping.
- I'd really rather not polling the drive.
What I've tried:
- I've looked at WMI and the Win32_LogicalDisk class. I can determine which drives are mounted to a drive letter, but not those mounted to a folder. The Win32_Volume* and Win32_MountPoint classes would be perfect, but are not available on XP.
- I've tried polling the drives using FindFirstVolume & GetVolumePathNamesForVolumeName (even though I'd rather not do that), but it appears that the drives must be spun up before it can give me the information. And again, ew, polling.
I was considering the possibility of using API hooking to hook calls to SetVolumeMountPoint and DeleteVolumeMountPoint but I don't think that would catch everything and it seems like that might be an ugly hack anyway.
So, yea, I'm looking for suggestions :)