From a28a9159569e60a4be9ecd19e3214a40e9030504 Mon Sep 17 00:00:00 2001 From: Alejandro Exojo Date: Mon, 11 May 2015 17:30:27 +0200 Subject: [PATCH] Fixed DokanUnmount bug 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 --- dokan/mount.c | 4 ++-- dokan/readme.txt | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dokan/mount.c b/dokan/mount.c index 9fce3522b..5b67b23e5 100644 --- a/dokan/mount.c +++ b/dokan/mount.c @@ -237,7 +237,7 @@ BOOL DOKANAPI DokanUnmount( WCHAR DriveLetter) { - WCHAR mountPoint[] = L"M:\\"; + WCHAR mountPoint[] = L"M:"; mountPoint[0] = DriveLetter; return DokanRemoveMountPoint(mountPoint); } @@ -361,4 +361,4 @@ DokanNetworkProviderUninstall() RegCloseKey(key); return TRUE; -} \ No newline at end of file +} diff --git a/dokan/readme.txt b/dokan/readme.txt index 793f3af58..997edf326 100644 --- a/dokan/readme.txt +++ b/dokan/readme.txt @@ -313,10 +313,11 @@ otherwise, the following error code is returned. Unmounting ========== -File system can be unmounted by calling the function DokanUnmount. In -most cases when the programs or shells use the file system hang, -unmount operation will solve the problems by bringing the system to -the previous state when the file system is not mounted. +File system can be unmounted by calling the function DokanUnmount or +DokanRemoveMountPoint. In most cases when the programs or shells use +the file system hang, unmount operation will solve the problems by +bringing the system to the previous state when the file system is not +mounted. User may use DokanCtl to unmount file system like this: > dokanctl.exe /u DriveLetter