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

@@ -67,3 +67,9 @@ void CAutoThread::StopAutoThread()
_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.