mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 19:21:38 +00:00
[NTFS]
Also retrieve $STANDARD_INFORMATION attribute on directory enumeration to get the right file attributes. This fixes improper display in cmd & in explorer due to missing file attributes flags svn path=/trunk/; revision=66007
This commit is contained in:
parent
5b57ee5686
commit
c60b5e1383
1 changed files with 15 additions and 3 deletions
|
@ -162,12 +162,16 @@ NtfsGetDirectoryInformation(PDEVICE_EXTENSION DeviceExt,
|
|||
{
|
||||
ULONG Length;
|
||||
PFILENAME_ATTRIBUTE FileName;
|
||||
PSTANDARD_INFORMATION StdInfo;
|
||||
|
||||
DPRINT("NtfsGetDirectoryInformation() called\n");
|
||||
|
||||
FileName = GetBestFileNameFromRecord(FileRecord);
|
||||
ASSERT(FileName != NULL);
|
||||
|
||||
StdInfo = GetStandardInformationFromRecord(FileRecord);
|
||||
ASSERT(StdInfo != NULL);
|
||||
|
||||
Length = FileName->NameLength * sizeof (WCHAR);
|
||||
if ((sizeof(FILE_DIRECTORY_INFORMATION) + Length) > BufferLength)
|
||||
return(STATUS_BUFFER_OVERFLOW);
|
||||
|
@ -183,7 +187,7 @@ NtfsGetDirectoryInformation(PDEVICE_EXTENSION DeviceExt,
|
|||
Info->ChangeTime.QuadPart = FileName->ChangeTime;
|
||||
|
||||
/* Convert file flags */
|
||||
NtfsFileFlagsToAttributes(FileName->FileAttributes, &Info->FileAttributes);
|
||||
NtfsFileFlagsToAttributes(FileName->FileAttributes | StdInfo->FileAttribute, &Info->FileAttributes);
|
||||
|
||||
Info->EndOfFile.QuadPart = FileName->AllocatedSize;
|
||||
Info->AllocationSize.QuadPart = ROUND_UP(FileName->AllocatedSize, DeviceExt->NtfsInfo.BytesPerCluster);
|
||||
|
@ -204,12 +208,16 @@ NtfsGetFullDirectoryInformation(PDEVICE_EXTENSION DeviceExt,
|
|||
{
|
||||
ULONG Length;
|
||||
PFILENAME_ATTRIBUTE FileName;
|
||||
PSTANDARD_INFORMATION StdInfo;
|
||||
|
||||
DPRINT("NtfsGetFullDirectoryInformation() called\n");
|
||||
|
||||
FileName = GetBestFileNameFromRecord(FileRecord);
|
||||
ASSERT(FileName != NULL);
|
||||
|
||||
StdInfo = GetStandardInformationFromRecord(FileRecord);
|
||||
ASSERT(StdInfo != NULL);
|
||||
|
||||
Length = FileName->NameLength * sizeof (WCHAR);
|
||||
if ((sizeof(FILE_FULL_DIRECTORY_INFORMATION) + Length) > BufferLength)
|
||||
return(STATUS_BUFFER_OVERFLOW);
|
||||
|
@ -225,7 +233,7 @@ NtfsGetFullDirectoryInformation(PDEVICE_EXTENSION DeviceExt,
|
|||
Info->ChangeTime.QuadPart = FileName->ChangeTime;
|
||||
|
||||
/* Convert file flags */
|
||||
NtfsFileFlagsToAttributes(FileName->FileAttributes, &Info->FileAttributes);
|
||||
NtfsFileFlagsToAttributes(FileName->FileAttributes | StdInfo->FileAttribute, &Info->FileAttributes);
|
||||
|
||||
Info->EndOfFile.QuadPart = FileName->AllocatedSize;
|
||||
Info->AllocationSize.QuadPart = ROUND_UP(FileName->AllocatedSize, DeviceExt->NtfsInfo.BytesPerCluster);
|
||||
|
@ -247,6 +255,7 @@ NtfsGetBothDirectoryInformation(PDEVICE_EXTENSION DeviceExt,
|
|||
{
|
||||
ULONG Length;
|
||||
PFILENAME_ATTRIBUTE FileName, ShortFileName;
|
||||
PSTANDARD_INFORMATION StdInfo;
|
||||
|
||||
DPRINT("NtfsGetBothDirectoryInformation() called\n");
|
||||
|
||||
|
@ -254,6 +263,9 @@ NtfsGetBothDirectoryInformation(PDEVICE_EXTENSION DeviceExt,
|
|||
ASSERT(FileName != NULL);
|
||||
ShortFileName = GetFileNameFromRecord(FileRecord, NTFS_FILE_NAME_DOS);
|
||||
|
||||
StdInfo = GetStandardInformationFromRecord(FileRecord);
|
||||
ASSERT(StdInfo != NULL);
|
||||
|
||||
Length = FileName->NameLength * sizeof (WCHAR);
|
||||
if ((sizeof(FILE_BOTH_DIR_INFORMATION) + Length) > BufferLength)
|
||||
return(STATUS_BUFFER_OVERFLOW);
|
||||
|
@ -282,7 +294,7 @@ NtfsGetBothDirectoryInformation(PDEVICE_EXTENSION DeviceExt,
|
|||
Info->ChangeTime.QuadPart = FileName->ChangeTime;
|
||||
|
||||
/* Convert file flags */
|
||||
NtfsFileFlagsToAttributes(FileName->FileAttributes, &Info->FileAttributes);
|
||||
NtfsFileFlagsToAttributes(FileName->FileAttributes | StdInfo->FileAttribute, &Info->FileAttributes);
|
||||
|
||||
Info->EndOfFile.QuadPart = FileName->AllocatedSize;
|
||||
Info->AllocationSize.QuadPart = ROUND_UP(FileName->AllocatedSize, DeviceExt->NtfsInfo.BytesPerCluster);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue