Return to Unit Filesystem
Description
To be documented
Class definitions
[Expand]
TDiskPartition = class(TListObject)
constructor Create(ADriver:TFileSysDriver; ADevice:TDiskDevice; APartition:TDiskPartition; APartitionNo:Integer);
|
|
destructor Destroy; override;
|
|
private
|
FLock:TSynchronizerHandle;
|
|
FLocalLock:TMutexHandle;
|
|
protected
|
FDriver:TFileSysDriver;
|
|
FDevice:TDiskDevice;
|
|
FPartition:TDiskPartition;
|
|
|
FPartitionNo:Integer;
|
\Partition1, \Partition2 etc - See Notes
|
|
FEntryNo:Integer;
|
0,1,2,3
|
FPartitionId:Byte;
|
Partition Type from Table
|
|
FBeginHead:Word;
|
Logical Starting Head (not Physical)
|
FBeginSector:Word;
|
Logical Starting Sector (not Physical)
|
FBeginCylinder:Word;
|
Logical Starting Cylinder (not Physical)
|
FEndHead:Word;
|
Logical Ending Head (not Physical)
|
FEndSector:Word;
|
Logical Ending Sector (not Physical)
|
FEndCylinder:Word;
|
Logical Ending Cylinder (not Physical)
|
FSectorOffset:LongWord;
|
Offset in Sectors from Location of Table to StartSector
|
|
FActive:Boolean;
|
Active Partition Indicator ($80)
|
FExtended:Boolean;
|
Extended Partition Type (no Volume) - Set by Recognizer
|
FRecognizable:Boolean;
|
Partition allows Recognize Partition
|
FRecognized:Boolean;
|
Recognized Partition Id - Set by Recognizer
|
|
FNonVolume:Boolean;
|
Non Volume Partition (eg Linux Swap) - Set by Recognizer
|
FMultiVolume:Boolean;
|
Multiple Volume Partition (eg Netware) - Set by Recognizer
|
|
FStartSector:Int64;
|
Absolute Start Sector on Device
|
FSectorCount:LongWord;
|
Total Sectors in Partition
|
|
function AcquireLock:Boolean;
|
|
function ReleaseLock:Boolean;
|
|
|
function GetName:String;
|
|
function GetPath:String;
|
|
function GetParent:String;
|
|
function GetLogical:Boolean;
|
|
function GetPrimary:Boolean;
|
|
procedure SetExtended(AExtended:Boolean);
|
|
|
function GetFreeSectors:LongWord;
|
Unused Sectors in Partition
|
function GetAvailableSectors:LongWord;
|
Largest block of Unused Sectors
|
|
function GetAvailableBlock(var AStart,ACount:LongWord):Boolean;
|
|
|
function GetRoot:TDiskPartition;
|
|
function GetParentStart:LongWord;
|
|
|
function GetPartitionRecord(ARecord:Pointer,ASector:LongWord):Boolean; virtual;
|
|
function SetPartitionRecord(ARecord:Pointer,ASector:LongWord):Boolean; virtual;
|
|
public
|
property Name:String read GetName;
|
|
property Path:String read GetPath;
|
|
property Parent:String read GetParent;
|
|
property Device:TDiskDevice read FDevice;
|
|
property Partition:TDiskPartition read FPartition;
|
|
property PartitionNo:Integer read FPartitionNo;
|
|
|
property EntryNo:Integer read FEntryNo write FEntryNo;
|
|
property PartitionId:Byte read FPartitionId;
|
|
|
property BeginHead:Word read FBeginHead;
|
|
property BeginSector:Word read FBeginSector;
|
|
property BeginCylinder:Word read FBeginCylinder;
|
|
property EndHead:Word read FEndHead;
|
|
property EndSector:Word read FEndSector;
|
|
property EndCylinder:Word read FEndCylinder;
|
|
property SectorOffset:LongWord read FSectorOffset;
|
|
|
property Active:Boolean read FActive;
|
|
property Logical:Boolean read GetLogical;
|
|
property Primary:Boolean read GetPrimary;
|
|
property Extended:Boolean read FExtended write SetExtended;
|
|
property Recognizable:Boolean read FRecognizable;
|
|
property Recognized:Boolean read FRecognized write FRecognized;
|
|
|
property NonVolume:Boolean read FNonVolume write FNonVolume;
|
|
property MultiVolume:Boolean read FMultiVolume write FMultiVolume;
|
|
|
property StartSector:Int64 read FStartSector;
|
|
property SectorCount:LongWord read FSectorCount;
|
|
|
property FreeSectors:LongWord read GetFreeSectors;
|
|
property AvailableSectors:LongWord read GetAvailableSectors;
|
|
|
property Root:TDiskPartition read GetRoot;
|
|
property ParentStart:LongWord read GetParentStart;
|
|
|
function ReaderLock:Boolean;
|
|
function ReaderUnlock:Boolean;
|
|
function ReaderConvert:Boolean;
|
|
function WriterLock:Boolean;
|
|
function WriterUnlock:Boolean;
|
|
function WriterConvert:Boolean;
|
|
|
function PartitionInit:Boolean; virtual;
|
|
|
function LocatePartitions:Boolean; virtual;
|
|
function LocateVolumes:Boolean; virtual;
|
|
|
function CreateVolume:TDiskVolume; virtual;
|
|
function DeleteVolume(AVolume:TDiskVolume):Boolean; virtual;
|
|
|
function OpenPartition(AMode:Integer):THandle; virtual;
|
|
procedure ClosePartition(AHandle:THandle); virtual;
|
|
function ReadPartition(AHandle:THandle; var ABuffer; ACount:Integer):Integer; virtual;
|
|
function WritePartition(AHandle:THandle; const ABuffer; ACount:Integer):Integer; virtual;
|
|
function SeekPartition(AHandle:THandle; const AOffset:Int64; AOrigin:Integer):Int64; virtual;
|
|
Function declarations
[Expand]
constructor TDiskPartition.Create(ADriver:TFileSysDriver; ADevice:TDiskDevice; APartition:TDiskPartition; APartitionNo:Integer);
Description: To be documented
[Expand]
destructor TDiskPartition.Destroy;
Description: To be documented
[Expand]
function TDiskPartition.AcquireLock:Boolean;
Description: To be documented
[Expand]
function TDiskPartition.ReleaseLock:Boolean;
Description: To be documented
[Expand]
function TDiskPartition.GetName:String;
Description: To be documented
[Expand]
function TDiskPartition.GetPath:String;
Description: To be documented
[Expand]
function TDiskPartition.GetParent:String;
Description: To be documented
[Expand]
function TDiskPartition.GetLogical:Boolean;
Description: Check for a non extended partition with a parent
[Expand]
function TDiskPartition.GetPrimary:Boolean;
Description: Check for a non extended partition with no parent
[Expand]
procedure TDiskPartition.SetExtended(AExtended:Boolean);
Description: Mark partition as extended, update no and recalculate start
Note
|
Once extended is enabled it cannot be turned off
If already enabled then no action is taken
|
[Expand]
function TDiskPartition.GetFreeSectors:LongWord;
Description: Get the total Count of Unused Sectors in the Partition
[Expand]
function TDiskPartition.GetAvailableSectors:LongWord;
Description: Get the largest Count of Unused Sectors in the Partition
[Expand]
function TDiskPartition.GetAvailableBlock(var AStart,ACount:LongWord):Boolean;
Description: Get the Start and Count of largest Unused Sectors in the Partition
[Expand]
function TDiskPartition.GetRoot:TDiskPartition;
Description: Returns the first level extended for a second level plus partition
[Expand]
function TDiskPartition.GetParentStart:LongWord;
Description: To be documented
[Expand]
function TDiskPartition.ReaderLock:Boolean;
Description: To be documented
[Expand]
function TDiskPartition.ReaderUnlock:Boolean;
Description: To be documented
[Expand]
function TDiskPartition.ReaderConvert:Boolean;
Description: Convert a Reader lock to a Writer lock
[Expand]
function TDiskPartition.WriterLock:Boolean;
Description: To be documented
[Expand]
function TDiskPartition.WriterUnlock:Boolean;
Description: To be documented
[Expand]
function TDiskPartition.WriterConvert:Boolean;
Description: Convert a Writer lock to a Reader lock
[Expand]
function TDiskPartition.PartitionInit:Boolean;
Description: To be documented
[Expand]
function TDiskPartition.LocatePartitions:Boolean;
Description: To be documented
[Expand]
function TDiskPartition.LocateVolumes:Boolean;
Description: To be documented
[Expand]
function TDiskPartition.CreateVolume:TDiskVolume;
Description: To be documented
[Expand]
function TDiskPartition.DeleteVolume(AVolume:TDiskVolume):Boolean;
Description: To be documented
Note
|
Caller must hold the volume writer lock
|
[Expand]
function TDiskPartition.OpenPartition(AMode:Integer):THandle; virtual;
Description: To be documented
[Expand]
procedure TDiskPartition.ClosePartition(AHandle:THandle); virtual;
Description: To be documented
[Expand]
function TDiskPartition.ReadPartition(AHandle:THandle; var ABuffer; ACount:Integer):Integer; virtual;
Description: To be documented
Note
|
Raw Reads must be in Sector sized multiples
|
[Expand]
function TDiskPartition.WritePartition(AHandle:THandle; const ABuffer; ACount:Integer):Integer; virtual;
Description: To be documented
Note
|
Raw Writes must be in Sector sized multiples
|
[Expand]
function TDiskPartition.SeekPartition(AHandle:THandle; const AOffset:Int64; AOrigin:Integer):Int64; virtual;
Description: To be documented
Note
|
Raw Seeks must be in Sector sized multiples
Raw Seeks cannot extend the size of the Partition
|
Return to Unit Reference