{FULLFAT]
[reactos.git] / reactos / include / reactos / libs / fullfat / ff_fatdef.h
1 /*****************************************************************************
2 * FullFAT - High Performance, Thread-Safe Embedded FAT File-System *
3 * Copyright (C) 2009 James Walmsley (james@worm.me.uk) *
4 * *
5 * This program is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17 * *
18 * IMPORTANT NOTICE: *
19 * ================= *
20 * Alternative Licensing is available directly from the Copyright holder, *
21 * (James Walmsley). For more information consult LICENSING.TXT to obtain *
22 * a Commercial license. *
23 * *
24 * See RESTRICTIONS.TXT for extra restrictions on the use of FullFAT. *
25 * *
26 * Removing the above notice is illegal and will invalidate this license. *
27 *****************************************************************************
28 * See http://worm.me.uk/fullfat for more information. *
29 * Or http://fullfat.googlecode.com/ for latest releases and the wiki. *
30 *****************************************************************************/
31 #ifndef _FF_FATDEF_H_
32 #define _FF_FATDEF_H_
33
34 /*
35 This file defines offsets to various data for the FAT specification.
36 */
37
38 // MBR / PBR Offsets
39
40 #define FF_FAT_BYTES_PER_SECTOR 0x00B
41 #define FF_FAT_SECTORS_PER_CLUS 0x00D
42 #define FF_FAT_RESERVED_SECTORS 0x00E
43 #define FF_FAT_NUMBER_OF_FATS 0x010
44 #define FF_FAT_ROOT_ENTRY_COUNT 0x011
45 #define FF_FAT_16_TOTAL_SECTORS 0x013
46 #define FF_FAT_32_TOTAL_SECTORS 0x020
47 #define FF_FAT_16_SECTORS_PER_FAT 0x016
48 #define FF_FAT_32_SECTORS_PER_FAT 0x024
49 #define FF_FAT_ROOT_DIR_CLUSTER 0x02C
50
51 #define FF_FAT_16_VOL_LABEL 0x02B
52 #define FF_FAT_32_VOL_LABEL 0x047
53
54 #define FF_FAT_PTBL 0x1BE
55 #define FF_FAT_PTBL_LBA 0x008
56 #define FF_FAT_PTBL_ACTIVE 0x000
57 #define FF_FAT_PTBL_ID 0x004
58
59 #define FF_FAT_MBR_SIGNATURE 0x1FE
60
61 #define FF_FAT_DELETED 0xE5
62
63 // Directory Entry Offsets
64 #define FF_FAT_DIRENT_SHORTNAME 0x000
65 #define FF_FAT_DIRENT_ATTRIB 0x00B
66 #define FF_FAT_DIRENT_CREATE_TIME 0x00E ///< Creation Time.
67 #define FF_FAT_DIRENT_CREATE_DATE 0x010 ///< Creation Date.
68 #define FF_FAT_DIRENT_LASTACC_DATE 0x012 ///< Date of Last Access.
69 #define FF_FAT_DIRENT_CLUS_HIGH 0x014
70 #define FF_FAT_DIRENT_LASTMOD_TIME 0x016 ///< Time of Last modification.
71 #define FF_FAT_DIRENT_LASTMOD_DATE 0x018 ///< Date of Last modification.
72 #define FF_FAT_DIRENT_CLUS_LOW 0x01A
73 #define FF_FAT_DIRENT_FILESIZE 0x01C
74 #define FF_FAT_LFN_ORD 0x000
75 #define FF_FAT_LFN_NAME_1 0x001
76 #define FF_FAT_LFN_CHECKSUM 0x00D
77 #define FF_FAT_LFN_NAME_2 0x00E
78 #define FF_FAT_LFN_NAME_3 0x01C
79
80 // Dirent Attributes
81 #define FF_FAT_ATTR_READONLY 0x01
82 #define FF_FAT_ATTR_HIDDEN 0x02
83 #define FF_FAT_ATTR_SYSTEM 0x04
84 #define FF_FAT_ATTR_VOLID 0x08
85 #define FF_FAT_ATTR_DIR 0x10
86 #define FF_FAT_ATTR_ARCHIVE 0x20
87 #define FF_FAT_ATTR_LFN 0x0F
88
89 #endif
90