Difference between revisions of "TDiskPartition"
From Ultibo.org
(Created page with "Return to Unit Filesystem __TOC__ === Description === ---- ''To be documented'' === Class definitions === ---- <div class="toccolours mw-collapsible...") |
|||
Line 313: | Line 313: | ||
|colspan="2"| | |colspan="2"| | ||
|- | |- | ||
− | | <code>function OpenPartition(AMode:Integer): | + | | <code>function OpenPartition(AMode:Integer):THandle; virtual;</code> |
| | | | ||
|- | |- | ||
− | | <code>procedure ClosePartition(AHandle: | + | | <code>procedure ClosePartition(AHandle:THandle); virtual;</code> |
| | | | ||
|- | |- | ||
− | | <code>function ReadPartition(AHandle: | + | | <code>function ReadPartition(AHandle:THandle; var ABuffer; ACount:Integer):Integer; virtual;</code> |
| | | | ||
|- | |- | ||
− | | <code>function WritePartition(AHandle: | + | | <code>function WritePartition(AHandle:THandle; const ABuffer; ACount:Integer):Integer; virtual;</code> |
| | | | ||
|- | |- | ||
− | | <code>function SeekPartition(AHandle: | + | | <code>function SeekPartition(AHandle:THandle; const AOffset:Int64; AOrigin:Integer):Int64; virtual;</code> |
| | | | ||
|- | |- | ||
Line 650: | Line 650: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <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 TDiskPartition.OpenPartition(AMode:Integer): | + | <pre style="border: 0; padding-bottom:0px;">function TDiskPartition.OpenPartition(AMode:Integer):THandle; virtual;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <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;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
Line 662: | Line 662: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <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 TDiskPartition.ClosePartition(AHandle: | + | <pre style="border: 0; padding-bottom:0px;">procedure TDiskPartition.ClosePartition(AHandle:THandle); virtual;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <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;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
Line 674: | Line 674: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <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 TDiskPartition.ReadPartition(AHandle: | + | <pre style="border: 0; padding-bottom:0px;">function TDiskPartition.ReadPartition(AHandle:THandle; var ABuffer; ACount:Integer):Integer; virtual;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <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;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
Line 686: | Line 686: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <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 TDiskPartition.WritePartition(AHandle: | + | <pre style="border: 0; padding-bottom:0px;">function TDiskPartition.WritePartition(AHandle:THandle; const ABuffer; ACount:Integer):Integer; virtual;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <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;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
Line 698: | Line 698: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <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 TDiskPartition.SeekPartition(AHandle: | + | <pre style="border: 0; padding-bottom:0px;">function TDiskPartition.SeekPartition(AHandle:THandle; const AOffset:Int64; AOrigin:Integer):Int64; virtual;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <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;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> |
Revision as of 04:23, 22 January 2025
Return to Unit Filesystem
Description
To be documented
Class definitions
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
constructor TDiskPartition.Create(ADriver:TFileSysDriver; ADevice:TDiskDevice; APartition:TDiskPartition; APartitionNo:Integer);
Description: To be documented
Note | None documented |
---|
destructor TDiskPartition.Destroy;
Description: To be documented
Note | None documented |
---|
function TDiskPartition.AcquireLock:Boolean;
Description: To be documented
Note | None documented |
---|
function TDiskPartition.ReleaseLock:Boolean;
Description: To be documented
Note | None documented |
---|
function TDiskPartition.GetName:String;
Description: To be documented
Note | None documented |
---|
function TDiskPartition.GetPath:String;
Description: To be documented
Note | None documented |
---|
function TDiskPartition.GetParent:String;
Description: To be documented
Note | None documented |
---|
function TDiskPartition.GetLogical:Boolean;
Description: Check for a non extended partition with a parent
Note | None documented |
---|
function TDiskPartition.GetPrimary:Boolean;
Description: Check for a non extended partition with no parent
Note | None documented |
---|
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 |
---|
function TDiskPartition.GetFreeSectors:LongWord;
Description: Get the total Count of Unused Sectors in the Partition
Note | None documented |
---|
function TDiskPartition.GetAvailableSectors:LongWord;
Description: Get the largest Count of Unused Sectors in the Partition
Note | None documented |
---|
function TDiskPartition.GetAvailableBlock(var AStart,ACount:LongWord):Boolean;
Description: Get the Start and Count of largest Unused Sectors in the Partition
Note | None documented |
---|
function TDiskPartition.GetRoot:TDiskPartition;
Description: Returns the first level extended for a second level plus partition
Note | None documented |
---|
function TDiskPartition.GetParentStart:LongWord;
Description: To be documented
Note | None documented |
---|
function TDiskPartition.ReaderLock:Boolean;
Description: To be documented
Note | None documented |
---|
function TDiskPartition.ReaderUnlock:Boolean;
Description: To be documented
Note | None documented |
---|
function TDiskPartition.ReaderConvert:Boolean;
Description: Convert a Reader lock to a Writer lock
Note | None documented |
---|
function TDiskPartition.WriterLock:Boolean;
Description: To be documented
Note | None documented |
---|
function TDiskPartition.WriterUnlock:Boolean;
Description: To be documented
Note | None documented |
---|
function TDiskPartition.WriterConvert:Boolean;
Description: Convert a Writer lock to a Reader lock
Note | None documented |
---|
function TDiskPartition.PartitionInit:Boolean;
Description: To be documented
Note | None documented |
---|
function TDiskPartition.LocatePartitions:Boolean;
Description: To be documented
Note | None documented |
---|
function TDiskPartition.LocateVolumes:Boolean;
Description: To be documented
Note | None documented |
---|
function TDiskPartition.CreateVolume:TDiskVolume;
Description: To be documented
Note | None documented |
---|
function TDiskPartition.DeleteVolume(AVolume:TDiskVolume):Boolean;
Description: To be documented
Note | Caller must hold the volume writer lock |
---|
function TDiskPartition.OpenPartition(AMode:Integer):THandle; virtual;
Description: To be documented
Note | None documented |
---|
procedure TDiskPartition.ClosePartition(AHandle:THandle); virtual;
Description: To be documented
Note | None documented |
---|
function TDiskPartition.ReadPartition(AHandle:THandle; var ABuffer; ACount:Integer):Integer; virtual;
Description: To be documented
Note | Raw Reads must be in Sector sized multiples |
---|
function TDiskPartition.WritePartition(AHandle:THandle; const ABuffer; ACount:Integer):Integer; virtual;
Description: To be documented
Note | Raw Writes must be in Sector sized multiples |
---|
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