mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 17:03:12 -05:00
memfs: handle FILE_ATTRIBUTE_ARCHIVE
This commit is contained in:
parent
16836c7cfb
commit
4f5e00474e
@ -379,7 +379,8 @@ static NTSTATUS Create(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
return Result;
|
return Result;
|
||||||
|
|
||||||
FileNode->FileInfo.FileAttributes = FileAttributes;
|
FileNode->FileInfo.FileAttributes = (FileAttributes & FILE_ATTRIBUTE_DIRECTORY) ?
|
||||||
|
FileAttributes : FileAttributes | FILE_ATTRIBUTE_ARCHIVE;
|
||||||
|
|
||||||
if (0 != SecurityDescriptor)
|
if (0 != SecurityDescriptor)
|
||||||
{
|
{
|
||||||
@ -437,6 +438,19 @@ static NTSTATUS Open(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NTFS and FastFat do this at Cleanup time, but we are going to cheat.
|
||||||
|
*
|
||||||
|
* To properly implement this we should maintain some state of whether
|
||||||
|
* we modified the file or not. Alternatively we could have the driver
|
||||||
|
* report to us at Cleanup time whether the file was modified (FO_FILE_MODIFIED).
|
||||||
|
*
|
||||||
|
* TBD.
|
||||||
|
*/
|
||||||
|
if (0 == (FileNode->FileInfo.FileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&
|
||||||
|
Request->Req.Create.DesiredAccess & (FILE_WRITE_DATA | FILE_APPEND_DATA))
|
||||||
|
FileNode->FileInfo.FileAttributes |= FILE_ATTRIBUTE_ARCHIVE;
|
||||||
|
|
||||||
FileNode->FileInfo.LastAccessTime = MemfsGetSystemTime();
|
FileNode->FileInfo.LastAccessTime = MemfsGetSystemTime();
|
||||||
|
|
||||||
FileNode->RefCount++;
|
FileNode->RefCount++;
|
||||||
@ -455,9 +469,9 @@ NTSTATUS Overwrite(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0;
|
MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0;
|
||||||
|
|
||||||
if (ReplaceFileAttributes)
|
if (ReplaceFileAttributes)
|
||||||
FileNode->FileInfo.FileAttributes = FileAttributes;
|
FileNode->FileInfo.FileAttributes = FileAttributes | FILE_ATTRIBUTE_ARCHIVE;
|
||||||
else
|
else
|
||||||
FileNode->FileInfo.FileAttributes |= FileAttributes;
|
FileNode->FileInfo.FileAttributes |= FileAttributes | FILE_ATTRIBUTE_ARCHIVE;
|
||||||
|
|
||||||
FileNode->FileInfo.FileSize = 0;
|
FileNode->FileInfo.FileSize = 0;
|
||||||
FileNode->FileInfo.LastWriteTime =
|
FileNode->FileInfo.LastWriteTime =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user