mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-08 04:52:10 -05:00
passthrough: FlushAndPurgeOnCleanup, SetDelete
This commit is contained in:
parent
24b96e7e1b
commit
25f627f36f
@ -448,21 +448,6 @@ static NTSTATUS SetFileSize(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
return GetFileInfoInternal(Handle, FileInfo);
|
return GetFileInfoInternal(Handle, FileInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS CanDelete(FSP_FILE_SYSTEM *FileSystem,
|
|
||||||
PVOID FileContext, PWSTR FileName)
|
|
||||||
{
|
|
||||||
HANDLE Handle = HandleFromContext(FileContext);
|
|
||||||
FILE_DISPOSITION_INFO DispositionInfo;
|
|
||||||
|
|
||||||
DispositionInfo.DeleteFile = TRUE;
|
|
||||||
|
|
||||||
if (!SetFileInformationByHandle(Handle,
|
|
||||||
FileDispositionInfo, &DispositionInfo, sizeof DispositionInfo))
|
|
||||||
return FspNtStatusFromWin32(GetLastError());
|
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static NTSTATUS Rename(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS Rename(FSP_FILE_SYSTEM *FileSystem,
|
||||||
PVOID FileContext,
|
PVOID FileContext,
|
||||||
PWSTR FileName, PWSTR NewFileName, BOOLEAN ReplaceIfExists)
|
PWSTR FileName, PWSTR NewFileName, BOOLEAN ReplaceIfExists)
|
||||||
@ -597,27 +582,42 @@ static NTSTATUS ReadDirectory(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static NTSTATUS SetDelete(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
PVOID FileContext, PWSTR FileName, BOOLEAN DeleteFile)
|
||||||
|
{
|
||||||
|
HANDLE Handle = HandleFromContext(FileContext);
|
||||||
|
FILE_DISPOSITION_INFO DispositionInfo;
|
||||||
|
|
||||||
|
DispositionInfo.DeleteFile = DeleteFile;
|
||||||
|
|
||||||
|
if (!SetFileInformationByHandle(Handle,
|
||||||
|
FileDispositionInfo, &DispositionInfo, sizeof DispositionInfo))
|
||||||
|
return FspNtStatusFromWin32(GetLastError());
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
static FSP_FILE_SYSTEM_INTERFACE PtfsInterface =
|
static FSP_FILE_SYSTEM_INTERFACE PtfsInterface =
|
||||||
{
|
{
|
||||||
GetVolumeInfo,
|
.GetVolumeInfo = GetVolumeInfo,
|
||||||
SetVolumeLabel_,
|
.SetVolumeLabel = SetVolumeLabel_,
|
||||||
GetSecurityByName,
|
.GetSecurityByName = GetSecurityByName,
|
||||||
Create,
|
.Create = Create,
|
||||||
Open,
|
.Open = Open,
|
||||||
Overwrite,
|
.Overwrite = Overwrite,
|
||||||
Cleanup,
|
.Cleanup = Cleanup,
|
||||||
Close,
|
.Close = Close,
|
||||||
Read,
|
.Read = Read,
|
||||||
Write,
|
.Write = Write,
|
||||||
Flush,
|
.Flush = Flush,
|
||||||
GetFileInfo,
|
.GetFileInfo = GetFileInfo,
|
||||||
SetBasicInfo,
|
.SetBasicInfo = SetBasicInfo,
|
||||||
SetFileSize,
|
.SetFileSize = SetFileSize,
|
||||||
CanDelete,
|
.Rename = Rename,
|
||||||
Rename,
|
.GetSecurity = GetSecurity,
|
||||||
GetSecurity,
|
.SetSecurity = SetSecurity,
|
||||||
SetSecurity,
|
.ReadDirectory = ReadDirectory,
|
||||||
ReadDirectory,
|
.SetDelete = SetDelete,
|
||||||
};
|
};
|
||||||
|
|
||||||
static VOID PtfsDelete(PTFS *Ptfs);
|
static VOID PtfsDelete(PTFS *Ptfs);
|
||||||
@ -692,6 +692,7 @@ static NTSTATUS PtfsCreate(PWSTR Path, PWSTR VolumePrefix, PWSTR MountPoint, UIN
|
|||||||
VolumeParams.PersistentAcls = 1;
|
VolumeParams.PersistentAcls = 1;
|
||||||
VolumeParams.PostCleanupWhenModifiedOnly = 1;
|
VolumeParams.PostCleanupWhenModifiedOnly = 1;
|
||||||
VolumeParams.PassQueryDirectoryPattern = 1;
|
VolumeParams.PassQueryDirectoryPattern = 1;
|
||||||
|
VolumeParams.FlushAndPurgeOnCleanup = 1;
|
||||||
VolumeParams.UmFileContextIsUserContext2 = 1;
|
VolumeParams.UmFileContextIsUserContext2 = 1;
|
||||||
if (0 != VolumePrefix)
|
if (0 != VolumePrefix)
|
||||||
wcscpy_s(VolumeParams.Prefix, sizeof VolumeParams.Prefix / sizeof(WCHAR), VolumePrefix);
|
wcscpy_s(VolumeParams.Prefix, sizeof VolumeParams.Prefix / sizeof(WCHAR), VolumePrefix);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user