⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 microudfclasstypes.pas

📁 用于CD/DVD烧录的Delphi源码,包括source和demo
💻 PAS
📖 第 1 页 / 共 2 页
字号:
{-----------------------------------------------------------------------------
 Unit Name: MicroUDFClassTypes
 Author:    Dancemammal
 Purpose:   Volume discriptors for MicroUDF File system
 History:   First Release
-----------------------------------------------------------------------------}


Unit MicroUDFClassTypes;

interface

Uses
     Windows, Messages, SysUtils, Classes, Graphics, Controls,
     MicroUDFConsts;


Type
 Dstring = Char;

Type
(* Character set specification (ECMA 167r3 1/7.2.1) *)
     UDF_CharSpec = packed record
          CharSetType : Byte;                    //OSTA_CS0_CHARACTER_SET_TYPE
          CharSetInfo : array [0..62] of Char;   //OSTA_CS0_CHARACTER_SET_INFO
     end;

  PUDF_CharSpec = ^UDF_CharSpec;


(* Timestamp (ECMA 167r3 1/7.3) *)
     UDF_Timestamp = packed record
          TypeAndTimezone        : Word;
          Year                   : Word;
          Month                  : Byte;
          Day                    : Byte;
          Hour                   : Byte;
          Minute                 : Byte;
          Second                 : Byte;
          Centiseconds           : Byte;
          HundredsOfMicroseconds : Byte;
          Microseconds           : Byte;
     end;
    PUDF_TimeStamp = ^UDF_TimeStamp;


(* Recorded Address (ECMA 167r3 4/7.1) *)

Type
  UDF_RecordedAddress = packed record
    LogicalBlockNum       : DWord;
    PartitionReferenceNum : Word;
  end;

  PUDF_RecordedAddress = ^UDF_RecordedAddress;

(* Short Allocation Descriptor (ECMA 167r3 4/14.14.1) *)
  UDF_ShortAllocationDescriptor = packed record
    ExtentLength     : DWord;
    ExtentPosition   : DWord;
  end;

  PUDF_ShortAllocationDescriptor = ^UDF_ShortAllocationDescriptor;


(* Long Allocation Descriptor (ECMA 167r3 4/14.14.2) *)
  UDF_LongAllocationDescriptor = packed record
    ExtentLength        : DWord;
    ExtentLocation      : UDF_RecordedAddress;
    ImplementationUse   : packed array [0..5] of Byte;
  end;

  PUDF_LongAllocationDescriptor = ^UDF_LongAllocationDescriptor;



(* Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) *)
  UDF_ExtendedAllocationDescriptor = packed record
    ExtentLength         : DWord;
    RecordedLength       : DWord;
    InformationLength    : DWord;
    ExtentLocation       : UDF_RecordedAddress;
    ImplementationUse    : packed array [0..1] of Byte;
  end;
  PUDF_ExtendedAllocationDescriptor = ^UDF_ExtendedAllocationDescriptor;


(* Entity identifier (ECMA 167r3 1/7.4) *)
Type
  UDF_EntityIdentifier = packed record
    Flags             : Byte;
    Identifier        : packed array [0..22] of Char;
    IdentifierSuffix  : packed array [0..7] of Char;
  end;

    PUDF_EntityIdentifier = ^UDF_EntityIdentifier;



Type
(* Volume Structure Descriptor (ECMA 167r3 2/9.1) *)
  UDF_VolumeStructureDescriptor = packed record
    StructureType       : Byte;
    StandardIdentifier  : packed array [0..VSD_STD_ID_LEN-1] of Char;
    StructureVersion    : Byte;
    StructureData       : packed array [0..2040] of Byte;
  end;

  PUDF_VolumeStructureDescriptor = ^UDF_VolumeStructureDescriptor;




(* Beginning Extended Area Descriptor (ECMA 167r3 2/9.2) *)

Type
     UDF_BeginningExtendedAreaDesc = packed record
          StructureType       : Byte;
          StandardIdentifier  : array [0..VSD_STD_ID_LEN-1] of Char;
          StructureVersion    : Byte;
          StructureData       : array [0..2040] of Byte;
     end;
      PUDF_BeginningExtendedAreaDesc = ^UDF_BeginningExtendedAreaDesc;


(* Terminating Extended Area Descriptor (ECMA 167r3 2/9.3) *)
     UDF_TerminatingExtendedAreaDesc = packed record
          StructureType       : Byte;
          StandardIdentifier  : array [0..VSD_STD_ID_LEN-1] of Char;
          StructureVersion    : Byte;
          StructureData       : array [0..2040] of Byte;
     end;
       PUDF_TerminatingExtendedAreaDesc = ^UDF_TerminatingExtendedAreaDesc;


(* Boot Descriptor (ECMA 167r3 2/9.4) *)
     UDF_BootDesc = packed record
          StructureType                       : Byte;
          StandardIdentifier                  : array [0..VSD_STD_ID_LEN-1] of Char;
          StructureVersion                    : Byte;
          Reserved1                           : Byte;
          ArchitectureType                    : UDF_EntityIdentifier;
          BootIdentifier                      : UDF_EntityIdentifier;
          BootExtentLocation                  : DWord;
          BootExtentLength                    : DWord;
          loadAddress                         : Int64;
          StartAddress                        : Int64;
          DescriptorCreationDateAndTime       : UDF_Timestamp;
          Flags                               : Word;
          Reserved2                           : array [0..31] of Byte;
          BootUse                             : array [0..1905] of Byte;
     end;
       PUDF_BootDesc = ^UDF_BootDesc;



(* Extent Descriptor (ECMA 167r3 3/7.1) *)
Type
  UDF_ExtentDescriptor = packed record
    ExtentLength     : DWord;
    ExtentLocation   : DWord;
  end;
    PUDF_ExtentDescriptor = ^UDF_ExtentDescriptor;



(* Tag Identifier (ECMA 167r3 3/7.2.1) *
    TAG_IDENT_PVD                        = $0001;
    TAG_IDENT_AVDP                       = $0002;
    TAG_IDENT_VDP                        = $0003;
    TAG_IDENT_IUVD                       = $0004;
    TAG_IDENT_PD                         = $0005;
    TAG_IDENT_LVD                        = $0006;
    TAG_IDENT_USD                        = $0007;
    TAG_IDENT_TD                         = $0008;
    TAG_IDENT_LVID                       = $0009; }

(* Descriptor Tag (ECMA 167r3 3/7.2) *)
  UDF_DescriptorTag = packed record
    TagIdentifier        : Word;
    DescriptorVersion    : Word;
    TagChecksum          : Byte;
    Reserved             : Byte;
    TagSerialNumber      : Word;
    DescriptorCRC        : Word;
    DescriptorCRCLength  : Word;
    TagLocation          : DWord;
  end;
   PUDF_DescriptorTag = ^UDF_DescriptorTag;



Type
     UDF_TDB = packed record
          T               : Byte;
          D               : Byte;
          I               : Byte;
          Length          : Word;
          Res             : Byte;
          LowestTrack     : Byte;
          HighestTrack    : Byte;
          TrackNumber     : Byte;
          RecordingMethod : Byte;
          PacketSize      : packed array [0..2] of Byte;
          Res1            : packed array [0..10] of Byte;
     end;
      PUDF_TDB = ^UDF_TDB;


(* NSR Descriptor (ECMA 167r3 3/9.1) *)
     UDF_NSRDescriptor = record
          StructureType      : Byte;
          StandardIdentifier : array [0..VSD_STD_ID_LEN-1] of Char;
          StructureVersion   : Byte;
          Reserved           : Byte;
          StructureData      : array [0..2039] of Byte;
     end;
      PUDF_NSRDescriptor = ^UDF_NSRDescriptor;



(* Primary Volume Descriptor (ECMA 167r3 3/10.1) *)
  UDF_PrimaryVolumeDescriptor = packed record
    DescriptorTag                        : UDF_DescriptorTag;
    VolumeDescriptorSequenceNumber       : DWord;
    PrimaryVolumeDescriptorNumber        : DWord;
    VolumeIdentifier                     : packed array [0..31] of dstring;
    VolumeSequenceNumber                 : Word;
    MaximumVolumeSequenceNumber          : Word;
    InterchangeLevel                     : Word;
    MaximumInterchangeLevel              : Word;
    CharacterSetList                     : DWord;
    MaximumCharacterSetList              : DWord;
    VolumeSetIdentifier                  : packed array [0..127] of dstring;
    DescriptorCharacterSet               : UDF_CharSpec;
    ExplanatoryCharacterSet              : UDF_CharSpec;
    VolumeAbstract                       : UDF_ExtentDescriptor;
    VolumeCopyrightNotice                : UDF_ExtentDescriptor;
    ApplicationIdentifier                : UDF_EntityIdentifier;
    RecordingDateAndTime                 : UDF_TimeStamp;
    ImplementationIdentifier             : UDF_EntityIdentifier;
    ImplementationUse                    : packed array [0..63] of Byte;
    PredecessorVolumeDescriptorSequenceLocation : Byte;
    Flags                                : Word;
    Reserved                             : packed array [0..21] of Byte;
  end;
   PUDF_PrimaryVolumeDescriptor = ^UDF_PrimaryVolumeDescriptor;


Type
(* Anchor Volume Descriptor Pointer (ECMA 167r3 3/10.2) *)
  UDF_AnchorVolumeDescriptorPointer = packed record
    DescriptorTag                         : UDF_DescriptorTag;
    MainVolumeDescriptorSequenceExtent    : UDF_ExtentDescriptor;
    ReserveVolumeDescriptorSequenceExtent : UDF_ExtentDescriptor;
    Reserved                              : packed array [0..479] of Byte;
  end;
   PUDF_AnchorVolumeDescriptorPointer = ^UDF_AnchorVolumeDescriptorPointer;

(* Volume Descriptor Pointer (ECMA 167r3 3/10.3) *)
  UDF_VolumeDescriptorPointer = packed record
    DescriptorTag                      : UDF_DescriptorTag;
    VolumeDescriptorSequenceNumber     : DWord;
    NextVolumeDescriptorSequenceExtent : UDF_ExtentDescriptor;
    Reserved                           : packed array [0..483] of Byte;
  end;
   PUDF_VolumeDescriptorPointer = ^UDF_VolumeDescriptorPointer;


(* LV information (UDF2.01,2.2.7.2*)
  UDF_LVInformation = packed record
    LVICharset               : UDF_CharSpec;
    LogicalVolumeIdentifier  : packed array [0..127] of dstring;
    LVInfo1                  : packed array [0..35] of dstring;
    LVInfo2                  : packed array [0..35] of dstring;
    LVInfo3                  : packed array [0..35] of dstring;
    ImplementionID           : UDF_EntityIdentifier;
    ImplementationUse        : packed array [0..127] of Byte;
  end;
   PUDF_LVInformation = ^UDF_LVInformation;


(* Implementation Use Volume Descriptor (ECMA 167r3 3/10.4) *)
  UDF_ImplementationUseVolumeDescriptor = packed record
    DescriptorTag                   : UDF_DescriptorTag;
    VolumeDescriptorSequenceNumber  : DWord;
    ImplementationIdentifier        : UDF_EntityIdentifier;
    LVInformation                   : UDF_LVInformation;
  end;
   PUDF_ImplementationUseVolumeDescriptor = ^UDF_ImplementationUseVolumeDescriptor;



(* Partition Descriptor (ECMA 167r3 3/10.5) *)
  UDF_PartitionDescriptor = packed record
    DescriptorTag                       : UDF_DescriptorTag;
    VolumeDescriptorSequenceNumber      : DWord;
    PartitionFlags                      : Word;
    PartitionNumber                     : Word;
    PartitionContents                   : UDF_EntityIdentifier;
    PartitionContentsUse                : packed array [0..127] of Byte;
    AccessType                          : DWord;
    PartitionStartingLocation           : DWord;
    PartitionLength                     : DWord;
    ImplementationIdentifier            : UDF_EntityIdentifier;
    ImplementationUse                   : packed array [0..127] of Byte;
    Reserved                            : packed array [0..155] of Byte;
  end;
   PUDF_PartitionDescriptor = ^UDF_PartitionDescriptor;





Type
     UDF_PartitionMapType1 = packed record
          PartitionMapType     : Byte;
          PartitionMapLength   : Byte;
          VolumeSeqNumber      : Word;
          partitionNumber      : Word;
     end;
       PUDF_PartitionMapType1 = ^UDF_PartitionMapType1;


     UDF_partitionMapType2 = packed record
          PartitionMapType     : Byte;
          PartitionMapLength   : Byte;
          Res                  : packed array [0..1] of Byte;
          Ident                : UDF_EntityIdentifier;
          VolumeSeqNumber      : Word;
          PartitionNumber      : Word;
          reserved             : packed array [0..23] of Byte;
     end;
      PUDF_partitionMapType2 = ^UDF_partitionMapType2;


(* Logical Volume Descriptor (ECMA 167r3 3/10.6) *)
     UDF_logicalVolDesc = packed record
          DescriptorTag            : UDF_DescriptorTag;
          VolumeDescSeqNum         : DWord;
          DescriptorCharacterSet   : UDF_CharSpec;
          LogicalVolumeIdentifier  : packed array [0..127] of dstring;
          LogicalBlockSize         : DWord;
          DomainIdentifier         : UDF_EntityIdentifier;
          LogicalVolumeContentsUse : UDF_LongAllocationDescriptor;
          MapTableLength           : DWord;
          NumPartitionMaps         : DWord;
          ImplementationIdentifier : UDF_EntityIdentifier;
          ImplementationUse        : array [0..127] of Byte;
          IntegritySequenceExtent  : UDF_ExtentDescriptor;
          partitionMap1            : UDF_PartitionMapType1;
          partitionMap2            : UDF_partitionMapType2;
     end;
       PUDF_logicalVolDesc = ^UDF_logicalVolDesc;


(* Generic Partition Map (ECMA 167r3 3/10.7.1) *)
     UDF_GenericPartitionMap = packed record
          PartitionMapType        : Byte;
          PartitionMapLength      : Byte;
          PartitionMapping1stByte : Byte;
     end;
      PUDF_GenericPartitionMap = ^UDF_GenericPartitionMap;


(* Type 1 Partition Map (ECMA 167r3 3/10.7.2) *)
     UDF_GenericPartitionMap1 = packed record
          PartitionMapType       : Byte;
          PartitionMapLength     : Byte;
          VolumeSeqNum           : Word;
          PartitionNum           : Word;
     end;
      PUDF_GenericPartitionMap1 = ^UDF_GenericPartitionMap1;

(* Type 2 Partition Map (ECMA 167r3 3/10.7.3) *)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -