More changes
This commit is contained in:
@@ -837,6 +837,28 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static NTSTATUS DOKAN_CALLBACK Sia_FlushFileBuffers(LPCWSTR FileName, PDOKAN_FILE_INFO DokanFileInfo)
|
||||||
|
{
|
||||||
|
String filePath = StdConstructPath(GetCacheLocation(), FileName);
|
||||||
|
HANDLE handle = reinterpret_cast<HANDLE>(DokanFileInfo->Context);
|
||||||
|
|
||||||
|
if (!handle || handle == INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (::FlushFileBuffers(handle))
|
||||||
|
{
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DWORD error = GetLastError();
|
||||||
|
return DokanNtStatusFromWin32(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void Initialize(CSiaApi* siaApi, CSiaDriveConfig* siaDriveConfig)
|
static void Initialize(CSiaApi* siaApi, CSiaDriveConfig* siaDriveConfig)
|
||||||
{
|
{
|
||||||
@@ -851,7 +873,7 @@ public:
|
|||||||
_dokanOps.FindFiles = Sia_FindFiles;
|
_dokanOps.FindFiles = Sia_FindFiles;
|
||||||
_dokanOps.FindFilesWithPattern = nullptr;
|
_dokanOps.FindFilesWithPattern = nullptr;
|
||||||
_dokanOps.FindStreams = nullptr;
|
_dokanOps.FindStreams = nullptr;
|
||||||
_dokanOps.FlushFileBuffers = nullptr;
|
_dokanOps.FlushFileBuffers = Sia_FlushFileBuffers;
|
||||||
_dokanOps.GetDiskFreeSpaceW = Sia_GetDiskFreeSpaceW;
|
_dokanOps.GetDiskFreeSpaceW = Sia_GetDiskFreeSpaceW;
|
||||||
_dokanOps.GetFileInformation = Sia_GetFileInformation;
|
_dokanOps.GetFileInformation = Sia_GetFileInformation;
|
||||||
_dokanOps.GetFileSecurityW = nullptr;
|
_dokanOps.GetFileSecurityW = nullptr;
|
||||||
|
Reference in New Issue
Block a user