[NTFS]
authorPierre Schweitzer <pierre@reactos.org>
Wed, 8 Oct 2014 19:45:33 +0000 (19:45 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Wed, 8 Oct 2014 19:45:33 +0000 (19:45 +0000)
- Add missing defines about file attributes
- Implement NtfsFCBIsDirectory()

Source: http://bos.asmhackers.net/docs/filesystems/ntfs/filename.html

svn path=/trunk/; revision=64618

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

index e9b0cc4..d1c1591 100644 (file)
@@ -118,10 +118,7 @@ NtfsDestroyFCB(PNTFS_FCB Fcb)
 BOOLEAN
 NtfsFCBIsDirectory(PNTFS_FCB Fcb)
 {
 BOOLEAN
 NtfsFCBIsDirectory(PNTFS_FCB Fcb)
 {
-    UNREFERENCED_PARAMETER(Fcb);
-//  return(Fcb->entry.Attrib & FILE_ATTRIBUTE_DIRECTORY);
-//  return(Fcb->Entry.FileFlags & 0x02);
-    return TRUE;
+    return ((Fcb->Entry.FileAttributes & NTFS_FILE_TYPE_DIRECTORY) == NTFS_FILE_TYPE_DIRECTORY);
 }
 
 
 }
 
 
index bca024f..4382f6c 100644 (file)
@@ -188,6 +188,13 @@ typedef enum
 #define NTFS_FILE_NAME_DOS            2
 #define NTFS_FILE_NAME_WIN32_AND_DOS        3
 
 #define NTFS_FILE_NAME_DOS            2
 #define NTFS_FILE_NAME_WIN32_AND_DOS        3
 
+#define NTFS_FILE_TYPE_READ_ONLY  0x1
+#define NTFS_FILE_TYPE_HIDDEN     0x2
+#define NTFS_FILE_TYPE_SYSTEM     0x4
+#define NTFS_FILE_TYPE_ARCHIVE    0x20
+#define NTFS_FILE_TYPE_COMPRESSED 0x800
+#define NTFS_FILE_TYPE_DIRECTORY  0x10000000
+
 typedef struct
 {
     ULONG Type;             /* Magic number 'FILE' */
 typedef struct
 {
     ULONG Type;             /* Magic number 'FILE' */