mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -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);
|
||||
}
|
||||
|
||||
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,
|
||||
PVOID FileContext,
|
||||
PWSTR FileName, PWSTR NewFileName, BOOLEAN ReplaceIfExists)
|
||||
@ -597,27 +582,42 @@ static NTSTATUS ReadDirectory(FSP_FILE_SYSTEM *FileSystem,
|
||||
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 =
|
||||
{
|
||||
GetVolumeInfo,
|
||||
SetVolumeLabel_,
|
||||
GetSecurityByName,
|
||||
Create,
|
||||
Open,
|
||||
Overwrite,
|
||||
Cleanup,
|
||||
Close,
|
||||
Read,
|
||||
Write,
|
||||
Flush,
|
||||
GetFileInfo,
|
||||
SetBasicInfo,
|
||||
SetFileSize,
|
||||
CanDelete,
|
||||
Rename,
|
||||
GetSecurity,
|
||||
SetSecurity,
|
||||
ReadDirectory,
|
||||
.GetVolumeInfo = GetVolumeInfo,
|
||||
.SetVolumeLabel = SetVolumeLabel_,
|
||||
.GetSecurityByName = GetSecurityByName,
|
||||
.Create = Create,
|
||||
.Open = Open,
|
||||
.Overwrite = Overwrite,
|
||||
.Cleanup = Cleanup,
|
||||
.Close = Close,
|
||||
.Read = Read,
|
||||
.Write = Write,
|
||||
.Flush = Flush,
|
||||
.GetFileInfo = GetFileInfo,
|
||||
.SetBasicInfo = SetBasicInfo,
|
||||
.SetFileSize = SetFileSize,
|
||||
.Rename = Rename,
|
||||
.GetSecurity = GetSecurity,
|
||||
.SetSecurity = SetSecurity,
|
||||
.ReadDirectory = ReadDirectory,
|
||||
.SetDelete = SetDelete,
|
||||
};
|
||||
|
||||
static VOID PtfsDelete(PTFS *Ptfs);
|
||||
@ -692,6 +692,7 @@ static NTSTATUS PtfsCreate(PWSTR Path, PWSTR VolumePrefix, PWSTR MountPoint, UIN
|
||||
VolumeParams.PersistentAcls = 1;
|
||||
VolumeParams.PostCleanupWhenModifiedOnly = 1;
|
||||
VolumeParams.PassQueryDirectoryPattern = 1;
|
||||
VolumeParams.FlushAndPurgeOnCleanup = 1;
|
||||
VolumeParams.UmFileContextIsUserContext2 = 1;
|
||||
if (0 != VolumePrefix)
|
||||
wcscpy_s(VolumeParams.Prefix, sizeof VolumeParams.Prefix / sizeof(WCHAR), VolumePrefix);
|
||||
|
Loading…
x
Reference in New Issue
Block a user