📄 cd.h
字号:
/*++
Copyright (c) 1989-2000 Microsoft Corporation
Module Name:
Cd.h
Abstract:
This module defines the on-disk structure of the Cdfs file system.
--*/
#ifndef _CDFS_
#define _CDFS_
//
// Sector size on Cdrom disks is hard-coded to 2048
//
#ifndef SECTOR_SIZE
#define SECTOR_SIZE (2048)
#endif
#define RAW_SECTOR_SIZE (2352)
#define SECTOR_MASK (SECTOR_SIZE - 1)
#define INVERSE_SECTOR_MASK ~(SECTOR_SIZE - 1)
#ifndef SECTOR_SHIFT
#define SECTOR_SHIFT (11)
#endif
#define XA_SECTOR_SIZE (2352)
//
// Cdfs file id is a large integer.
//
typedef LARGE_INTEGER FILE_ID;
typedef FILE_ID *PFILE_ID;
//
// The following constants are values from the disk.
//
#define FIRST_VD_SECTOR (16)
#define VOL_ID_LEN (5)
#define ESC_SEQ_LEN (3)
#define VERSION_1 (1)
#define VD_TERMINATOR (255)
#define VD_PRIMARY (1)
#define VD_SECONDARY (2)
#define VOLUME_ID_LENGTH (32)
//
// Leave the following so that CdfsBoot.c will compile
//
#define CD_SECTOR_SIZE (2048)
#define ISO_VOL_ID "CD001"
#define HSG_VOL_ID "CDROM"
#define ISO_ATTR_MULTI 0x0080
#define ISO_ATTR_DIRECTORY 0x0002
#define MIN_DIR_REC_SIZE (sizeof( RAW_DIR_REC ) - MAX_FILE_ID_LENGTH)
#define RVD_STD_ID( r, i ) (i ? r->StandardId : \
((PRAW_HSG_VD) r)->StandardId )
#define RVD_DESC_TYPE( r, i ) (i ? r->DescType : \
((PRAW_HSG_VD) r)->DescType )
#define RVD_VERSION( r, i ) (i ? r->Version : \
((PRAW_HSG_VD) r)->Version )
#define RVD_LB_SIZE( r, i ) (i ? r->LogicalBlkSzI : \
((PRAW_HSG_VD) r)->LogicalBlkSzI )
#define RVD_VOL_SIZE( r, i ) (i ? r->VolSpaceI : \
((PRAW_HSG_VD) r)->VolSpaceI )
#define RVD_ROOT_DE( r, i ) (i ? r->RootDe : \
((PRAW_HSG_VD) r)->RootDe )
#define DE_FILE_FLAGS( iso, de ) (iso ? de->FlagsISO : de->FlagsHSG)
//
// Data track flag for track entries in TOC
//
#define TOC_DATA_TRACK (0x04)
#define TOC_LAST_TRACK (0xaa)
//
// There is considerable rearrangement of the volume descriptors for
// ISO and HSG. However, within each standard the same structure can
// be used for both the primary and secondary descriptors.
//
// Both of these structures are aligned correctly so that no
// special macros will be needed to unpack them.
//
//
// Declaration of length of root directory entry in volume descriptor
//
#define LEN_ROOT_DE (34)
//
// Maximum length of file ID on the disk. We allow file size beyond the ISO 9660
// standard.
//
#define MAX_FILE_ID_LENGTH (255)
typedef struct _RAW_ISO_VD {
UCHAR DescType; // volume type: 1 = standard, 2 = coded
UCHAR StandardId[5]; // volume structure standard id = CD001
UCHAR Version; // volume structure version number = 1
UCHAR VolumeFlags; // volume flags
UCHAR SystemId[32]; // system identifier
UCHAR VolumeId[32]; // volume identifier
UCHAR Reserved[8]; // reserved 8 = 0
ULONG VolSpaceI; // size of the volume in LBN's Intel
ULONG VolSpaceM; // size of the volume in LBN's Motorola
UCHAR CharSet[32]; // character set bytes 0 = ASCII
USHORT VolSetSizeI; // volume set size Intel
USHORT VolSetSizeM; // volume set size Motorola
USHORT VolSeqNumI; // volume set sequence number Intel
USHORT VolSeqNumM; // volume set sequence number Motorola
USHORT LogicalBlkSzI; // logical block size Intel
USHORT LogicalBlkSzM; // logical block size Motorola
ULONG PathTableSzI; // path table size in bytes Intel
ULONG PathTableSzM; // path table size in bytes Motorola
ULONG PathTabLocI[2]; // LBN of 2 path tables Intel
ULONG PathTabLocM[2]; // LBN of 2 path tables Motorola
UCHAR RootDe[LEN_ROOT_DE];// dir entry of the root directory
UCHAR VolSetId[128]; // volume set identifier
UCHAR PublId[128]; // publisher identifier
UCHAR PreparerId[128]; // data preparer identifier
UCHAR AppId[128]; // application identifier
UCHAR Copyright[37]; // file name of copyright notice
UCHAR Abstract[37]; // file name of abstract
UCHAR Bibliograph[37]; // file name of bibliography
UCHAR CreateDate[17]; // volume creation date and time
UCHAR ModDate[17]; // volume modification date and time
UCHAR ExpireDate[17]; // volume expiration date and time
UCHAR EffectDate[17]; // volume effective date and time
UCHAR FileStructVer; // file structure version number = 1
UCHAR Reserved3; // reserved
UCHAR ResApp[512]; // reserved for application
UCHAR Reserved4[653]; // remainder of 2048 bytes reserved
} RAW_ISO_VD;
typedef RAW_ISO_VD *PRAW_ISO_VD;
typedef struct _RAW_HSG_VD {
ULONG BlkNumI; // logical block number Intel
ULONG BlkNumM; // logical block number Motorola
UCHAR DescType; // volume type: 1 = standard, 2 = coded
UCHAR StandardId[5]; // volume structure standard id = CDROM
UCHAR Version; // volume structure version number = 1
UCHAR VolumeFlags; // volume flags
UCHAR SystemId[32]; // system identifier
UCHAR VolumeId[32]; // volume identifier
UCHAR Reserved[8]; // reserved 8 = 0
ULONG VolSpaceI; // size of the volume in LBN's Intel
ULONG VolSpaceM; // size of the volume in LBN's Motorola
UCHAR CharSet[32]; // character set bytes 0 = ASCII
USHORT VolSetSizeI; // volume set size Intel
USHORT VolSetSizeM; // volume set size Motorola
USHORT VolSeqNumI; // volume set sequence number Intel
USHORT VolSeqNumM; // volume set sequence number Motorola
USHORT LogicalBlkSzI; // logical block size Intel
USHORT LogicalBlkSzM; // logical block size Motorola
ULONG PathTableSzI; // path table size in bytes Intel
ULONG PathTableSzM; // path table size in bytes Motorola
ULONG PathTabLocI[4]; // LBN of 4 path tables Intel
ULONG PathTabLocM[4]; // LBN of 4 path tables Motorola
UCHAR RootDe[LEN_ROOT_DE];// dir entry of the root directory
UCHAR VolSetId[128]; // volume set identifier
UCHAR PublId[128]; // publisher identifier
UCHAR PreparerId[128]; // data preparer identifier
UCHAR AppId[128]; // application identifier
UCHAR Copyright[32]; // file name of copyright notice
UCHAR Abstract[32]; // file name of abstract
UCHAR CreateDate[16]; // volume creation date and time
UCHAR ModDate[16]; // volume modification date and time
UCHAR ExpireDate[16]; // volume expiration date and time
UCHAR EffectDate[16]; // volume effective date and time
UCHAR FileStructVer; // file structure version number
UCHAR Reserved3; // reserved
UCHAR ResApp[512]; // reserved for application
UCHAR Reserved4[680]; // remainder of 2048 bytes reserved
} RAW_HSG_VD;
typedef RAW_HSG_VD *PRAW_HSG_VD;
typedef struct _RAW_JOLIET_VD {
UCHAR DescType; // volume type: 2 = coded
UCHAR StandardId[5]; // volume structure standard id = CD001
UCHAR Version; // volume structure version number = 1
UCHAR VolumeFlags; // volume flags
UCHAR SystemId[32]; // system identifier
UCHAR VolumeId[32]; // volume identifier
UCHAR Reserved[8]; // reserved 8 = 0
ULONG VolSpaceI; // size of the volume in LBN's Intel
ULONG VolSpaceM; // size of the volume in LBN's Motorola
UCHAR CharSet[32]; // character set bytes 0 = ASCII, Joliett Seq here
USHORT VolSetSizeI; // volume set size Intel
USHORT VolSetSizeM; // volume set size Motorola
USHORT VolSeqNumI; // volume set sequence number Intel
USHORT VolSeqNumM; // volume set sequence number Motorola
USHORT LogicalBlkSzI; // logical block size Intel
USHORT LogicalBlkSzM; // logical block size Motorola
ULONG PathTableSzI; // path table size in bytes Intel
ULONG PathTableSzM; // path table size in bytes Motorola
ULONG PathTabLocI[2]; // LBN of 2 path tables Intel
ULONG PathTabLocM[2]; // LBN of 2 path tables Motorola
UCHAR RootDe[LEN_ROOT_DE];// dir entry of the root directory
UCHAR VolSetId[128]; // volume set identifier
UCHAR PublId[128]; // publisher identifier
UCHAR PreparerId[128]; // data preparer identifier
UCHAR AppId[128]; // application identifier
UCHAR Copyright[37]; // file name of copyright notice
UCHAR Abstract[37]; // file name of abstract
UCHAR Bibliograph[37]; // file name of bibliography
UCHAR CreateDate[17]; // volume creation date and time
UCHAR ModDate[17]; // volume modification date and time
UCHAR ExpireDate[17]; // volume expiration date and time
UCHAR EffectDate[17]; // volume effective date and time
UCHAR FileStructVer; // file structure version number = 1
UCHAR Reserved3; // reserved
UCHAR ResApp[512]; // reserved for application
UCHAR Reserved4[653]; // remainder of 2048 bytes reserved
} RAW_JOLIET_VD;
typedef RAW_JOLIET_VD *PRAW_JOLIET_VD;
//
// Macros to access the different volume descriptors.
//
#define CdRvdId(R,F) ( \
FlagOn( (F), VCB_STATE_HSG ) ? \
((PRAW_HSG_VD) (R))->StandardId : \
((PRAW_ISO_VD) (R))->StandardId \
)
#define CdRvdVersion(R,F) ( \
FlagOn( (F), VCB_STATE_HSG ) ? \
((PRAW_HSG_VD) (R))->Version : \
((PRAW_ISO_VD) (R))->Version \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -