--- Cannot embed stylesheet: [Errno 2] No such file or directory: '../../../aros.css' --->
| AddPartition() | CreatePartitionTable() | DeletePartition() | DestroyPartitionTable() |
| SetPartitionAttrs() | SetPartitionTableAttrs() | WritePartitionDataQ() | WritePartitionTable() |
struct PartitionHandle * AddPartition(
struct PartitionHandle * root,
const struct TagItem * taglist );
struct PartitionHandle * AddPartitionTags(
struct PartitionHandle * root,
TAG tag, ... );
Add a new partition.
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, ...)
PartitionHandle of the new partition; 0 for an error
LONG CreatePartitionTable(
struct PartitionHandle * root,
ULONG type );
Create a new partition table.
root - partition to create table in type - the type of the partition table to create
0 on success; an error code otherwise
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().
void DeletePartition(
struct PartitionHandle * ph );
Delete a partition along with its subpartitions.
ph - PartitionHandle to delete
LONG DestroyPartitionTable(
struct PartitionHandle * root );
Destroy a partition table by immediately overwriting table data on disk.
root - partition table to destroy
0 on success; an error code otherwise
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.
LONG SetPartitionAttrs(
struct PartitionHandle * ph,
const struct TagItem * taglist );
LONG SetPartitionAttrsTags(
struct PartitionHandle * ph,
TAG tag, ... );
Set attributes of a partition
ph - PartitionHandle taglist - list of attributes; unknown tags are ignored
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)
LONG SetPartitionTableAttrs(
struct PartitionHandle * root,
const struct TagItem * taglist );
LONG SetPartitionTableAttrsTags(
struct PartitionHandle * root,
TAG tag, ... );
Set attributes of a partition table.
ph - PartitionHandle of the partition table taglist - list of attributes; unknown tags are ignored
LONG WritePartitionDataQ(
struct PartitionHandle * Partition,
APTR Buffer,
ULONG DataSize,
UQUAD StartBlock );
Write raw data to the partition.
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.
Return code of DoIO() function which was used to write the data.
LONG WritePartitionTable(
struct PartitionHandle * root );
Write a partition table; writing this partition table doesn't affect subpartition tables.
root - partition table to write
0 for success; an error code otherwise