AddBootFileSystem()
Synopsis
LONG AddBootFileSystem(
struct Node * handle );
Function
Adds the specified filesystem to the system list of bootable
filesystems (actually FileSystem.resource).
Result
Zero if everything went okay or common dos.library-compliant error code.
Notes
This function can be called during system startup before dos.library
is available. In this case filesystem loading will be delayed until
dos.library started up. Delayed loading will be handled automatically
without any caller's intervention.
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.
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.
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().
DestroyPartitionTable()
Synopsis
LONG DestroyPartitionTable(
struct PartitionHandle * root );
Function
Destroy a partition table by immediately overwriting table data on
disk.
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.
FindFileSystemA()
Synopsis
struct Node * FindFileSystemA(
struct PartitionHandle * table,
const struct TagItem * taglist );
struct Node * FindFileSystem(
struct PartitionHandle * table,
TAG tag, ... );
Function
Locate a filesystem handler in the partition.
Result
Abstract handle of a filesystem or NULL if the filesystem with the
given parameters was not located in the partition.
GetFileSystemAttrsA()
Synopsis
void GetFileSystemAttrsA(
struct Node * handle,
const struct TagItem * taglist );
void GetFileSystemAttrs(
struct Node * handle,
TAG tag, ... );
Function
get attributes of a partition table
Notes
Name is returned as a pointer to an internally allocated string. You
should copy it if you want to keep it after the filesystem's
partition table handle has been closed.
The following fields in struct FileSysEntry will not be filled in:
- Node name
- fse_Handler
- fse_SegList
You need to query for the filesystem's name separately and copy it
into a BSTR yourself, if you need to. Loading the handler is done by
the LoadFileSystem() function.
GetPartitionAttrs()
Synopsis
LONG GetPartitionAttrs(
struct PartitionHandle * ph,
const struct TagItem * taglist );
LONG GetPartitionAttrsTags(
struct PartitionHandle * ph,
TAG tag, ... );
Function
Get attributes of a partition.
Result
Currently reserved, always zero.
Notes
Nested partition tables (e.g. RDB subpartitions on PC MBR drive) are
treated as virtual disks. In this case start and end block numbers are
relative to the beginning of the virtual disk (which is represented by
a parent partition containing the RDB itself), not absolute numbers.
The same applies to DriveGeomerty and geometry-related fields in the
DosEnvec structure.
Note that geometry data can be stored on disk in the partition table
ifself (RDB for example), and this way it may not match the physical
device's geometry (for example, if the disk was partitioned on
another operating system which used virtual geometry). In this case
you might need to adjust these data in order to mount the file system
correctly (if absolute start/end blocks are not cylinder-aligned).
Starting from V2, partition.library always provides default values
for all attributes, even for those not listed as readable in
QueryPartitionAttrs() results.
GetPartitionTableAttrs()
Synopsis
LONG GetPartitionTableAttrs(
struct PartitionHandle * root,
const struct TagItem * taglist );
LONG GetPartitionTableAttrsTags(
struct PartitionHandle * root,
TAG tag, ... );
Function
Get attributes of a partition table.
LoadBootFileSystems()
Synopsis
LONG LoadBootFileSystems();
Function
Perform a deferred loading of boot filesystems.
Result
Zero if everything went okay or DOS error code in case of failure.
Notes
This function is actually private; it's called by dos.library during
the initialization process. There's no sense to call it from within
user software.
OpenPartitionTable()
Synopsis
LONG OpenPartitionTable(
struct PartitionHandle * root );
Function
Open a partition table. On success root->list will be filled with a
list of PartitionHandles. If one partition contains more
subpartitions, the caller should call OpenPartitionTable() on the
PartitionHandle recursively.
Result
0 for success; an error code otherwise.
QueryPartitionTableAttrs()
Synopsis
const struct PartitionAttribute * QueryPartitionTableAttrs(
struct PartitionHandle * table );
Function
Query partition table attributes.
Result
List of NULL-terminated ULONGs with attributes.
ReadPartitionDataQ()
Synopsis
LONG ReadPartitionDataQ(
struct PartitionHandle * Partition,
APTR Buffer,
ULONG DataSize,
UQUAD StartBlock );
Function
Read raw data from the partition.
Result
Return code of DoIO() function which was used to read the data.
SetPartitionAttrs()
Synopsis
LONG SetPartitionAttrs(
struct PartitionHandle * ph,
const struct TagItem * taglist );
LONG SetPartitionAttrsTags(
struct PartitionHandle * ph,
TAG tag, ... );
Function
Set attributes of a partition
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.
WritePartitionDataQ()
Synopsis
LONG WritePartitionDataQ(
struct PartitionHandle * Partition,
APTR Buffer,
ULONG DataSize,
UQUAD StartBlock );
Function
Write raw data to the partition.
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.
Result
0 for success; an error code otherwise