-
Notifications
You must be signed in to change notification settings - Fork 665
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
DokanUnmount() always fails #57
Comments
Can you provide some logs ? Does Mirror.exe work ? |
Here's the log from the Visual Studio debug console:
I took the following steps:
I'll try out Mirror.exe and enable more robust logging within the next few days. |
Please can you use DebugView https://technet.microsoft.com/en-us/library/bb896647.aspx so that we can see, why the mounter service failed to delete the mount point. |
Since we have no update from you @Corillian . |
I'm afraid my inactivity hardly means the problem is resolved. I have plenty of things to work on and am unable to devote all of my time to figuring out why this driver is hanging. To that end I have been unable to gather any debug output as my locally built copy of the driver fails to install with:
I'm using the source tagged at v0.7.4. I followed your build/install instructions and I am running windows 7 x64 in |
Ok I got the install issues sorted out. It looks like my service was hung due to the inability to unmount Dokan, I hadn't explicitly killed the process, and to make a long story short when I ran the 0.7.4 uninstaller stuff got corrupted and created non-obvious issues. Unfortunately even though I now have my debug build of Dokan installed and running I am not getting any additional debug info in DebugView or my Visual Studio output window. I double checked |
Alrighty I got the debug output. My WinDbg kernel capture was turned off. GitHub won't let me upload the log file but you can find it at http://pastebin.com/ZPqvk5a0. The major highlights are when I call
DokanUnmount() returns false and my Dokan thread continues to be hung in
which still doesn't cause
I hope that helps, let me know if there's anything else I can assist with. |
Good to have news from you :) !!! Just to be sure I understand well: If you can add some logs and see where it fail and why, it would be nice ! Sorry for taking your time but you are the only personn who has repport this issue 😢 |
The log obove is provided by driver and not by mounter service we are interested in. |
@marinkobabic I don't have any mounter service output beyond:
|
Ok I have discovered why the call to if(!DokanUnmount(m_localDriveRoot[0])) // m_localDriveRoot[0] resolves to L'M' at which point BOOL DOKANAPI
DokanUnmount(
WCHAR DriveLetter)
{
WCHAR mountPoint[] = L"M:"; // <--- FAIL
mountPoint[0] = DriveLetter; // <--- FAIL
return DokanRemoveMountPoint(mountPoint);
} The issue is that the Dokan mounter service expects the drive name to be formatted as for (listEntry = g_MountList.Flink; listEntry != &g_MountList; listEntry = listEntry->Flink) {
mountEntry = CONTAINING_RECORD(listEntry, MOUNT_ENTRY, ListEntry);
if (useMountPoint) {
if (wcscmp(DokanControl->MountPoint, mountEntry->MountControl.MountPoint) == 0) { // <--- FAIL
found = TRUE;
break;
}
} else {
if (wcscmp(DokanControl->DeviceName, mountEntry->MountControl.DeviceName) == 0) {
found = TRUE;
break;
}
}
}
control.Type = DOKAN_CONTROL_UNMOUNT;
control.Option = DOKAN_CONTROL_OPTION_FORCE_UNMOUNT;
wcscpy_s(control.MountPoint, sizeof(control.MountPoint) / sizeof(WCHAR), MountPoint); // <--- POSSIBLE FAIL
DokanMountControl(&control); however DbgPrintW(L"DokanControl MountEntry not found. Try unmount '%s' force: %d\n", Control->MountPoint, Control->Option);
if (Control->Option == DOKAN_CONTROL_OPTION_FORCE_UNMOUNT && DokanControlUnmount(Control->MountPoint)) {
Control->Status = DOKAN_CONTROL_SUCCESS;
break;
} Now that |
Ok this is a bit frustrating. The documentation explicitly states that when mounting I should use a drive letter formatted as typedef struct _DOKAN_OPTIONS {
USHORT Version; // Supported Dokan Version, ex. "530" (Dokan ver 0.5.3)
ULONG ThreadCount; // number of threads to be used
ULONG Options; // combination of DOKAN_OPTIONS_*
ULONG64 GlobalContext; // FileSystem can use this variable
LPCWSTR MountPoint; // mount point "M:\" (drive letter) or
// "C:\mount\dokan" (path in NTFS)
} DOKAN_OPTIONS, *PDOKAN_OPTIONS; That's it, that's all there is for documentation right there. For unmounting the docs mention On top of that, commit a28a915 still doesn't solve the root problem: Dokan isn't normalizing mount paths. This is a major issue and if you noticed in my description above To summarize: Dokan should normalize mount paths and I suspect, at least for single letter drive mounts, it should also be case-insensitive. |
@Corillian, Yes I see your point ! |
Fixed with #79 |
I have not been able to find a way to call DokanUnmount() such that it actually succeeds. Not only that but
dokanctl.exe /u M
also fails. The only way I can unmount the drive is by executingdokanctl.exe /u M /f
however DokanMain() still doesn't return and additional calls to DokanUnmount() also fail.I am running a console application and DokanMain() is being called on its own thread with
DOKAN_OPTION_KEEP_ALIVE | DOKAN_OPTION_DEBUG
.The text was updated successfully, but these errors were encountered: