?? ecma119.h
字號:
/****************************************************************************************
* Copyright (c) 2002 ZORAN Corporation, All Rights Reserved
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
* File: $Workfile: ECMA119.h $
*
* Description:
* ============
*
*
* Log:
* ====
* $Revision: 3 $
* Last Modified by $Author: Leslie $ at $Modtime: 03-01-30 16:34 $
****************************************************************************************
* Updates:
****************************************************************************************
* $Log: /SourceCode/I64_Common/I64_Reference/Playcore/FileSys/ISO9660/ECMA119.h $
*
* 3 03-01-30 23:13 Leslie
* Add new FILEREC struct type
*
* 5 23/04/02 9:30 Nirm
* - Added dependency in "Config.h".
*
* 4 27/01/02 17:32 Nirm
* Added support for Short Filenames (to reduce memory consumption).
*
* 3 1/10/02 15:29 Idan
* Corrected Include-Paths + added a define for memory optimization
*
* 2 12/31/01 19:46 Idan
* initializing the ISO9660 FS is working.
*
* 1 12/27/01 14:19 Idan
*
****************************************************************************************/
/////////////////////////////////////////////////////////////////////////////
// ECMA119.h - Definitions and Data-Structures described in ECMA-119 (ISO-9660)
//
// Author: Nir Milstein
#include "Config.h" // Global Configuration - do not remove!
#ifndef __ECMA_119_H_
#define __ECMA_119_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 LOGICAL_BLOCK_SIZE 2048
/////////////////////////////////////////////////////////////////////////////
// Recording of Descriptor Fields (ECMA-119 7)
// 16-bit Numerical Value (ECMA-167 7.2)
typedef UINT16 LB16; // A Little-Endian 16-bit (ECMA-119 7.2.1)
typedef UINT16 MB16; // A Big-Endian 16-bit (ECMA-119 7.2.2)
// Both-Bytes 16-bit (ECMA-119 7.2.3)
typedef struct BB16_TAG {
LB16 wLE16; // Little-Endian
MB16 wBE16; // Big-Endian
} BB16;
// 32-bit Numerical Value (ECMA-167 7.3)
typedef UINT32 LB32; // A Little-Endian 32-bit (ECMA-119 7.3.1)
typedef UINT32 MB32; // A Big-Endian 32-bit (ECMA-119 7.3.2)
// Both-Bytes 32-bit (ECMA-119 7.3.3)
typedef struct BB32_TAG {
LB32 dwLE32; // Little-Endian
MB32 dwBE32; // Big-Endian
} BB32;
// Separators (ECMA-119 7.4.3)
#define SEPARATOR1 0x2E
#define SEPARATOR2 0x3B
// File-Identifier (ECMA-119 7.5.1)
#define SHORT_ID_LENGTH 32
/////////////////////////////////////////////////////////////////////////////
// Volume Descriptors (ECMA-119 8)
#define VOLUME_DESC_LEN 2048
#define STANDARD_ID_LEN 5
// Generic Volume Descriptor (ECMA-119 8.1)
struct GenericVolumeStructureDesc {
UINT8 uVolumeDescType;
BYTE aStandardID[STANDARD_ID_LEN];
UINT8 uVolumeDescVersion;
BYTE aReserved[2041];
};
#define STANDARD_ID_CD001 "CD001"
#define DESC_TYPE_BOOT 0
#define DESC_TYPE_PRIMARY_VOLUME 1
#define DESC_TYPE_SUPPL_VOLUME 2
#define DESC_TYPE_VOLUME_PARTITION 3
#define DESC_TYPE_TERMINATOR 255
// Boot Record (ECMA-119 8.2)
struct BootRecordDesc {
UINT8 uVolumeDescType;
BYTE aStandardID[STANDARD_ID_LEN];
UINT8 uVolumeDescVersion;
BYTE sBootSystemID[32];
BYTE sBootID[32];
BYTE aBootSystemUse[1977];
};
// Volume Descriptor-Set Terminator (ECMA-119 8.3)
#define VolumeDescriptorSetTerminator GenericVolumeStructureDesc
// Root-Directory Record (ECMA-119 8.9.1)
// Record Timestamp (ECMA-119 9.1.5)
typedef struct RecordTimestamp_TAG {
BYTE uYear; // Since 1900
BYTE uMonth;
BYTE uDay;
BYTE uHour;
BYTE uMinute;
BYTE uSecond;
BYTE uGMT_Offset;
} RecordTimestamp;
struct ReservedDirRecord {
UINT8 cbLengthOfDirRecord;
UINT8 cbExtendedAttrRecordLength;
BB32 dwExtentLocation;
BB32 dwDataLength;
RecordTimestamp rtsRecording;
UINT8 uFlags;
UINT8 uFileUnitSize;
UINT8 uInterleaveGapSize;
BB16 uVolumeSequenceNumber;
UINT8 cbLengthOfDirID;
BYTE cDirID;
};
// Primary-Volume Descriptor (ECMA-119 8.4)
#define MAX_ID_LENGTH 128
// Volume Timestamp (ECMA-119 8.4.26.1)
typedef struct VolumeTimestamp_TAG {
BYTE sYear[4];
BYTE sMonth[2];
BYTE sDay[2];
BYTE sHour[2];
BYTE sMinute[2];
BYTE sSecond[2];
BYTE sHundredthsOfSec[2];
BYTE uGMT_Offset;
} VolumeTimestamp;
struct PrimaryVolumeDesc {
UINT8 uVolumeDescType;
BYTE aStandardID[STANDARD_ID_LEN];
UINT8 uVolumeDescVersion;
UINT8 uUnused1;
BYTE sSystemID[32];
BYTE sVolumeID[32];
BYTE aUnused2[8];
BB32 dwVolumeSpaceSize;
BYTE aUnused3[32];
BB16 uVolumeSetSize;
BB16 uVolumeSequenceNumber;
BB16 uLogicalBlockSize;
BB32 dwPathTableSize;
LB32 dwLocationOfLPathTable;
LB32 dwLocationOfOptionalLPathTable;
MB32 dwLoactionOfMPathTable;
MB32 dwLoactionOfOptionalMPathTable;
struct ReservedDirRecord rdrRootDir;
BYTE sVolumeSetID[MAX_ID_LENGTH];
BYTE sPublisherID[MAX_ID_LENGTH];
BYTE sDataPreparerID[MAX_ID_LENGTH];
BYTE sApplicationID[MAX_ID_LENGTH];
BYTE sCopyrightFileID[37];
BYTE sAbstractFileID[37];
BYTE sBibliographicFileID[37];
VolumeTimestamp vtsCreation;
VolumeTimestamp vtsModification;
VolumeTimestamp vtsExpiration;
VolumeTimestamp vtsEffective;
UINT8 uFileStructureVersion;
UINT8 uReserved;
BYTE aApplicationUse[512];
BYTE aReserved[653];
};
// Supplementary Volume Descriptor (ECMA-119 8.5)
struct SupplementaryVolumeDesc {
UINT8 uVolumeDescType;
BYTE aStandardID[STANDARD_ID_LEN];
UINT8 uVolumeDescVersion;
UINT8 uVolumeFlags;
BYTE sSystemID[32];
BYTE sVolumeID[32];
BYTE aUnused1[8];
BB32 dwVolumeSpaceSize;
BYTE aEscapeSequences[32];
BB16 uVolumeSetSize;
BB16 uVolumeSequenceNumber;
BB16 uLogicalBlockSize;
BB32 dwPathTableSize;
LB32 dwLocationOfLPathTable;
LB32 dwLocationOfOptionalLPathTable;
MB32 dwLoactionOfMPathTable;
MB32 dwLoactionOfOptionalMPathTable;
struct ReservedDirRecord rdrRootDir;
BYTE sVolumeSetID[MAX_ID_LENGTH];
BYTE sPublisherID[MAX_ID_LENGTH];
BYTE sDataPreparerID[MAX_ID_LENGTH];
BYTE sApplicationID[MAX_ID_LENGTH];
BYTE sCopyrightFileID[37];
BYTE sAbstractFileID[37];
BYTE sBibliographicFileID[37];
VolumeTimestamp vtsCreation;
VolumeTimestamp vtsModification;
VolumeTimestamp vtsExpiration;
VolumeTimestamp vtsEffective;
UINT8 uFileStructureVersion;
UINT8 uReserved;
BYTE aApplicationUse[512];
BYTE aReserved[653];
};
// Volume Partition Descriptor (ECMA-119 8.6)
struct VolumePartitionDesc {
UINT8 uVolumeDescType;
BYTE aStandardID[STANDARD_ID_LEN];
UINT8 uVolumeDescVersion;
UINT8 uUnused;
BYTE aSystemID[32];
BYTE aVolumePartitionID[32];
BB32 dwVolumePartitionLocation;
BB32 dwVolumePartitionSize;
BYTE aSystemUse[1960];
};
/////////////////////////////////////////////////////////////////////////////
// File and Directory Descriptors (ECMA-119 9)
// Directory/File Record (ECMA-119 9.1)
struct DirFileRecord {
UINT8 cbLengthOfDirRecord;
UINT8 cbExtendedAttrRecordLength;
BB32 dwExtentLocation;
BB32 dwDataLength;
RecordTimestamp rtsRecording;
UINT8 uFlags;
UINT8 uFileUnitSize;
UINT8 uInterleaveGapSize;
BB16 uVolumeSequenceNumber;
UINT8 cbLengthOfFileID;
BYTE sFileID[];
BYTE aPadding[];
BYTE aSystemUse[];
};
struct FILEREC
{ // Total size MUST fit a multiple of DWORDs
UINT32 StartAddr; /* 4 bytes : Location start block address */
UINT32 Size; /* 4 bytes : File size in Bytes */
WCHAR Name[CLIPS_MAX_FILENAME_LEN]; /* xx bytes : File Name */
UINT8 FileType; /* 1 byte ; index of the file type */
};
#define FILE_FLAGS_HIDDEN 0x01
#define FILE_FLAGS_DIRECTORY 0x02
#define FILE_FLAGS_ASSOCIATED 0x04
#define FILE_FLAGS_RECORD_VALID 0x08
#define FILE_FLAGS_PROTECTION 0x10
#define FILE_FLAGS_MULTI_EXT 0x80
#define FILE_FILEID_CURRENT "\00"
#define FILE_FILEID_PARENT "\01"
// The following two variants of the Dir/File Record are used to access the
// members in a 32-bit Word-aligned manner.
struct DirFileRecord_Aligned {
BYTE aPadding[2];
struct DirFileRecord dfrRec;
};
struct ReservedDirRecord_Aligned {
BYTE aPadding[2];
struct ReservedDirRecord rdrRec;
};
// DVD Copyright-Management Information of System-Use (DVD-ROM Spec., Part 2: File-System, 3.7.2)
struct DirFileRecordSystemUse_DVD {
BYTE ucCGMSInfo;
UINT8 uDataStructureType;
BYTE aProtectionSystemInfo[4];
};
// Path-Table Record (ECMA-119 9.4)
struct PathTableRecord {
UINT8 cbLengthOfDirID;
UINT8 cbExtendedAttrRecordLength;
#ifdef MOTOROLA
MB32 dwExtentLocation;
MB16 uParentDirNumber;
#else
LB32 dwExtentLocation;
LB16 uParentDirNumber;
#endif //MOTOROLA
BYTE sDirID[];
BYTE aPadding[];
};
// The following variant of the Path-Table Record is used to access the
// members in a 32-bit Word-aligned manner.
struct PathTableRecord_Aligned {
BYTE aPadding[2];
struct PathTableRecord ptrRec;
};
// Extended Attribute Record (ECMA-119 9.5)
// Note: This class is not required
/////////////////////////////////////////////////////////////////////////////
// Implementation-Specific auxiliary structures
struct GenericVolumeStructureDesc_Base {
UINT8 uVolumeDescType;
BYTE aStandardID[STANDARD_ID_LEN];
UINT8 uVolumeDescVersion;
};
#define PARTIAL_VOLUME_DESC_OFFSET 40
#define DATA_PREPARER_IDENTIFIER_OFFSET 446
struct VolumeDesc_Partial {
BYTE sVolumeID[32];
BYTE aUnused2[8];
BB32 dwVolumeSpaceSize;
BYTE aEscapeSequences[32];
BB16 uVolumeSetSize;
BB16 uVolumeSequenceNumber;
BB16 uLogicalBlockSize;
BB32 dwPathTableSize;
LB32 dwLocationOfLPathTable;
LB32 dwLocationOfOptionalLPathTable;
MB32 dwLoactionOfMPathTable;
MB32 dwLoactionOfOptionalMPathTable;
struct ReservedDirRecord rdrRootDir;
};
#pragma pack()
#endif //__ECMA_119_H_
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -