-
Notifications
You must be signed in to change notification settings - Fork 686
Fix DokanUnmount bug #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
As reported in the mailing list, DokanUnmount called DokanRemoveMountPoint with an extra character at the end. Fixed it, and mention DokanRemoveMountPoint in the readme.txt, since is an exported function in the public header and is necessary if you mount the file system in a path, not a drive letter. See: https://groups.google.com/d/topic/dokan/zAZukiICdNk/discussion
Sorry if you received a notification for this twice. I force-pushed the commit just to amend the message and include the link to the discussion. |
I think this is because the string passed to tell where you mount it has to be the same when you unmount. Since the mirror.exe example mounts in a drive letter, the string that has to be passed when unmounting has to be one single letter as well. That's why I added it to the readme, because I think you should probably use the long version. That way you always have the same string for sure. The patch changed DokanUnmount, though. The mirror uses the other one, so I think should not be affected. |
You are right, I made more test. |
Ah, I see, sorry for my confusion. |
Using Unmount or RemoveMountPoint make no difference. |
Yes, all right, but I feel that somehow for compatibility and symmetry reasons, the single character (drive letter) unmount should be converted to use a mount point of the form L"M:", as it was before this commit. My experiments showed that in any case exactly the same string has to be used in RemoveMountPoint, as it was specified during the mount operation. Even upper - and lowercase have influence, which is also ignored currently. In mirror.c a single character is accepted in the command line arguments, but is converted to the form L"M:", so yes, if for this client the Unmount('M') leads to RemoveMountPoint(L"M:"), that seems to work, but what if the client just forwards the 'M' as L"M", without the ':', the Unmount('M') would fail. So each try to simplify things with such kind of helper do confuse more and more, because not all cases or intentions of the user can be covered. Another hint for keeping backward compatibility can be found here e.g. in dokan.c line 191, where older versions used a single letter mount point that is altered to the same form L"M:". So for maximum backward compatibility and simplified user experience I would suggest to convert each single character input (whether in mount, unmount or anywhere else) by appending a colon sign and backslash and take the upper case string of that as the new mount point of the form L"M:" |
I agree with you! Your proposal seems to be fine! This should fix all misunderstanding. |
As reported in the mailing list, DokanUnmount called
DokanRemoveMountPoint with an extra character at the end. Fixed it, and
mention DokanRemoveMountPoint in the readme.txt, since is an exported
function in the public header and is necessary if you mount the file
system in a path, not a drive letter.