ptedit
| AddPartition() | CreatePartitionTable() | DeletePartition() | DestroyPartitionTable() |
| SetPartitionAttrs() | SetPartitionTableAttrs() | WritePartitionDataQ() | WritePartitionTable() |
AddPartition()
Synopsis
struct PartitionHandle * AddPartition(
struct PartitionHandle * root,
const struct TagItem * taglist );
struct PartitionHandle * AddPartitionTags(
struct PartitionHandle * root,
TAG tag, ... );
Function
Add a new partition.
Inputs
root - PartitionHandle, where to add the new partition
taglist - tags that specify more information about the partition
unknown tags are ignored
PT_DOSENVEC - ptr to a DosEnvec
de_LowCyl and de_HighCyl specify start and end of cylinder
de_Reserved, de_Bootblocks, ...
de_Surfaces, de_BlocksPerTrack, ... are inherited from "root"
PT_TYPE - partition type (depends on PartitionTable type)
PT_POSITION - position number within the partition table (MBR->PC)
PT_ACTIVE - set this partition active (MBR->PC)
PT_NAME - set partition name (HD0, HD1, ...)
Result
PartitionHandle of the new partition; 0 for an error
CreatePartitionTable()
Synopsis
LONG CreatePartitionTable(
struct PartitionHandle * root,
ULONG type );
Function
Create a new partition table.
Inputs
root - partition to create table in type - the type of the partition table to create
Result
0 on success; an error code otherwise
Notes
After calling this function the state of the PartitionHandle will be the same as when calling OpenPartitionTable(). Therefore before closing the PartitionHandle you should call ClosePartitionTable().
DeletePartition()
Synopsis
void DeletePartition(
struct PartitionHandle * ph );
Function
Delete a partition along with its subpartitions.
Inputs
ph - PartitionHandle to delete
DestroyPartitionTable()
Synopsis
LONG DestroyPartitionTable(
struct PartitionHandle * root );
Function
Destroy a partition table by immediately overwriting table data on disk.
Inputs
root - partition table to destroy
Result
0 on success; an error code otherwise
Notes
After calling this function the state of the PartitionHandle will be the same as before calling OpenPartitionTable(). Therefore do not reference any child PartitionHandles any more.
SetPartitionAttrs()
Synopsis
LONG SetPartitionAttrs(
struct PartitionHandle * ph,
const struct TagItem * taglist );
LONG SetPartitionAttrsTags(
struct PartitionHandle * ph,
TAG tag, ... );
Function
Set attributes of a partition
Inputs
ph - PartitionHandle taglist - list of attributes; unknown tags are ignored
Tags
PT_DOSENVEC - set new DosEnvec values PT_TYPE - change partition type (MBR-PC) PT_POSITION - move partition to another position (MBR-PC) PT_ACTIVE - set partition active PT_NAME - change name of partition (max 31 Bytes + NULL-byte)
SetPartitionTableAttrs()
Synopsis
LONG SetPartitionTableAttrs(
struct PartitionHandle * root,
const struct TagItem * taglist );
LONG SetPartitionTableAttrsTags(
struct PartitionHandle * root,
TAG tag, ... );
Function
Set attributes of a partition table.
Inputs
ph - PartitionHandle of the partition table taglist - list of attributes; unknown tags are ignored
WritePartitionDataQ()
Synopsis
LONG WritePartitionDataQ(
struct PartitionHandle * Partition,
APTR Buffer,
ULONG DataSize,
UQUAD StartBlock );
Function
Write raw data to the partition.
Inputs
Partition - a handle to a partition to read from
Buffer - a pointer to a data buffer
DataSize - Size of data to read in bytes. This size must be a
multiple of block size in order to ensure correct
operation.
StartBlock - Number of the first block to start writing from.
Result
Return code of DoIO() function which was used to write the data.
WritePartitionTable()
Synopsis
LONG WritePartitionTable(
struct PartitionHandle * root );
Function
Write a partition table; writing this partition table doesn't affect subpartition tables.
Inputs
root - partition table to write
Result
0 for success; an error code otherwise


