mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 00:43:00 -05:00
sys: fileinfo: correctly set AllInformation and StandardInformation DeletePending flag
This commit is contained in:
parent
04186ea834
commit
eec63332e0
@ -134,6 +134,7 @@ static NTSTATUS FspFsvolQueryAllInformation(PFILE_OBJECT FileObject,
|
|||||||
|
|
||||||
PFILE_ALL_INFORMATION Info = (PFILE_ALL_INFORMATION)*PBuffer;
|
PFILE_ALL_INFORMATION Info = (PFILE_ALL_INFORMATION)*PBuffer;
|
||||||
FSP_FILE_NODE *FileNode = FileObject->FsContext;
|
FSP_FILE_NODE *FileNode = FileObject->FsContext;
|
||||||
|
BOOLEAN DeletePending;
|
||||||
|
|
||||||
if (0 == FileInfo)
|
if (0 == FileInfo)
|
||||||
{
|
{
|
||||||
@ -144,6 +145,9 @@ static NTSTATUS FspFsvolQueryAllInformation(PFILE_OBJECT FileObject,
|
|||||||
return FspFsvolQueryNameInformation(FileObject, PBuffer, BufferEnd);
|
return FspFsvolQueryNameInformation(FileObject, PBuffer, BufferEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DeletePending = 0 != FileNode->DeletePending;
|
||||||
|
MemoryBarrier();
|
||||||
|
|
||||||
Info->BasicInformation.CreationTime.QuadPart = FileInfo->CreationTime;
|
Info->BasicInformation.CreationTime.QuadPart = FileInfo->CreationTime;
|
||||||
Info->BasicInformation.LastAccessTime.QuadPart = FileInfo->LastAccessTime;
|
Info->BasicInformation.LastAccessTime.QuadPart = FileInfo->LastAccessTime;
|
||||||
Info->BasicInformation.LastWriteTime.QuadPart = FileInfo->LastWriteTime;
|
Info->BasicInformation.LastWriteTime.QuadPart = FileInfo->LastWriteTime;
|
||||||
@ -154,7 +158,7 @@ static NTSTATUS FspFsvolQueryAllInformation(PFILE_OBJECT FileObject,
|
|||||||
Info->StandardInformation.AllocationSize.QuadPart = FileInfo->AllocationSize;
|
Info->StandardInformation.AllocationSize.QuadPart = FileInfo->AllocationSize;
|
||||||
Info->StandardInformation.EndOfFile.QuadPart = FileInfo->FileSize;
|
Info->StandardInformation.EndOfFile.QuadPart = FileInfo->FileSize;
|
||||||
Info->StandardInformation.NumberOfLinks = 1;
|
Info->StandardInformation.NumberOfLinks = 1;
|
||||||
Info->StandardInformation.DeletePending = FileObject->DeletePending;
|
Info->StandardInformation.DeletePending = DeletePending || FileObject->DeletePending;
|
||||||
Info->StandardInformation.Directory = FileNode->IsDirectory;
|
Info->StandardInformation.Directory = FileNode->IsDirectory;
|
||||||
|
|
||||||
Info->InternalInformation.IndexNumber.QuadPart = FileNode->IndexNumber;
|
Info->InternalInformation.IndexNumber.QuadPart = FileNode->IndexNumber;
|
||||||
@ -363,6 +367,7 @@ static NTSTATUS FspFsvolQueryStandardInformation(PFILE_OBJECT FileObject,
|
|||||||
|
|
||||||
PFILE_STANDARD_INFORMATION Info = (PFILE_STANDARD_INFORMATION)*PBuffer;
|
PFILE_STANDARD_INFORMATION Info = (PFILE_STANDARD_INFORMATION)*PBuffer;
|
||||||
FSP_FILE_NODE *FileNode = FileObject->FsContext;
|
FSP_FILE_NODE *FileNode = FileObject->FsContext;
|
||||||
|
BOOLEAN DeletePending;
|
||||||
|
|
||||||
if (0 == FileInfo)
|
if (0 == FileInfo)
|
||||||
{
|
{
|
||||||
@ -372,10 +377,13 @@ static NTSTATUS FspFsvolQueryStandardInformation(PFILE_OBJECT FileObject,
|
|||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DeletePending = 0 != FileNode->DeletePending;
|
||||||
|
MemoryBarrier();
|
||||||
|
|
||||||
Info->AllocationSize.QuadPart = FileInfo->AllocationSize;
|
Info->AllocationSize.QuadPart = FileInfo->AllocationSize;
|
||||||
Info->EndOfFile.QuadPart = FileInfo->FileSize;
|
Info->EndOfFile.QuadPart = FileInfo->FileSize;
|
||||||
Info->NumberOfLinks = 1;
|
Info->NumberOfLinks = 1;
|
||||||
Info->DeletePending = FileObject->DeletePending;
|
Info->DeletePending = DeletePending || FileObject->DeletePending;
|
||||||
Info->Directory = FileNode->IsDirectory;
|
Info->Directory = FileNode->IsDirectory;
|
||||||
|
|
||||||
*PBuffer = (PVOID)(Info + 1);
|
*PBuffer = (PVOID)(Info + 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user