Unit VirtualDisk
From Ultibo.org
Return to Unit Reference
Description
Ultibo Virtual Disk interface unit
To be documented
Constants
Virtual disk specific constants
VIRTUAL_*
VIRTUAL_DEVICE_DESCRIPTION = 'Virtual Disk Device';
|
|
VIRTUAL_CONTROLLER_DESCRIPTION = 'Virtual Disk Controller';
|
Virtual flag contants
virtualFlag*
virtualFlagNone = $00000000;
|
|
virtualFlagFixed = $00000001;
|
|
virtualFlagDynamic = $00000002;
|
|
virtualFlagBase = $00000004;
|
|
virtualFlagDelta = $00000008;
|
|
virtualFlagDevice = $00000010;
|
|
virtualFlagSplit = $00000020;
|
VMware constants
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 disk type constants
vmware*DiskType
vmwareMaxDiskType = 0;
|
|
vmwareDiskTypeNone = 0;
|
VMware descriptor tag constants
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';
|
VMware create type constants
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;
|
VMware access type constants
vmwareAccessType_*
vmwareMaxAccessType = 2;
|
|
vmwareAccessType_RW = 0;
|
|
vmwareAccessType_RDONLY = 1;
|
|
vmwareAccessType_NOACCESS = 2;
|
VMware extent type constants
vmwareExtentType_*
vmwareMaxExtentType = 6;
|
|
vmwareExtentType_FLAT = 0;
|
|
vmwareExtentType_SPARSE = 1;
|
|
vmwareExtentType_ZERO = 2;
|
|
vmwareExtentType_VMFS = 3;
|
|
vmwareExtentType_VMFSSPARSE = 4;
|
|
vmwareExtentType_VMFSRDM = 5;
|
|
vmwareExtentType_VMFSRAW = 6;
|
VMware disk flag constants
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 |
VMware compression type constants
vmwareCompression*
vmwareCompressionNone = 0;
|
|
vmwareCompressionDeflate = 1;
|
The deflate algorithm is described in RFC 1951 |
VPC constants
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;
|
VPC disk type constants
vpcDiskType*
vpcMaxDiskType = 6;
|
|
vpcDiskTypeNone = 0;
|
|
vpcDiskTypeReserved1 = 1;
|
|
vpcDiskTypeFixed = 2;
|
|
vpcDiskTypeDynamic = 3;
|
|
vpcDiskTypeDifferencing = 4;
|
|
vpcDiskTypeReserved2 = 5;
|
|
vpcDiskTypeReserved3 = 6;
|
VPC feature constants
vpcFeature*
vpcFeatureNone = $00000000;
|
|
vpcFeatureTemporary = $00000001;
|
|
vpcFeatureReserved = $00000002;
|
This bit must always be set to 1 |
VPC creator host OS constants
vpcCreator*
vpcCreatorWindows = $5769326B;
|
Wi2k |
vpcCreatorMacintosh = $4D616320;
|
Mac |
VPC platform code constants
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 |
VPC bitmap mask constants
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);
|
VirtualBox constants
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;
|
VirtualBox disk type constants
vboxDiskType*
vboxMaxDiskType = 4;
|
|
vboxDiskTypeNone = 0;
|
|
vboxDiskTypeDynamic = 1;
|
|
vboxDiskTypeStatic = 2;
|
|
vboxDiskTypeUnknown = 3;
|
|
vboxDiskTypeDifferencing = 4;
|
VirtualBox disk flag constants
vboxDiskFlags*
vboxDiskFlagsNone = $00000000;
|
Type definitions
To be documented
Public variables
None defined
Function declarations
Initialization functions
procedure VirtualInit;
Description: To be documented
Note | None documented |
---|
procedure VirtualQuit;
Description: To be documented
Note | None documented |
---|
Virtual disk helper functions
function VirtualDataToPointer(const AData; ASize:Integer; ASwap:Boolean):Pointer;
Description: Creates a pointer and copies data from a buffer
Note | Allows byte order swapping on copy |
---|
function VirtualPointerToData(APointer:Pointer; var AData; ASize:Integer; ASwap:Boolean):Boolean;
Description: Copies data to a buffer from supplied pointer
Note | Allows byte order swapping on copy |
---|
function VirtualDataToString(const AData; ASize:Integer; AUnicode:Boolean):String;
Description: Converts the supplied data to a string
Note | Accounts for unicode and byte ordering |
---|
function VirtualStringToData(const AString:String; var AData; ASize:Integer ;AUnicode:Boolean):Boolean;
Description: Converts the supplied string to data
Note | Accounts for unicode and byte ordering |
---|
Return to Unit Reference