Author: pschweitzer
Date: Thu Jan 8 20:28:25 2015
New Revision: 66007
URL:
http://svn.reactos.org/svn/reactos?rev=66007&view=rev
Log:
[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
Modified:
trunk/reactos/drivers/filesystems/ntfs/dirctl.c
Modified: trunk/reactos/drivers/filesystems/ntfs/dirctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/d…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] Thu Jan 8 20:28:25 2015
@@ -162,11 +162,15 @@
{
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)
@@ -183,7 +187,7 @@
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,11 +208,15 @@
{
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)
@@ -225,7 +233,7 @@
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,12 +255,16 @@
{
ULONG Length;
PFILENAME_ATTRIBUTE FileName, ShortFileName;
+ PSTANDARD_INFORMATION StdInfo;
DPRINT("NtfsGetBothDirectoryInformation() called\n");
FileName = GetBestFileNameFromRecord(FileRecord);
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)
@@ -282,7 +294,7 @@
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);