Mountmgr on empty directory

Hello,
When I want to mount my disk filesystem on a empty directory using mountmgr, I should call
mandatory the Ioctl ‘IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION’ function by passing \Device\Volume {GUID}
and then mount it using Ioctl ‘IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_CREATED’ MountPointDir: ‘\DosDevices\c:\directorymonter’ and target: ‘??\Volume{GUID}’.
It works but it creates a DRIVE LETTER (eg. \DosDevices\G:) ‘The drive letter works’ instead of mounting it on an empty folder (\DosDevices\c:\directorymonter)!
And when I run the mountvol utility it freeze some time and returns a error ‘A device attached to the system is not functioning’.

I try differently by passing the user mode function: SetVolumeMountPoint, I have a user-mode crash exception but not BSOD.

If I do not call the Ioctl ‘IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION’ function then the function mountmgr ‘IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_CREATED’ returns error ‘2’ (Object not found)…

conclusion:
How to mount by mountmgr a disk filesystem into empty directory ?

Thank.

In French languages :

Bonjour,
Quand je veux monter mon disque sur un empty directory en utilisant mountmgr , je suis obliger de passer
obligatoirement par la fonction Ioctl ‘IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION’ en lui passant \Device\Volume{GUID}
et ensuite je le monte en utilisant la fonction Ioctl ‘IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_CREATED’ MountPointDir: ‘\DosDevices\c:\repertoiremonter’ et le targe: '??\Volume{GUID}.
Ca marche mais il me cr?er un DRIVE LETTER (eg. \DosDevices\G:) ‘Le drive letter fonctionne’ au lieu de le monter sur un dossier vide (\DosDevices\c:\repertoiremonter) !
Et quand j’execute l’utilitaire mountvol il bloque quelque temps et me renvoie une erreur ‘A device attached to the system is not functioning’.

J’ai essayer autrement en passant la fonction user mode : SetVolumeMountPoint , j’ai un crash user-mode.

Si je n’appelle pas la fonction Ioctl’ IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION’ alors mountmgr me retourne erreur ‘2’ (Object not found) ? la fonction IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_CREATED .

Merci.

In Windows this functionality is provided by a file system driver for a mount-point folder through a reparse point. As far as I know only NTFS supports it. That means \DosDevices\c:\directorymonter must be on NTFS volume.

You should use SetVolumeMountPoint instead of composing IOCTLs. Your method with IOCTLs doesn’t create a reparse point on NTFS volume. You notified the mount manager without making a real mount point.