Difference between revisions of "Unit Filesystem"
Line 2,259: | Line 2,259: | ||
=== Type definitions === | === Type definitions === | ||
+ | ---- | ||
+ | |||
+ | |||
+ | '''Storage device event''' | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PStorageDeviceEvent = ^TStorageDeviceEvent;</code> | ||
+ | |||
+ | <code>TStorageDeviceEvent = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Timer:TTimerHandle;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>Device:PStorageDevice;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Cache timer''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PCacheTimerItem = ^TCacheTimerItem;</code> | ||
+ | |||
+ | <code>TCacheTimerItem = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Key:Integer;</code> | ||
+ | | Ordering key for timer list | ||
+ | |- | ||
+ | | <code>Page:TObject;</code> | ||
+ | | The cache page referenced by this timer list item | ||
+ | |- | ||
+ | | <code>Prev:PCacheTimerItem;</code> | ||
+ | | Previous item in timer list | ||
+ | |- | ||
+ | | <code>Next:PCacheTimerItem;</code> | ||
+ | | Next item in timer list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Entry timer''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PEntryTimerItem = ^TEntryTimerItem;</code> | ||
+ | |||
+ | <code>TEntryTimerItem = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Key:Integer;</code> | ||
+ | | Ordering key for timer list | ||
+ | |- | ||
+ | | <code>Entry:TObject;</code> | ||
+ | | The disk entry referenced by this timer list item | ||
+ | |- | ||
+ | | <code>Prev:PEntryTimerItem;</code> | ||
+ | | Previous item in timer list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Media type''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TMediaType = (mtUNKNOWN,mtINVALID,mtFLOPPY,mtFIXED,mtREMOVABLE,mtCDROM,mtDVD,mtOTHER);</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Floppy type''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TFloppyType = (ftUNKNOWN,ftINVALID,ft360K,ft12M,ft720K,ft144M,ft288M,ftATAPI);</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Image type''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TImageType = (itUNKNOWN,itINVALID,itMEMORY,itFILE,itDEVICE,itISO,itBOCHS,itVMWARE,itVPC,itVBOX);</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Cache state''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TCacheState = (csCLEAN,csDIRTY);</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Cache mode''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TCacheMode = (cmNONE,cmREADONLY,cmREADWRITE);</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Cache page type''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TCachePageType = (ptNONE,ptDEVICE);</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Cache page state''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TCachePageState = (psUNKNOWN,psEMPTY,psCLEAN,psDIRTY);</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Cache page content''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TCachePageContent = (pcUNKNOWN,pcDATA,pcDIRECTORY,pcENTRY,pcSYSTEM);</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Cache statistics''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PCacheStatistics = ^TCacheStatistics;</code> | ||
+ | |||
+ | <code>TCacheStatistics = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Information'' | ||
+ | |- | ||
+ | | <code>PageSize:LongWord;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>PageCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>CacheSize:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>CacheMode:TCacheMode;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>CacheState:TCacheState;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FlushTimeout:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DiscardTimeout:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Read / Write'' | ||
+ | |- | ||
+ | | <code>ReadCached:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReadDirect:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>WriteBack:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>WriteThrough:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>WriteDirect:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Hit / Miss'' | ||
+ | |- | ||
+ | | <code>HitCount:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>MissCount:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Allocate Success / Failure'' | ||
+ | |- | ||
+ | | <code>FailCount:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SuccessCount:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Page Flush / Discard'' | ||
+ | |- | ||
+ | | <code>FlushCount:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DiscardCount:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>UnknownCount:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Page Times'' | ||
+ | |- | ||
+ | | <code>OldestClean:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>NewestClean:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>OldestDirty:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>NewestDirty:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Search''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>TSearchRec = SysUtils.TRawbyteSearchRec;</code> | ||
+ | |||
+ | <code>TSearchRec = 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: TSearchRec is always defined in SysUtils | ||
+ | |- | ||
+ | | <code>Time: Integer;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>Size: Integer;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Attr: Integer;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Name: TFileName;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ExcludeAttr: Integer;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FindHandle: THandle;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FindData: TWin32FindData;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''File search types''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TFileSearchRec = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>FindHandle:THandle;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>FindData:TWin32FindData;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Disk search''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TDiskSearchRec = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Name:String;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>MediaType:TMediaType;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FloppyType:TFloppyType;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FindHandle:THandle;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Context:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Verbose:Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Partition search''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TPartitionSearchRec = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Name:String;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>Index:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FindHandle:THandle;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Context:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Verbose:Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Volume search''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TVolumeSearchRec = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Name:String;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>Attributes:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>VolumeLabel:String;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>VolumeGUID:String;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>VolumeSerial:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DriveType:TDriveType;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FileSysType:TFileSysType;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FindHandle:THandle;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Context:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Verbose:Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Drive search''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TDriveSearchRec = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Name:String;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>Attributes:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>VolumeLabel:String;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>VolumeGUID:String;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>VolumeSerial:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DriveType:TDriveType;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FileSysType:TFileSysType;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FindHandle:THandle;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Context:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Verbose:Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Image search''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TImageSearchRec = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Name:String;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>ImageNo:Integer;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ImageType:TImageType;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>MediaType:TMediaType;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FloppyType:TFloppyType;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Attributes:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SectorSize:Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SectorCount:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Cylinders:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Heads:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Sectors:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>PartitionId:Byte;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FindHandle:THandle;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Context:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Verbose:Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Catalog search''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TCatalogSearchRec = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Name:String;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>Path:String;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>CatalogNo:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>MediaType:TMediaType;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FloppyType:TFloppyType;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Attributes:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SectorSize:Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SectorCount:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FindHandle:THandle;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Context:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Mount search''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TMountSearchRec = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Name:String;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>FindHandle:THandle;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Context:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Junction search''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TJunctionSearchRec = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Name:String;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>FindHandle:THandle;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Context:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Stream search''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TStreamSearchRec = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>FindHandle:THandle;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>Context:Pointer;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FindData:TWin32FindStreamData;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Link search''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TLinkSearchRec = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Name:String;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>FindHandle:THandle;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Context:Pointer;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''FAT12/FAT16 BIOS parameter block''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TBiosPB = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>BytesPerSector:Word;</code> | ||
+ | | 512,1024,2048,4096 - Usually 512 | ||
+ | |- | ||
+ | | <code>SectorsPerCluster:Byte;</code> | ||
+ | | 1,2,4,8,16,32,64,128 | ||
+ | |- | ||
+ | | <code>ReservedSectors:Word;</code> | ||
+ | | FAT12/16 - Usually 1, FAT32 - Usually 32 | ||
+ | |- | ||
+ | | <code>NumberOfFats:Byte;</code> | ||
+ | | Usually 2 | ||
+ | |- | ||
+ | | <code>RootEntryCount:Word;</code> | ||
+ | | FAT32 always 0, FAT16 usually 512 (RootEntryCount * 32 must be even multiple of BytesPerSector) | ||
+ | |- | ||
+ | | <code>TotalSectors16:Word;</code> | ||
+ | | Total Sectors on the drive or 0 if TotalSectors32 used | ||
+ | |- | ||
+ | | <code>MediaId:Byte;</code> | ||
+ | | F8 for Fixed media, F0 usually for Removable media | ||
+ | |- | ||
+ | | <code>SectorsPerFat16:Word;</code> | ||
+ | | FAT32 always 0, Number of Sectors per FAT | ||
+ | |- | ||
+ | | <code>SectorsPerTrack:Word;</code> | ||
+ | | Sectors Per Track for Int13 | ||
+ | |- | ||
+ | | <code>NumberOfHeads:Word;</code> | ||
+ | | Number of Header for Int13 eg 1.44MB = 2 | ||
+ | |- | ||
+ | | <code>HiddenSectors:LongWord;</code> | ||
+ | | Number of Hidden Sectors preceeding Partition (Only valid on Partitioned media) | ||
+ | |- | ||
+ | | <code>TotalSectors32:LongWord;</code> | ||
+ | | Total Sectors on the drive or 0 if TotalSectors16 used | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''FAT32 BIOS parameter block''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TExtBiosPB = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>BytesPerSector:Word;</code> | ||
+ | | 512,1024,2048,4096 - Usually 512 | ||
+ | |- | ||
+ | | <code>SectorsPerCluster:Byte;</code> | ||
+ | | 1,2,4,8,16,32,64,128 | ||
+ | |- | ||
+ | | <code>ReservedSectors:Word;</code> | ||
+ | | FAT12/16 - Usually 1, FAT32 - Usually 32 | ||
+ | |- | ||
+ | | <code>NumberOfFats:Byte;</code> | ||
+ | | Usually 2 | ||
+ | |- | ||
+ | | <code>RootEntryCount:Word;</code> | ||
+ | | FAT32 always 0, FAT16 usually 512 (RootEntryCount * 32 must be even multiple of BytesPerSector) | ||
+ | |- | ||
+ | | <code>TotalSectors16:Word;</code> | ||
+ | | Total Sectors on the drive or 0 if TotalSectors32 used | ||
+ | |- | ||
+ | | <code>MediaId:Byte;</code> | ||
+ | | F8 for Fixed media, F0 usually for Removable media | ||
+ | |- | ||
+ | | <code>SectorsPerFat16:Word;</code> | ||
+ | | FAT32 always 0, Number of Sectors per FAT | ||
+ | |- | ||
+ | | <code>SectorsPerTrack:Word;</code> | ||
+ | | Sectors Per Track for Int13 | ||
+ | |- | ||
+ | | <code>NumberOfHeads:Word;</code> | ||
+ | | Number of Header for Int13 eg 1.44MB = 2 | ||
+ | |- | ||
+ | | <code>HiddenSectors:LongWord;</code> | ||
+ | | Number of Hidden Sectors preceeding Partition (Only valid on Partitioned media) | ||
+ | |- | ||
+ | | <code>TotalSectors32:LongWord;</code> | ||
+ | | Total Sectors on the drive or 0 if TotalSectors16 used | ||
+ | |- | ||
+ | | <code>SectorsPerFat32:LongWord;</code> | ||
+ | | Number of Sectors per FAT | ||
+ | |- | ||
+ | | <code>ExtendedFlags:Word;</code> | ||
+ | | Bits 0-3 -- Zero-based number of active FAT. Only valid if mirroring. | ||
+ | Bits 0-3 - is disabled. | ||
+ | |||
+ | Bits 4-6 - Reserved. | ||
+ | |||
+ | Bit 7 - 0 means the FAT is mirrored at runtime into all FATs. | ||
+ | |||
+ | Bit 7 - 1 means only one FAT is active, it is the one referenced. | ||
+ | |||
+ | Bit 7 - in bits 0-3. | ||
+ | |||
+ | Bits 8-15 -- Reserved. | ||
+ | |- | ||
+ | | <code>FileSysVersion:Word;</code> | ||
+ | | FAT32 Version (Current 0:0) | ||
+ | |- | ||
+ | | <code>RootCluster:LongWord;</code> | ||
+ | | Usually Cluster 2 | ||
+ | |- | ||
+ | | <code>FileSysInfoSector:Word;</code> | ||
+ | | Usually 1 | ||
+ | |- | ||
+ | | <code>BackupBootSector:Word;</code> | ||
+ | | Usually 6 | ||
+ | |- | ||
+ | | <code>Reserved:array[0..11] of Byte;</code> | ||
+ | | Always 0 | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''NTFS BIOS parameter block''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TNtfsBiosPB = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>BytesPerSector:Word;</code> | ||
+ | | 512,1024,2048,4096 - Usually 512 | ||
+ | |- | ||
+ | | <code>SectorsPerCluster:Byte;</code> | ||
+ | | 1,2,4,8,16,32,64,128 - Usually 8 | ||
+ | |- | ||
+ | | <code>ReservedSectors:Word;</code> | ||
+ | | Must always be 0 on NTFS (Win2K Volume Manager ?) | ||
+ | |- | ||
+ | | <code>Reserved1:array[0..2] of Byte;</code> | ||
+ | | Must always be 0 on NTFS | ||
+ | |- | ||
+ | | <code>Reserved2:Word;</code> | ||
+ | | Must always be 0 on NTFS | ||
+ | |- | ||
+ | | <code>MediaId:Byte;</code> | ||
+ | | F8 for Fixed media, F0 usually for Removable media | ||
+ | |- | ||
+ | | <code>Reserved3:Word;</code> | ||
+ | | Must always be 0 on NTFS | ||
+ | |- | ||
+ | | <code>SectorsPerTrack:Word;</code> | ||
+ | | Sectors Per Track for Int13 | ||
+ | |- | ||
+ | | <code>NumberOfHeads:Word;</code> | ||
+ | | Number of Header for Int13 eg 1.44MB = 2 | ||
+ | |- | ||
+ | | <code>HiddenSectors:LongWord;</code> | ||
+ | | Number of Hidden Sectors preceeding Partition | ||
+ | |- | ||
+ | | <code>Reserved4:LongWord;</code> | ||
+ | | Must always be 0 on NTFS | ||
+ | |- | ||
+ | | <code>Reserved5:LongWord;</code> | ||
+ | | Not used by NTFS - Usually 80008000 | ||
+ | |- | ||
+ | | <code>TotalSectors:Int64;</code> | ||
+ | | Total Sectors on the drive | ||
+ | |- | ||
+ | | <code>MFTCluster:Int64;</code> | ||
+ | | Start Cluster of $MFT | ||
+ | |- | ||
+ | | <code>MFTMirror:Int64;</code> | ||
+ | | Start Cluster of $MFTMirr | ||
+ | |- | ||
+ | | <code>ClustersPerFile:LongInt;</code> | ||
+ | | Clusters Per File Record (Can be negative) (F6 = 1024 - See Notes) | ||
+ | |- | ||
+ | | <code>ClustersPerIndex:LongInt;</code> | ||
+ | | Clusters Per Index Record (Can be negative) (F6 = 1024 - See Notes) | ||
+ | |- | ||
+ | | <code>VolumeSerial:Int64;</code> | ||
+ | | Volume Serial Number | ||
+ | |- | ||
+ | | <code>Checksum:LongWord;</code> | ||
+ | | Checksum (Not Used) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Partition entry types''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TPartitionEntry = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>BootIndicator:Byte;</code> | ||
+ | | 80 for active partition | ||
+ | |- | ||
+ | | <code>StartHead:Byte;</code> | ||
+ | | Either Bits 0-3 only or Bits 0-7 depending on BIOS | ||
+ | |- | ||
+ | | <code>StartSector:Byte;</code> | ||
+ | | Bits 0-5 = Sector, Bits 6-7 = Bits 8-9 of Cylinder | ||
+ | |- | ||
+ | | <code>StartCylinder:Byte;</code> | ||
+ | | Bits 0-7 Only, Bits 8-9 in Sector | ||
+ | |- | ||
+ | | <code>TypeIndicator:Byte;</code> | ||
+ | | See Table in Interrupt List and Below | ||
+ | |- | ||
+ | | <code>EndHead:Byte;</code> | ||
+ | | Either Bits 0-3 only or Bits 0-7 depending on BIOS | ||
+ | |- | ||
+ | | <code>EndSector:Byte;</code> | ||
+ | | Bits 0-5 = Sector, Bits 6-7 = Bits 8-9 of Cylinder | ||
+ | |- | ||
+ | | <code>EndCylinder:Byte;</code> | ||
+ | | Bits 0-7 Only, Bits 8-9 in Sector | ||
+ | |- | ||
+ | | <code>SectorOffset:LongWord;</code> | ||
+ | | Offset in sectors from current position to Start of Partition | ||
+ | |- | ||
+ | | <code>SectorCount:LongWord;</code> | ||
+ | | Size in Sectors of the Partition | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Partition table''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TPartitionTable = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>PartitionEntry:array[MIN_PARTITION..MAX_PARTITION] of TPartitionEntry;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Master boot code''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TMasterBootCode = packed array[0..445] of Byte;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Master boot record''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PMasterBootRecord = ^TMasterBootRecord;</code> | ||
+ | |||
+ | <code>TMasterBootRecord = 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: Standard Master Boot Record | ||
+ | |- | ||
+ | | <code>BootCode:TMasterBootCode;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>PartitionTable:TPartitionTable;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Signature:Word;</code> | ||
+ | | Magic Number $AA55 | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Ext master boot code''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TExtMasterBootCode = packed array[0..439] of Byte;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Ext master boot record''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PExtMasterBootRecord = ^TExtMasterBootRecord;</code> | ||
+ | |||
+ | <code>TExtMasterBootRecord = 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: NT/2000/XP Master Boot Record | ||
+ | |- | ||
+ | | <code>BootCode:TExtMasterBootCode;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DiskSignature:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Reserved1:Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>PartitionTable:TPartitionTable;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Signature:Word;</code> | ||
+ | | Magic Number $AA55 | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Partition record''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PPartitionRecord = ^TPartitionRecord;</code> | ||
+ | |||
+ | <code>TPartitionRecord = 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: Similar to TMasterBootRecord | ||
+ | |- | ||
+ | | <code>Dummy:array[0..445] of Byte;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>PartitionTable:TPartitionTable;</code> | ||
+ | | Only first 2 ever used | ||
+ | |- | ||
+ | | <code>Signature:Word;</code> | ||
+ | | Magic Number $AA55 | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Sector types''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PSector = ^TSector;</code> | ||
+ | |||
+ | <code>TSector = packed array[0..511] of Byte;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Boot sector jump''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TBootSectorJump = packed array[0..2] of Byte;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Boot sector code''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TBootSectorCode = packed array[0..447] of Byte;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Boot sector''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PBootSector = ^TBootSector;</code> | ||
+ | |||
+ | <code>TBootSector = 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: FAT12/FAT16 Boot Sector | ||
+ | |- | ||
+ | | <code>BootJump:TBootSectorJump;</code> | ||
+ | | JMP - EBh,??h,90h or E9h,??h,??h | ||
+ | |- | ||
+ | | <code>OEMName:array[0..7] of Char;</code> | ||
+ | | MSWIN4.0/MSWIN4.1/MSDOS5.0 | ||
+ | |- | ||
+ | | <code>BPB:TBiosPB;</code> | ||
+ | | See Above | ||
+ | |- | ||
+ | | <code>DriveNumber:Byte;</code> | ||
+ | | BIOS Int13 Drive No 00h, 80h, FFh etc | ||
+ | |- | ||
+ | | <code>Reserved1:Byte;</code> | ||
+ | | Always 00h | ||
+ | |- | ||
+ | | <code>BootSignature:Byte;</code> | ||
+ | | Always 29h | ||
+ | |- | ||
+ | | <code>VolumeSerial:LongWord;</code> | ||
+ | | Serial No (Date/Time when Formatted) | ||
+ | |- | ||
+ | | <code>VolumeName:array[0..10] of Char;</code> | ||
+ | | Volume Label or "NO NAME" | ||
+ | |- | ||
+ | | <code>SystemName:array[0..7] of Char;</code> | ||
+ | | System Type FAT12, FAT16, FAT32 etc | ||
+ | |- | ||
+ | | <code>BootCode:TBootSectorCode;</code> | ||
+ | | Executable Code | ||
+ | |- | ||
+ | | <code>Signature:Word;</code> | ||
+ | | Magic Number $AA55 | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Ext boot sector jumps''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TExtBootSectorJump = packed array[0..2] of Byte;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Ext boot sector code''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TExtBootSectorCode = packed array[0..419] of Byte;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Ext boot sector''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PExtBootSector = ^TExtBootSector;</code> | ||
+ | |||
+ | <code>TExtBootSector = 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: FAT32 Boot Sector | ||
+ | |- | ||
+ | | <code>BootJump:TExtBootSectorJump;</code> | ||
+ | | JMP - EBh,??h,90h or E9h,??h,??h | ||
+ | |- | ||
+ | | <code>OEMName:array[0..7] of Char;</code> | ||
+ | | MSWIN4.1 | ||
+ | |- | ||
+ | | <code>BPB:TExtBiosPB;</code> | ||
+ | | See Above | ||
+ | |- | ||
+ | | <code>DriveNumber:Byte;</code> | ||
+ | | BIOS Int13 Drive No 00h, 80h, FFh etc | ||
+ | |- | ||
+ | | <code>Reserved1:Byte;</code> | ||
+ | | Always 00h | ||
+ | |- | ||
+ | | <code>BootSignature:Byte;</code> | ||
+ | | Always 29h | ||
+ | |- | ||
+ | | <code>VolumeSerial:LongWord;</code> | ||
+ | | Serial No (Date/Time when Formatted) | ||
+ | |- | ||
+ | | <code>VolumeName:array[0..10] of Char;</code> | ||
+ | | Volume Label or "NO NAME" | ||
+ | |- | ||
+ | | <code>SystemName:array[0..7] of Char;</code> | ||
+ | | System Type FAT12, FAT16, FAT32 etc | ||
+ | |- | ||
+ | | <code>BootCode:TExtBootSectorCode;</code> | ||
+ | | Executable Code | ||
+ | |- | ||
+ | | <code>Signature:Word;</code> | ||
+ | | Magic Number $AA55 | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''NTFS boot sector jump''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TNtfsBootSectorJump = packed array[0..2] of Byte;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''NTFS boot sector code''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TNtfsBootSectorCode = packed array[0..425] of Byte;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''NTFS boot sector''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PNtfsBootSector = ^TNtfsBootSector;</code> | ||
+ | |||
+ | <code>TNtfsBootSector = 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: NTFS Boot Sector | ||
+ | |- | ||
+ | | <code>BootJump:TNtfsBootSectorJump;</code> | ||
+ | | JMP - EBh,??h,90h | ||
+ | |- | ||
+ | | <code>OEMName:array[0..7] of Char;</code> | ||
+ | | Always NTFS | ||
+ | |- | ||
+ | | <code>BPB:TNtfsBiosPB;</code> | ||
+ | | See Above (73 Bytes BPB and ExtBPB) | ||
+ | |- | ||
+ | | <code>BootCode:TNtfsBootSectorCode;</code> | ||
+ | | Executable Code | ||
+ | |- | ||
+ | | <code>Signature:Word;</code> | ||
+ | | Magic Number $AA55 | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''EXTFS boot sector''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PExtfsBootSector = ^TExtfsBootSector;</code> | ||
+ | |||
+ | <code>TExtfsBootSector = 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: EXTFS Boot Sector | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''FileSystem logging specific types''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PFileSysLogging = ^TFileSysLogging;</code> | ||
+ | |||
+ | <code>TFileSysLogging = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Logging Properties'' | ||
+ | |- | ||
+ | | <code>Logging:TLoggingDevice;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | === Class definitions === | ||
---- | ---- | ||
Revision as of 00:32, 19 January 2017
Return to Unit Reference
Contents
[hide]Description
Ultibo FileSystem interface unit
Numbering of Devices, Partitions, Volumes, Drives etc
Example:
Machine with 2 Floppy drives, 2 Fixed drives
Fixed Drive 1 has 2 Partitions (1 Primary and 1 Extended)
Fixed Drive 2 has 1 Partition (1 Primary)
\Floppy0 = Device 00h / Partition 0
\Floppy1 = Device 01h / Partition 0
\Harddisk0\Partition1 = Device 80h / Partition 1
\Harddisk0\Extended1 = Device 80h / Extended 1
\Harddisk0\Partition2 = Device 80h / Partition 2
\Harddisk1\Partition1 = Device 81h / Partition 1
\Volume1 = \Floppy0
\Volume2 = \Floppy1
\Volume3 = \Harddisk0\Partition1
\Volume4 = \Harddisk1\Partition1
\Volume5 = \Harddisk0\Partition2
A: = \Volume1
B: = \Volume2
C: = \Volume3 (Alternate Name = \HarddiskVolume1)
D: = \Volume4 (Alternate Name = \HarddiskVolume2)
E: = \Volume5 (Alternate Name = \HarddiskVolume3)
Constants
FILESYS_*
FILESYS_LOCK_*
FILESYS_CACHE_*
FILESYS_ENTRY_*
CACHE_TIMER_*
ENTRY_TIMER_*
*_PARTITION, *_DEVICE, *_VOLUME
FIND_FLAG_*
FIND_WILDCARD_*
fm*Mask
fa*
va*
da*
ia*
ca*
NAME_HASH_SIZE*
pid*
FILESYS_*_DEVICE_DESCRIPTION
FILESYS_*_CONTROLLER_DESCRIPTION
FILESYS_LOG_*
Type definitions
Storage device event
Cache timer
Entry timer
Media type
TMediaType = (mtUNKNOWN,mtINVALID,mtFLOPPY,mtFIXED,mtREMOVABLE,mtCDROM,mtDVD,mtOTHER);
|
Floppy type
TFloppyType = (ftUNKNOWN,ftINVALID,ft360K,ft12M,ft720K,ft144M,ft288M,ftATAPI);
|
Image type
TImageType = (itUNKNOWN,itINVALID,itMEMORY,itFILE,itDEVICE,itISO,itBOCHS,itVMWARE,itVPC,itVBOX);
|
Cache state
TCacheState = (csCLEAN,csDIRTY);
|
Cache mode
TCacheMode = (cmNONE,cmREADONLY,cmREADWRITE);
|
Cache page type
TCachePageType = (ptNONE,ptDEVICE);
|
Cache page state
TCachePageState = (psUNKNOWN,psEMPTY,psCLEAN,psDIRTY);
|
Cache page content
TCachePageContent = (pcUNKNOWN,pcDATA,pcDIRECTORY,pcENTRY,pcSYSTEM);
|
Cache statistics
Search
File search types
TFileSearchRec = record
Disk search
TDiskSearchRec = record
Partition search
TPartitionSearchRec = record
Volume search
TVolumeSearchRec = record
Drive search
TDriveSearchRec = record
Image search
TImageSearchRec = record
Catalog search
TCatalogSearchRec = record
Mount search
TMountSearchRec = record
Junction search
TJunctionSearchRec = record
Stream search
TStreamSearchRec = record
Link search
TLinkSearchRec = record
FAT12/FAT16 BIOS parameter block
TBiosPB = packed record
FAT32 BIOS parameter block
TExtBiosPB = packed record
NTFS BIOS parameter block
TNtfsBiosPB = packed record
Partition entry types
TPartitionEntry = packed record
Partition table
TPartitionTable = packed record
Master boot code
TMasterBootCode = packed array[0..445] of Byte;
|
Master boot record
Ext master boot code
TExtMasterBootCode = packed array[0..439] of Byte;
|
Ext master boot record
Partition record
Sector types
Boot sector jump
TBootSectorJump = packed array[0..2] of Byte;
|
Boot sector code
TBootSectorCode = packed array[0..447] of Byte;
|
Boot sector
Ext boot sector jumps
TExtBootSectorJump = packed array[0..2] of Byte;
|
Ext boot sector code
TExtBootSectorCode = packed array[0..419] of Byte;
|
Ext boot sector
NTFS boot sector jump
TNtfsBootSectorJump = packed array[0..2] of Byte;
|
NTFS boot sector code
TNtfsBootSectorCode = packed array[0..425] of Byte;
|
NTFS boot sector
EXTFS boot sector
FileSystem logging specific types
Class definitions
To be documented
Public variables
FileSystem logging
FILESYS_DEFAULT_LOG_LEVEL:LongWord = FILESYS_LOG_LEVEL_DEBUG;
|
Minimum level for FileSystem messages. Only messages with level greater than or equal to this will be printed. |
FILESYS_LOG_ENABLED:Boolean;
|
Function declarations
Initialization functions
FileSystem functions (Delphi / FreePascal RTL Equivalent)
Drive functions
function FSSetDriveLabel(ADrive:Byte; const ALabel:String):Boolean; inline;
function FSSetDriveSerial(ADrive:Byte; ASerial:LongWord):Boolean; inline;
function FSSetCurrentDrive(const ADrive:String):Boolean; inline;
File functions
function FSFileOpen(const AFileName:String; AMode:Integer):Integer; inline;
function FSFileCreate(const AFileName:String):Integer; inline;
function FSDeleteFile(const AFileName:String):Boolean; inline;
function FSRenameFile(const AOldName,ANewName:String):Boolean; inline;
function FSFileSeek(AHandle,AOffset,AOrigin:Integer):Integer; inline;
function FSFileExists(const AFileName:String):Boolean; inline;
function FSFileGetAttr(const AFileName:String):Integer; inline;
function FSFileSetAttr(const AFileName:String; AAttr:Integer):Integer; inline;
function FSFileSetDate(AHandle:Integer; AAge:Integer):Integer; inline;
function FSFileRead(AHandle:Integer; var ABuffer; ACount:Integer):Integer; inline;
function FSFileWrite(AHandle:Integer; const ABuffer; ACount:Integer):Integer; inline;
Directory functions
function FSRenameDir(const AOldName,ANewName:String):Boolean; inline;
function FSSetCurrentDir(const ADirName:String):Boolean; inline;
function FSDirectoryExists(const ADirName:String):Boolean; inline;
Search functions
function FSFindFirst(const APath:String; AAttr:Integer; var ASearchRec:TSearchRec):Integer; inline;
function FSFindNext(var ASearchRec:TSearchRec):Integer; inline;
Additional functions
function FSFileCopy(const ASourceFile,ADestFile:String; AFailIfExists:Boolean):Boolean; inline;
function FSFileCopyEx(const ASourceFile,ADestFile:String; AFailIfExists:Boolean; AUseSourceDate:Boolean; ADestDate:Integer; AUseSourceAttr:Boolean; ADestAttr:Integer):Boolean; inline;
function FSGetShortName(const AFileName:String):String; inline;
function FSGetLongName(const AFileName:String):String; inline;
function FSGetTrueName(const AFileName:String):String; inline;
Extended functions
function FSFileSeekEx(AHandle:Integer; const AOffset:Int64; AOrigin:Integer):Int64; inline;
function FSFileAgeEx(const AFileName:String):TFileTime; inline;
function FSFileSetDateEx(AHandle:Integer; AAge:TFileTime):Integer; inline;
function FSGetFileTime(AHandle:THandle; ACreateTime,AAccessTime,AWriteTime:PFileTime):Boolean; inline;
function FSSetFileTime(AHandle:THandle; ACreateTime,AAccessTime,AWriteTime:PFileTime):Boolean; inline;
function FSFindFirstEx(const APath:String; var ASearchRec:TFileSearchRec):Integer; inline;
function FSFindNextEx(var ASearchRec:TFileSearchRec):Integer; inline;
procedure FSFindCloseEx(var ASearchRec:TFileSearchRec); inline;
FileSystem functions (Win32 Compatibility)
Drive functions
function FSDefineDosDevice(const ADeviceName,ATargetPath:String; AFlags:LongWord):Boolean; inline;
function FSGetDiskType(const ARootPath:String):LongWord; inline;
function FSGetDiskFreeSpace(const ARootPath:String; var ASectorsPerCluster,ABytesPerSector,ANumberOfFreeClusters,ATotalNumberOfClusters:LongWord):Boolean; inline;
function FSGetDiskFreeSpaceEx(const APathName:String; var AFreeBytesAvailableToCaller,ATotalNumberOfBytes,ATotalNumberOfFreeBytes:Int64):Boolean; inline;
function FSGetVolumeInformation(const ARootPath:String; var AVolumeName:String; var AVolumeSerialNumber,AMaximumComponentLength,AFileSystemFlags:LongWord; var ASystemName:String):Boolean; inline;
function FSQueryDosDevice(const ARootPath:String):String; inline;
function FSSetVolumeLabel(const AVolume:String; const ALabel:String):Boolean; inline;
File functions
function FSCloseFile(AHandle:THandle):Boolean; inline;
function FSCopyFile(const AExistingName,ANewName:String; AFailIfExists:Boolean):Boolean; inline;
function FSCreateFile(const AFileName:String; AAccessMode,AShareMode,ACreateFlags,AFileAttributes:LongWord):THandle; inline;
function FSFindCloseFile(AHandle:THandle):Boolean; inline;
function FSFindFirstFile(const AFileName:String; var AFindData:TWin32FindData):THandle; inline;
function FSFindNextFile(AHandle:THandle; var AFindData:TWin32FindData):Boolean; inline;
function FSFlushFileBuffers(AHandle:THandle):Boolean; inline;
function FSGetFileAttributes(const AFileName:String):LongWord; inline;
function FSGetFileSize(AHandle:THandle; var AFileSizeHigh:LongWord):LongWord; inline;
function FSGetFullPathName(const AFileName:String):String; inline;
function FSGetShortPathName(const ALongPath:String):String; inline;
function FSMoveFile(const AExistingName,ANewName:String):Boolean; inline;
function FSReadFile(AHandle:THandle; var ABuffer; ABytesToRead:LongWord; var ABytesRead:LongWord):Boolean; inline;
function FSSetFileAttributes(const AFileName:String; AFileAttributes:LongWord):Boolean; inline;
function FSSetFilePointer(AHandle:THandle; ADistanceToMove:LongWord; var ADistanceToMoveHigh:LongWord; AMoveMethod:LongWord):LongWord; inline;
function FSSetFilePointerEx(AHandle:THandle; const ADistanceToMove:Int64; var ANewFilePointer:Int64; AMoveMethod:LongWord):Boolean; inline;
function FSWriteFile(AHandle:THandle;const ABuffer; ABytesToWrite:LongWord; var ABytesWritten:LongWord):Boolean; inline;
function FSGetLongPathName(const AShortPath:String):String; inline;
function FSSetFileShortName(const AFileName,AShortName:String):Boolean;
function FSSetFileShortNameEx(AHandle:THandle; const AShortName:String):Boolean;
function FSCreateHardLink(const ALinkName,AFileName:String):Boolean;
function FSCreateSymbolicLink(const ALinkName,ATargetName:String; ADirectory:Boolean):Boolean;
Directory functions
function FSCreateDirectory(const APathName:String):Boolean; inline;
function FSRemoveDirectory(const APathName:String):Boolean; inline;
function FSSetCurrentDirectory(const APathName:String):Boolean; inline;
RTL FileSystem functions
System file functions
procedure SystemDoRename(Name1,Name2:PChar; Name1Changeable,Name2Changeable:Boolean);
function SystemDoWrite(Handle:THandle; Address:Pointer; Len:LongInt):LongInt;
function SystemDoRead(Handle:THandle; Address:Pointer; Len:LongInt):LongInt;
procedure SystemDoOpen(var F; Name:PFileTextRecChar; Flags:LongInt; NameChangeable:Boolean);
System directory functions
Dos disk functions
Dos FindFirst/FindNext functions
function DosFindFirst(const Path:PathStr; Attr:Word; var f:SearchRec):Integer;
Dos file functions
SysUtils file functions
function SysUtilsFileOpen(const FileName:RawByteString; Mode:Integer):THandle;
function SysUtilsFileCreate(const FileName:RawByteString):THandle;
function SysUtilsDeleteFile(const FileName:RawByteString):Boolean;
function SysUtilsRenameFile(const OldName,NewName:RawByteString):Boolean;
function SysUtilsFileSeek(Handle:THandle; Offset,Origin:LongInt):LongInt;
function SysUtilsFileTruncate(Handle:THandle;Size:Int64):Boolean;
function SysUtilsFileAge(const FileName:RawByteString):LongInt;
function SysUtilsFileExists(const FileName:RawByteString):Boolean;
function SysUtilsFileGetAttr(const FileName:RawByteString):LongInt;
function SysUtilsFileSetAttr(const FileName:RawByteString; Attr:LongInt):LongInt;
function SysUtilsFileSetDate(Handle:THandle; Age:LongInt):LongInt;
function SysUtilsFileRead(Handle:THandle; out Buffer; Count:LongInt):LongInt;
function SysUtilsFileWrite(Handle:THandle; const Buffer; Count:LongInt):LongInt;
function SysUtilsFileSeekEx(Handle:THandle; Offset:Int64; Origin:LongInt):Int64;
function SysUtilsInternalFindFirst(const Path:RawByteString; Attr:LongInt; out SearchRec:TSearchRec; var Name:RawByteString):LongInt;
function SysUtilsInternalFindNext(var SearchRec:TSearchRec; var Name:RawByteString):LongInt;
SysUtils disk functions
function SysUtilsDirectoryExists(const Directory:RawByteString):Boolean;
FileSystem logging functions
function FileSysLoggingStart(Logging:PLoggingDevice):LongWord;
function FileSysLoggingStop(Logging:PLoggingDevice):LongWord;
function FileSysLoggingOutput(Logging:PLoggingDevice; const Data:String):LongWord;
function FileSysLoggingSetTarget(Logging:PLoggingDevice; const Target:String):LongWord;
FileSystem helper functions
function FileSysStorageGetMediaType(Storage:PStorageDevice):TMediaType;
function FileSysStorageGetController(Storage:PStorageDevice):TDiskController;
procedure FileSysStorageDeviceAdd(Event:PStorageDeviceEvent);
procedure FileSysStorageDeviceInsert(Event:PStorageDeviceEvent);
function FileSysStorageDeviceRemove(Storage:PStorageDevice):LongWord;
function FileSysStorageDeviceEject(Storage:PStorageDevice):LongWord;
function FileSysStorageDeviceEnum(Storage:PStorageDevice; Data:Pointer):LongWord;
function FileSysStorageDeviceNotify(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;
function ComparePartitions(APartition1,APartition2:Pointer):Integer;
function StringToFileSysType(const AFileSysType:String):TFileSysType;
function StringToPartitionId(const APartitionId:String):Byte;
function CachePageTimeToDateTime(const APageTime:Int64):TDateTime;
Return to Unit Reference