mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-14 15:52:47 -05:00
sys: FILE_ATTRIBUTE_DIRECTORY support
This commit is contained in:
@ -216,6 +216,12 @@ static NTSTATUS FspFsvolCreateNoLock(
|
||||
FlagOn(CreateOptions, FILE_DIRECTORY_FILE))
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
|
||||
/* do not allow the temporary bit on a directory */
|
||||
if (FlagOn(CreateOptions, FILE_DIRECTORY_FILE) &&
|
||||
FlagOn(FileAttributes, FILE_ATTRIBUTE_TEMPORARY) &&
|
||||
(FILE_CREATE == CreateDisposition || FILE_OPEN_IF == CreateDisposition))
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
|
||||
/* check security descriptor validity */
|
||||
if (0 != SecurityDescriptor)
|
||||
{
|
||||
@ -901,6 +907,13 @@ NTSTATUS FspFsvolCreateComplete(
|
||||
FileObject->PrivateCacheMap = 0;
|
||||
FileObject->FsContext = FileNode;
|
||||
FileObject->FsContext2 = FileDesc;
|
||||
if (!FileNode->IsDirectory)
|
||||
{
|
||||
/* properly set temporary bit for lazy writer */
|
||||
if (FlagOn(Response->Rsp.Create.Opened.FileInfo.FileAttributes,
|
||||
FILE_ATTRIBUTE_TEMPORARY))
|
||||
SetFlag(FileObject->Flags, FO_TEMPORARY_FILE);
|
||||
}
|
||||
if (FspTimeoutInfinity32 == FsvolDeviceExtension->VolumeParams.FileInfoTimeout &&
|
||||
!FlagOn(IrpSp->Parameters.Create.Options, FILE_NO_INTERMEDIATE_BUFFERING) &&
|
||||
!Response->Rsp.Create.Opened.DisableCache)
|
||||
|
@ -915,6 +915,15 @@ static NTSTATUS FspFsvolSetBasicInformation(PFILE_OBJECT FileObject,
|
||||
{
|
||||
if (sizeof(FILE_BASIC_INFORMATION) > Length)
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
|
||||
PFILE_BASIC_INFORMATION Info = (PFILE_BASIC_INFORMATION)Buffer;
|
||||
FSP_FILE_NODE *FileNode = FileObject->FsContext;
|
||||
UINT32 FileAttributes = Info->FileAttributes;
|
||||
|
||||
/* do not allow the temporary bit on a directory */
|
||||
if (FileNode->IsDirectory &&
|
||||
FlagOn(FileAttributes, FILE_ATTRIBUTE_TEMPORARY))
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
else if (0 == Response)
|
||||
{
|
||||
@ -941,6 +950,16 @@ static NTSTATUS FspFsvolSetBasicInformation(PFILE_OBJECT FileObject,
|
||||
FSP_FILE_NODE *FileNode = FileObject->FsContext;
|
||||
ULONG NotifyFilter = 0;
|
||||
|
||||
if (!FileNode->IsDirectory)
|
||||
{
|
||||
/* properly set temporary bit for lazy writer */
|
||||
if (FlagOn(Response->Rsp.SetInformation.FileInfo.FileAttributes,
|
||||
FILE_ATTRIBUTE_TEMPORARY))
|
||||
SetFlag(FileObject->Flags, FO_TEMPORARY_FILE);
|
||||
else
|
||||
ClearFlag(FileObject->Flags, FO_TEMPORARY_FILE);
|
||||
}
|
||||
|
||||
FspFileNodeSetFileInfo(FileNode, FileObject, &Response->Rsp.SetInformation.FileInfo);
|
||||
|
||||
if ((UINT32)-1 != Request->Req.SetInformation.Info.Basic.FileAttributes)
|
||||
|
Reference in New Issue
Block a user