?? ecma167.h
字號:
/****************************************************************************************
* Copyright (c) 2002 ZORAN Corporation, All Rights Reserved
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
* File: $Workfile: ECMA167.h $
*
* Description:
* ============
*
*
* Log:
* ====
* $Revision: 2 $
* Last Modified by $Author: Nirm $ at $Modtime: 23/04/02 9:06 $
****************************************************************************************
* Updates:
****************************************************************************************
* $Log: /I49/H49V/Playcore/FileSys/UDF/ECMA167.h $
*
* 2 23/04/02 9:30 Nirm
* - Added dependency in "Config.h".
*
* 1 30/01/02 18:12 Nirm
****************************************************************************************/
/////////////////////////////////////////////////////////////////////////////
// ECMA167.h - Definitions and Data-Structures described in ECMA-167
//
// Author: Nir Milstein
#include "Config.h" // Global Configuration - do not remove!
#ifndef __ECMA_167_H_
#define __ECMA_167_H_
#include "Include\SysDefs.h"
// NOTE: All of the structures MUST be packed, since they represent
// data-structures resident on the Medium!
#pragma pack(1)
/////////////////////////////////////////////////////////////////////////////
// Constants
#define VOLUME_RECOGNITION_SEQUENCE_START_LSN 16
#define FIRST_ANCHOR_POINT_LSN 256
#define MAX_ID_LENGTH 128
#define MAX_SUPPORT_FILE_ID_LENGTH 256
/////////////////////////////////////////////////////////////////////////////
// General - Basic Types (ECMA-167 1/7)
// D-String (ECMA-167 1/7.2)
typedef char DString;
// Character-Set Specification (ECMA-167 1/7.2.1)
typedef struct CharSpec_TAG {
UINT8 uCharacterSetType;
BYTE aCharacterSetInfo[63];
} CharSpec;
#define CHARACTER_SET_TYPE_CS0 0x00
// Timestamp (ECMA-167 1/7.3)
typedef struct Timestamp_TAG {
UINT16 uTypeAndTimezone;
INT16 iYear;
UINT8 uMonth;
UINT8 uDay;
UINT8 uHour;
UINT8 uMinute;
UINT8 uSecond;
UINT8 uCentiseconds;
UINT8 uHundredsOfSeconds;
UINT8 uMicroseconds;
} Timestamp;
#define TIMESTAMP_TYPE_CUT 0
#define TIMESTAMP_TYPE_LOCAL 1
#define TIMESTAMP_TYPE_AGREEMENT 2
// Entity Identifier (ECMA-167 1/7.4)
typedef struct RegID_Tag {
UINT8 uFlags;
BYTE aIdentifier[23];
BYTE aIdentifierSuffix[8];
} RegID;
#define REGID_FLAGS_DIRTY 0x01
#define REGID_FLAGS_PROTECTED 0x02
/////////////////////////////////////////////////////////////////////////////
// Volume and Boot-Block Recognition - Volume Recognition Structures (ECMA-167 2/9)
// Volume Structure Descriptor (ECMA-167 2/9.1)
#define STANDARD_ID_LEN 5
struct GenericVolumeStructureDesc {
UINT8 uStructureType;
BYTE aStandardID[STANDARD_ID_LEN];
UINT8 uStructureVersion;
BYTE aStructureData[2041];
};
#define STANDARD_ID_BEA01 "BEA01"
#define STANDARD_ID_BOOT2 "BOOT2"
#define STANDARD_ID_CD001 "CD001"
#define STANDARD_ID_CDW02 "CDW02"
#define STANDARD_ID_NSR02 "NSR02"
#define STANDARD_ID_NSR03 "NSR03"
#define STANDARD_ID_TEA01 "TEA01"
// Beginning Extended Area Descriptor (ECMA-167 2/9.2)
#define BeginningExtendedAreaDesc GenericVolumeStructureDesc
// Terminating Extended Area Descriptor (ECMA-167 2/9.3)
#define TerminatingExtendedAreaDesc GenericVolumeStructureDesc
// Boot Descriptor (ECMA-167 2/9.4)
struct BootDesc {
UINT8 uStructureType;
BYTE aStandardID[STANDARD_ID_LEN];
UINT8 uStructureVersion;
BYTE ucReserved;
RegID ridArchitectureType;
RegID ridBootID;
UINT32 dwBootExtentLocation;
UINT32 dwBootExtentLength;
UINT32 dwLoadAddressLow;
UINT32 dwLoadAddressHigh;
UINT32 dwStartAddressLow;
UINT32 dwStartAddressHigh;
Timestamp tsDescCreation;
UINT16 wFlags;
BYTE aReserved[32];
BYTE aBootUse[1906];
};
/////////////////////////////////////////////////////////////////////////////
// Volume Structure - Basic Types (ECMA-167 3/7)
// Extent Descriptor (ECMA-167 3/7.1)
typedef struct Extent_ad_TAG {
UINT32 dwExtentLength;
UINT32 dwExtentLocation;
} Extent_ad;
// Descriptor Tag (ECMA-167 3/7.2)
typedef struct Tag_TAG {
UINT16 uTagID;
UINT16 uDescriptorVersion;
UINT8 uTagChecksum;
BYTE ucReserved;
UINT16 uTagSerialNumber;
UINT16 uDescriptorCRC;
UINT16 uDescriptorCRCLength;
UINT32 dwTagLocation;
} Tag;
#define TAG_ID_PRIMARY_VOLUME_DESC 1
#define TAG_ID_ANCHOR_VOLUME_DESC_PTR 2
#define TAG_ID_VOLUME_DESC_PTR 3
#define TAG_ID_IMP_USE_VOLUME_DESC 4
#define TAG_ID_PARTITION_DESC 5
#define TAG_ID_LOGICAL_VOLUME_DESC 6
#define TAG_ID_UNALLOC_SPACE_DESC 7
#define TAG_ID_TERMINATING_DESC 8
#define TAG_ID_LOGICAL_VOLUME_INTEGRITY 9
/////////////////////////////////////////////////////////////////////////////
// Volume Structure - Volume Recognition Structures (ECMA-167 3/9)
// NSR Descriptor (ECMA-167 3/9.1)
struct NSRDesc {
UINT8 uStructureType;
BYTE aStandardID[STANDARD_ID_LEN];
UINT8 uStructureVersion;
BYTE ucReserved;
BYTE aStructureData[2040];
};
/////////////////////////////////////////////////////////////////////////////
// Volume Structure - Volume Data Structures (ECMA-167 3/10)
// Primary Volume Descriptor (ECMA-167 3/10.1)
struct PrimaryVolumeDesc {
Tag tgDescTag;
UINT32 dwVolumeDescSequenceNumber;
UINT32 dwPrimaryVolumeDescNumber;
DString sVolumeID[32];
UINT16 uVolumeSequenceNumber;
UINT16 uMaxVolumeSequenceNumber;
UINT16 uInterchangeLevel;
UINT16 uMaxInterchangeLevel;
UINT32 dwCharSetList;
UINT32 dwMaxCharSetList;
DString sVolumeSetID[128];
CharSpec csDescriptorCharSet;
CharSpec csExplanatoryCharSet;
Extent_ad exVolumeAbstract;
Extent_ad exVolumeCopyrightNotice;
RegID ridApplicationID;
Timestamp tsRecording;
RegID ridImplID;
BYTE aImplUse[64];
UINT32 dwPredecessorVolumeDescSequenceLocation;
UINT16 wFlags;
BYTE aReserved[22];
};
#define PVD_FLAGS_VOLUME_SET_ID 0x0001
// Anchor Volume Descriptor Pointer (ECMA-167 3/10.2)
struct AnchorVolumeDescPtr {
Tag tgDescTag;
Extent_ad exMainVolumeDescSequenceExtent;
Extent_ad exReserveVolumeDescSequenceExtent;
BYTE aReserved[480];
};
// Volume Descriptor Pointer (ECMA-167 3/10.3)
struct VolumeDescPtr {
Tag tgDescTag;
UINT32 dwVolumeDescSequenceNumber;
Extent_ad exNextVolumeDescSequenceExtent;
BYTE aReserved[484];
};
// Implementation Use Volume Descriptor (ECMA-167 3/10.4)
struct ImplUseVolumeDesc {
Tag tgDescTag;
UINT32 dwVolumeDescSequenceNumber;
RegID ridImplID;
BYTE aImplUse[460];
};
// Partition Descriptor (ECMA-167 3/10.5)
struct PartitionDesc {
Tag tgDescTag;
UINT32 dwVolumeDescSequenceNumber;
UINT16 wPartitionFlags;
UINT16 uPartitionNumber;
RegID ridPartitionContents;
BYTE aPartitionContentsUse[128];
UINT32 uAccessType;
UINT32 dwPartitionStartingLocation;
UINT32 uPartitionLength;
RegID ridImplID;
BYTE aImplUse[128];
BYTE aReserved[156];
};
#define PARTITION_FLAGS_ALLOCATION 1
#define PARTITION_CONTENTS_FDC01 "+FDC01"
#define PARTITION_CONTENTS_CD001 "+CD001"
#define PARTITION_CONTENTS_CDW02 "+CDW02"
#define PARTITION_CONTENTS_NSR02 "+NSR02"
#define PARTITION_CONTENTS_NSR03 "+NSR03"
#define PARTITION_ACCESS_NONE 0
#define PARTITION_ACCESS_RO 1
#define PARTITION_ACCESS_WO 2
#define PARTITION_ACCESS_RW 3
#define PARTITION_ACCESS_OW 4
// Logical Volume Descriptor (ECMA-167 3/10.6)
struct LogicalVolumeDesc {
Tag tgDescTag;
UINT32 dwVolumeDescSequenceNumber;
CharSpec csDescCharSet;
DString sLogicalVolumeID[128];
UINT32 cbLogicalBlockSize;
RegID ridDomainID;
BYTE aLogicalVolumeContentsUse[16];
UINT32 cbMapTableLength;
UINT32 uNumberOfPartitionMaps;
RegID ridImplID;
BYTE aImplUse[128];
Extent_ad exIntegritySequenceExtent;
BYTE aPartitionMaps[];
};
// Generic Partition Map (ECMA-167 3/10.7.1)
struct PartitionMapGeneric {
UINT8 uPartitionMapType;
UINT8 cbPartitionMapLength;
BYTE aPartitionMapping[];
};
#define PARTITION_MAP_TYPE_NONE 0
#define PARTITION_MAP_TYPE_1 1
#define PARTITION_MAP_TYPE_2 2
// Type1 PartitionMap (ECMA-167 3/10.7.2)
struct PartitionMapType1 {
UINT8 uPartitionMapType;
UINT8 cbPartitionMapLength;
UINT16 uVolumeSequenceNumber;
UINT16 uPartitionNumber;
};
// Type2 PartitionMap (ECMA-167 3/10.7.3)
struct PartitionMapType2 {
UINT8 uPartitionMapType;
UINT8 cbPartitionMapLength;
BYTE aPartitionID[62];
};
// Unallocated Space Descriptor (ECMA-167 3/10.8)
struct UnallocatedSpaceDesc {
Tag tgDescTag;
UINT32 dwVolumeDescSequenceNumber;
UINT32 uNumberOfAllocationDescs;
Extent_ad exAllcationDescs[];
};
// Terminating Descriptor (ECMA-167 3/10.9)
struct TerminatingDescriptor {
Tag tgDescTag;
BYTE aReserved[496];
};
// Logical Volume Integrity Descriptor (ECMA-167 3/10.10)
struct LogicalVolumeIntegrityDesc {
Tag tgDescTag;
Timestamp tsRecording;
UINT32 dwIntegrityType;
Extent_ad exNextIntegrityExtent;
BYTE aLogicalVolumeContentsUse[32];
UINT32 uNumberOfPartitions;
UINT32 uLengthOfImplUse;
UINT32 aFreeSpaceTable[];
UINT32 aSizeTable[];
BYTE aImplUse[];
};
#define INTEGRITY_TYPE_OPEN 0
#define INTEGRITY_TYPE_CLOSE 1
/////////////////////////////////////////////////////////////////////////////
// File Structure - Basic Types (ECMA-167 4/7)
// Recorded Address (ECMA-167 4/7.1)
typedef struct LB_Addr_TAG {
UINT32 uLogicalBlockNumber; // Relative to the start of the Partition
UINT16 uPartitionReferenceNumber;
} LB_Addr;
// Descriptor Tag (ECMA-167 4/7.2)
#define TAG_ID_FILE_SET_DESC 256
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -