Difference between revisions of "Unit VirtualDisk"
(Created page with "Return to Unit Reference === Description === ---- ''To be documented'' === Constants === ---- ''To be documented'' === Type definitions === ---- ''To...") |
|||
(15 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
---- | ---- | ||
− | '' | + | '''Ultibo Virtual Disk Interface unit''' |
=== Constants === | === Constants === | ||
---- | ---- | ||
− | '' | + | |
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Virtual disk specific constants ''' <code> VIRTUAL_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>VIRTUAL_DEVICE_DESCRIPTION = 'Virtual Disk Device';</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>VIRTUAL_CONTROLLER_DESCRIPTION = 'Virtual Disk Controller';</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Virtual flag''' <code> virtualFlag* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>virtualFlagNone = $00000000;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>virtualFlagFixed = $00000001;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>virtualFlagDynamic = $00000002;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>virtualFlagBase = $00000004;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>virtualFlagDelta = $00000008;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>virtualFlagDevice = $00000010;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>virtualFlagSplit = $00000020;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Initramfs constants''' <code> memoryInitramfs* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>memoryInitramfsName = 'INITRAMFS';</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VMware constants''' <code> vmware* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vmwareFileExtension = '.vmdk';</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vmwareFileMask = '*.vmdk';</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vmwareNoParentCID = $FFFFFFFF;</code> | ||
+ | | not($00000000) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vmwareSparseMagicNumber = $564d444b;</code> | ||
+ | | 'VMDK' | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vmwareEsxSparseMagicNumber = $44574f43;</code> | ||
+ | | 'COWD' | ||
+ | |- | ||
+ | | <code>vmwareEsxSparseMaxParentLength = 1024;</code> | ||
+ | | COWDISK_MAX_PARENT_FILELEN | ||
+ | |- | ||
+ | | <code>vmwareEsxSparseMaxNameLength = 60;</code> | ||
+ | | COWDISK_MAX_NAME_LEN | ||
+ | |- | ||
+ | | <code>vmwareEsxSparseMaxDescriptionLength = 512;</code> | ||
+ | | COWDISK_MAX_DESC_LEN | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vmwareSectorSize = 512;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VMware disk type''' <code> vmware*DiskType </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vmwareMaxDiskType = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>vmwareDiskTypeNone = 0;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VMware descriptor tag''' <code> vmwareTag* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vmwareTagDisk = 'Disk DescriptorFile';</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>vmwareTagVersion = 'version';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareTagCID = 'CID';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareTagParentCID = 'parentCID';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareTagCreateType = 'createType';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareTagExtent = 'Extent Description';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareTagDatabase = 'The Disk Data Base';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareTagDDB = 'DDB';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareTagAdapter = 'ddb.adapterType';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareTagSectors = 'ddb.geometry.sectors';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareTagHeads = 'ddb.geometry.heads';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareTagCylinders = 'ddb.geometry.cylinders';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareTagParentHint = 'parentFileNameHint';</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VMware create type''' <code> vmwareCreateType_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vmwareMaxCreateType = 11;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>vmwareCreateType_monolithicSparse = 0;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareCreateType_vmfsSparse = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareCreateType_monolithicFlat = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareCreateType_vmfs = 3;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareCreateType_twoGbMaxExtentSparse = 4;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareCreateType_twoGbMaxExtentFlat = 5;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareCreateType_fullDevice = 6;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareCreateType_vmfsRaw = 7;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareCreateType_partitionedDevice = 8;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareCreateType_vmfsRawDeviceMap = 9;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareCreateType_vmfsPassthroughRawDeviceMap = 10;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareCreateType_streamOptimized = 11;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VMware access type''' <code> vmwareAccessType_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vmwareMaxAccessType = 2;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>vmwareAccessType_RW = 0;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareAccessType_RDONLY = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareAccessType_NOACCESS = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VMware extent type''' <code> vmwareExtentType_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vmwareMaxExtentType = 6;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>vmwareExtentType_FLAT = 0;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareExtentType_SPARSE = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareExtentType_ZERO = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareExtentType_VMFS = 3;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareExtentType_VMFSSPARSE = 4;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareExtentType_VMFSRDM = 5;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareExtentType_VMFSRAW = 6;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VMware disk flag''' <code> vmwareFlag* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vmwareFlagValidTest = $00000001;</code> | ||
+ | | bit 0: valid new line detection test | ||
+ | |- | ||
+ | | <code>vmwareFlagRedundantGrain = $00000002;</code> | ||
+ | | bit 1: redundant grain table will be used | ||
+ | |- | ||
+ | | <code>vmwareFlagGrainCompressed = $00010000;</code> | ||
+ | | bit 16: the grains are compressed. The type of compression is described by compressAlgorithm | ||
+ | |- | ||
+ | | <code>vmwareFlagLBAMarkers = $00020000;</code> | ||
+ | | bit 17: there are markers in the virtual disk to identify every block of metadata or data and the markers for the virtual machine data contain a LBA | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VMware compression type''' <code> vmwareCompression* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vmwareCompressionNone = 0;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vmwareCompressionDeflate = 1;</code> | ||
+ | | The deflate algorithm is described in RFC 1951 | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VPC constants''' <code> vpc* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vpcFileExtension = '.vhd';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcUndoExtension = '.vud';</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vpcFileMask = '*.vhd';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcUndoMask = '*.vud';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcSplitMask = '*.v??';</code> | ||
+ | | .v01, v02 etc up to 64 | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vpcFooterCookie = 'conectix';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcDynamicCookie = 'cxsparse';</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vpcMaxDiskExtents = 64;</code> | ||
+ | | Maximum number of 4GB split files in a disk image | ||
+ | |- | ||
+ | | <code>vpcExtentMaxSize = 4294967296;</code> | ||
+ | | Maximum size of s split file (4GB) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vpcUnixTimeOffset = 946684800;</code> | ||
+ | | Offset from 1/1/1970 to 1/1/2000 | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vpcFooterVersion = $00010000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcDynamicVersion = $00010000;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vpcSectorSize = 512;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vpcUnallocatedBlock = $FFFFFFFF;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcFixedDiskTableOffset = $FFFFFFFFFFFFFFFF;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcDynamicDiskDataOffset = $FFFFFFFFFFFFFFFF;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vpcMaxBlockGroup = $FF;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcBlockGroupMask = $FF;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcBlockGroupOffset = $100;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VPC disk type''' <code> vpcDiskType* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vpcMaxDiskType = 6;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>vpcDiskTypeNone = 0;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcDiskTypeReserved1 = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcDiskTypeFixed = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcDiskTypeDynamic = 3;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcDiskTypeDifferencing = 4;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcDiskTypeReserved2 = 5;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcDiskTypeReserved3 = 6;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VPC feature''' <code> vpcFeature* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vpcFeatureNone = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcFeatureTemporary = $00000001;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcFeatureReserved = $00000002;</code> | ||
+ | | This bit must always be set to 1 | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VPC creator host OS''' <code> vpcCreator* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vpcCreatorWindows = $5769326B;</code> | ||
+ | | Wi2k | ||
+ | |- | ||
+ | | <code>vpcCreatorMacintosh = $4D616320;</code> | ||
+ | | Mac | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VPC platform code''' <code> vpcPlatform* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vpcPlatformNone = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vpcPlatformWi2r = $57693272;</code> | ||
+ | | Wi2r deprecated | ||
+ | |- | ||
+ | | <code>vpcPlatformWi2k = $5769326B;</code> | ||
+ | | Wi2k deprecated | ||
+ | |- | ||
+ | | <code>vpcPlatformW2ru = $57327275;</code> | ||
+ | | W2ru Unicode pathname (UTF-16) on Windows relative to the differencing disk pathname | ||
+ | |- | ||
+ | | <code>vpcPlatformW2ku = $57326B75;</code> | ||
+ | | W2ku Absolute Unicode (UTF-16) pathname on Windows | ||
+ | |- | ||
+ | | <code>vpcPlatformMac = $4D616320;</code> | ||
+ | | Mac OS alias stored as a blob | ||
+ | |- | ||
+ | | <code>vpcPlatformMacX = $4D616358;</code> | ||
+ | | MacX A file URL with UTF-8 encoding conforming to RFC 2396 | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VPC bitmap mask''' <code> vpcBitmapMask* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vpcBitmapMaskBits = 32;</code> | ||
+ | | LongWord Bitmap Masks | ||
+ | |- | ||
+ | | <code>vpcBitmapMaskNone = $00000000;</code> | ||
+ | | LongWord (Used for fast counting of free blocks) | ||
+ | |- | ||
+ | | <code>vpcBitmapMaskAll = $FFFFFFFF;</code> | ||
+ | | LongWord (Used for fast counting of used blocks) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | |colspan="2"|<code>vpcBitmapMasks:array[0..31] of LongWord = (</code> | ||
+ | |- | ||
+ | |colspan="2"|<code>$00000001,$00000002,$00000004,$00000008,$00000010,$00000020,$00000040,$00000080,</code> | ||
+ | |- | ||
+ | |colspan="2"|<code>$00000100,$00000200,$00000400,$00000800,$00001000,$00002000,$00004000,$00008000,</code> | ||
+ | |- | ||
+ | |colspan="2"|<code>$00010000,$00020000,$00040000,$00080000,$00100000,$00200000,$00400000,$00800000,</code> | ||
+ | |- | ||
+ | |colspan="2"|<code>$01000000,$02000000,$04000000,$08000000,$10000000,$20000000,$40000000,$80000000);</code> | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vpcBitmapMasks:array[0..31] of LongWord = (</code> | ||
+ | | Ordered to allow for big endian bitmap | ||
+ | |- | ||
+ | |colspan="2"|<code>$00000080,$00000040,$00000020,$00000010,$00000008,$00000004,$00000002,$00000001,</code> | ||
+ | |- | ||
+ | |colspan="2"|<code>$00008000,$00004000,$00002000,$00001000,$00000800,$00000400,$00000200,$00000100,</code> | ||
+ | |- | ||
+ | |colspan="2"|<code>$00800000,$00400000,$00200000,$00100000,$00080000,$00040000,$00020000,$00010000,</code> | ||
+ | |- | ||
+ | |colspan="2"|<code>$80000000,$40000000,$20000000,$10000000,$08000000,$04000000,$02000000,$01000000);</code> | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VirtualBox constants''' <code> vbox* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vboxFileExtension = '.vdi';</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vboxDiskBanner = '<<< Sun xVM VirtualBox Disk Image >>>';</code> | ||
+ | | Plus a LF character in some images (#10) | ||
+ | |- | ||
+ | | <code>vboxDiskVersion = $00010001;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vboxDiskSignature = $BEDA107F;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vboxFileMask = '*.vdi';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vboxPathMask = '*.*';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vboxDeltaPath = '..\Machines\';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vboxParentPath = '..\..\..\VDI\';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vboxNewParentPath = '..\..\..\HardDisks\';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vboxSnapshotPath = '\Snapshots\';</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>vboxUnallocatedBlock = $FFFFFFFF;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VirtualBox disk type''' <code> vboxDiskType* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vboxMaxDiskType = 4;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>vboxDiskTypeNone = 0;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vboxDiskTypeDynamic = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vboxDiskTypeStatic = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vboxDiskTypeUnknown = 3;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>vboxDiskTypeDifferencing = 4;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''VirtualBox disk flag''' <code> vboxDiskFlags* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>vboxDiskFlagsNone = $00000000;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Type definitions === | === Type definitions === | ||
---- | ---- | ||
− | '' | + | |
+ | '''ESX sparse extent header''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PEsxSparseExtentHeader = ^TEsxSparseExtentHeader;</code> | ||
+ | |||
+ | <code>TEsxSparseExtentHeader = packed record </code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: Always 2048 bytes (Only used for Delta disks, not Dynamic) | ||
+ | |- | ||
+ | | <code>magicNumber:LongWord;</code> | ||
+ | | 0x44574f43/'COWD' | ||
+ | |- | ||
+ | | <code>version:LongWord;</code> | ||
+ | | The value of this entry should be 1 | ||
+ | |- | ||
+ | | <code>flags:LongWord;</code> | ||
+ | | set to 3 | ||
+ | |- | ||
+ | | <code>numSectors:LongWord;</code> | ||
+ | | total number of sectors on the base disk | ||
+ | |- | ||
+ | | <code>grainSize:LongWord;</code> | ||
+ | | one sector by default. Can vary from one sector to 1MB | ||
+ | |- | ||
+ | | <code>gdOffset:LongWord;</code> | ||
+ | | starts at the fourth sector, because the COWDisk_Header structure takes four sectors | ||
+ | |- | ||
+ | | <code>numGDEntries:LongWord;</code> | ||
+ | | is CEILING(numSectors, gtCoverage) | ||
+ | |- | ||
+ | | <code>freeSector:LongWord;</code> | ||
+ | | the next free data sector. This needs to be less than the length of the delta link. It is initially set to gdOffset + numGDSectors | ||
+ | |- | ||
+ | | <code>case Integer of</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>0: (cylinders:LongWord;</code> | ||
+ | | root | ||
+ | |- | ||
+ | | <code>heads:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>sectors:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>generation:LongWord;</code> | ||
+ | | cont | ||
+ | |- | ||
+ | | <code>name:array[0..vmwareEsxSparseMaxNameLength - 1] of Char;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>description:array[0..vmwareEsxSparseMaxDescriptionLength - 1] of Char;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>savedGeneration:LongWord;</code> | ||
+ | | used to detect the unclean shutdown of the delta link. It is initially set to 0 | ||
+ | |- | ||
+ | | <code>reserved:array[0..7] of Char;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>uncleanShutdown:LongWord;</code> | ||
+ | | used to trigger the metadata consistency check in case there is an abnormal termination of the program | ||
+ | |- | ||
+ | | <code>padding:array[0..395] of Char);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>1: (parentFileName:array[0..vmwareEsxSparseMaxParentLength - 1] of Char;</code> | ||
+ | | child | ||
+ | |- | ||
+ | | <code>parentGeneration:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>generationx:LongWord;</code> | ||
+ | | cont | ||
+ | |- | ||
+ | | <code>namex:array[0..vmwareEsxSparseMaxNameLength - 1] of Char;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>descriptionx:array[0..vmwareEsxSparseMaxDescriptionLength - 1] of Char;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>savedGenerationx:LongWord;</code> | ||
+ | | used to detect the unclean shutdown of the delta link. It is initially set to 0 | ||
+ | |- | ||
+ | | <code>reservedx:array[0..7] of Char;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>uncleanShutdownx:LongWord;</code> | ||
+ | | used to trigger the metadata consistency check in case there is an abnormal termination of the program | ||
+ | |- | ||
+ | | <code>paddingx:array[0..395] of Char);</code> | ||
+ | | remaining fields are not used. They are present to maintain compatibility with legacy virtual disk formats | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''VMware sparse extent header''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PVmwareSparseExtentHeader = ^TVmwareSparseExtentHeader;</code> | ||
+ | |||
+ | <code>TVmwareSparseExtentHeader = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: Always 512 bytes (Used for both Dynamic and Delta disks) | ||
+ | |- | ||
+ | | <code>magicNumber:LongWord;</code> | ||
+ | | 0x564d444b/'VMDK' | ||
+ | |- | ||
+ | | <code>version:LongWord;</code> | ||
+ | | The value of this entry should be 1 | ||
+ | |- | ||
+ | | <code>flags:LongWord;</code> | ||
+ | | See above | ||
+ | |- | ||
+ | | <code>capacity:Int64;</code> | ||
+ | | the capacity of this extent in sectors (should be a multiple of the grain size) | ||
+ | |- | ||
+ | | <code>grainSize:Int64;</code> | ||
+ | | size of a grain in sectors (must be a power of 2 and must be greater than 8 (4KB)) | ||
+ | |- | ||
+ | | <code>descriptorOffset:Int64;</code> | ||
+ | | offset of the embedded descriptor in the extent (expressed in sectors) | ||
+ | |- | ||
+ | | <code>descriptorSize:Int64;</code> | ||
+ | | valid only if descriptorOffset is non-zero (expressed in sectors) | ||
+ | |- | ||
+ | | <code>numGTEsPerGT:LongWord;</code> | ||
+ | | the number of entries in a grain table (for VMware virtual disks is 512) | ||
+ | |- | ||
+ | | <code>rgdOffset:Int64;</code> | ||
+ | | redundant level 0 of metadata (expressed in sectors) | ||
+ | |- | ||
+ | | <code>gdOffset:Int64;</code> | ||
+ | | level 0 of metadata (expressed in sectors) | ||
+ | |- | ||
+ | | <code>overHead:Int64;</code> | ||
+ | | number of sectors occupied by the metadata | ||
+ | |- | ||
+ | | <code>uncleanShutdown:ByteBool;</code> | ||
+ | | set to FALSE when VMware software closes an extent. Four entries are used to detect when an extent file has been corrupted by transferring it using FTP in text mode. The entries should be initialized with the following values | ||
+ | |- | ||
+ | | <code>singleEndLineChar:Char;</code> | ||
+ | | '\n' | ||
+ | |- | ||
+ | | <code>nonEndLineChar:Char;</code> | ||
+ | | ' ' | ||
+ | |- | ||
+ | | <code>doubleEndLineChar1:Char;</code> | ||
+ | | '\r' | ||
+ | |- | ||
+ | | <code>doubleEndLineChar2:Char;</code> | ||
+ | | '\n' | ||
+ | |- | ||
+ | | <code>compressAlgorithm:Word;</code> | ||
+ | | See above | ||
+ | |- | ||
+ | | <code>pad:array[0..432] of Byte;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''VPC dish geometry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PVpcDiskGeometry = ^TVpcDiskGeometry;</code> | ||
+ | |||
+ | <code>TVpcDiskGeometry = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: Always 4 bytes | ||
+ | |- | ||
+ | | <code>Cylinders:Word;</code> | ||
+ | | Cylinders | ||
+ | |- | ||
+ | | <code>Heads:Byte;</code> | ||
+ | | Heads | ||
+ | |- | ||
+ | | <code>Sectors:Byte;</code> | ||
+ | | Sectors per track | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''VPC parent locator''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PVpcParentLocator = ^TVpcParentLocator;</code> | ||
+ | |||
+ | <code>TVpcParentLocator = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: Always 24 bytes | ||
+ | |- | ||
+ | | <code>PlatformCode:LongWord;</code> | ||
+ | | describes which platform-specific format is used for the file locator (see above) | ||
+ | |- | ||
+ | | <code>PlatformDataSpace:LongWord;</code> | ||
+ | | the number of 512-byte sectors needed to store the parent hard disk locator | ||
+ | |- | ||
+ | | <code>PlatformDataLength:LongWord;</code> | ||
+ | | length of the parent hard disk locator in bytes | ||
+ | |- | ||
+ | | <code>Reserved:LongWord;</code> | ||
+ | | Reserved, must be zero | ||
+ | |- | ||
+ | | <code>PlatformDataOffset:Int64;</code> | ||
+ | | offset in bytes where the platform specific file locator data is stored | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''VPC hard disk footer''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PVpcHardDiskFooter = ^TVpcHardDiskFooter;</code> | ||
+ | |||
+ | <code>TVpcHardDiskFooter = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: Always 512 bytes (At end of file on Fixed disks, at start and end on Dynamic and Differencing disks) | ||
+ | |- | ||
+ | | <code>Cookie:array[0..7] of Char;</code> | ||
+ | | conectix | ||
+ | |- | ||
+ | | <code>Features:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Version:LongWord;</code> | ||
+ | | 0x00010000 | ||
+ | |- | ||
+ | | <code>DataOffset:Int64;</code> | ||
+ | | Offset to Dynamic Disk Header, Must be 0xFFFFFFFF for Fixed Disks | ||
+ | |- | ||
+ | | <code>TimeStamp:LongWord;</code> | ||
+ | | seconds since January 1, 2000 12:00:00 AM in UTC/GMT (Unix Time minus 30 years) | ||
+ | |- | ||
+ | | <code>CreatorApplication:array[0..3] of Char;</code> | ||
+ | | Microsoft Virtual PC = "vpc "/Microsoft Virtual Server = "vs " | ||
+ | |- | ||
+ | | <code>CreatorVersion:LongWord;</code> | ||
+ | | Virtual Server 2004 = 0x00010000/Virtual PC 2004 = 0x00050000 | ||
+ | |- | ||
+ | | <code>CreatorHostOS:LongWord;</code> | ||
+ | | Windows 0x5769326B (Wi2k)/Macintosh 0x4D616320 (Mac ) | ||
+ | |- | ||
+ | | <code>OriginalSize:Int64;</code> | ||
+ | | Size in Bytes of the VHD at Creation | ||
+ | |- | ||
+ | | <code>CurrentSize:Int64;</code> | ||
+ | | Current Size in Bytes of the VHD | ||
+ | |- | ||
+ | | <code>DiskGeometry:TVpcDiskGeometry;</code> | ||
+ | | See above | ||
+ | |- | ||
+ | | <code>DiskType:LongWord;</code> | ||
+ | | See above | ||
+ | |- | ||
+ | | <code>Checksum:LongWord;</code> | ||
+ | | 1s compliment checksum of the footer | ||
+ | |- | ||
+ | | <code>UniqueId:TGUID;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SavedState:ByteBool;</code> | ||
+ | | Set to 1 if disk is in a saved state | ||
+ | |- | ||
+ | | <code>Reserved:array[0..426] of Byte;</code> | ||
+ | | Reserved, must be zero | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''VPC dynamic disk header''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PVpcDynamicDiskHeader = ^TVpcDynamicDiskHeader;</code> | ||
+ | |||
+ | <code>TVpcDynamicDiskHeader = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: Always 1024 bytes (Used for both Dynamic and Differencing disks) | ||
+ | |- | ||
+ | | <code>Cookie:array[0..7] of Char;</code> | ||
+ | | cxsparse | ||
+ | |- | ||
+ | | <code>DataOffset:Int64;</code> | ||
+ | | currently unused by existing formats and should be set to 0xFFFFFFFF | ||
+ | |- | ||
+ | | <code>TableOffset:Int64;</code> | ||
+ | | absolute byte offset of the Block Allocation Table (BAT) | ||
+ | |- | ||
+ | | <code>HeaderVersion:LongWord;</code> | ||
+ | | must be initialized to 0x00010000 | ||
+ | |- | ||
+ | | <code>MaxTableEntries:LongWord;</code> | ||
+ | | maximum entries present in the BAT. equal to the number of blocks in the disk (disk size divided by the blocksize) | ||
+ | |- | ||
+ | | <code>BlockSize:LongWord;</code> | ||
+ | | The default value is 0x00200000 (indicating a block size of 2 MB) | ||
+ | |- | ||
+ | | <code>Checksum:LongWord;</code> | ||
+ | | 1s compliment checksum of the header | ||
+ | |- | ||
+ | | <code>ParentUniqueId:TGUID;</code> | ||
+ | | only used for differencing hard disks | ||
+ | |- | ||
+ | | <code>ParentTimeStamp:LongWord;</code> | ||
+ | | number of seconds since January 1, 2000 12:00:00 AM in UTC/GMT | ||
+ | |- | ||
+ | | <code>Reserved1:LongWord;</code> | ||
+ | | Must be zero | ||
+ | |- | ||
+ | | <code>ParentUnicodeName:array[0..255] of WideChar;</code> | ||
+ | | parent hard disk filename (Unicode/UTF16 string) | ||
+ | |- | ||
+ | | <code>ParentLocator1:TVpcParentLocator;</code> | ||
+ | | These entries store an absolute byte offset in the file where the parent locator for a differencing hard disk is stored | ||
+ | |- | ||
+ | | <code>ParentLocator2:TVpcParentLocator;</code> | ||
+ | | These fields are used only for differencing disks and should be set to zero for dynamic disks | ||
+ | |- | ||
+ | | <code>ParentLocator3:TVpcParentLocator;</code> | ||
+ | | These fields are used only for differencing disks and should be set to zero for dynamic disks | ||
+ | |- | ||
+ | | <code>ParentLocator4:TVpcParentLocator;</code> | ||
+ | | These fields are used only for differencing disks and should be set to zero for dynamic disks | ||
+ | |- | ||
+ | | <code>ParentLocator5:TVpcParentLocator;</code> | ||
+ | | These fields are used only for differencing disks and should be set to zero for dynamic disks | ||
+ | |- | ||
+ | | <code>ParentLocator6:TVpcParentLocator;</code> | ||
+ | | These fields are used only for differencing disks and should be set to zero for dynamic disks | ||
+ | |- | ||
+ | | <code>ParentLocator7:TVpcParentLocator;</code> | ||
+ | | These fields are used only for differencing disks and should be set to zero for dynamic disks | ||
+ | |- | ||
+ | | <code>ParentLocator8:TVpcParentLocator;</code> | ||
+ | | These fields are used only for differencing disks and should be set to zero for dynamic disks | ||
+ | |- | ||
+ | | <code>Reserved2:array[0..255] of Byte;</code> | ||
+ | | Reserved, must be zero | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''VirtualBox disk header''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PVboxDiskHeader = ^TVboxDiskHeader;</code> | ||
+ | |||
+ | <code>TVboxDiskHeader = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: Always 512 bytes (At start of file for both Fixed and Dynamic disks) | ||
+ | |- | ||
+ | | <code>Banner:array[0..63] of Char;</code> | ||
+ | | <<< Sun xVM VirtualBox Disk Image >>> | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | 7F 10 DA BE | ||
+ | |- | ||
+ | | <code>Version:LongWord;</code> | ||
+ | | 1.1 | ||
+ | |- | ||
+ | | <code>HeaderSize:LongWord;</code> | ||
+ | | 0x190 | ||
+ | |- | ||
+ | | <code>DiskType:LongWord;</code> | ||
+ | | see above | ||
+ | |- | ||
+ | | <code>DiskFlags:LongWord;</code> | ||
+ | | see above | ||
+ | |- | ||
+ | | <code>Description:array[0..255] of Char;</code> | ||
+ | | Unused | ||
+ | |- | ||
+ | | <code>BlocksOffset:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DataOffset:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Cylinders:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Heads:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Sectors:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SectorSize:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Reserved1:LongWord;</code> | ||
+ | | Must be zero | ||
+ | |- | ||
+ | | <code>DiskSize:Int64;</code> | ||
+ | | Bytes | ||
+ | |- | ||
+ | | <code>BlockSize:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>BlockExtra:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>TotalBlocks:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>AllocatedBlocks:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>UUID:TGUID;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SnapshotUUID:TGUID;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>LinkUUID:TGUID;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ParentUUID:TGUID;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Unknown1:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Unknown2:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Reserved2:LongWord;</code> | ||
+ | | Must be 0x3F | ||
+ | |- | ||
+ | | <code>Reserved3:LongWord;</code> | ||
+ | | Must be 0x200 | ||
+ | |- | ||
+ | | <code>Unused:array[0..9] of LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | === Class definitions === | ||
+ | ---- | ||
+ | |||
+ | |||
+ | '''Virtual disk specific classes''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskController|<code>TVirtualDiskController = class(TDiskController)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskDevice|<code>TVirtualDiskDevice = class(TDiskDevice)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskPartition|<code>TVirtualDiskPartition = class(TDiskPartition)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskImage|<code>TVirtualDiskImage = class(TDiskImage)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskMemoryImage|<code>TVirtualDiskMemoryImage = class(TVirtualDiskImage)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskFileImage|<code>TVirtualDiskFileImage = class(TVirtualDiskImage)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskDeviceImage|<code>TVirtualDiskDeviceImage = class(TVirtualDiskImage)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskIsoImage|<code>TVirtualDiskIsoImage = class(TVirtualDiskImage)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskBochsImage|<code>TVirtualDiskBochsImage = class(TVirtualDiskImage)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskVmwareImage|<code>TVirtualDiskVmwareImage = class(TVirtualDiskImage)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskVpcImage|<code>TVirtualDiskVpcImage = class(TVirtualDiskImage)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskVboxImage|<code>TVirtualDiskVboxImage = class(TVirtualDiskImage)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualRecognizer|<code>TVirtualRecognizer = class(TRecognizer)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskResizer|<code>TVirtualDiskResizer = class(TDiskResizer)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskCopier|<code>TVirtualDiskCopier = class(TDiskCopier)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskImager|<code>TVirtualDiskImager = class(TDiskImager)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskExtent|<code>TVirtualDiskExtent = class(TListObject)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskVmwareExtent|<code>TVirtualDiskVmwareExtent = class(TVirtualDiskExtent)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskVpcExtent|<code>TVirtualDiskVpcExtent = class(TVirtualDiskExtent)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskVboxExtent|<code>TVirtualDiskVboxExtent = class(TVirtualDiskExtent)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskTable|<code>TVirtualDiskTable = class(TListObject)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskVmwareTable|<code>TVirtualDiskVmwareTable = class(TVirtualDiskTable)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskVpcTable|<code>TVirtualDiskVpcTable = class(TVirtualDiskTable)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskVboxTable|<code>TVirtualDiskVboxTable = class(TVirtualDiskTable)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskBlock|<code>TVirtualDiskBlock = class(TListObject)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskVmwareBlock|<code>TVirtualDiskVmwareBlock = class(TVirtualDiskBlock)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskVpcGroup|<code>TVirtualDiskVpcGroup = class(TListObject)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TVirtualDiskVpcBlock|<code>TVirtualDiskVpcBlock = class(TVirtualDiskBlock)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | <br /> | ||
=== Public variables === | === Public variables === | ||
---- | ---- | ||
− | '' | + | ''None defined'' |
=== Function declarations === | === Function declarations === | ||
---- | ---- | ||
− | |||
+ | '''Initialization functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure VirtualInit;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure VirtualQuit;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Virtual disk helper functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function VirtualDataToPointer(const AData; ASize:Integer; ASwap:Boolean):Pointer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Creates a pointer and copies data from a buffer</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Allows byte order swapping on copy | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function VirtualPointerToData(APointer:Pointer; var AData; ASize:Integer; ASwap:Boolean):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Copies data to a buffer from supplied pointer</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Allows byte order swapping on copy | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function VirtualDataToString(const AData; ASize:Integer; AUnicode:Boolean):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Converts the supplied data to a string</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Accounts for unicode and byte ordering | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function VirtualStringToData(const AString:String; var AData; ASize:Integer ;AUnicode:Boolean):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Converts the supplied string to data</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Accounts for unicode and byte ordering | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
Return to [[Unit_Reference|Unit Reference]] | Return to [[Unit_Reference|Unit Reference]] |
Latest revision as of 04:40, 29 October 2021
Return to Unit Reference
Contents
Description
Ultibo Virtual Disk Interface unit
Constants
VIRTUAL_*
VIRTUAL_DEVICE_DESCRIPTION = 'Virtual Disk Device';
|
|
VIRTUAL_CONTROLLER_DESCRIPTION = 'Virtual Disk Controller';
|
virtualFlag*
virtualFlagNone = $00000000;
|
|
virtualFlagFixed = $00000001;
|
|
virtualFlagDynamic = $00000002;
|
|
virtualFlagBase = $00000004;
|
|
virtualFlagDelta = $00000008;
|
|
virtualFlagDevice = $00000010;
|
|
virtualFlagSplit = $00000020;
|
memoryInitramfs*
memoryInitramfsName = 'INITRAMFS';
|
vmware*
vmwareFileExtension = '.vmdk';
|
|
vmwareFileMask = '*.vmdk';
|
|
vmwareNoParentCID = $FFFFFFFF;
|
not($00000000) |
vmwareSparseMagicNumber = $564d444b;
|
'VMDK' |
vmwareEsxSparseMagicNumber = $44574f43;
|
'COWD' |
vmwareEsxSparseMaxParentLength = 1024;
|
COWDISK_MAX_PARENT_FILELEN |
vmwareEsxSparseMaxNameLength = 60;
|
COWDISK_MAX_NAME_LEN |
vmwareEsxSparseMaxDescriptionLength = 512;
|
COWDISK_MAX_DESC_LEN |
vmwareSectorSize = 512;
|
vmware*DiskType
vmwareMaxDiskType = 0;
|
|
vmwareDiskTypeNone = 0;
|
vmwareTag*
vmwareTagDisk = 'Disk DescriptorFile';
|
|
vmwareTagVersion = 'version';
|
|
vmwareTagCID = 'CID';
|
|
vmwareTagParentCID = 'parentCID';
|
|
vmwareTagCreateType = 'createType';
|
|
vmwareTagExtent = 'Extent Description';
|
|
vmwareTagDatabase = 'The Disk Data Base';
|
|
vmwareTagDDB = 'DDB';
|
|
vmwareTagAdapter = 'ddb.adapterType';
|
|
vmwareTagSectors = 'ddb.geometry.sectors';
|
|
vmwareTagHeads = 'ddb.geometry.heads';
|
|
vmwareTagCylinders = 'ddb.geometry.cylinders';
|
|
vmwareTagParentHint = 'parentFileNameHint';
|
vmwareCreateType_*
vmwareMaxCreateType = 11;
|
|
vmwareCreateType_monolithicSparse = 0;
|
|
vmwareCreateType_vmfsSparse = 1;
|
|
vmwareCreateType_monolithicFlat = 2;
|
|
vmwareCreateType_vmfs = 3;
|
|
vmwareCreateType_twoGbMaxExtentSparse = 4;
|
|
vmwareCreateType_twoGbMaxExtentFlat = 5;
|
|
vmwareCreateType_fullDevice = 6;
|
|
vmwareCreateType_vmfsRaw = 7;
|
|
vmwareCreateType_partitionedDevice = 8;
|
|
vmwareCreateType_vmfsRawDeviceMap = 9;
|
|
vmwareCreateType_vmfsPassthroughRawDeviceMap = 10;
|
|
vmwareCreateType_streamOptimized = 11;
|
vmwareAccessType_*
vmwareMaxAccessType = 2;
|
|
vmwareAccessType_RW = 0;
|
|
vmwareAccessType_RDONLY = 1;
|
|
vmwareAccessType_NOACCESS = 2;
|
vmwareExtentType_*
vmwareMaxExtentType = 6;
|
|
vmwareExtentType_FLAT = 0;
|
|
vmwareExtentType_SPARSE = 1;
|
|
vmwareExtentType_ZERO = 2;
|
|
vmwareExtentType_VMFS = 3;
|
|
vmwareExtentType_VMFSSPARSE = 4;
|
|
vmwareExtentType_VMFSRDM = 5;
|
|
vmwareExtentType_VMFSRAW = 6;
|
vmwareFlag*
vmwareFlagValidTest = $00000001;
|
bit 0: valid new line detection test |
vmwareFlagRedundantGrain = $00000002;
|
bit 1: redundant grain table will be used |
vmwareFlagGrainCompressed = $00010000;
|
bit 16: the grains are compressed. The type of compression is described by compressAlgorithm |
vmwareFlagLBAMarkers = $00020000;
|
bit 17: there are markers in the virtual disk to identify every block of metadata or data and the markers for the virtual machine data contain a LBA |
vmwareCompression*
vmwareCompressionNone = 0;
|
|
vmwareCompressionDeflate = 1;
|
The deflate algorithm is described in RFC 1951 |
vpc*
vpcFileExtension = '.vhd';
|
|
vpcUndoExtension = '.vud';
|
|
vpcFileMask = '*.vhd';
|
|
vpcUndoMask = '*.vud';
|
|
vpcSplitMask = '*.v??';
|
.v01, v02 etc up to 64 |
vpcFooterCookie = 'conectix';
|
|
vpcDynamicCookie = 'cxsparse';
|
|
vpcMaxDiskExtents = 64;
|
Maximum number of 4GB split files in a disk image |
vpcExtentMaxSize = 4294967296;
|
Maximum size of s split file (4GB) |
vpcUnixTimeOffset = 946684800;
|
Offset from 1/1/1970 to 1/1/2000 |
vpcFooterVersion = $00010000;
|
|
vpcDynamicVersion = $00010000;
|
|
vpcSectorSize = 512;
|
|
vpcUnallocatedBlock = $FFFFFFFF;
|
|
vpcFixedDiskTableOffset = $FFFFFFFFFFFFFFFF;
|
|
vpcDynamicDiskDataOffset = $FFFFFFFFFFFFFFFF;
|
|
vpcMaxBlockGroup = $FF;
|
|
vpcBlockGroupMask = $FF;
|
|
vpcBlockGroupOffset = $100;
|
vpcDiskType*
vpcMaxDiskType = 6;
|
|
vpcDiskTypeNone = 0;
|
|
vpcDiskTypeReserved1 = 1;
|
|
vpcDiskTypeFixed = 2;
|
|
vpcDiskTypeDynamic = 3;
|
|
vpcDiskTypeDifferencing = 4;
|
|
vpcDiskTypeReserved2 = 5;
|
|
vpcDiskTypeReserved3 = 6;
|
vpcFeature*
vpcFeatureNone = $00000000;
|
|
vpcFeatureTemporary = $00000001;
|
|
vpcFeatureReserved = $00000002;
|
This bit must always be set to 1 |
vpcCreator*
vpcCreatorWindows = $5769326B;
|
Wi2k |
vpcCreatorMacintosh = $4D616320;
|
Mac |
vpcPlatform*
vpcPlatformNone = $00000000;
|
|
vpcPlatformWi2r = $57693272;
|
Wi2r deprecated |
vpcPlatformWi2k = $5769326B;
|
Wi2k deprecated |
vpcPlatformW2ru = $57327275;
|
W2ru Unicode pathname (UTF-16) on Windows relative to the differencing disk pathname |
vpcPlatformW2ku = $57326B75;
|
W2ku Absolute Unicode (UTF-16) pathname on Windows |
vpcPlatformMac = $4D616320;
|
Mac OS alias stored as a blob |
vpcPlatformMacX = $4D616358;
|
MacX A file URL with UTF-8 encoding conforming to RFC 2396 |
vpcBitmapMask*
vpcBitmapMaskBits = 32;
|
LongWord Bitmap Masks |
vpcBitmapMaskNone = $00000000;
|
LongWord (Used for fast counting of free blocks) |
vpcBitmapMaskAll = $FFFFFFFF;
|
LongWord (Used for fast counting of used blocks) |
vpcBitmapMasks:array[0..31] of LongWord = (
| |
$00000001,$00000002,$00000004,$00000008,$00000010,$00000020,$00000040,$00000080,
| |
$00000100,$00000200,$00000400,$00000800,$00001000,$00002000,$00004000,$00008000,
| |
$00010000,$00020000,$00040000,$00080000,$00100000,$00200000,$00400000,$00800000,
| |
$01000000,$02000000,$04000000,$08000000,$10000000,$20000000,$40000000,$80000000);
| |
vpcBitmapMasks:array[0..31] of LongWord = (
|
Ordered to allow for big endian bitmap |
$00000080,$00000040,$00000020,$00000010,$00000008,$00000004,$00000002,$00000001,
| |
$00008000,$00004000,$00002000,$00001000,$00000800,$00000400,$00000200,$00000100,
| |
$00800000,$00400000,$00200000,$00100000,$00080000,$00040000,$00020000,$00010000,
| |
$80000000,$40000000,$20000000,$10000000,$08000000,$04000000,$02000000,$01000000);
|
vbox*
vboxFileExtension = '.vdi';
|
|
vboxDiskBanner = '<<< Sun xVM VirtualBox Disk Image >>>';
|
Plus a LF character in some images (#10) |
vboxDiskVersion = $00010001;
|
|
vboxDiskSignature = $BEDA107F;
|
|
vboxFileMask = '*.vdi';
|
|
vboxPathMask = '*.*';
|
|
vboxDeltaPath = '..\Machines\';
|
|
vboxParentPath = '..\..\..\VDI\';
|
|
vboxNewParentPath = '..\..\..\HardDisks\';
|
|
vboxSnapshotPath = '\Snapshots\';
|
|
vboxUnallocatedBlock = $FFFFFFFF;
|
vboxDiskType*
vboxMaxDiskType = 4;
|
|
vboxDiskTypeNone = 0;
|
|
vboxDiskTypeDynamic = 1;
|
|
vboxDiskTypeStatic = 2;
|
|
vboxDiskTypeUnknown = 3;
|
|
vboxDiskTypeDifferencing = 4;
|
vboxDiskFlags*
vboxDiskFlagsNone = $00000000;
|
Type definitions
ESX sparse extent header
PEsxSparseExtentHeader = ^TEsxSparseExtentHeader;
TEsxSparseExtentHeader = packed record
Note: Always 2048 bytes (Only used for Delta disks, not Dynamic) | |
magicNumber:LongWord;
|
0x44574f43/'COWD' |
version:LongWord;
|
The value of this entry should be 1 |
flags:LongWord;
|
set to 3 |
numSectors:LongWord;
|
total number of sectors on the base disk |
grainSize:LongWord;
|
one sector by default. Can vary from one sector to 1MB |
gdOffset:LongWord;
|
starts at the fourth sector, because the COWDisk_Header structure takes four sectors |
numGDEntries:LongWord;
|
is CEILING(numSectors, gtCoverage) |
freeSector:LongWord;
|
the next free data sector. This needs to be less than the length of the delta link. It is initially set to gdOffset + numGDSectors |
case Integer of
|
|
0: (cylinders:LongWord;
|
root |
heads:LongWord;
|
|
sectors:LongWord;
|
|
generation:LongWord;
|
cont |
name:array[0..vmwareEsxSparseMaxNameLength - 1] of Char;
|
|
description:array[0..vmwareEsxSparseMaxDescriptionLength - 1] of Char;
|
|
savedGeneration:LongWord;
|
used to detect the unclean shutdown of the delta link. It is initially set to 0 |
reserved:array[0..7] of Char;
|
|
uncleanShutdown:LongWord;
|
used to trigger the metadata consistency check in case there is an abnormal termination of the program |
padding:array[0..395] of Char);
|
|
1: (parentFileName:array[0..vmwareEsxSparseMaxParentLength - 1] of Char;
|
child |
parentGeneration:LongWord;
|
|
generationx:LongWord;
|
cont |
namex:array[0..vmwareEsxSparseMaxNameLength - 1] of Char;
|
|
descriptionx:array[0..vmwareEsxSparseMaxDescriptionLength - 1] of Char;
|
|
savedGenerationx:LongWord;
|
used to detect the unclean shutdown of the delta link. It is initially set to 0 |
reservedx:array[0..7] of Char;
|
|
uncleanShutdownx:LongWord;
|
used to trigger the metadata consistency check in case there is an abnormal termination of the program |
paddingx:array[0..395] of Char);
|
remaining fields are not used. They are present to maintain compatibility with legacy virtual disk formats |
VMware sparse extent header
PVmwareSparseExtentHeader = ^TVmwareSparseExtentHeader;
TVmwareSparseExtentHeader = packed record
Note: Always 512 bytes (Used for both Dynamic and Delta disks) | |
magicNumber:LongWord;
|
0x564d444b/'VMDK' |
version:LongWord;
|
The value of this entry should be 1 |
flags:LongWord;
|
See above |
capacity:Int64;
|
the capacity of this extent in sectors (should be a multiple of the grain size) |
grainSize:Int64;
|
size of a grain in sectors (must be a power of 2 and must be greater than 8 (4KB)) |
descriptorOffset:Int64;
|
offset of the embedded descriptor in the extent (expressed in sectors) |
descriptorSize:Int64;
|
valid only if descriptorOffset is non-zero (expressed in sectors) |
numGTEsPerGT:LongWord;
|
the number of entries in a grain table (for VMware virtual disks is 512) |
rgdOffset:Int64;
|
redundant level 0 of metadata (expressed in sectors) |
gdOffset:Int64;
|
level 0 of metadata (expressed in sectors) |
overHead:Int64;
|
number of sectors occupied by the metadata |
uncleanShutdown:ByteBool;
|
set to FALSE when VMware software closes an extent. Four entries are used to detect when an extent file has been corrupted by transferring it using FTP in text mode. The entries should be initialized with the following values |
singleEndLineChar:Char;
|
'\n' |
nonEndLineChar:Char;
|
' ' |
doubleEndLineChar1:Char;
|
'\r' |
doubleEndLineChar2:Char;
|
'\n' |
compressAlgorithm:Word;
|
See above |
pad:array[0..432] of Byte;
|
VPC dish geometry
PVpcDiskGeometry = ^TVpcDiskGeometry;
TVpcDiskGeometry = packed record
Note: Always 4 bytes | |
Cylinders:Word;
|
Cylinders |
Heads:Byte;
|
Heads |
Sectors:Byte;
|
Sectors per track |
VPC parent locator
PVpcParentLocator = ^TVpcParentLocator;
TVpcParentLocator = packed record
Note: Always 24 bytes | |
PlatformCode:LongWord;
|
describes which platform-specific format is used for the file locator (see above) |
PlatformDataSpace:LongWord;
|
the number of 512-byte sectors needed to store the parent hard disk locator |
PlatformDataLength:LongWord;
|
length of the parent hard disk locator in bytes |
Reserved:LongWord;
|
Reserved, must be zero |
PlatformDataOffset:Int64;
|
offset in bytes where the platform specific file locator data is stored |
VPC hard disk footer
PVpcHardDiskFooter = ^TVpcHardDiskFooter;
TVpcHardDiskFooter = packed record
Note: Always 512 bytes (At end of file on Fixed disks, at start and end on Dynamic and Differencing disks) | |
Cookie:array[0..7] of Char;
|
conectix |
Features:LongWord;
|
|
Version:LongWord;
|
0x00010000 |
DataOffset:Int64;
|
Offset to Dynamic Disk Header, Must be 0xFFFFFFFF for Fixed Disks |
TimeStamp:LongWord;
|
seconds since January 1, 2000 12:00:00 AM in UTC/GMT (Unix Time minus 30 years) |
CreatorApplication:array[0..3] of Char;
|
Microsoft Virtual PC = "vpc "/Microsoft Virtual Server = "vs " |
CreatorVersion:LongWord;
|
Virtual Server 2004 = 0x00010000/Virtual PC 2004 = 0x00050000 |
CreatorHostOS:LongWord;
|
Windows 0x5769326B (Wi2k)/Macintosh 0x4D616320 (Mac ) |
OriginalSize:Int64;
|
Size in Bytes of the VHD at Creation |
CurrentSize:Int64;
|
Current Size in Bytes of the VHD |
DiskGeometry:TVpcDiskGeometry;
|
See above |
DiskType:LongWord;
|
See above |
Checksum:LongWord;
|
1s compliment checksum of the footer |
UniqueId:TGUID;
|
|
SavedState:ByteBool;
|
Set to 1 if disk is in a saved state |
Reserved:array[0..426] of Byte;
|
Reserved, must be zero |
VPC dynamic disk header
PVpcDynamicDiskHeader = ^TVpcDynamicDiskHeader;
TVpcDynamicDiskHeader = packed record
Note: Always 1024 bytes (Used for both Dynamic and Differencing disks) | |
Cookie:array[0..7] of Char;
|
cxsparse |
DataOffset:Int64;
|
currently unused by existing formats and should be set to 0xFFFFFFFF |
TableOffset:Int64;
|
absolute byte offset of the Block Allocation Table (BAT) |
HeaderVersion:LongWord;
|
must be initialized to 0x00010000 |
MaxTableEntries:LongWord;
|
maximum entries present in the BAT. equal to the number of blocks in the disk (disk size divided by the blocksize) |
BlockSize:LongWord;
|
The default value is 0x00200000 (indicating a block size of 2 MB) |
Checksum:LongWord;
|
1s compliment checksum of the header |
ParentUniqueId:TGUID;
|
only used for differencing hard disks |
ParentTimeStamp:LongWord;
|
number of seconds since January 1, 2000 12:00:00 AM in UTC/GMT |
Reserved1:LongWord;
|
Must be zero |
ParentUnicodeName:array[0..255] of WideChar;
|
parent hard disk filename (Unicode/UTF16 string) |
ParentLocator1:TVpcParentLocator;
|
These entries store an absolute byte offset in the file where the parent locator for a differencing hard disk is stored |
ParentLocator2:TVpcParentLocator;
|
These fields are used only for differencing disks and should be set to zero for dynamic disks |
ParentLocator3:TVpcParentLocator;
|
These fields are used only for differencing disks and should be set to zero for dynamic disks |
ParentLocator4:TVpcParentLocator;
|
These fields are used only for differencing disks and should be set to zero for dynamic disks |
ParentLocator5:TVpcParentLocator;
|
These fields are used only for differencing disks and should be set to zero for dynamic disks |
ParentLocator6:TVpcParentLocator;
|
These fields are used only for differencing disks and should be set to zero for dynamic disks |
ParentLocator7:TVpcParentLocator;
|
These fields are used only for differencing disks and should be set to zero for dynamic disks |
ParentLocator8:TVpcParentLocator;
|
These fields are used only for differencing disks and should be set to zero for dynamic disks |
Reserved2:array[0..255] of Byte;
|
Reserved, must be zero |
VirtualBox disk header
PVboxDiskHeader = ^TVboxDiskHeader;
TVboxDiskHeader = packed record
Note: Always 512 bytes (At start of file for both Fixed and Dynamic disks) | |
Banner:array[0..63] of Char;
|
<<< Sun xVM VirtualBox Disk Image >>> |
Signature:LongWord;
|
7F 10 DA BE |
Version:LongWord;
|
1.1 |
HeaderSize:LongWord;
|
0x190 |
DiskType:LongWord;
|
see above |
DiskFlags:LongWord;
|
see above |
Description:array[0..255] of Char;
|
Unused |
BlocksOffset:LongWord;
|
|
DataOffset:LongWord;
|
|
Cylinders:LongWord;
|
|
Heads:LongWord;
|
|
Sectors:LongWord;
|
|
SectorSize:LongWord;
|
|
Reserved1:LongWord;
|
Must be zero |
DiskSize:Int64;
|
Bytes |
BlockSize:LongWord;
|
|
BlockExtra:LongWord;
|
|
TotalBlocks:LongWord;
|
|
AllocatedBlocks:LongWord;
|
|
UUID:TGUID;
|
|
SnapshotUUID:TGUID;
|
|
LinkUUID:TGUID;
|
|
ParentUUID:TGUID;
|
|
Unknown1:LongWord;
|
|
Unknown2:LongWord;
|
|
Reserved2:LongWord;
|
Must be 0x3F |
Reserved3:LongWord;
|
Must be 0x200 |
Unused:array[0..9] of LongWord;
|
Class definitions
Virtual disk specific classes
TVirtualDiskController = class(TDiskController)
|
TVirtualDiskDevice = class(TDiskDevice)
|
TVirtualDiskPartition = class(TDiskPartition)
|
TVirtualDiskImage = class(TDiskImage)
|
TVirtualDiskMemoryImage = class(TVirtualDiskImage)
|
TVirtualDiskFileImage = class(TVirtualDiskImage)
|
TVirtualDiskDeviceImage = class(TVirtualDiskImage)
|
TVirtualDiskIsoImage = class(TVirtualDiskImage)
|
TVirtualDiskBochsImage = class(TVirtualDiskImage)
|
TVirtualDiskVmwareImage = class(TVirtualDiskImage)
|
TVirtualDiskVpcImage = class(TVirtualDiskImage)
|
TVirtualDiskVboxImage = class(TVirtualDiskImage)
|
TVirtualRecognizer = class(TRecognizer)
|
TVirtualDiskResizer = class(TDiskResizer)
|
TVirtualDiskCopier = class(TDiskCopier)
|
TVirtualDiskImager = class(TDiskImager)
|
TVirtualDiskExtent = class(TListObject)
|
TVirtualDiskVmwareExtent = class(TVirtualDiskExtent)
|
TVirtualDiskVpcExtent = class(TVirtualDiskExtent)
|
TVirtualDiskVboxExtent = class(TVirtualDiskExtent)
|
TVirtualDiskTable = class(TListObject)
|
TVirtualDiskVmwareTable = class(TVirtualDiskTable)
|
TVirtualDiskVpcTable = class(TVirtualDiskTable)
|
TVirtualDiskVboxTable = class(TVirtualDiskTable)
|
TVirtualDiskBlock = class(TListObject)
|
TVirtualDiskVmwareBlock = class(TVirtualDiskBlock)
|
TVirtualDiskVpcGroup = class(TListObject)
|
TVirtualDiskVpcBlock = class(TVirtualDiskBlock)
|
Public variables
None defined
Function declarations
Initialization functions
procedure VirtualInit;
Note | None documented |
---|
procedure VirtualQuit;
Note | None documented |
---|
Virtual disk helper functions
function VirtualDataToPointer(const AData; ASize:Integer; ASwap:Boolean):Pointer;
Note | Allows byte order swapping on copy |
---|
function VirtualPointerToData(APointer:Pointer; var AData; ASize:Integer; ASwap:Boolean):Boolean;
Note | Allows byte order swapping on copy |
---|
function VirtualDataToString(const AData; ASize:Integer; AUnicode:Boolean):String;
Note | Accounts for unicode and byte ordering |
---|
function VirtualStringToData(const AString:String; var AData; ASize:Integer ;AUnicode:Boolean):Boolean;
Note | Accounts for unicode and byte ordering |
---|
Return to Unit Reference