Modules/NTFS - Implimentation in progress
[tpg/acess2.git] / KernelLand / Modules / Filesystems / NTFS / attributes.h
1 /*
2  * Acess2 - NTFS Driver
3  * By John Hodge (thePowersGang)
4  * This file is published under the terms of the Acess licence. See the
5  * file COPYING for details.
6  *
7  * attributes.h - MFT Attribute Types
8  */
9 #ifndef _ATTRIBUTES_H_
10 #define _ATTRIBUTES_H_
11
12 enum eNTFS_FILE_Attribs
13 {
14         NTFS_FileAttrib_StandardInformation = 0x10,
15         NTFS_FileAttrib_FileName        = 0x30,
16         NTFS_FileAttrib_SecurityDescriptor = 0x50,
17         NTFS_FileAttrib_Data            = 0x80,
18         NTFS_FileAttrib_IndexRoot       = 0x90,
19         NTFS_FileAttrib_IndexAllocation = 0xA0,
20         NTFS_FileAttrib_Bitmap          = 0xB0,
21         // NTFS_FileAttrib_
22 };
23
24 typedef struct
25 {
26         Uint64  CreationTime;
27         Uint64  AlterTime;
28         Uint64  MFTChangeTime;
29         Uint64  ReadTime;
30         Uint32  DOSFilePermissions;
31         Uint32  MaxNumVersions;
32         Uint32  VersionNumber;
33         Uint32  ClassID;
34         // 2K+
35         Uint32  OwnerID;
36         Uint32  SecurityID;
37         Uint64  QuotaCharged;
38         Uint64  UpdateSequenceNumber;
39 } PACKED tNTFS_Attrib_StandardInformation;
40
41 enum eNTFS_Filename_Namespaces
42 {
43         NTFS_FilenameNamespace_POSIX,   // [^NUL,/]
44         NTFS_FilenameNamespace_Win32,   //
45         NTFS_FilenameNamespace_DOS,     //
46         NTFS_FilenameNamespace_Win32DOS,        // Same name in both Win32/DOS, so merged
47 };
48
49 typedef struct sNTFS_Attrib_Filename
50 {
51         Uint64  ParentDirectory;        //!< Parent directory MFT entry
52         Sint64  CreationTime;   //!< Time the file was created
53         Sint64  LastDataModTime;        //!< Last change time for the data
54         Sint64  LastMftModTime; //!< Last change time for the MFT entry
55         Sint64  LastAccessTime; //!< Last Access Time (unreliable on most systems)
56         
57         Uint64  AllocatedSize;  //!< Allocated data size for $DATA unnamed stream
58         Uint64  DataSize;       //!< Actual size of $DATA unnamed stream
59         Uint32  Flags;  //!< File attribute files
60         
61         union {
62                 struct {
63                         Uint16  PackedSize;     //!< Size of buffer needed for extended attributes
64                         Uint16  _reserved;
65                 } PACKED        ExtAttrib;
66                 struct {
67                         Uint32  Tag;    //!< Type of reparse point
68                 } PACKED        ReparsePoint;
69         } PACKED        Type;
70
71         Uint8   FilenameLength; 
72         Uint8   FilenameNamespac;       //!< Filename namespace (DOS, Windows, Unix)
73         Uint16  Filename[0];
74 } PACKED        tNTFS_Attrib_Filename;
75
76 typedef struct sNTFS_Attrib_IndexEntry
77 {
78         Uint64  FileReference;
79         Uint16  EntryLength;
80         Uint16  StreamLength;
81         Uint8   Flags;  // [0]: Sub-node, [1]: Last entry in node
82         Uint8   _pad[3];
83         // Stream data and sub-node VCN (64-bit) follows
84 } PACKED tNTFS_Attrib_IndexEntry;
85
86 typedef struct sNTFS_Attrib_IndexRoot
87 {
88         // Index Root
89         Uint32  AttributeType;  // Type of indexed attribute
90         Uint32  CollationRule;  // Sorting method
91         Uint32  AllocEntrySize; // 
92         Uint8   ClustersPerIndexRec;
93         Uint8   _pad1[3];
94         // Index Header
95         Uint32  FirstEntryOfs;
96         Uint32  TotalSize;
97         Uint32  AllocSize;
98         Uint8   Flags;
99         Uint8   _pad2[3];
100         // List of IndexEntry structures follow
101 } PACKED        tNTFS_Attrib_IndexRoot;
102
103
104 #endif

UCC git Repository :: git.ucc.asn.au