X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FFilesystems%2FNTFS%2Fcommon.h;h=8d2a9ecdf43a01575e317a0774a02429a60d4263;hb=da7ef0c8cace452ccfdfa0881a3c0b09970874d8;hp=ba25c18af93482fb65ea8304ab8a279bfaa447da;hpb=377247d261f82cc9c26ccd06cc075594b12bd760;p=tpg%2Facess2.git diff --git a/Modules/Filesystems/NTFS/common.h b/Modules/Filesystems/NTFS/common.h index ba25c18a..8d2a9ecd 100644 --- a/Modules/Filesystems/NTFS/common.h +++ b/Modules/Filesystems/NTFS/common.h @@ -1,14 +1,68 @@ /* + * Acess2 - NTFS Driver + * By John Hodge (thePowersGang) + * This file is published under the terms of the Acess licence. See the + * file COPYING for details. + * + * common.h - Common Types and Definitions */ #ifndef _COMMON_H_ #define _COMMON_H_ +#include +#include + // === STRUCTURES === +/** + * In-memory representation of an NTFS Disk + */ typedef struct sNTFS_Disk { + int FD; + + int ClusterSize; + Uint64 MFTBase; + tVFS_Node RootNode; } tNTFS_Disk; +typedef struct sNTFS_BootSector +{ + // 0 + Uint8 Jump[3]; + Uint8 SystemID[8]; // = "NTFS " + Uint16 BytesPerSector; + Uint8 SectorsPerCluster; + + // 14 + Uint8 Unused[7]; + Uint8 MediaDescriptor; + Uint16 Unused2; + Uint16 SectorsPerTrack; + + Uint64 Unused3; + Uint32 Unknown; + + // 38 + Uint64 TotalSectorCount; // Size of volume in sectors + Uint64 MFTStart; // Logical Cluster Number of Cluster 0 of MFT + Uint64 MFTMirrorStart; // Logical Cluster Number of Cluster 0 of MFT Backup + + // 60 + // If either of these are -ve, the size can be obtained via + // SizeInBytes = 2^(-1 * Value) + Uint32 ClustersPerMFTRecord; + Uint32 ClustersPerIndexRecord; + + Uint64 SerialNumber; + + Uint8 Padding[512-72]; + +} tNTFS_BootSector; + +/** + * FILE header, an entry in the MFT + */ typedef struct sNTFS_FILE_Header { Uint32 Magic; // 'FILE' @@ -48,6 +102,9 @@ typedef struct sNTFS_FILE_Header } tNTFS_FILE_Header; +/** + * File Attribute, follows the FILE header + */ typedef struct sNTFS_FILE_Attrib { Uint32 Type; // See eNTFS_FILE_Attribs