-revert janderwalds change until because it breaks the gcc 4.x build
[reactos.git] / reactos / boot / freeldr / freeldr / include / fs / iso.h
1 /*
2 * FreeLoader
3 * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
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 2 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, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #ifndef __ISO_H
21 #define __ISO_H
22
23
24 struct _DIR_RECORD
25 {
26 UCHAR RecordLength; // 1
27 UCHAR ExtAttrRecordLength; // 2
28 ULONG ExtentLocationL; // 3-6
29 ULONG ExtentLocationM; // 7-10
30 ULONG DataLengthL; // 11-14
31 ULONG DataLengthM; // 15-18
32 UCHAR Year; // 19
33 UCHAR Month; // 20
34 UCHAR Day; // 21
35 UCHAR Hour; // 22
36 UCHAR Minute; // 23
37 UCHAR Second; // 24
38 UCHAR TimeZone; // 25
39 UCHAR FileFlags; // 26
40 UCHAR FileUnitSize; // 27
41 UCHAR InterleaveGapSize; // 28
42 ULONG VolumeSequenceNumber; // 29-32
43 UCHAR FileIdLength; // 33
44 UCHAR FileId[1]; // 34
45 } __attribute__((packed));
46
47 typedef struct _DIR_RECORD DIR_RECORD, *PDIR_RECORD;
48
49
50
51
52 /* Volume Descriptor header*/
53 struct _VD_HEADER
54 {
55 UCHAR VdType; // 1
56 UCHAR StandardId[5]; // 2-6
57 UCHAR VdVersion; // 7
58 } __attribute__((packed));
59
60 typedef struct _VD_HEADER VD_HEADER, *PVD_HEADER;
61
62
63
64 /* Primary Volume Descriptor */
65 struct _PVD
66 {
67 UCHAR VdType; // 1
68 CHAR StandardId[5]; // 2-6
69 UCHAR VdVersion; // 7
70 UCHAR unused0; // 8
71 CHAR SystemId[32]; // 9-40
72 CHAR VolumeId[32]; // 41-72
73 UCHAR unused1[8]; // 73-80
74 ULONG VolumeSpaceSizeL; // 81-84
75 ULONG VolumeSpaceSizeM; // 85-88
76 UCHAR unused2[32]; // 89-120
77 ULONG VolumeSetSize; // 121-124
78 ULONG VolumeSequenceNumber; // 125-128
79 ULONG LogicalBlockSize; // 129-132
80 ULONG PathTableSizeL; // 133-136
81 ULONG PathTableSizeM; // 137-140
82 ULONG LPathTablePos; // 141-144
83 ULONG LOptPathTablePos; // 145-148
84 ULONG MPathTablePos; // 149-152
85 ULONG MOptPathTablePos; // 153-156
86 DIR_RECORD RootDirRecord; // 157-190
87 CHAR VolumeSetIdentifier[128]; // 191-318
88 CHAR PublisherIdentifier[128]; // 319-446
89
90 /* more data ... */
91
92 } __attribute__((packed));
93
94 typedef struct _PVD PVD, *PPVD;
95
96
97
98 typedef struct
99 {
100 ULONG FileStart; // File start sector
101 ULONG FileSize; // File size
102 ULONG FilePointer; // File pointer
103 BOOLEAN Directory;
104 ULONG DriveNumber;
105 } ISO_FILE_INFO, * PISO_FILE_INFO;
106
107
108 BOOLEAN IsoOpenVolume(ULONG DriveNumber);
109 FILE* IsoOpenFile(PCSTR FileName);
110 BOOLEAN IsoReadFile(FILE *FileHandle, ULONG BytesToRead, ULONG* BytesRead, PVOID Buffer);
111 ULONG IsoGetFileSize(FILE *FileHandle);
112 VOID IsoSetFilePointer(FILE *FileHandle, ULONG NewFilePointer);
113 ULONG IsoGetFilePointer(FILE *FileHandle);
114
115 #endif // #defined __FAT_H