Hello all,
I’m refreshing some legacy code we have that creates a virtual drive to access our file-based storage containers.
As part of the refresh I’m trying to use the mount manager. As I understand it, the process I need to undergo is this:
- Create my device (IoCreateDeviceSecure in my case)
- Send a volume arrival notification (MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION) to mountmgr.sys with the nt device path for the device - in my case \Devices\Antony\mounteddrive1
- That should generate some mount manager IOCTLs for my device:
IOCTL_MOUNTDEV_QUERY_DEVICE_NAME
IOCTL_MOUNTDEV_QUERY_UNIQUE_ID
IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME - I can then issue a IOCTL_MOUNTMGR_CREATE_POINT containing the device name and the NT-namespace win32 name I’d like it to link to - so \Devices\Antony\mounteddrive1 and \DosDevices\Z:
This is the procedure I’m currently working through - however, I’ve noticed a strange problem occuring. I realised that my initial unicodestring.length property was returning 4 for the device name, so the mountmgr was not receiving the full device string. However, it did succesfully complete 3 and create a \DosDevices\Volume{GUID} device, not symlinked to anything.
I corrected that, and now I receive C0000034 errors - object not found.
So, my questions then are:
- Since my device exists and using the old DefineDosDevice mechanism I can mount it, what am I missing? Anything?
- Is my understanding of how to interface with the mount manager correct?
Thanks for your help,
Antony