[NTFS]
authorPierre Schweitzer <pierre@reactos.org>
Wed, 15 Oct 2014 20:36:30 +0000 (20:36 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Wed, 15 Oct 2014 20:36:30 +0000 (20:36 +0000)
Implement NtfsFileFlagsToAttributes() to fix some of the attributes of the MFT to make them usable by ReactOS.
Would deserve a double-check

svn path=/trunk/; revision=64753

reactos/drivers/filesystems/ntfs/misc.c
reactos/drivers/filesystems/ntfs/ntfs.h

index c365f03..d1a4ffc 100644 (file)
@@ -109,4 +109,19 @@ NtfsDateTimeToFileTime(ULONGLONG NtfsTime,
     SystemTime->QuadPart = NtfsTime + 116444736000000000;
 }
 
     SystemTime->QuadPart = NtfsTime + 116444736000000000;
 }
 
+VOID
+NtfsFileFlagsToAttributes(ULONG NtfsAttributes,
+                          PULONG FileAttributes)
+{
+    *FileAttributes = NtfsAttributes;
+    if ((NtfsAttributes & NTFS_FILE_TYPE_DIRECTORY) == NTFS_FILE_TYPE_DIRECTORY)
+    {
+        *FileAttributes = NtfsAttributes & ~NTFS_FILE_TYPE_DIRECTORY;
+        *FileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
+    }
+
+    if (NtfsAttributes == 0)
+        *FileAttributes = FILE_ATTRIBUTE_NORMAL;
+}
+
 /* EOF */
 /* EOF */
index 2974969..697e8c8 100644 (file)
@@ -686,11 +686,9 @@ VOID
 NtfsDateTimeToFileTime(ULONGLONG NtfsTime,
                        PLARGE_INTEGER SystemTime);
 
 NtfsDateTimeToFileTime(ULONGLONG NtfsTime,
                        PLARGE_INTEGER SystemTime);
 
-#if 0
 VOID
 VOID
-CdfsFileFlagsToAttributes(PFCB Fcb,
-                         PULONG FileAttributes);
-#endif
+NtfsFileFlagsToAttributes(ULONG NtfsAttributes,
+                          PULONG FileAttributes);
 
 
 /* rw.c */
 
 
 /* rw.c */