#include <lvm_intr.h> ADDRESS _System Create_Partition( ADDRESS Handle, /* (I) Handle to disk or free space block */ CARDINAL32 Size, /* (I) Partition size, in sectors */ char Name[ PARTITION_NAME_SIZE ], /* (I) Partition name */ Allocation_Algorithm Algorithm, /* (I) Free space selection algorithm */ BOOLEAN Bootable, /* (I) TRUE if partition must be bootable */ BOOLEAN Primary_Partition, /* (I) TRUE if partition must be primary */ BOOLEAN Allocate_From_Start, /* (I) TRUE to allocate from start of free space */ CARDINAL32 * Error_Code /* (O) Address where the error code will be stored */ );
Parameters
In the event that a disk handle is provided, the LVM Engine will automatically determine which block of free space, out of those available on the disk, should be used to create the new partition. In this case, the Algorithm parameter will govern how this determination is to be made.
If the partition cannot be made bootable according to the above criteria, the partition will not be created, and the value pointed to by Error_Code will be non-zero.
If the Primary_Partition parameter is set to FALSE, then it is assumed that OS/2 is the operating system that will be booted.
Returns
The function return value will be the handle of the partition created. If the partition could not be created, then NULL will be returned, and the value pointed to by Error_Code will be non-zero.
Errors
If an error occurs, the value pointed to by Error_Code will be greater than 0.
If the partition cannot be created, then any memory allocated by this function will be freed, and the partitioning of the disk in question will be unchanged.
Side Effects
A partition may be created on a disk drive.
Notes
If Handle is not a valid handle, then a trap may result.
If Handle is the handle of a partition or volume, then the function will abort, and the value pointed to by Error_Code will be non-zero.
16-Bit Equivalent:
CARDINAL32 _Far16 _Pascal _loadds CREATE_PARTITION16( CARDINAL32 Handle, CARDINAL32 Size, char * _Seg16 Name, Allocation_Algorithm Algorithm, BOOLEAN Bootable, BOOLEAN Primary_Partition, BOOLEAN Allocate_From_Start, CARDINAL32 * _Seg16 Error_Code );