dokany icon indicating copy to clipboard operation
dokany copied to clipboard

Ability to Mount only UNC without Drive

Open zastrowm opened this issue 4 years ago • 6 comments

Is there way to mount a filesystem without a drive/drive-letter? I'd like to do something like:

mirror.exe /r C:\MyFiles\ /u \localhost\myfs

where no drive letter is assigned - i.e. you can only access it via \\localhost\myfs instead of H:\. I think that's what this question was asking about, but I unable to determine if that's possible and I just haven't discovered how, or if it's not currently possible.

Environment

  • Windows version: Windows 10, 1909
  • Processor architecture: x64
  • Dokany version: 1.3.1.10000
  • Library type (Dokany/FUSE): Dokany

Check List

  • [X] I checked my issue doesn't exist yet
  • [X] My issue is valid with mirror default sample and not specific to my user-mode driver implementation
  • [X] I can always reproduce the issue with the provided description below.
  • [X] I have updated Dokany to the latest version and have reboot my computer after.
  • [ ] I tested one of the last snapshot from appveyor CI

Description

zastrowm avatar Apr 02 '20 19:04 zastrowm

@zastrowm Hi,

Unfortunately that is not currently the case. Could you explain your case not want at all having the drive visible?

Liryna avatar Apr 02 '20 20:04 Liryna

I have an application that discovers devices dynamically while it is open; if a device requires a password, the application prompts the user. While it's up, I'd like to be able to allow the user to browse the file systems of the device, using the open file dialog (for instance) or just windows explorer.

In general, I'd rather the user not have drives appear and disappear as the application launches.

zastrowm avatar Apr 02 '20 22:04 zastrowm

You can make the filesystem only usable from specific applications by filtering processid during CreateFile and return access denied when appropriate. The device will be visible but not accessible.

Liryna avatar Apr 03 '20 05:04 Liryna

Yep - it's specifically the making the device visible that I'm trying to avoid.

Is it worth filing a feature request for it, or is this something that isn't even possible?

zastrowm avatar Apr 06 '20 18:04 zastrowm

@zastrowm It is always good to have all the possibilities but I have doubt technically. It would need to mount a drive without having symbolic link with driver letter but still have the network redirector providing the full device path.

You can create the feature but it will not be a priority for now unless a good number of people are interested in it or a pull request <3

Liryna avatar Apr 06 '20 19:04 Liryna

@adropit @zastrowm by default the mirror has M as MountPoint if /l is not specified. https://github.com/dokan-dev/dokany/blob/master/samples/dokan_mirror/mirror.c#L77

Have you tried to call the mirror with /l "" like mirror.exe /r C:\MyFiles\ /l "" /u \localhost\myfs https://github.com/dokan-dev/dokany/blob/master/samples/dokan_mirror/mirror.c#L1580-L1581 If it do not work, try to change the mirror to force an empty value.

Looking at the code only the mirror is doing a check to force MountPoint usage. Even if I believe you might get some issue later but lets start little by little.

Liryna avatar Apr 15 '20 13:04 Liryna