8 * In-memory representation of an NTFS Disk
10 typedef struct sNTFS_Disk
17 typedef struct sNTFS_BootSector
21 Uint8 SystemID[8]; // = "NTFS "
22 Uint16 BytesPerSector;
23 Uint8 SectorsPerCluster;
27 Uint8 MediaDescriptor;
29 Uint16 SectorsPerTrack;
35 Uint64 TotalSectorCount; // Size of volume in sectors
36 Uint64 MFTStart; // Logical Cluster Number of Cluster 0 of MFT
37 Uint64 MFTMirrorStart; // Logical Cluster Number of Cluster 0 of MFT Backup
40 // If either of these are -ve, the size can be obtained via
41 // SizeInBytes = 2^(-1 * Value)
42 Uint32 ClustersPerMFTRecord;
43 Uint32 ClustersPerIndexRecord;
47 Uint8 Padding[515-offsetof(tNTFS_BootSector, Padding)];
52 * FILE header, an entry in the MFT
54 typedef struct sNTFS_FILE_Header
56 Uint32 Magic; // 'FILE'
57 Uint16 UpdateSequenceOfs;
58 Uint16 UpdateSequenceSize; // Size in words of the UpdateSequenceArray
60 Uint64 LSN; // $LogFile Sequence Number
62 Uint16 SequenceNumber;
64 Uint16 FirstAttribOfs; // Size of header?
65 Uint16 Flags; // 0: In Use, 1: Directory
67 Uint32 RecordSize; // Real Size of FILE Record
68 Uint32 RecordSpace; // Allocated Size for FILE Record
71 * Base address of the MFT containing this record
73 Uint64 Reference; // "File reference to the base FILE record" ???
81 Uint16 RecordNumber; // Number of this MFT Record
82 Uint16 UpdateSequenceNumber;
83 Uint16 UpdateSequenceArray[];
86 Uint16 UpdateSequenceNumber;
87 Uint16 UpdateSequenceArray[];
94 * File Attribute, follows the FILE header
96 typedef struct sNTFS_FILE_Attrib
98 Uint32 Type; // See eNTFS_FILE_Attribs
99 Uint32 Size; // Includes header
101 Uint8 ResidentFlag; // (What does this mean?)
104 Uint16 Flags; // 0: Compressed, 14: Encrypted, 15: Sparse
110 Uint32 AttribLen; // In words
115 Uint16 Name[]; // UTF-16
122 Uint16 CompressionUnitSize;
124 Uint64 AllocatedSize;
126 Uint64 InitiatedSize; // One assumes, ammount of actual data stored
127 Uint16 Name[]; // UTF-16