Hi,
The IFS kit documentation on Storage volumes says that I can notify
the mount manager when a new volume device object is added to the system,
in one of the following ways:
- In my volume driver, call IoRegisterDeviceInterface() to register
a new class MOUNTDEV_MOUNTED_DEVICE_GUID (for a valid PDO).
PnP then takes over and alerts the mount-manager about this new
volume, and hence the mount manager sends my driver its series
of Irps for MOUNTDEV_QUERY_DEVICE_NAME, UNIQUE_ID and
SUGGESTED_LINK_NAME etc
or
- Send the mount manager an IRP_MJ_DEVICE_CONTROL with the
IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION control code.
This simulates PnP of the same type as in (1).
My volume driver, is unfortunately NOT using PnP, and so does a (2),
and it works. Now, my question is how to alert the mount manager
when my volume goes OFFLINE? I want the symbolic-link (drive-letter)
to be deleted. Simply doing a IoDeleteSymbolicLink() on the
drive-letter works. However, if after that my volume again comes
online, and I repeat (2), the mount manager does NOT re-create
the drive-letter symbolic link.
Any ideas?
Also, is there a way to FORCE the mount manager
to use my suggested drive letter (if a previous entry exists
in its persistent database). I have tried setting
MOUNTDEV_SUGGESTED_LINK_NAME->UseOnlyIfThereAreNoOtherLinks
(in response to IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME)
to FALSE (as well as TRUE), but it appears that the mount
manager simply ignores the suggested drive letter if
one already exists in its persistent database.
Thanks a lot.
-Vipul.