Create_Volume

This function creates a volume from a list of partitions. The partitions are specified by their corresponding handles.


#include <lvm_intr.h>

void _System Create_Volume(

    char         Name[ VOLUME_NAME_SIZE ],   /* (I) The name to assign to the volume */
    BOOLEAN      Create_LVM_Volume,          /* (I) TRUE to create an LVM Volume, FALSE to create a Compatibility Volume */
    BOOLEAN      Bootable,                   /* (I) TRUE if the new volume must be bootable */
    char         Drive_Letter_Preference,    /* (I) The drive letter to assign to the volume */
    CARDINAL32   FeaturesToUse,              /* (I) Reserved field, must be 0 */
    CARDINAL32   Partition_Count,            /* (I) The number of partition handles being specified */
    ADDRESS      Partition_Handles[ ],       /* (I) Array of partition handles */
    CARDINAL32 * Error_Code                  /* (O) Address where the error code will be stored */

);

Parameters

Name
The name to assign to the newly created volume.
Create_LVM_Volume
If TRUE, then an LVM volume is created; otherwise, a compatibility volume is created.
Bootable
If TRUE, the volume will not be created unless OS/2 can be booted from it.

If this value is TRUE and Boot Manager is not installed, then the volume must consist of a primary partition on the first drive in the system. In this event, the volume will be set as Startable.

If Boot Manager is installed, setting this value to TRUE will cause the newly-created volume to be added to the Boot Manager menu automatically.

Note that if this value is TRUE, Create_LVM_Volume must be set to FALSE, otherwise the volume creation will fail.

Drive_Letter_Preference
This is the drive letter to use for accessing the newly created volume, specified as a literal character (e.g. 'C', 'F', etc.). Specifying a non-alphabetic character will cause the volume to be created without a drive letter (i.e. 'hidden').
FeaturesToUse
This is currently reserved for future use and should always be set to 0.
Partition_Count
The number of partition handles being specified in the Partition_Handles array. This indicates the total number of partitions that will be linked together to form the volume being created.
Partition_Handles
An array of partition handles, each one specifying a partition that is to become part of the volume being created.
Error_Code
The address of a CARDINAL32 in which to store an error code should an error occur.

Returns

N/A.

Errors

If Drive_Letter_Preference specifies a drive letter which is already in use by a non-LVM-controlled drive (such as a network drive), then a trap is likely.

If any of the handles specified in Partition_Handles is not a valid handle, then a trap is likely. If any of the handles are not partition handles, then the volume will not be created, and an error condition will result.

If Partition_Count is greater than the number of items in Partition_Handles, then a trap is likely.

The volume will not be created if any of the specified requirements cannot be met.

If the volume cannot be created, then the existing partition/volume structure of the disk will be unchanged, any memory allocated by this function will be freed, and the value pointed to by Error_Code will be greater than 0.

Side Effects

A volume may be created.

Notes

None.

16-Bit Equivalent:

void _Far16 _Pascal _loadds CREATE_VOLUME16(
        char   *     _Seg16 Name,
        BOOLEAN             Create_LVM_Volume,
        BOOLEAN             Bootable,
        char                Drive_Letter_Preference,
        CARDINAL32          FeaturesToUse,
        CARDINAL32          Partition_Count,
        CARDINAL32 * _Seg16 Partition_Handles,
        CARDINAL32 * _Seg16 Error_Code
);