1
0
This commit is contained in:
Scott E. Graves
2017-04-02 20:37:24 -05:00
parent e60653e9b4
commit ccf2dfe537
4 changed files with 33 additions and 26 deletions

View File

@@ -31,6 +31,7 @@ protected:
virtual void AutoThreadCallback(const CSiaCurl& siaCurl, CSiaDriveConfig* siaDriveConfig);
public:
bool IsRunning() const;
SiaHostConfig GetHostConfig() const;
void StartAutoThread();
void StopAutoThread();

View File

@@ -66,8 +66,8 @@ public:
static SString UploadStatusToString(const _UploadStatus& uploadStatus);
public:
_UploadStatus GetUploadStatus(const SString& siaPath);
CSiaError<_UploadErrorCode> AddOrUpdate(const SString& siaPath, SString filePath);
_UploadStatus GetUploadStatus(const SString& siaPath);
CSiaError<_UploadErrorCode> Remove(const SString& siaPath);
};

View File

@@ -66,4 +66,10 @@ void CAutoThread::StopAutoThread()
_thread->join();
_thread.reset(nullptr);
}
}
bool CAutoThread::IsRunning() const
{
return (_thread != nullptr);
}

View File

@@ -860,7 +860,7 @@ private:
// Paging IO cannot write after allocate file size.
if (dokanFileInfo->PagingIo)
{
if (static_cast<UINT64>(offset) >= li.QuadPart)
if (offset >= li.QuadPart)
{
*bytesWritten = 0;
if (opened)
@@ -868,7 +868,7 @@ private:
return STATUS_SUCCESS;
}
if (static_cast<UINT64>(offset + bytesToWrite) > li.QuadPart)
if ((offset + bytesToWrite) > li.QuadPart)
{
UINT64 bytes = li.QuadPart - offset;
if (bytes >> 32)
@@ -882,7 +882,7 @@ private:
}
}
if (static_cast<UINT64>(offset) > li.QuadPart)
if (offset > li.QuadPart)
{
// In the mirror sample helperZeroFileData is not necessary. NTFS will
// zero a hole.
@@ -979,30 +979,30 @@ private:
dokanFileInfo->Context = 0;
}
if (dokanFileInfo->DeleteOnClose)
{
// Should already be deleted by CloseHandle
// if open with FILE_FLAG_DELETE_ON_CLOSE
if (dokanFileInfo->IsDirectory)
{
if (RetryableAction(filePath.RemoveDirectory(), DEFAULT_RETRY_COUNT, DEFAULT_RETRY_DELAY_MS))
{
}
else
{
}
}
else
{
if (dokanFileInfo->DeleteOnClose)
{
// Should already be deleted by CloseHandle
// if open with FILE_FLAG_DELETE_ON_CLOSE
if (dokanFileInfo->IsDirectory)
{
if (RetryableAction(filePath.RemoveDirectory(), DEFAULT_RETRY_COUNT, DEFAULT_RETRY_DELAY_MS))
{
}
else
{
}
}
{
}
else
{
}
}
else
{
if (RetryableAction(filePath.RemoveDirectory(), DEFAULT_RETRY_COUNT, DEFAULT_RETRY_DELAY_MS))
{
}
else
{
}
}
RefreshActiveFileTree(true);
}
}
}
static NTSTATUS DOKAN_CALLBACK Sia_FlushFileBuffers(LPCWSTR fileName, PDOKAN_FILE_INFO dokanFileInfo)