I run into the problem when try to define volume of my Disk On key after
it plugs in.
Device is plugged, registered as Hardware device (in Enum.…,
Services\USBSTOR… etc.),
but if GetLogicalDriveStrings()is called immediately, it doesn’t report
about the new volume!
I’ve added Sleep(slp_time) before calling GetLogicalDriveStrings().
It helps on my (Windows XP SP2) computer only, if slp_time~1000msc.
(1sec.)!?!
The question:
Is it possible to set up event if new volume is added in the
configuration?
Some hints:
-
I tried controlling the section …/CurrentControlSet/MountedDevices
by RegNotifyChangeKeyValue().
It reports correctly, if NEW Disk on Key is added.
But it doesn’t report, if the same key plug out/in few times. -
I tried controlling …\Services\PartMgr.
The notification is coming, but asks the same Sleep() interval after. -
I’d like to receive notification about new Symbolic Link.
But I have not found appropriate API…