1
0

Disable debug

This commit is contained in:
Scott E. Graves
2017-03-23 08:40:59 -05:00
parent 4a2784aae6
commit 610e769a94

View File

@@ -549,14 +549,12 @@ private:
static NTSTATUS DOKAN_CALLBACK Sia_Mounted(PDOKAN_FILE_INFO DokanFileInfo) static NTSTATUS DOKAN_CALLBACK Sia_Mounted(PDOKAN_FILE_INFO DokanFileInfo)
{ {
std::lock_guard<std::mutex> l(_dokanMutex);
StartFileListThread(); StartFileListThread();
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
static NTSTATUS DOKAN_CALLBACK Sia_Unmounted(PDOKAN_FILE_INFO DokanFileInfo) static NTSTATUS DOKAN_CALLBACK Sia_Unmounted(PDOKAN_FILE_INFO DokanFileInfo)
{ {
std::lock_guard<std::mutex> l(_dokanMutex);
StopFileListThread(); StopFileListThread();
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
@@ -791,6 +789,7 @@ private:
if (DokanFileInfo->Context) if (DokanFileInfo->Context)
{ {
::CloseHandle(reinterpret_cast<HANDLE>(DokanFileInfo->Context)); ::CloseHandle(reinterpret_cast<HANDLE>(DokanFileInfo->Context));
std::lock_guard<std::mutex> l(_dokanMutex);
_openFileMap.erase(DokanFileInfo->Context); _openFileMap.erase(DokanFileInfo->Context);
DokanFileInfo->Context = 0; DokanFileInfo->Context = 0;
} }
@@ -876,20 +875,20 @@ public:
ZeroMemory(&_dokanOptions, sizeof(DOKAN_OPTIONS)); ZeroMemory(&_dokanOptions, sizeof(DOKAN_OPTIONS));
_dokanOptions.Version = DOKAN_VERSION; _dokanOptions.Version = DOKAN_VERSION;
_dokanOptions.ThreadCount = 0; // use default _dokanOptions.ThreadCount = 0; // use default
_dokanOptions.Options = DOKAN_OPTION_DEBUG; _dokanOptions.Options = 0;
} }
static void Mount(const wchar_t& driveLetter, const SString& cacheLocation) static void Mount(const wchar_t& driveLetter, const SString& cacheLocation)
{ {
if (_siaApi && !_mountThread) if (_siaApi && !_mountThread)
{ {
// May spend a little wait time here while files are cleaned-up and re-added to queue
_uploadManager.reset(new CUploadManager(CSiaCurl(_siaApi->GetHostConfig()), _siaDriveConfig));
_cacheLocation = cacheLocation; _cacheLocation = cacheLocation;
wchar_t tmp[] = { driveLetter, ':', '\\', 0 }; wchar_t tmp[] = { driveLetter, ':', '\\', 0 };
_mountPoint = tmp; _mountPoint = tmp;
_mountThread.reset(new std::thread([&]() _mountThread.reset(new std::thread([&]()
{ {
// May spend a little wait time here while files are cleaned-up and re-added to queue
_uploadManager.reset(new CUploadManager(CSiaCurl(_siaApi->GetHostConfig()), _siaDriveConfig));
_dokanOptions.MountPoint = _mountPoint.ToUpper().str().c_str(); _dokanOptions.MountPoint = _mountPoint.ToUpper().str().c_str();
_mountStatus = DokanMain(&_dokanOptions, &_dokanOps); _mountStatus = DokanMain(&_dokanOptions, &_dokanOps);
})); }));