Mount changes
This commit is contained in:
@@ -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 = "";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user