Delay in Volume registration after disk on key plugs in is 1sec ?

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:

  1. 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. :frowning:

  2. I tried controlling …\Services\PartMgr.
    The notification is coming, but asks the same Sleep() interval after. :frowning:

  3. I’d like to receive notification about new Symbolic Link.
    But I have not found appropriate API… :frowning:

>Is it possible to set up event if new volume is added in the

configuration?

IIRC WM_DEVICECHANGE is sent for such events.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com