/* The following are invariant for a disk drive. */
typedef struct _Drive_Control_Record
{
CARDINAL32 Drive_Number; /* OS/2 Drive Number for this drive. */
CARDINAL32 Drive_Size; /* The total number of sectors on the drive. */
ULONG Drive_Serial_Number; /* The serial number assigned to this drive.
For info. purposes only. */
PVOID Drive_Handle; /* Handle used for operations on the disk that
this record corresponds to. */
CARDINAL32 Cylinder_Count; /* The number of cylinders on the drive. */
CARDINAL32 Heads_Per_Cylinder; /* The number of heads per cylinder for this drive. */
CARDINAL32 Sectors_Per_Track; /* The number of sectors per track for this drive. */
BOOLEAN Drive_Is_PRM; /* Set to TRUE if this drive is a PRM. */
BYTE Reserved[3]; /* Alignment. */
} Drive_Control_Record;
/* The following structure is returned by the Get_Drive_Control_Data function. */
typedef struct _Drive_Control_Array
{
Drive_Control_Record * Drive_Control_Data; /* An array of drive control records. */
CARDINAL32 Count; /* The number of entries in the array
of drive control records. */
} Drive_Control_Array;
/* The following structure defines the information that can be changed for a specific disk drive. */
typedef struct _Drive_Information_Record
{
CARDINAL32 Total_Available_Sectors; /* The number of sectors on the disk
which are not currently assigned to
a partition. */
CARDINAL32 Largest_Free_Block_Of_Sectors; /* The number of sectors in the largest
contiguous block of available sectors. */
BOOLEAN Corrupt_Partition_Table; /* If TRUE, then the partitioning
information found on the drive is
incorrect! */
BOOLEAN Unusable; /* If TRUE, the drive's MBR is not
accessible and the drive can not be
partitioned. */
BOOLEAN IO_Error; /* If TRUE, then the last I/O operation
on this drive failed! */
BYTE Reserved;
char Drive_Name[DISK_NAME_SIZE]; /* User assigned name for this disk
drive. */
} Drive_Information_Record;
typedef struct _Partition_Information_Record
{
PVOID Partition_Handle; /* The handle used to perform
operations on this partition. */
PVOID Volume_Handle; /* If this partition is part
of a volume, this will be the
handle of the volume. If
this partition is NOT
part of a volume, then
this handle will be 0. */
PVOID Drive_Handle; /* The handle for the drive
this partition resides on. */
ULONG Partition_Serial_Number; /* The serial number assigned
to this partition. */
CARDINAL32 Partition_Start; /* The LBA of the first
sector of the partition. */
CARDINAL32 True_Partition_Size; /* The total number of
sectors comprising the partition. */
CARDINAL32 Usable_Partition_Size; /* The size of the partition
as reported to the IFSM. This is the
size of the partition less
any LVM overhead. */
CARDINAL32 Boot_Limit; /* The maximum number of
sectors from this block
of free space that can be
used to create a bootable
partition if you allocate
from the beginning of the block
of free space. */
BOOLEAN Spanned_Volume; /* TRUE if this partition is
part of a multi-partition
volume. */
BOOLEAN Primary_Partition; /* True or False. Any
non-zero value here indicates
that this partition is
a primary partition. Zero
here indicates that this
partition is a "logical drive"
- i.e. it resides inside of
an extended partition. */
BYTE Active_Flag; /* 80 = Partition is marked
as being active.
0 = Partition is not
active. */
BYTE OS_Flag; /* This field is from the
partition table. It is
known as the OS flag, the
Partition Type Field,
Filesystem Type, and
various other names.
Values of interest
If this field is: (values
are in hex)
07 = The partition is a
compatibility
partition formatted
for use with an
installable
filesystem, such as
HPFS or JFS.
00 = Unformatted partition
01 = FAT12 filesystem is
in use on this
partition.
04 = FAT16 filesystem is
in use on this
partition.
0A = OS/2 Boot Manager
Partition
35 = LVM partition
06 = OS/2 FAT16 partition */
BYTE Partition_Type; /* 0 = Free Space
1 = LVM Partition (Part of
an LVM Volume.)
2 = Compatibility Partition
All other values are reserved
for future use. */
BYTE Partition_Status; /* 0 = Free Space
1 = In Use - i.e. already
assigned to a volume.
2 = Available - i.e. not
currently assigned
to a volume. */
BOOLEAN On_Boot_Manager_Menu; /* Set to TRUE if this
partition is not part of
a Volume yet is on the
Boot Manager Menu. */
BYTE Reserved; /* Alignment. */
char Volume_Drive_Letter; /* The drive letter assigned
to the volume that this
partition is a part of. */
char Drive_Name[DISK_NAME_SIZE]; /* User assigned name for
this disk drive. */
char File_System_Name[FILESYSTEM_NAME_SIZE];/* The name of the filesystem
in use on this partition,
if it is known. */
char Partition_Name[PARTITION_NAME_SIZE]; /* The user assigned name for
this partition. */
char Volume_Name[VOLUME_NAME_SIZE]; /* If this partition is part
of a volume, then this
will be the name of the
volume that this partition
is a part of. If this record
represents free space,
then the Volume_Name will be
"FS xx", where xx is a unique
numeric ID generated by
LVM.DLL. Otherwise it
will be an empty string. */
} Partition_Information_Record;
/* The following defines are for use with the Partition_Type field in the Partition_Information_Record. */
#define FREE_SPACE_PARTITION 0
#define LVM_PARTITION 1
#define COMPATIBILITY_PARTITION 2
/* The following defines are for use with the Partition_Status field in the Partition_Information_Record. */
#define PARTITION_IS_IN_USE 1
#define PARTITION_IS_AVAILABLE 2
#define PARTITION_IS_FREE_SPACE 0
/* The following structure is returned by various functions in the LVM Engine. */
typedef struct _Partition_Information_Array
{
Partition_Information_Record * Partition_Array; /* An array of Partition_Information_Records. */
CARDINAL32 Count; /* The number of entries in the Partition_Array. */
} Partition_Information_Array;
/* The following items are invariant for a volume. */
typedef struct _Volume_Control_Record
{
ULONG Volume_Serial_Number; /* The serial number assigned to this volume. */
PVOID Volume_Handle; /* The handle used to perform operations on this volume. */
BOOLEAN Compatibility_Volume; /* TRUE indicates that this volume is compatible with older versions of OS/2.
FALSE indicates that this is an LVM specific volume and can not be used without OS2LVM.DMD. */
BOOLEAN On_PRM; /* Set to TRUE if this volume resides on a PRM. Set to FALSE otherwise. */
BYTE Reserved[2]; /* Alignment. */
} Volume_Control_Record;
/* The following structure is returned by the Get_Volume_Control_Data function. */
typedef struct _Volume_Control_Array
{
Volume_Control_Record * Volume_Control_Data; /* An array of volume control records. */
CARDINAL32 Count; /* The number of entries in the array of volume control records. */
} Volume_Control_Array;
/* The following information about a volume can (and often does) vary. */
typedef struct _Volume_Information_Record
{
CARDINAL32 Volume_Size; /* The number of sectors comprising the volume. */
CARDINAL32 Partition_Count; /* The number of partitions which comprise this volume. */
CARDINAL32 Drive_Letter_Conflict; /* 0 indicates that the drive letter preference for this volume is unique.
1 indicates that the drive letter preference for this volume
is not unique, but this volume got its preferred drive letter anyway.
2 indicates that the drive letter preference for this volume
is not unique, and this volume did NOT get its preferred drive letter.
4 indicates that this volume is currently "hidden" - i.e. it has
no drive letter preference at the current time. */
BOOLEAN Compatibility_Volume; /* TRUE if this is for a compatibility volume, FALSE otherwise. */
BOOLEAN Bootable; /* Set to TRUE if this volume appears on the Boot Manager menu, or if it is
a compatibility volume and its corresponding partition is the first active
primary partition on the first drive. */
char Drive_Letter_Preference; /* The drive letter that this volume desires to be. */
BYTE Status; /* 0 = None.
1 = Bootable
2 = Startable
3 = Installable. */
char Volume_Name[VOLUME_NAME_SIZE]; /* The user assigned name for this volume. */
char File_System_Name[FILESYSTEM_NAME_SIZE];/* The name of the filesystem in use on this partition, if it is known. */
} Volume_Information_Record;
/* The following structure defines an item on the Boot Manager Menu. */
typedef struct _Boot_Manager_Menu_Item
{
PVOID Handle; /* A Volume or Partition handle. */
BOOLEAN Volume; /* If TRUE, then Handle is the handle of a Volume. Otherwise, Handle is the handle of a partition. */
} Boot_Manager_Menu_Item;
/* The following structure is used to get a list of the items on the
partition manager menu. */
typedef struct _Boot_Manager_Menu
{
Boot_Manager_Menu_Item * Menu_Items;
CARDINAL32 Count;
} Boot_Manager_Menu;
/* The following preprocessor directives define the operations that
can be performed on a partition, volume, or a block of free space.
These definitions represent bits in a 32 bit value returned by the
Get_Valid_Options function. */
#define CREATE_PRIMARY_PARTITION 1
#define CREATE_LOGICAL_DRIVE 2
#define DELETE_PARTITION 4
#define SET_ACTIVE_PRIMARY 8
#define SET_PARTITION_ACTIVE 0x10
#define SET_PARTITION_INACTIVE 0x20
#define SET_STARTABLE 0x40
#define INSTALL_BOOT_MANAGER 0x80
#define REMOVE_BOOT_MANAGER 0x100
#define SET_BOOT_MANAGER_DEFAULTS 0x200
#define ADD_TO_BOOT_MANAGER_MENU 0x400
#define REMOVE_FROM_BOOT_MANAGER_MENU 0x800
#define DELETE_VOLUME 0x1000
#define HIDE_VOLUME 0x2000
#define EXPAND_VOLUME 0x4000
#define SET_VOLUME_INSTALLABLE 0x8000
#define ASSIGN_DRIVE_LETTER 0x10000
#define CAN_BOOT_PRIMARY 0x20000 /* If a primary is created from this block of free space, then it can be made bootable. */
#define CAN_BOOT_LOGICAL 0x40000 /* If a logical drive is created from this block of free space, then OS/2 can boot from it by adding it to the boot manager menu. */
#define CAN_SET_NAME 0x80000
/* The following enumeration defines the allocation strategies used
by the Create_Partition function. */
typedef enum _Allocation_Algorithm
{
Automatic, /* Let LVM decide which block of free space to use to create the partition. */
Best_Fit, /* Use the block of free space which is closest in size to the partition being created. */
First_Fit, /* Use the first block of free space on the disk which is large enough to hold a partition of the specified size. */
Last_Fit, /* Use the last block of free space on the disk which is large enough to hold a partition of the specified size. */
From_Largest, /* Find the largest block of free space and allocate the partition from that block of free space. */
From_Smallest, /* Find the smallest block of free space that can accommodate a partition of the size specified. */
All /* Turn the specified drive or block of free space into a single partition. */