1
0

Mount changes

This commit is contained in:
Scott E. Graves
2017-03-22 17:22:50 -05:00
parent 42e76bd921
commit 3295c413bc
4 changed files with 58 additions and 11 deletions

View File

@@ -878,7 +878,7 @@ public:
ZeroMemory(&_dokanOptions, sizeof(DOKAN_OPTIONS));
_dokanOptions.Version = DOKAN_VERSION;
_dokanOptions.ThreadCount = 0; // use default
_dokanOptions.ThreadCount = 4; // use default
_dokanOptions.Options = DOKAN_OPTION_DEBUG;
}
@@ -887,14 +887,15 @@ public:
if (_siaApi && !_mountThread)
{
_cacheLocation = cacheLocation;
wchar_t tmp[] = { driveLetter, ':', '\\', 0 };
wchar_t tmp[] = { driveLetter, ':', '\\', '\0' };
_mountPoint = tmp;
_mountThread.reset(new std::thread([&]()
{
_dokanOptions.MountPoint = _mountPoint.str().c_str();
_dokanOptions.MountPoint = _mountPoint.ToUpper().str().c_str();
_mountStatus = DokanMain(&_dokanOptions, &_dokanOps);
OutputDebugString(std::to_wstring(_mountStatus).c_str());
}));
_mountThread->detach();
}
}
@@ -902,10 +903,8 @@ public:
{
if (_mountThread)
{
DokanRemoveMountPoint(_mountPoint.str().c_str());
_mountThread->join();
_mountThread.reset(nullptr);
DokanUnmount(_mountPoint[0]);
_mountThread.reset(nullptr);
_mountPoint = "";
}
}