1
0

Build fixes

This commit is contained in:
Scott E. Graves
2017-03-23 13:54:26 -05:00
parent 616478bfff
commit 06815ad171
6 changed files with 89 additions and 54 deletions

View File

@@ -549,12 +549,14 @@ private:
static NTSTATUS DOKAN_CALLBACK Sia_Mounted(PDOKAN_FILE_INFO DokanFileInfo)
{
_uploadManager.reset(new CUploadManager(CSiaCurl(_siaApi->GetHostConfig()), _siaDriveConfig));
StartFileListThread();
return STATUS_SUCCESS;
}
static NTSTATUS DOKAN_CALLBACK Sia_Unmounted(PDOKAN_FILE_INFO DokanFileInfo)
{
_uploadManager.reset(nullptr);
StopFileListThread();
return STATUS_SUCCESS;
}
@@ -875,7 +877,7 @@ public:
ZeroMemory(&_dokanOptions, sizeof(DOKAN_OPTIONS));
_dokanOptions.Version = DOKAN_VERSION;
_dokanOptions.ThreadCount = 0; // use default
_dokanOptions.Options = 0;
_dokanOptions.Options = DOKAN_OPTION_DEBUG;
}
static void Mount(const wchar_t& driveLetter, const SString& cacheLocation)
@@ -883,7 +885,6 @@ public:
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;
wchar_t tmp[] = { driveLetter, ':', '\\', 0 };
_mountPoint = tmp;
@@ -901,7 +902,6 @@ public:
{
while (!DokanRemoveMountPoint(&_mountPoint[0]))
::Sleep(1000);
_uploadManager.reset(nullptr);
// HACK - DokanMain() never returns
::TerminateThread(_mountThread->native_handle(), -1);
_mountThread->join();