3 * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
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.
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.
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.
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
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
));
47 typedef struct _DIR_RECORD DIR_RECORD
, *PDIR_RECORD
;
52 /* Volume Descriptor header*/
56 UCHAR StandardId
[5]; // 2-6
58 } __attribute__((packed
));
60 typedef struct _VD_HEADER VD_HEADER
, *PVD_HEADER
;
64 /* Primary Volume Descriptor */
68 UCHAR StandardId
[5]; // 2-6
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
92 } __attribute__((packed
));
94 typedef struct _PVD PVD
, *PPVD
;
100 U32 FileStart
; // File start sector
101 U32 FileSize
; // File size
102 U32 FilePointer
; // File pointer
105 } ISO_FILE_INFO
, * PISO_FILE_INFO
;
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
);
115 #endif // #defined __FAT_H