Modules/FAT - Fixed edge cases in read
[tpg/acess2.git] / Modules / Filesystems / NTFS / index.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  * index.h - Index Types
8  */
9 #ifndef _INDEX_H_
10 #define _INDEX_H_
11
12 #include "attributes.h"
13
14 typedef struct
15 {
16         Uint32  EntryOffset;
17         Uint32  IndexLength;
18         Uint32  AllocateSize;
19         Uint8   Flags;
20         Uint8   _reserved[3];
21 } PACKED        tNTFS_IndexHeader;
22
23 typedef struct
24 {
25         Uint32  Type;
26         Uint32  CollationRule;
27         Uint32  IndexBlockSize;
28         Uint8   ClustersPerIndexBlock;
29         Uint8   _reserved[3];
30         tNTFS_IndexHeader       Header;
31 } PACKED        tNTFS_IndexRoot;
32
33 typedef struct
34 {
35         union {
36                 struct {
37                         Uint64  File;   // MFT Index of file
38                 } PACKED        Dir;
39                 /**
40                  * Views/Indexes
41                  */
42                 struct {
43                         Uint16  DataOffset;
44                         Uint16  DataLength;
45                         Uint32  _reserved;
46                 } PACKED        ViewIndex;
47         } PACKED        Header;
48         
49         Uint16  Length; //!< Size of the index entry (multiple of 8 bytes)
50         Uint16  KeyLength;      //!< Size of key value
51         Uint16  Flags;  //!< Flags Bitfield
52         Uint16  _reserved;
53         
54         /**
55          * \brief Key Data
56          * \note Only valid if \a Flags does not have \a INDEX_ENTRY_END set
57          * \note In NTFS3 only \a Filename is used
58          */
59         union {
60                 tNTFS_Attrib_Filename   Filename;
61                 //TODO: more key types
62         } PACKED        Key;
63 } PACKED        tNTFS_IndexEntry;
64
65 #endif

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