3 * By John Hodge (thePowersGang)
4 * This file is published under the terms of the Acess licence. See the
5 * file COPYING for details.
7 * common.h - Common Types and Definitions
9 #ifndef _NTFS__COMMON_H_
10 #define _NTFS__COMMON_H_
16 typedef struct sNTFS_File tNTFS_File;
17 typedef struct sNTFS_Directory tNTFS_Directory;
18 typedef struct sNTFS_Disk tNTFS_Disk;
19 typedef struct sNTFS_Attrib tNTFS_Attrib;
20 typedef struct sNTFS_AttribDataRun tNTFS_AttribDataRun;
30 struct sNTFS_Directory
33 tNTFS_Attrib *I30Root;
34 tNTFS_Attrib *I30Allocation;
38 * In-memory representation of an NTFS Disk
50 tNTFS_Attrib *MFTDataAttr;
51 tNTFS_Attrib *MFTBitmapAttr;
55 tNTFS_Directory RootDir;
58 struct sNTFS_AttribDataRun
78 int CompressionUnitL2Size; // 0 = uncompressed
79 Uint64 FirstPopulatedCluster;
80 tNTFS_AttribDataRun *Runs;
85 extern tVFS_NodeType gNTFS_DirType;
86 extern tVFS_NodeType gNTFS_FileType;
88 extern int NTFS_int_ApplyUpdateSequence(void *Buf, size_t BufLen, const Uint16 *Sequence, size_t NumEntries);
89 // -- MFT Access / Manipulation
90 extern tNTFS_FILE_Header *NTFS_GetMFT(tNTFS_Disk *Disk, Uint32 MFTEntry);
91 extern void NTFS_ReleaseMFT(tNTFS_Disk *Disk, Uint32 MFTEntry, tNTFS_FILE_Header *Entry);
92 extern tNTFS_Attrib *NTFS_GetAttrib(tNTFS_Disk *Disk, Uint32 MFTEntry, int Type, const char *Name, int DesIdx);
93 extern size_t NTFS_ReadAttribData(tNTFS_Attrib *Attrib, Uint64 Offset, size_t Length, void *Buffer);
95 extern int NTFS_ReadDir(tVFS_Node *Node, int Pos, char Dest[FILENAME_MAX]);
96 extern tVFS_Node *NTFS_FindDir(tVFS_Node *Node, const char *Name, Uint Flags);