ReactOS 0.4.15-dev-8093-g3285f69
osta_misc.h
Go to the documentation of this file.
1
2// Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine
3// All rights reserved
4// This file was released under the GPLv2 on June 2015.
6
7#ifndef _OSTA_MISC_H_
8#define _OSTA_MISC_H_
9
10/* based on ECMA 167 structure definitions */
11#include "ecma_167.h"
12
13#pragma pack(push, 1)
14
15/* -------- Basic types and constants ----------- */
16/* UDF character set (UDF 1.50 2.1.2) */
17#define UDF_CHAR_SET_TYPE 0
18#define UDF_CHAR_SET_INFO "OSTA Compressed Unicode"
19
20#define UDF_ID_DEVELOPER ("*WINNT " VER_STR_PRODUCT_NAME " UDF")
21
22#define UDF_ID_DEVELOPER_ADAPTEC "*Adaptec DirectCD"
23
24/* UDF 1.02 2.2.6.4 */
26{
33};
34
35/* UDF 1.02 2.2.7.2 */
36/* LVInformation may be present in ImpUseVolDesc.impUse */
38{
46};
47
49{
57};
58
59/* UDF 1.5 2.2.8 */
61{
64 uint8 reserved1[2]; /* #00 */
68 uint8 reserved2[24]; /* #00 */
69};
70
71#define UDF_VAT_FREE_ENTRY 0xffffffff
72
73/* UDF 1.5 2.2.9 */
75{
78 uint8 reserved1[2]; /* #00 */
79 EntityID partIdent; /* Flags = 0 */
80 /* Id = UDF_ID_SPARABLE */
81 /* IdSuf = 2.1.5.3 */
86 uint8 reserved2[1]; /* #00 */
88// uint32 locSparingTable[0];
89// uint8 pad[0];
91
92#define UDF_TYPE1_MAP15 0x1511U
93#define UDF_VIRTUAL_MAP15 0x1512U
94#define UDF_VIRTUAL_MAP20 0x2012U
95#define UDF_SPARABLE_MAP15 0x1522U
96#define UDF_METADATA_MAP25 0x2522U
97
98#ifndef PACKETSIZE_UDF
99#define PACKETSIZE_UDF 32
100#endif //PACKETSIZE_UDF
101
102/* UDF 2.5 */
104{
107 uint8 reserved1[2]; /* #00 */
108 EntityID partIdent; /* Flags = 0 */
109 /* Id = UDF_ID_METADATA */
110 /* IdSuf = 2.1.5.3 */
116 uint32 allocationUnit; /* blocks */
117 uint16 alignmentUnit; /* blocks */
121
122#define UDF_METADATA_DUPLICATED 0x01U
123
124/* DVD Copyright Management Info, see UDF 1.02 3.3.4.5.1.2 */
125/* when ImpUseExtendedAttr.impIdent= "*UDF DVD CGMS Info" */
131};
132
133/* the impUse of long_ad used in AllocDescs - UDF 1.02 2.3.10.1 */
135{
138};
139
140/* the impUse of long_ad used in AllocDescs - UDF 1.02 2.3.10.1 */
142{
145};
146
147/* UDF 1.02 2.3.10.1 */
148#define UDF_EXTENT_LENGTH_MASK 0x3FFFFFFF
149#define UDF_EXTENT_FLAG_MASK 0xc0000000
150#define UDF_EXTENT_FLAG_ERASED 0x40000000
151
152/*
153 * Important! VirtualAllocationTables are
154 * very different between 1.5 and 2.0!
155 */
156
157/* ----------- 1.5 ------------- */
158/* UDF 1.5 2.2.10 */
159#define UDF_FILE_TYPE_VAT15 0x0U
160
161/* UDF 1.5 2.2.10 - VAT layout: */
163/* uint32 VirtualSector[0];*/
166 };
167/* where number of VirtualSector's is (VATSize-36)/4 */
168
169/* ----------- 2.0 ------------- */
170/* UDF 2.0 2.2.10 */
171#define UDF_FILE_TYPE_VAT20 0xf8U
172
173/* UDF 2.0 2.2.10 (different from 1.5!) */
180 uint32 numFIDSDirectories; /* non-parent */
185/* uint8 impUse[0];*/
186/* uint32 vatEntry[0];*/
187};
188
189/* Sparing maps, see UDF 1.5 2.2.11 */
190typedef struct _SparingEntry {
194
195#define SPARING_LOC_AVAILABLE 0xffffffff
196#define SPARING_LOC_CORRUPTED 0xfffffff0
197
200
203
204/* sparing maps, see UDF 2.0 2.2.11 */
205typedef struct _SPARING_TABLE {
207 EntityID sparingIdent; /* *UDF Sparing Table */
209 uint16 reserved; /* #00 */
211// SparingEntry mapEntry[0];
213
214/* Identifier Suffixes, see EntityID */
215
216typedef struct {
221
222#define ENTITYID_FLAGS_HARD_RO 0x01U
223#define ENTITYID_FLAGS_SOFT_RO 0x02U
224
225typedef struct {
231
232typedef struct {
237
238/* Unique ID maps, see UDF 2.0 2.2.11 */
239
240typedef struct {
247
250
251typedef struct {
256// UniqueIDEntry mapEntry[0];
258
261
262/* Entity Identifiers (UDF 1.50 6.1) */
263#define UDF_ID_COMPLIANT "*OSTA UDF Compliant"
264#define UDF_ID_LV_INFO "*UDF LV Info"
265#define UDF_ID_FREE_EA "*UDF FreeEASpace"
266#define UDF_ID_FREE_APP_EA "*UDF FreeAppEASpace"
267#define UDF_ID_DVD_CGMS "*UDF DVD CGMS Info"
268#define UDF_ID_OS2_EA "*UDF OS/2 EA"
269#define UDF_ID_OS2_EA_LENGTH "*UDF OS/2 EALength"
270#define UDF_ID_OS400_DIRINFO "*UDF OS/400 DirInfo"
271#define UDF_ID_MAC_VOLUME "*UDF Mac VolumeInfo"
272#define UDF_ID_MAC_FINDER "*UDF Mac FinderInfo"
273#define UDF_ID_MAC_UNIQUE "*UDF Mac UniqueIDTable"
274#define UDF_ID_MAC_RESOURCE "*UDF Mac ResourceFork"
275#define UDF_ID_VIRTUAL "*UDF Virtual Partition"
276#define UDF_ID_SPARABLE "*UDF Sparable Partition"
277#define UDF_ID_METADATA "*UDF Metadata Partition"
278#define UDF_ID_ALLOC "*UDF Virtual Alloc Tbl"
279#define UDF_ID_SPARING "*UDF Sparing Table"
280
281/* Operating System Identifiers (UDF 1.50 6.3) */
282#define UDF_OS_CLASS_UNDEF 0x00U
283#define UDF_OS_CLASS_DOS 0x01U
284#define UDF_OS_CLASS_OS2 0x02U
285#define UDF_OS_CLASS_MAC 0x03U
286#define UDF_OS_CLASS_UNIX 0x04U
287#define UDF_OS_CLASS_WIN95 0x05U
288#define UDF_OS_CLASS_WINNT 0x06U
289#define UDF_OS_CLASS_OS400 0x07U
290#define UDF_OS_CLASS_BEOS 0x08U
291#define UDF_OS_CLASS_WINCE 0x09U
292
293#define UDF_OS_ID_GENERIC 0x00U
294#define UDF_OS_ID_UNDEF 0x00U
295#define UDF_OS_ID_DOS 0x00U
296#define UDF_OS_ID_OS2 0x00U
297#define UDF_OS_ID_MAC 0x00U
298#define UDF_OS_ID_UNIX 0x00U
299#define UDF_OS_ID_WIN95 0x00U
300#define UDF_OS_ID_WINNT 0x00U
301#define UDF_OS_ID_OS400 0x00U
302#define UDF_OS_ID_BEOS 0x00U
303
304#define UDF_OS_ID_AIX 0x01U
305#define UDF_OS_ID_SOLARIS 0x02U
306#define UDF_OS_ID_HPUX 0x03U
307#define UDF_OS_ID_IRIX 0x04U
308#define UDF_OS_ID_LINUX 0x05U
309#define UDF_OS_ID_MKLINUX 0x06U
310#define UDF_OS_ID_FREEBSD 0x07U
311#define UDF_OS_ID_NETBSD 0x08U
312
313#define UDF_NAME_PAD 4
314#define UDF_NAME_LEN 255
315#define UDF_EXT_SIZE 5 // ???
316#define UDF_PATH_LEN 1023
317#define UDF_VOL_LABEL_LEN 32
318
319/* Reserved file names */
320
321#define UDF_FN_NON_ALLOCATABLE L"Non-Allocatable Space"
322#define UDF_FN_NON_ALLOCATABLE_2 L"Non-Allocatable List"
323
324#define UDF_FN_NON_ALLOCATABLE_USER "Non-Allocatable Space"
325#define UDF_FN_NON_ALLOCATABLE_2_USER "Non-Allocatable List"
326
327/* Reserved system stream names */
328/* METADATA bit shall be set to 1 */
329
330#define UDF_SN_UID_MAPPING L"*UDF Unique ID Mapping Data"
331#define UDF_SN_NON_ALLOCATABLE L"*UDF Non-Allocatable Space"
332#define UDF_SN_POWER_CAL_TABLE L"*UDF Power Cal Table"
333#define UDF_SN_BACKUP L"*UDF Backup"
334
335/* Reserved non-system stream names */
336/* METADATA bit shall be set to 0 */
337
338#define UDF_SN_MAC_RESOURCE_FORK L"*UDF Macintosh Resource Fork"
339#define UDF_SN_OS2_EA L"*UDF OS/2 EA"
340#define UDF_SN_NT_ACL L"*UDF NT ACL"
341#define UDF_SN_UNIX_ACL L"*UDF UNIX ACL"
342
343#define UDF_RESERVED_NAME_HDR L"*UDF "
344
345/* ----------- 2.01 ------------ */
346/* UDF 2.0 2.2.10 */
347#define UDF_FILE_TYPE_REALTIME 0xf9U
348
349#define TID_ADAPTEC_LOGICAL_VOL_DESC 0x9999U
350
351#pragma pack(pop)
352
353#endif /* _OSTA_MISC_H */
unsigned short uint16
Definition: types.h:30
unsigned int uint32
Definition: types.h:32
unsigned char uint8
Definition: types.h:28
r reserved
Definition: btrfs.c:3006
uint8 dstring
Definition: ecma_167.h:20
PSPARING_ENTRY PSPARING_MAP
Definition: osta_misc.h:202
UID_MAPPING_ENTRY * PUID_MAPPING_ENTRY
Definition: osta_misc.h:249
UID_MAPPING_TABLE * PUID_MAPPING_TABLE
Definition: osta_misc.h:260
SPARING_ENTRY * PSPARING_ENTRY
Definition: osta_misc.h:199
SPARING_ENTRY SPARING_MAP
Definition: osta_misc.h:201
struct _SPARABLE_PARTITION_MAP SPARABLE_PARTITION_MAP
SparingEntry SPARING_ENTRY
Definition: osta_misc.h:198
UniqueIDMappingData UID_MAPPING_TABLE
Definition: osta_misc.h:259
struct _SPARING_TABLE SPARING_TABLE
struct _SPARING_TABLE * PSPARING_TABLE
struct _METADATA_PARTITION_MAP * PMETADATA_PARTITION_MAP
struct _SPARABLE_PARTITION_MAP * PSPARABLE_PARTITION_MAP
UniqueIDEntry UID_MAPPING_ENTRY
Definition: osta_misc.h:248
struct _SparingEntry SparingEntry
struct _METADATA_PARTITION_MAP METADATA_PARTITION_MAP
uint8 impUse[4]
Definition: osta_misc.h:137
uint16 flags
Definition: osta_misc.h:136
uint8 protectionSystemInfo[4]
Definition: osta_misc.h:130
uint16 headerChecksum
Definition: osta_misc.h:127
uint8 reserved[2]
Definition: osta_misc.h:143
uint32 uniqueID
Definition: osta_misc.h:144
EntityID impIdent
Definition: osta_misc.h:44
dstring LVInfo1[36]
Definition: osta_misc.h:41
dstring LVInfo2[36]
Definition: osta_misc.h:42
uint8 impUse[128]
Definition: osta_misc.h:45
dstring logicalVolIdent[128]
Definition: osta_misc.h:40
charspec LVICharset
Definition: osta_misc.h:39
dstring LVInfo3[36]
Definition: osta_misc.h:43
uint16 currentRev
Definition: osta_misc.h:226
uint8 partitionMapType
Definition: osta_misc.h:50
uint8 reserved1[2]
Definition: osta_misc.h:52
EntityID partIdent
Definition: osta_misc.h:53
uint16 partitionNum
Definition: osta_misc.h:55
uint8 reserved2[24]
Definition: osta_misc.h:56
uint16 volSeqNum
Definition: osta_misc.h:54
uint8 partitionMapLength
Definition: osta_misc.h:51
uint32 parentLogicalBlock
Definition: osta_misc.h:242
uint16 parentPartitionReferenceNum
Definition: osta_misc.h:244
uint16 objectPartitionReferenceNum
Definition: osta_misc.h:245
uint32 uniqueID
Definition: osta_misc.h:241
uint32 objectLogicalBlock
Definition: osta_misc.h:243
dstring logicalVolIdent[128]
Definition: osta_misc.h:177
EntityID partIdent
Definition: osta_misc.h:65
uint8 partitionMapType
Definition: osta_misc.h:62
uint8 partitionMapLength
Definition: osta_misc.h:63
uint8 reserved2[24]
Definition: osta_misc.h:68
uint8 reserved1[2]
Definition: osta_misc.h:64
uint32 metadataMirrorFELocation
Definition: osta_misc.h:114
uint32 metadataBitmapFELocation
Definition: osta_misc.h:115
uint32 sequenceNum
Definition: osta_misc.h:210
uint16 reallocationTableLen
Definition: osta_misc.h:208
uint16 reserved
Definition: osta_misc.h:209
EntityID sparingIdent
Definition: osta_misc.h:207
uint32 mappedLocation
Definition: osta_misc.h:192
uint32 origLocation
Definition: osta_misc.h:191
Definition: ecma_167.h:138