Fix some Rtl Prototype inconsistencies, more are in ntifs/winddk but i have fixed...
[reactos.git] / reactos / boot / freeldr / freeldr / 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 U32 ExtentLocationL; // 3-6
29 U32 ExtentLocationM; // 7-10
30 U32 DataLengthL; // 11-14
31 U32 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 U32 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 UCHAR StandardId[5]; // 2-6
69 UCHAR VdVersion; // 7
70 UCHAR unused0; // 8
71 UCHAR SystemId[32]; // 9-40
72 UCHAR VolumeId[32]; // 41-72
73 UCHAR unused1[8]; // 73-80
74 U32 VolumeSpaceSizeL; // 81-84
75 U32 VolumeSpaceSizeM; // 85-88
76 UCHAR unused2[32]; // 89-120
77 U32 VolumeSetSize; // 121-124
78 U32 VolumeSequenceNumber; // 125-128
79 U32 LogicalBlockSize; // 129-132
80 U32 PathTableSizeL; // 133-136
81 U32 PathTableSizeM; // 137-140
82 U32 LPathTablePos; // 141-144
83 U32 LOptPathTablePos; // 145-148
84 U32 MPathTablePos; // 149-152
85 U32 MOptPathTablePos; // 153-156
86 DIR_RECORD RootDirRecord; // 157-190
87 UCHAR VolumeSetIdentifier[128]; // 191-318
88 UCHAR 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 U32 FileStart; // File start sector
101 U32 FileSize; // File size
102 U32 FilePointer; // File pointer
103 BOOL Directory;
104 U32 DriveNumber;
105 } ISO_FILE_INFO, * PISO_FILE_INFO;
106
107
108 BOOL IsoOpenVolume(U32 DriveNumber);
109 FILE* IsoOpenFile(PUCHAR FileName);
110 BOOL IsoReadFile(FILE *FileHandle, U32 BytesToRead, U32* BytesRead, PVOID Buffer);
111 U32 IsoGetFileSize(FILE *FileHandle);
112 VOID IsoSetFilePointer(FILE *FileHandle, U32 NewFilePointer);
113 U32 IsoGetFilePointer(FILE *FileHandle);
114
115 #endif // #defined __FAT_H