2 * ntfs.handler - New Technology FileSystem handler
4 * Copyright © 2012 The AROS Development Team
6 * This program is free software; you can redistribute it and/or modify it
7 * under the same terms as AROS itself.
16 #define FILE_MFTMIRR 1
17 #define FILE_LOGFILE 2
19 #define FILE_ATTRDEF 4
23 #define FILE_BADCLUS 8
25 #define FILE_UPCASE 10
27 #define AT_STANDARD_INFORMATION 0x10
28 #define AT_ATTRIBUTE_LIST 0x20
29 #define AT_FILENAME 0x30
30 #define AT_OBJECT_ID 0x40
31 #define AT_SECURITY_DESCRIPTOR 0x50
32 #define AT_VOLUME_NAME 0x60
33 #define AT_VOLUME_INFORMATION 0x70
35 #define AT_INDEX_ROOT 0x90
36 #define AT_INDEX_ALLOCATION 0xA0
37 #define AT_BITMAP 0xB0
38 #define AT_REPARSE_POINT 0xC0
39 #define AT_EA_INFORMATION 0xD0
41 #define AT_PROPERTY_SET 0xF0
42 #define AT_LOGGED_UTILITY_STRM 0x100
43 #define AT_USER 0x1000
44 #define AT_END 0xFFFFFFFF
46 #define ATTR_READ_ONLY 0x01
47 #define ATTR_HIDDEN 0x02
48 #define ATTR_SYSTEM 0x04
49 #define ATTR_DOSDIRECTORY 0x10
50 #define ATTR_ARCHIVE 0x20
51 #define ATTR_DEVICE 0x40
52 #define ATTR_NORMAL 0x80
53 #define ATTR_TEMPORARY 0x100
54 #define ATTR_SPARSE 0x200
55 #define ATTR_REPARSE 0x400
56 #define ATTR_COMPRESSED 0x800
57 #define ATTR_OFFLINE 0x1000
58 #define ATTR_NOT_INDEXED 0x2000
59 #define ATTR_ENCRYPTED 0x4000
60 #define ATTR_DIRECTORY 0x10000000
61 #define ATTR_INDEX_VIEW 0x20000000
63 #define FLAG_COMPRESSED 1
64 #define FLAG_ENCRYPTED 0x4000
65 #define FLAG_SPARSE 0x8000
72 #define COM_LOG_LEN 12
73 #define COM_SEC (COM_LEN >> 9)
75 #define INDEX_ENTRY_END 2
77 #define MFTREF_MASK 0x0000ffffffffffffULL
79 #define ATTR_RESIDENT_FORM 0x00
80 #define ATTR_NONRESIDENT_FORM 0x01
82 #define FILERECORD_SEGMENT_IN_USE (0x0001)
83 #define FILERECORD_NAME_INDEX_PRESENT (0x0002)
85 struct NTFSBootSector
{
89 UWORD bytes_per_sector
; /* Size of a sector in bytes. */
90 UBYTE sectors_per_cluster
; /* Size of a cluster in sectors. */
94 UWORD sectors_per_track
; /* irrelevant */
95 UWORD heads
; /* irrelevant */
96 ULONG hidden_sectors
; /* zero */
98 QUAD number_of_sectors
;
99 QUAD mft_lcn
; /* Cluster location of mft data. */
100 QUAD mftmirr_lcn
; /* Cluster location of copy of mft. */
101 BYTE clusters_per_mft_record
; /* Mft record size in clusters. */
103 BYTE clusters_per_index_record
; /* Index block size in clusters. */
105 UQUAD volume_serial_number
; /* Irrelevant (serial number). */
106 ULONG checksum
; /* Boot sector checksum. */
107 } __attribute__ ((__packed__
));
109 /* MultiSectorHeader */
112 UBYTE magic
[4]; // 0x00
113 UWORD usa_offset
; // 0x04
114 UWORD usa_count
; // 0x06
115 } __attribute__ ((__packed__
));
117 struct MFTSegmentReference
119 ULONG seg_low
; // 0x00
120 UWORD seg_high
; // 0x04
121 UWORD seg_sn
; // 0x06
122 } __attribute__ ((__packed__
));
124 struct MFTRecordEntry
126 struct MFTRecordMSH header
;
128 UWORD sequence_number
; // 0x10
129 UWORD link_count
; // 0x12
130 UWORD attrs_offset
; // 0x14
132 ULONG bytes_in_use
; // 0x18
133 ULONG bytes_allocated
; // 0x1C
134 struct MFTSegmentReference base_mft_record
; // 0x20
135 UWORD next_attr_instance
; // 0x28
136 UWORD reserved
; // 0x2A
137 ULONG mft_record_number
; // 0x2C
138 } __attribute__ ((__packed__
));
145 UBYTE attrname_length
; /* UTF32 size of attrname (0 = unnamed) */
146 UWORD attrname_offset
;
155 } __attribute__ ((__packed__
)) resident
;
159 UQUAD mapping_pairs_offset
;
160 UBYTE compression_unit
;
162 UQUAD allocated_size
;
166 } __attribute__ ((__packed__
)) non_resident
;
167 } __attribute__ ((__packed__
)) data
;
168 } __attribute__ ((__packed__
));
170 struct MFTIndexHeader
{
174 } __attribute__ ((__packed__
)) dir
;
179 } __attribute__ ((__packed__
)) vi
;
180 } __attribute__ ((__packed__
)) data
;
185 } __attribute__ ((__packed__
));
187 struct MFTIndexEntry
{
191 } __attribute__ ((__packed__
)) dir
;
196 } __attribute__ ((__packed__
)) vi
;
197 } __attribute__ ((__packed__
)) data
;
210 } __attribute__ ((__packed__)) key;*/
211 } __attribute__ ((__packed__
));
213 #endif /* NTFS_STRUCT_H */