home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lvmtlk12.zip / include / lvm_intr.h < prev    next >
C/C++ Source or Header  |  2001-06-06  |  488KB  |  7,072 lines

  1. /*
  2. *
  3. *   Copyright (c) International Business Machines  Corp., 2000
  4. *
  5. *   This program is free software;  you can redistribute it and/or modify
  6. *   it under the terms of the GNU General Public License as published by
  7. *   the Free Software Foundation; either version 2 of the License, or
  8. *   (at your option) any later version.
  9. *
  10. *   This program is distributed in the hope that it will be useful,
  11. *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
  12. *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
  13. *   the GNU General Public License for more details.
  14. *
  15. *   You should have received a copy of the GNU General Public License
  16. *   along with this program;  if not, write to the Free Software
  17. *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. *
  19. * Module: lvm_intr.h
  20. */
  21.  
  22. /*
  23. * Change History:
  24. *
  25. */
  26.  
  27. /*
  28. * Functions: void                         Open_LVM_Engine
  29. *            void                         Open_LVM_Engine2
  30. *            void                         Close_LVM_Engine
  31. *            Drive_Control_Array          Get_Drive_Control_Data
  32. *            Drive_Information_Record     Get_Drive_Status
  33. *            Partition_Information_Array  Get_Partitions
  34. *            Partition_Information_Record Get_Partition_Information
  35. *            void                         Create_Partition
  36. *            void                         Delete_Partition
  37. *            void                         Set_Active_Flag
  38. *            void                         Set_OS_Flag
  39. *            Volume_Control_Array         Get_Volume_Control_Data
  40. *            Volume_Information_Record    Get_Volume_Information
  41. *            void                         Create_Volume
  42. *            void                         Create_Volume2
  43. *            void                         Hide_Volume
  44. *            void                         Expand_Volume
  45. *            void                         Assign_Drive_Letter
  46. *            void                         Set_Installable
  47. *            void                         Set_Name
  48. *            CARDINAL32                   Get_Valid_Options
  49. *            BOOLEAN                      Boot_Manager_Is_Installed
  50. *            void                         Add_To_Boot_Manager
  51. *            void                         Remove_From_Boot_Manager
  52. *            Boot_Manager_Menu            Get_Boot_Manager_Menu
  53. *            void                         Install_Boot_Manager
  54. *            void                         Remove_Boot_Manager
  55. *            void                         Set_Boot_Manager_Options
  56. *            void                         Get_Boot_Manager_Options
  57. *            void                         New_MBR
  58. *            CARDINAL32                   Get_Available_Drive_Letters
  59. *            BOOLEAN                      Reboot_Required
  60. *            void                         Set_Reboot_Flag
  61. *            BOOLEAN                      Get_Reboot_Flag
  62. *            void                         Set_Min_Install_Size
  63. *            void                         Start_Logging
  64. *            void                         Stop_Logging
  65. *
  66. * Description:  This module defines the interface to LVM.DLL, which is the
  67. *               engine that performs all of the disk partitioning/volume
  68. *               creation work.
  69. *
  70. */
  71.  
  72. #ifndef LVM_INTERFACE_H_INCLUDED
  73.  
  74. #define LVM_INTERFACE_H_INCLUDED 1
  75.  
  76. #include "LVM_Gbls.h"         /* BYTE, CARDINAL32, ADDRESS, BOOLEAN, BYTE */
  77.  
  78. #include "LVM_Cons.h"         /* DISK_NAME_SIZE, PARTITION_NAME_SIZE, VOLUME_NAME_SIZE, FILESYSTEM_NAME_SIZE */
  79. #include "LVM_Type.h"         /* DoubleWord */
  80.  
  81. /* The following are invariant for a disk drive. */
  82. typedef struct _Drive_Control_Record {
  83. CARDINAL32   Drive_Number;                   /* OS/2 Drive Number for this drive. */
  84. CARDINAL32   Drive_Size;                     /* The total number of sectors on the drive. */
  85. DoubleWord   Drive_Serial_Number;            /* The serial number assigned to this drive.  For info. purposes only. */
  86. ADDRESS      Drive_Handle;                   /* Handle used for operations on the disk that this record corresponds to. */
  87. CARDINAL32   Cylinder_Count;                 /* The number of cylinders on the drive. */
  88. CARDINAL32   Heads_Per_Cylinder;             /* The number of heads per cylinder for this drive. */
  89. CARDINAL32   Sectors_Per_Track;              /* The number of sectors per track for this drive. */
  90. BOOLEAN      Drive_Is_PRM;                   /* Set to TRUE if this drive is a PRM. */
  91. BYTE         Reserved[3];                    /* Alignment. */
  92. } Drive_Control_Record;
  93.  
  94. /* The following structure is returned by the Get_Drive_Control_Data function. */
  95. typedef struct _Drive_Control_Array{
  96. Drive_Control_Record *   Drive_Control_Data;       /* An array of drive control records. */
  97. CARDINAL32               Count;                    /* The number of entries in the array of drive control records. */
  98. } Drive_Control_Array;
  99.  
  100. /* The following structure defines the information that can be changed for a specific disk drive. */
  101. typedef struct _Drive_Information_Record {
  102. CARDINAL32   Total_Available_Sectors;        /* The number of sectors on the disk which are not currently assigned to a partition. */
  103. CARDINAL32   Largest_Free_Block_Of_Sectors;  /* The number of sectors in the largest contiguous block of available sectors.  */
  104. BOOLEAN      Corrupt_Partition_Table;        /* If TRUE, then the partitioning information found on the drive is incorrect! */
  105. BOOLEAN      Unusable;                       /* If TRUE, the drive's MBR is not accessible and the drive can not be partitioned. */
  106. BOOLEAN      IO_Error;                       /* If TRUE, then the last I/O operation on this drive failed! */
  107. BOOLEAN      Is_Big_Floppy;                  /* If TRUE, then the drive is a PRM formatted as a big floppy (i.e. the old style removable media support). */
  108. char         Drive_Name[DISK_NAME_SIZE];     /* User assigned name for this disk drive. */
  109. } Drive_Information_Record;
  110.  
  111. typedef struct _Partition_Information_Record {
  112. ADDRESS      Partition_Handle;                      /* The handle used to perform operations on this partition. */
  113. ADDRESS      Volume_Handle;                         /* If this partition is part of a volume, this will be the handle of
  114. the volume.  If this partition is NOT part of a volume, then this
  115. handle will be 0.                                                  */
  116. ADDRESS      Drive_Handle;                          /* The handle for the drive this partition resides on. */
  117. DoubleWord   Partition_Serial_Number;               /* The serial number assigned to this partition. */
  118. CARDINAL32   Partition_Start;                       /* The LBA of the first sector of the partition. */
  119. CARDINAL32   True_Partition_Size;                   /* The total number of sectors comprising the partition. */
  120. CARDINAL32   Usable_Partition_Size;                 /* The size of the partition as reported to the IFSM.  This is the
  121. size of the partition less any LVM overhead.                     */
  122. CARDINAL32   Boot_Limit;                            /* The maximum number of sectors from this block of free space that can be used to
  123. create a bootable partition if you allocate from the beginning of the block of
  124. free space.                                                       */
  125. BOOLEAN      Spanned_Volume;                        /* TRUE if this partition is part of a multi-partition volume. */
  126. BOOLEAN      Primary_Partition;                     /* True or False.  Any non-zero value here indicates that
  127. this partition is a primary partition.  Zero here indicates
  128. that this partition is a "logical drive" - i.e. it resides
  129. inside of an extended partition. */
  130. BYTE         Active_Flag;                           /* 80 = Partition is marked as being active.
  131. 0 = Partition is not active.                   */
  132. BYTE         OS_Flag;                               /* This field is from the partition table.  It is known as the
  133. OS flag, the Partition Type Field, Filesystem Type, and
  134. various other names.
  135.  
  136. Values of interest
  137.  
  138. If this field is: (values are in hex)
  139.  
  140. 07 = The partition is a compatibility partition formatted for use
  141. with an installable filesystem, such as HPFS or JFS.
  142. 00 = Unformatted partition
  143. 01 = FAT12 filesystem is in use on this partition.
  144. 04 = FAT16 filesystem is in use on this partition.
  145. 0A = OS/2 Boot Manager Partition
  146. 35 = LVM partition
  147. 84 = OS/2 FAT16 partition which has been relabeled by Boot Manager to "Hide" it. */
  148. BYTE         Partition_Type;                        /* 0 = Free Space
  149. 1 = LVM Partition (Part of an LVM Volume.)
  150. 2 = Compatibility Partition
  151. All other values are reserved for future use. */
  152. BYTE         Partition_Status;                      /* 0 = Free Space
  153. 1 = In Use - i.e. already assigned to a volume.
  154. 2 = Available - i.e. not currently assigned to a volume. */
  155. BOOLEAN      On_Boot_Manager_Menu;                  /* Set to TRUE if this partition is not part of a Volume yet is on the Boot Manager Menu. */
  156. BYTE         Reserved;                              /* Alignment. */
  157. char         Volume_Drive_Letter;                   /* The drive letter assigned to the volume that this partition is a part of. */
  158. char         Drive_Name[DISK_NAME_SIZE];            /* User assigned name for this disk drive. */
  159. char         File_System_Name[FILESYSTEM_NAME_SIZE];/* The name of the filesystem in use on this partition, if it is known. */
  160. char         Partition_Name[PARTITION_NAME_SIZE];   /* The user assigned name for this partition. */
  161. char         Volume_Name[VOLUME_NAME_SIZE];         /* If this partition is part of a volume, then this will be the
  162. name of the volume that this partition is a part of.  If this
  163. record represents free space, then the Volume_Name will be
  164. "FREE SPACE xx", where xx is a unique numeric ID generated by
  165. LVM.DLL.  Otherwise it will be an empty string.                */
  166. } Partition_Information_Record;
  167.  
  168. /* The following defines are for use with the Partition_Type field in the Partition_Information_Record. */
  169. #define FREE_SPACE_PARTITION     0
  170. #define LVM_PARTITION            1
  171. #define COMPATIBILITY_PARTITION  2
  172.  
  173. /* The following defines are for use with the Partition_Status field in the Partition_Information_Record. */
  174. #define PARTITION_IS_IN_USE      1
  175. #define PARTITION_IS_AVAILABLE   2
  176. #define PARTITION_IS_FREE_SPACE  0
  177.  
  178. /* The following structure is returned by various functions in the LVM Engine. */
  179. typedef struct _Partition_Information_Array {
  180. Partition_Information_Record * Partition_Array; /* An array of Partition_Information_Records. */
  181. CARDINAL32                     Count;           /* The number of entries in the Partition_Array. */
  182. } Partition_Information_Array;
  183.  
  184. /* The following items are invariant for a volume. */
  185. typedef struct _Volume_Control_Record {
  186. DoubleWord Volume_Serial_Number;            /* The serial number assigned to this volume. */
  187. ADDRESS    Volume_Handle;                   /* The handle used to perform operations on this volume. */
  188. BOOLEAN    Compatibility_Volume;            /* TRUE indicates that this volume is compatible with older versions of OS/2.
  189. FALSE indicates that this is an LVM specific volume and can not be used without OS2LVM.DMD. */
  190. BYTE       Device_Type;                     /* Indicates what type of device the Volume resides on:
  191. 0 = Hard Drive under LVM Control
  192. 1 = PRM under LVM Control
  193. 2 = CD-ROM
  194. 3 = Network drive
  195. 4 = Unknown device NOT under LVM Control
  196. */
  197. BYTE       Reserved[2];                     /* Alignment. */
  198. } Volume_Control_Record;
  199.  
  200. /* The following define the device types used in the Device_Type field of the Volume_Control_Record. */
  201. #define LVM_HARD_DRIVE  0
  202. #define LVM_PRM         1
  203. #define NON_LVM_CDROM   2
  204. #define NETWORK_DRIVE   3
  205. #define NON_LVM_DEVICE  4
  206.  
  207. /* The following structure is returned by the Get_Volume_Control_Data function. */
  208. typedef struct _Volume_Control_Array{
  209. Volume_Control_Record *  Volume_Control_Data;      /* An array of volume control records. */
  210. CARDINAL32               Count;                    /* The number of entries in the array of volume control records. */
  211. } Volume_Control_Array;
  212.  
  213. /* The following information about a volume can (and often does) vary. */
  214. typedef struct _Volume_Information_Record {
  215. CARDINAL32 Volume_Size;                           /* The number of sectors comprising the volume. */
  216. CARDINAL32 Partition_Count;                       /* The number of partitions which comprise this volume. */
  217. CARDINAL32 Drive_Letter_Conflict;                 /* 0 indicates that the drive letter preference for this volume is unique.
  218. 1 indicates that the drive letter preference for this volume
  219. is not unique, but this volume got its preferred drive letter anyway.
  220. 2 indicates that the drive letter preference for this volume
  221. is not unique, and this volume did NOT get its preferred drive letter.
  222. 4 indicates that this volume is currently "hidden" - i.e. it has
  223. no drive letter preference at the current time.                        */
  224. BOOLEAN    Compatibility_Volume;                  /* TRUE if this is for a compatibility volume, FALSE otherwise. */
  225. BOOLEAN    Bootable;                              /* Set to TRUE if this volume appears on the Boot Manager menu, or if it is
  226. a compatibility volume and its corresponding partition is the first active
  227. primary partition on the first drive.                                         */
  228. char       Drive_Letter_Preference;               /* The drive letter that this volume desires to be. */
  229. char       Current_Drive_Letter;                  /* The drive letter currently used to access this volume.  May be different than
  230. Drive_Letter_Preference if there was a conflict ( i.e. Drive_Letter_Preference
  231. is already in use by another volume ).                                          */
  232. char       Initial_Drive_Letter;                  /* The drive letter assigned to this volume by the operating system when LVM was started.
  233. This may be different from the Drive_Letter_Preference if there were conflicts, and
  234. may be different from the Current_Drive_Letter.  This will be 0x0 if the Volume did
  235. not exist when the LVM Engine was opened (i.e. it was created during this LVM session). */
  236. BOOLEAN    New_Volume;                            /* Set to FALSE if this volume existed before the LVM Engine was opened.  Set to
  237. TRUE if this volume was created after the LVM Engine was opened.                */
  238. BYTE       Status;                                /* 0 = None.
  239. 1 = Bootable
  240. 2 = Startable
  241. 3 = Installable.           */
  242. BYTE       Reserved_1;
  243. char       Volume_Name[VOLUME_NAME_SIZE];         /* The user assigned name for this volume. */
  244. char       File_System_Name[FILESYSTEM_NAME_SIZE];/* The name of the filesystem in use on this partition, if it is known. */
  245. } Volume_Information_Record;
  246.  
  247. /* The following structure is used to return the feature information for the installed features, or the features on a volume. */
  248. typedef struct _Feature_Information_Array {
  249. CARDINAL32        Count;
  250. Feature_ID_Data * Feature_Data;
  251. } Feature_Information_Array;
  252.  
  253. /* The following structure defines an item on the Boot Manager Menu. */
  254. typedef struct _Boot_Manager_Menu_Item {
  255. ADDRESS     Handle;            /* A Volume or Partition handle. */
  256. BOOLEAN     Volume;            /* If TRUE, then Handle is the handle of a Volume.  Otherwise, Handle is the handle of a partition. */
  257. } Boot_Manager_Menu_Item;
  258.  
  259. /* The following structure is used to get a list of the items on the partition manager menu. */
  260. typedef struct _Boot_Manager_Menu {
  261. Boot_Manager_Menu_Item *  Menu_Items;
  262. CARDINAL32                Count;
  263. } Boot_Manager_Menu;
  264.  
  265. /* The following structure is used to specify an LVM Feature when creating a volume.  Since LVM Features may be part of
  266. more than one LVM Class, the specific class to be used with the feature must also be specified.                        */
  267. typedef struct _LVM_Feature_Specification_Record {
  268. CARDINAL32       Feature_ID;     /* The feature ID of the feature to use. */
  269. LVM_Classes      Actual_Class;   /* The LVM Class (supported by the specified feature) to use. */
  270. ADDRESS          Init_Data;      /* The address of a buffer containing initialization data for this feature.
  271. NULL if there is no initialization data being provided for this feature. */
  272. } LVM_Feature_Specification_Record;
  273.  
  274. /* The following structure is used with the Get_Child_Handles function. */
  275. typedef struct {
  276. CARDINAL32   Count;
  277. ADDRESS *    Handles;
  278. } LVM_Handle_Array_Record;
  279.  
  280. /* The following preprocessor directives define the operations that can be performed on a partition, volume, or a block of free space.
  281. These definitions represent bits in a 32 bit value returned by the Get_Valid_Options function.                                         */
  282.  
  283. #define CREATE_PRIMARY_PARTITION           1
  284.  
  285. #define CREATE_LOGICAL_DRIVE               2
  286.  
  287. #define DELETE_PARTITION                   4
  288.  
  289. #define SET_ACTIVE_PRIMARY                 8
  290.  
  291. #define SET_PARTITION_ACTIVE              0x10
  292.  
  293. #define SET_PARTITION_INACTIVE            0x20
  294.  
  295. #define SET_STARTABLE                     0x40
  296.  
  297. #define INSTALL_BOOT_MANAGER              0x80
  298.  
  299. #define REMOVE_BOOT_MANAGER               0x100
  300.  
  301. #define SET_BOOT_MANAGER_DEFAULTS         0x200
  302.  
  303. #define ADD_TO_BOOT_MANAGER_MENU          0x400
  304.  
  305. #define REMOVE_FROM_BOOT_MANAGER_MENU     0x800
  306.  
  307. #define DELETE_VOLUME                     0x1000
  308.  
  309. #define HIDE_VOLUME                       0x2000
  310.  
  311. #define EXPAND_VOLUME                     0x4000
  312.  
  313. #define SET_VOLUME_INSTALLABLE            0x8000
  314.  
  315. #define ASSIGN_DRIVE_LETTER               0x10000
  316.  
  317. #define CAN_BOOT_PRIMARY                  0x20000      /* If a primary is created from this block of free space, then it can be made bootable. */
  318.  
  319. #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. */
  320.  
  321. #define CAN_SET_NAME                      0x80000
  322.  
  323. #define SET_BOOT_MANAGER_STARTABLE        0x100000
  324.  
  325. /* The following enumeration defines the allocation strategies used by the Create_Partition function. */
  326. typedef enum _Allocation_Algorithm {
  327. Automatic,               /* Let LVM decide which block of free space to use to create the partition. */
  328. Best_Fit,                /* Use the block of free space which is closest in size to the partition being created. */
  329. First_Fit,               /* Use the first block of free space on the disk which is large enough to hold a partition of the specified size. */
  330. Last_Fit,                /* Use the last block of free space on the disk which is large enough to hold a partition of the specified size. */
  331. From_Largest,            /* Find the largest block of free space and allocate the partition from that block of free space. */
  332. From_Smallest,           /* Find the smallest block of free space that can accommodate a partition of the size specified. */
  333. All                      /* Turn the specified drive or block of free space into a single partition. */
  334. } Allocation_Algorithm;
  335.  
  336. /* Error codes returned by the LVM Engine. */
  337. #define LVM_ENGINE_NO_ERROR                            0
  338. #define LVM_ENGINE_OUT_OF_MEMORY                       1
  339. #define LVM_ENGINE_IO_ERROR                            2
  340. #define LVM_ENGINE_BAD_HANDLE                          3
  341. #define LVM_ENGINE_INTERNAL_ERROR                      4
  342. #define LVM_ENGINE_ALREADY_OPEN                        5
  343. #define LVM_ENGINE_NOT_OPEN                            6
  344. #define LVM_ENGINE_NAME_TOO_BIG                        7
  345. #define LVM_ENGINE_OPERATION_NOT_ALLOWED               8
  346. #define LVM_ENGINE_DRIVE_OPEN_FAILURE                  9
  347. #define LVM_ENGINE_BAD_PARTITION                      10
  348. #define LVM_ENGINE_CAN_NOT_MAKE_PRIMARY_PARTITION     11
  349. #define LVM_ENGINE_TOO_MANY_PRIMARY_PARTITIONS        12
  350. #define LVM_ENGINE_CAN_NOT_MAKE_LOGICAL_DRIVE         13
  351. #define LVM_ENGINE_REQUESTED_SIZE_TOO_BIG             14
  352. #define LVM_ENGINE_1024_CYLINDER_LIMIT                15
  353. #define LVM_ENGINE_PARTITION_ALIGNMENT_ERROR          16
  354. #define LVM_ENGINE_REQUESTED_SIZE_TOO_SMALL           17
  355. #define LVM_ENGINE_NOT_ENOUGH_FREE_SPACE              18
  356. #define LVM_ENGINE_BAD_ALLOCATION_ALGORITHM           19
  357. #define LVM_ENGINE_DUPLICATE_NAME                     20
  358. #define LVM_ENGINE_BAD_NAME                           21
  359. #define LVM_ENGINE_BAD_DRIVE_LETTER_PREFERENCE        22
  360. #define LVM_ENGINE_NO_DRIVES_FOUND                    23
  361. #define LVM_ENGINE_WRONG_VOLUME_TYPE                  24
  362. #define LVM_ENGINE_VOLUME_TOO_SMALL                   25
  363. #define LVM_ENGINE_BOOT_MANAGER_ALREADY_INSTALLED     26
  364. #define LVM_ENGINE_BOOT_MANAGER_NOT_FOUND             27
  365. #define LVM_ENGINE_INVALID_PARAMETER                  28
  366. #define LVM_ENGINE_BAD_FEATURE_SET                    29
  367. #define LVM_ENGINE_TOO_MANY_PARTITIONS_SPECIFIED      30
  368. #define LVM_ENGINE_LVM_PARTITIONS_NOT_BOOTABLE        31
  369. #define LVM_ENGINE_PARTITION_ALREADY_IN_USE           32
  370. #define LVM_ENGINE_SELECTED_PARTITION_NOT_BOOTABLE    33
  371. #define LVM_ENGINE_VOLUME_NOT_FOUND                   34
  372. #define LVM_ENGINE_DRIVE_NOT_FOUND                    35
  373. #define LVM_ENGINE_PARTITION_NOT_FOUND                36
  374. #define LVM_ENGINE_TOO_MANY_FEATURES_ACTIVE           37
  375. #define LVM_ENGINE_PARTITION_TOO_SMALL                38
  376. #define LVM_ENGINE_MAX_PARTITIONS_ALREADY_IN_USE      39
  377. #define LVM_ENGINE_IO_REQUEST_OUT_OF_RANGE            40
  378. #define LVM_ENGINE_SPECIFIED_PARTITION_NOT_STARTABLE  41
  379. #define LVM_ENGINE_SELECTED_VOLUME_NOT_STARTABLE      42
  380. #define LVM_ENGINE_EXTENDFS_FAILED                    43
  381. #define LVM_ENGINE_REBOOT_REQUIRED                    44
  382. #define LVM_ENGINE_CAN_NOT_OPEN_LOG_FILE              45
  383. #define LVM_ENGINE_CAN_NOT_WRITE_TO_LOG_FILE          46
  384. #define LVM_ENGINE_REDISCOVER_FAILED                  47
  385. #define LVM_ENGINE_INTERNAL_VERSION_FAILURE           48
  386. #define LVM_ENGINE_PLUGIN_OPERATION_INCOMPLETE        49
  387. #define LVM_ENGINE_BAD_FEATURE_ID                     50
  388. #define LVM_ENGINE_NO_INIT_DATA                       51
  389. #define LVM_ENGINE_NO_CONTEXT_DATA                    52
  390. #define LVM_ENGINE_WRONG_CLASS_FOR_FEATURE            53
  391. #define LVM_ENGINE_INCOMPATIBLE_FEATURES_SELECTED     54
  392. #define LVM_ENGINE_NO_CHILDREN                        55
  393. #define LVM_ENGINE_FEATURE_NOT_SUPPORTED_BY_INTERFACE 56
  394. #define LVM_ENGINE_NO_PARENT                          57
  395. #define LVM_ENGINE_VOLUME_HAS_NOT_BEEN_COMMITTED_YET  58
  396. #define LVM_ENGINE_UNABLE_TO_REFERENCE_VOLUME         59
  397. #define LVM_ENGINE_PARSING_ERROR                      60
  398. #define LVM_ENGINE_INTERNAL_FEATURE_ERROR             61
  399. #define LVM_ENGINE_VOLUME_NOT_CONVERTED               62
  400.  
  401. /* Function Prototypes */
  402.  
  403. #ifndef USE_16_BIT_FUNCTIONS
  404.  
  405. /* ************************************************************************** *
  406.  
  407. Functions relating to the LVM Engine itself
  408.  
  409. ************************************************************************** */
  410.  
  411. /****************************************************************************************************/
  412. /*                                                                                                  */
  413. /*   Function Name: Open_LVM_Engine                                                                 */
  414. /*                                                                                                  */
  415. /*   Descriptive Name: Opens the LVM Engine and readies it for use.                                 */
  416. /*                                                                                                  */
  417. /*   Input: BOOLEAN Ignore_CHS : If TRUE, then the LVM engine will not check the CHS values in the  */
  418. /*                               MBR/EBR partition tables for validity.  This is useful if there    */
  419. /*                               are drive geometry problems, such as the drive was partitioned and */
  420. /*                               formatted with one geometry and then moved to a different machine  */
  421. /*                               which uses a different geometry for the drive.  This would cause   */
  422. /*                               the starting and ending CHS values in the partition tables to      */
  423. /*                               be inconsistent with the size and partition offset entries in the  */
  424. /*                               partition tables.  Setting Ignore_CHS to TRUE will disable the     */
  425. /*                               LVM Engine's CHS consistency checks, thereby allowing the drive    */
  426. /*                               to be partitioned.                                                 */
  427. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in which to store an error code   */
  428. /*                                    should an error occur.                                        */
  429. /*                                                                                                  */
  430. /*   Output:  *Error_Code will be 0 if this function completes successfully.  If an error occurs,   */
  431. /*            *Error_Code will contain a non-zero error code.                                       */
  432. /*                                                                                                  */
  433. /*   Error Handling: If this function aborts with an error, all memory allocated during the course  */
  434. /*                   of this function will be released.  Disk read errors will be reported to the   */
  435. /*                   user via pop-up error messages.  Disk read errors will only cause this         */
  436. /*                   function to abort if none of the disk drives in the system could be            */
  437. /*                   successfully read.                                                             */
  438. /*                                                                                                  */
  439. /*   Side Effects:  The LVM Engine will be initialized.  The partition tables for all OS2DASD       */
  440. /*                  controlled disk drives will be read into memory.  Memory will be allocated for  */
  441. /*                  the data structures used by the LVM Engine.                                     */
  442. /*                                                                                                  */
  443. /*   Notes:  This is provided for programs that used LVM Version 1.  This function assumes an       */
  444. /*           LVM_Interface_Type of VIO_Interface.                                */
  445. /*                                                                                                  */
  446. /****************************************************************************************************/
  447. void _System Open_LVM_Engine( BOOLEAN Ignore_CHS, CARDINAL32 * Error_Code );
  448.  
  449. /****************************************************************************************************/
  450. /*                                                                                                  */
  451. /*   Function Name: Open_LVM_Engine2                                                                */
  452. /*                                                                                                  */
  453. /*   Descriptive Name: Opens the LVM Engine and readies it for use.                                 */
  454. /*                                                                                                  */
  455. /*   Input: BOOLEAN Ignore_CHS : If TRUE, then the LVM engine will not check the CHS values in the  */
  456. /*                               MBR/EBR partition tables for validity.  This is useful if there    */
  457. /*                               are drive geometry problems, such as the drive was partitioned and */
  458. /*                               formatted with one geometry and then moved to a different machine  */
  459. /*                               which uses a different geometry for the drive.  This would cause   */
  460. /*                               the starting and ending CHS values in the partition tables to      */
  461. /*                               be inconsistent with the size and partition offset entries in the  */
  462. /*                               partition tables.  Setting Ignore_CHS to TRUE will disable the     */
  463. /*                               LVM Engine's CHS consistency checks, thereby allowing the drive    */
  464. /*                               to be partitioned.                                                 */
  465. /*          LVM_Interface_Types Interface_Type - Indicate the type of user interface being used:    */
  466. /*                               PM_Interface, VIO_Interface, or Java_Interface.  This lets the     */
  467. /*                               LVM Engine know which interface support routines to call in any    */
  468. /*                               plugin modules which may be loaded.                                */
  469. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in which to store an error code   */
  470. /*                                    should an error occur.                                        */
  471. /*                                                                                                  */
  472. /*   Output:  *Error_Code will be 0 if this function completes successfully.  If an error occurs,   */
  473. /*            *Error_Code will contain a non-zero error code.                                       */
  474. /*                                                                                                  */
  475. /*   Error Handling: If this function aborts with an error, all memory allocated during the course  */
  476. /*                   of this function will be released.  Disk read errors will be reported to the   */
  477. /*                   user via pop-up error messages.  Disk read errors will only cause this         */
  478. /*                   function to abort if none of the disk drives in the system could be            */
  479. /*                   successfully read.                                                             */
  480. /*                                                                                                  */
  481. /*   Side Effects:  The LVM Engine will be initialized.  The partition tables for all OS2DASD       */
  482. /*                  controlled disk drives will be read into memory.  Memory will be allocated for  */
  483. /*                  the data structures used by the LVM Engine.                                     */
  484. /*                                                                                                  */
  485. /*   Notes:  None.                                                                                  */
  486. /*                                                                                                  */
  487. /****************************************************************************************************/
  488. void _System Open_LVM_Engine2( BOOLEAN Ignore_CHS, LVM_Interface_Types Interface_Type, CARDINAL32 * Error_Code );
  489.  
  490. /*********************************************************************/
  491. /*                                                                   */
  492. /*   Function Name: Commit_Changes                                   */
  493. /*                                                                   */
  494. /*   Descriptive Name: Saves any changes made to the partitioning    */
  495. /*                     information of the OS2DASD controlled disk    */
  496. /*                     drives in the system.                         */
  497. /*                                                                   */
  498. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  499. /*                                   in which to store an error code */
  500. /*                                   should an error occur.          */
  501. /*                                                                   */
  502. /*   Output:  The function return value will be TRUE if all of the   */
  503. /*            partitioning/volume changes made were successfully     */
  504. /*            written to disk.  Also, *Error_Code will be 0 if no    */
  505. /*            errors occur.                                          */
  506. /*                                                                   */
  507. /*            If an error occurs, then the furnction return value    */
  508. /*            will be FALSE and *Error_Code will contain a non-zero  */
  509. /*            error code.                                            */
  510. /*                                                                   */
  511. /*   Error Handling:  If an error occurs, the function return value  */
  512. /*                    will be false and *Error_Code will be > 0.     */
  513. /*                                                                   */
  514. /*                    Disk read and write errors will be indicated by*/
  515. /*                    setting the IO_Error field of the              */
  516. /*                    Drive_Information_Record to TRUE.  Thus, if    */
  517. /*                    the function return value is FALSE, and        */
  518. /*                    *Error_Code indicates an I/O error, the caller */
  519. /*                    of this function should call the               */
  520. /*                    Get_Drive_Status function on each drive to     */
  521. /*                    determine which drives had I/O errors.         */
  522. /*                                                                   */
  523. /*                    If a read or write error occurs, then the      */
  524. /*                    engine may not have been able to create a      */
  525. /*                    partition or volume.  Thus, the caller         */
  526. /*                    may want to refresh all partition and volume   */
  527. /*                    data to see what the engine was and was not    */
  528. /*                    able to create.                                */
  529. /*                                                                   */
  530. /*   Side Effects:  The partitioning information of the disk drives  */
  531. /*                  in the system may be altered.                    */
  532. /*                                                                   */
  533. /*   Notes:  None.                                                   */
  534. /*                                                                   */
  535. /*********************************************************************/
  536. BOOLEAN _System Commit_Changes( CARDINAL32 * Error_Code );
  537.  
  538. /*********************************************************************/
  539. /*                                                                   */
  540. /*   Function Name: Set_Java_Call_Back                               */
  541. /*                                                                   */
  542. /*   Descriptive Name: This function allows the calling Java program */
  543. /*                     to set the call back address.  The call back  */
  544. /*                     address is used when the LVM Engine or one of */
  545. /*                     its plug-ins, needs to run a Java class to    */
  546. /*                     gather information from the user.             */
  547. /*                                                                   */
  548. /*   Input: void (* Execute_Java_Class) ... - The address of a       */
  549. /*                                            function that the LVM  */
  550. /*                                            engine may call when   */
  551. /*                                            it needs a Java class  */
  552. /*                                            to be executed.  This  */
  553. /*                                            is only required if the*/
  554. /*                                            user interface being   */
  555. /*                                            used is written in Java*/
  556. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  557. /*                                   in which to store an error code */
  558. /*                                   should an error occur.          */
  559. /*                                                                   */
  560. /*   Output: If the function completes successfully, then *Error_Code*/
  561. /*           will be set to LVM_ENGINE_NO_ERROR.  Otherwise,         */
  562. /*           *Error_Code will be set to a non-zero error code.       */
  563. /*                                                                   */
  564. /*   Error Handling:  If an error occurs, the function will abort and*/
  565. /*                    *Error_Code will be set to a non-zero error    */
  566. /*                    code.                                          */
  567. /*                                                                   */
  568. /*   Side Effects:  The Java call back address is set to point to the*/
  569. /*                  specified function.  Once the Java call back     */
  570. /*                  address is set, LVM plug-ins which require the   */
  571. /*                  Java call back will be enabled and can be used   */
  572. /*                  during the creation of LVM Volumes.              */
  573. /*                                                                   */
  574. /*   Notes:  If a Java interface is in use (as specified on the      */
  575. /*           Open_LVM_Engine call), then this function must be called*/
  576. /*           in order to enable those LVM plug-ins which require     */
  577. /*           initialization information during the creation of an    */
  578. /*           LVM Volume.  If these plug-ins are not enabled, then    */
  579. /*           they will not be reported by the Get_Available_Features */
  580. /*           API, nor can they be used or accessed by any other LVM  */
  581. /*           Engine APIs.  Thus, this function should be called      */
  582. /*           immediately after the Open_LVM_Engine API is called.    */
  583. /*                                                                   */
  584. /*********************************************************************/
  585. void _System Set_Java_Call_Back( void (* _System Execute_Java_Class) ( char *       Class_Name,
  586. ADDRESS      InputBuffer,
  587. CARDINAL32   InputBufferSize,
  588. ADDRESS    * OutputBuffer,
  589. CARDINAL32 * OutputBufferSize,
  590. CARDINAL32 * Error_Code),
  591. CARDINAL32 * Error_Code );
  592.  
  593. /*********************************************************************/
  594. /*                                                                   */
  595. /*   Function Name: Close_LVM_Engine                                 */
  596. /*                                                                   */
  597. /*   Descriptive Name: Closes the LVM Engine and frees any memory    */
  598. /*                     held by the LVM Engine.                       */
  599. /*                                                                   */
  600. /*   Input: None.                                                    */
  601. /*                                                                   */
  602. /*   Output:  None.                                                  */
  603. /*                                                                   */
  604. /*   Error Handling: N/A                                             */
  605. /*                                                                   */
  606. /*   Side Effects:  Any memory held by the LVM Engine is released.   */
  607. /*                                                                   */
  608. /*   Notes:  None.                                                   */
  609. /*                                                                   */
  610. /*********************************************************************/
  611. void _System Close_LVM_Engine ( void );
  612.  
  613. /*********************************************************************/
  614. /*                                                                   */
  615. /*   Function Name: Get_Available_Features                           */
  616. /*                                                                   */
  617. /*   Descriptive Name: Returns the feature ID information for each of*/
  618. /*                     the features that the LVM Engine knows about. */
  619. /*                                                                   */
  620. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  621. /*                                   in which to store an error code */
  622. /*                                   should an error occur.          */
  623. /*                                                                   */
  624. /*   Output: If successful, a Feature_Information_Array structure is */
  625. /*           returned with a non-zero Count.  Also, *Error_Code will */
  626. /*           be set to LVM_ENGINE_NO_ERROR.  If an error occurs,     */
  627. /*           then the Count field in the structure will be 0 and     */
  628. /*           (*Error_Code) will contain a non-zero error code.       */
  629. /*                                                                   */
  630. /*   Error Handling: The only expected error is if this function is  */
  631. /*                   called while the LVM Engine is not open.  This  */
  632. /*                   should be the only error condition.             */
  633. /*                                                                   */
  634. /*   Side Effects:  Memory is allocated using the LVM Engine's memory*/
  635. /*                  manager for the array of Feature_ID_Data items   */
  636. /*                  being returned.                                  */
  637. /*                                                                   */
  638. /*   Notes:  None.                                                   */
  639. /*                                                                   */
  640. /*********************************************************************/
  641. Feature_Information_Array _System Get_Available_Features( CARDINAL32 * Error_Code );
  642.  
  643. /*********************************************************************/
  644. /*                                                                   */
  645. /*   Function Name: Issue_Feature_Command                            */
  646. /*                                                                   */
  647. /*   Descriptive Name: Issues a feature specific command to either   */
  648. /*                     the Ring 0 or Ring 3 portion of the feature.  */
  649. /*                                                                   */
  650. /*   Input: CARDINAL32 Feature_ID - The numeric ID assigned to the   */
  651. /*                                  feature which is to receive the  */
  652. /*                                  command being issued.            */
  653. /*          ADDRESS Handle - The handle of the volume, partition, or */
  654. /*                           aggregate to which the feature command  */
  655. /*                           is to be directed.                      */
  656. /*          BOOLEAN Ring0 - If TRUE, then the command will be sent   */
  657. /*                          to the Ring 0 portion of the feature.    */
  658. /*                          If FALSE, then the command will be sent  */
  659. /*                          to the Ring 3 portion of the feature.    */
  660. /*          ADDRESS InputBuffer - A buffer containing the command and*/
  661. /*                                any necessary information for the  */
  662. /*                                feature to process the command.    */
  663. /*          CARDINAL32 InputSize - The number of bytes in the        */
  664. /*                                 InputBuffer.                      */
  665. /*          ADDRESS * OutputBuffer - The address of a variable used  */
  666. /*                                   to hold the location of the     */
  667. /*                                   output buffer created by the    */
  668. /*                                   feature in response to the      */
  669. /*                                   command in InputBuffer.         */
  670. /*          CARDINAL32 * OutputSize - The address of a variable used */
  671. /*                                    to hold the number of bytes in */
  672. /*                                    *OutputBuffer.                 */
  673. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  674. /*                                   in which to store an error code */
  675. /*                                   should an error occur.          */
  676. /*                                                                   */
  677. /*   Output: If successful, then *Error_Code will be set to          */
  678. /*           LVM_ENGINE_NO_ERROR.  If unsuccessful, then *Error_Code */
  679. /*           will be set to a non-zero error code.  *OutputBuffer and*/
  680. /*           *OutputSize are set by the feature.  If the feature     */
  681. /*           specified does not exist, then *OutputBuffer will be    */
  682. /*           NULL and *Outputsize will be 0.  If the feature does    */
  683. /*           exist, then the value of *OutputBuffer and *OutputSize  */
  684. /*           depend upon the feature.                                */
  685. /*                                                                   */
  686. /*   Error Handling: If the specified feature does not exist, then   */
  687. /*                   *Error_Code will contain a non-zero error code, */
  688. /*                   *OutputBuffer will be NULL, and *OutputSize will*/
  689. /*                   be set to 0.  All other error conditions are    */
  690. /*                   feature dependent.                              */
  691. /*                                                                   */
  692. /*   Side Effects:  Side effects are feature dependent.              */
  693. /*                                                                   */
  694. /*   Notes:  None.                                                   */
  695. /*                                                                   */
  696. /*********************************************************************/
  697. void _System Issue_Feature_Command( CARDINAL32 Feature_ID,
  698. ADDRESS Handle,
  699. BOOLEAN Ring0,
  700. ADDRESS InputBuffer,
  701. CARDINAL32 InputSize,
  702. ADDRESS * OutputBuffer,
  703. CARDINAL32 * OutputSize,
  704. CARDINAL32 * Error_Code );
  705.  
  706. /*********************************************************************/
  707. /*                                                                   */
  708. /*   Function Name: Parse_Feature_Parameters                         */
  709. /*                                                                   */
  710. /*   Descriptive Name: This function allows access to the parsing    */
  711. /*                     function of an LVM Plug-in Feature.  The      */
  712. /*                     specified feature will be passed a list of    */
  713. /*                     tokens to parse, and, if it parses the tokens */
  714. /*                     successfully, will produce a buffer containing*/
  715. /*                     initialization data that can be used with the */
  716. /*                     Create_Volume API.  If it encounters an error,*/
  717. /*                     the current item in the Tokens list will be   */
  718. /*                     the offending item, and a pointer to an error */
  719. /*                     message will be returned.                     */
  720. /*                                                                   */
  721. /*   Input: DLIST  Tokens - A DLIST of tokens to parse.  Parsing will*/
  722. /*                          begin with the current entry in the list */
  723. /*                          and proceed until there is an error or   */
  724. /*                          until the specified feature has found a  */
  725. /*                          complete command.  Each feature defines  */
  726. /*                          what commands it will accept.            */
  727. /*          LVM_Feature_Specification_Record * Feature_Data - A      */
  728. /*                          pointer to a record which contains the   */
  729. /*                          ID of the feature which is to parse the  */
  730. /*                          DLIST of Tokens.  The other fields in    */
  731. /*                          this record will be filled in by the     */
  732. /*                          feature if it successfully parses the    */
  733. /*                          tokens.                                  */
  734. /*          char ** Error_Message - The address of a pointer to char.*/
  735. /*                          This will be set to NULL if the feature  */
  736. /*                          successfully parses the list of tokens,  */
  737. /*                          or it will be set to point to an error   */
  738. /*                          message if an error occurs.              */
  739. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32    */
  740. /*                          variable into which an error code may    */
  741. /*                          be placed.  The error code will be       */
  742. /*                          LVM_ENGINE_NO_ERROR if this function     */
  743. /*                          completes successfully, or a non-zero    */
  744. /*                          error code if an error occurs.           */
  745. /*                                                                   */
  746. /*   Output: If there are no errors, the Actual_Class and Init_Data  */
  747. /*           fields of *Feature_Data will be set, *Error_Message will*/
  748. /*           be set to NULL, and Error_Code will be set to           */
  749. /*           LVM_ENGINE_NO_ERROR.  The current item in the Tokens    */
  750. /*           list will be the first token that was not parsed by the */
  751. /*           feature (i.e. the first token after the command accepted*/
  752. /*           by the plug-in).                                        */
  753. /*                                                                   */
  754. /*           If an error occurs, the values of Actual_Class and      */
  755. /*           Init_Data in *Feature_Data are undefined.  *Error_Code  */
  756. /*           will be set to LVM_ENGINE_PARSING_ERROR if the error is */
  757. /*           parsing related, or some other non-zero value if the    */
  758. /*           error is not parsing related.  If the error is parsing  */
  759. /*           related, then *Error_Message will point to an error     */
  760. /*           message which can be displayed for the user.  The       */
  761. /*           current item in the Tokens list will be the token which */
  762. /*           failed.                                                 */
  763. /*                                                                   */
  764. /*   Error Handling: If an parsing related error occurs, i.e. the    */
  765. /*                   tokens in the Tokens list do not form a valid   */
  766. /*                   command accepted by the specified feature, then */
  767. /*                   the current item in the Tokens list will be the */
  768. /*                   offending token, *Error_Message will be set to  */
  769. /*                   point to an error message, and *Error_Code will */
  770. /*                   be set to LVM_ENGINE_PARSING_ERROR.             */
  771. /*                   If any other error occurs, the current item in  */
  772. /*                   the Tokens list will be the token that was being*/
  773. /*                   processed when the error occurs, and *Error_Code*/
  774. /*                   will be set to a non-zero value.                */
  775. /*                                                                   */
  776. /*   Side Effects:  The current item in the Tokens list may change.  */
  777. /*                                                                   */
  778. /*   Notes:  Each feature defines which commands it will accept, and */
  779. /*           therefore which commands it will successfully parse.    */
  780. /*                                                                   */
  781. /*********************************************************************/
  782. void _System Parse_Feature_Parameters( DLIST                               Tokens,
  783. LVM_Feature_Specification_Record  * Feature_Data,
  784. char **                             Error_Message,
  785. CARDINAL32 *                        Error_Code);
  786.  
  787. /*********************************************************************/
  788. /*                                                                   */
  789. /*   Function Name: Refresh_LVM_Engine                               */
  790. /*                                                                   */
  791. /*   Descriptive Name: This function causes the LVM Engine to look   */
  792. /*                     for changes in the current system             */
  793. /*                     configuration and update its internal tables  */
  794. /*                     accordingly.                                  */
  795. /*                                                                   */
  796. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  797. /*                                   in which to store an error code */
  798. /*                                   should an error occur.          */
  799. /*                                                                   */
  800. /*   Output:  None.                                                  */
  801. /*                                                                   */
  802. /*   Error Handling: If an error occurs, *Error_Code will be set to  */
  803. /*                   a non-zero value.                               */
  804. /*                                                                   */
  805. /*   Side Effects: Volumes which represent non-LVM devices may have  */
  806. /*                 their handles changed!                            */
  807. /*                                                                   */
  808. /*   Notes:  After calling this function, Get_Volume_Control_Data    */
  809. /*           should be called to get the updated list of volumes.    */
  810. /*           This is necessary as the handles of some volumes may    */
  811. /*           have changed.                                           */
  812. /*                                                                   */
  813. /*********************************************************************/
  814. void _System  Refresh_LVM_Engine( CARDINAL32 * Error_Code );
  815.  
  816. /* ************************************************************************** *
  817.  
  818. Functions relating to Drives
  819.  
  820. ************************************************************************** */
  821.  
  822. /*********************************************************************/
  823. /*                                                                   */
  824. /*   Function Name:  Get_Drive_Control_Data                          */
  825. /*                                                                   */
  826. /*   Descriptive Name:  This function returns an array of            */
  827. /*                      Drive_Control_Records.  These records provide*/
  828. /*                      important information about the drives in the*/
  829. /*                      system and provide the handles required to   */
  830. /*                      access them.                                 */
  831. /*                                                                   */
  832. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  833. /*                                   in which to store an error code */
  834. /*                                   should an error occur.          */
  835. /*                                                                   */
  836. /*   Output:  A Drive_Control_Array structure is returned.  If no    */
  837. /*            errors occur, Drive_Control_Data will be non-NULL,     */
  838. /*            Count will be greater than zero, and *Error_Code will  */
  839. /*            be 0.                                                  */
  840. /*                                                                   */
  841. /*   Error Handling:  If an error occurs, the Drive_Control_Array    */
  842. /*                    returned by this function will have NULL for   */
  843. /*                    Drive_Control_Data, and 0 for Count.           */
  844. /*                    *Error_Code will be greater than 0.            */
  845. /*                                                                   */
  846. /*   Side Effects:  None.                                            */
  847. /*                                                                   */
  848. /*   Notes:  The caller becomes responsible for the memory allocated */
  849. /*           for the array of Drive_Control_Records pointed to by    */
  850. /*           Drive_Control_Data pointer in the Drive_Control_Array   */
  851. /*           structure returned by this function.  The caller should */
  852. /*           free this memory when they are done using it.           */
  853. /*                                                                   */
  854. /*********************************************************************/
  855. Drive_Control_Array _System Get_Drive_Control_Data( CARDINAL32 * Error_Code );
  856.  
  857. /*********************************************************************/
  858. /*                                                                   */
  859. /*   Function Name:  Get_Drive_Status                                */
  860. /*                                                                   */
  861. /*   Descriptive Name:  Returns the Drive_Information_Record for the */
  862. /*                      drive specified by Drive_Handle.             */
  863. /*                                                                   */
  864. /*   Input: ADDRESS Drive_Handle - The handle of the drive to use.   */
  865. /*                             Drive handles are obtained through the*/
  866. /*                             Get_Drive_Control_Data function.      */
  867. /*         CARDINAL32 * Error_Code - The address of a CARDINAL32 in  */
  868. /*                                   in which to store an error code */
  869. /*                                   should an error occur.          */
  870. /*                                                                   */
  871. /*   Output: This function returns the Drive_Information_Record for  */
  872. /*           the drive associated with the specified Drive_Handle.   */
  873. /*           If no errors occur, *Error_Code will be set to 0.  If an*/
  874. /*           error does occur, then *Error_Code will be non-zero.    */
  875. /*                                                                   */
  876. /*   Error Handling:  If an error occurs, then *Error_Code will be   */
  877. /*                    non-zero.                                      */
  878. /*                                                                   */
  879. /*   Side Effects:  None.                                            */
  880. /*                                                                   */
  881. /*   Notes:  None.                                                   */
  882. /*                                                                   */
  883. /*********************************************************************/
  884. Drive_Information_Record _System Get_Drive_Status( ADDRESS Drive_Handle, CARDINAL32 * Error_Code );
  885.  
  886. /* ************************************************************************** *
  887.  
  888. Functions relating to Partitions
  889.  
  890. ************************************************************************** */
  891.  
  892. /*********************************************************************/
  893. /*                                                                   */
  894. /*   Function Name: Get_Partitions                                   */
  895. /*                                                                   */
  896. /*   Descriptive Name: Returns an array of partitions associated     */
  897. /*                     with the object specified by Handle.          */
  898. /*                                                                   */
  899. /*   Input:ADDRESS Handle - This is the handle of a drive or volume. */
  900. /*                      Drive handles are obtained through the       */
  901. /*                      Get_Drive_Control_Data function.  Volume     */
  902. /*                      handles are obtained through the             */
  903. /*                      Get_Volume_Control_Data function.            */
  904. /*         CARDINAL32 * Error_Code - The address of a CARDINAL32 in  */
  905. /*                                   in which to store an error code */
  906. /*                                   should an error occur.          */
  907. /*                                                                   */
  908. /*   Output: This function returns a structure.  The structure has   */
  909. /*           two components: an array of partition information       */
  910. /*           records and the number of entries in the array.  If     */
  911. /*           Handle is the handle of a disk drive, then the returned */
  912. /*           array will contain a partition information record for   */
  913. /*           each partition and block of free space on that drive.   */
  914. /*           If Handle is the handle of a volume, then the returned  */
  915. /*           array will contain a partition information record for   */
  916. /*           each partition which is part of the specified volume.   */
  917. /*           If no errors occur, then *Error_Code will be 0.  If an  */
  918. /*           error does occur, then *Error_Code will be non-zero.    */
  919. /*                                                                   */
  920. /*   Error Handling: Any memory allocated for the return value will  */
  921. /*                   be freed.  The Partition_Information_Array      */
  922. /*                   returned by this function will contain a NULL   */
  923. /*                   pointer for Partition_Array, and have a Count of*/
  924. /*                   0.  *Error_Code will be non-zero.               */
  925. /*                                                                   */
  926. /*                   If Handle is non-NULL and is invalid, a trap    */
  927. /*                   is likely.                                      */
  928. /*                                                                   */
  929. /*   Side Effects:  Memory will be allocated to hold the array       */
  930. /*                  returned by this function.                       */
  931. /*                                                                   */
  932. /*   Notes:  The caller becomes responsible for the memory allocated */
  933. /*           for the array of Partition_Information_Records pointed  */
  934. /*           to by Partition_Array pointer in the                    */
  935. /*           Partition_Information_Array structure returned by this  */
  936. /*           function.  The caller should free this memory when they */
  937. /*           are done using it.                                      */
  938. /*                                                                   */
  939. /*********************************************************************/
  940. Partition_Information_Array _System Get_Partitions( ADDRESS Handle, CARDINAL32 * Error_Code );
  941.  
  942. /*********************************************************************/
  943. /*                                                                   */
  944. /*   Function Name: Get_Partition_Handle                             */
  945. /*                                                                   */
  946. /*   Descriptive Name: Returns the handle of the partition whose     */
  947. /*                     serial number matches the one provided.       */
  948. /*                                                                   */
  949. /*   Input: CARDINAL32 Serial_Number - This is the serial number to  */
  950. /*                                     look for.  If a partition with*/
  951. /*                                     a matching serial number is   */
  952. /*                                     found, its handle will be     */
  953. /*                                     returned.                     */
  954. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  955. /*                                    in which to store an error code*/
  956. /*                                    should an error occur.         */
  957. /*                                                                   */
  958. /*   Output: If a partition with a matching serial number is found,  */
  959. /*              then the function return value will be the handle    */
  960. /*              of the partition found.  If no matching partition is */
  961. /*              found, then the function return value will be NULL.  */
  962. /*                                                                   */
  963. /*   Error Handling:  If no errors occur, *Error_Code will be        */
  964. /*                    LVM_ENGINE_NO_ERROR.  If an error occurs, then */
  965. /*                    *Error_Code will be a non-zero error code.     */
  966. /*                                                                   */
  967. /*   Side Effects:  None.                                            */
  968. /*                                                                   */
  969. /*   Notes:  None.                                                   */
  970. /*                                                                   */
  971. /*********************************************************************/
  972. ADDRESS _System Get_Partition_Handle( CARDINAL32 Serial_Number, CARDINAL32 * Error_Code );
  973.  
  974. /*********************************************************************/
  975. /*                                                                   */
  976. /*   Function Name: Get_Partition_Information                        */
  977. /*                                                                   */
  978. /*   Descriptive Name: Returns the Partition_Information_Record for  */
  979. /*                     the partition specified by Partition_Handle.  */
  980. /*                                                                   */
  981. /*   Input: ADDRESS Partition_Handle - The handle associated with the*/
  982. /*                                     partition for which the       */
  983. /*                                     Partition_Information_Record  */
  984. /*                                     is desired.                   */
  985. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  986. /*                                    in which to store an error code*/
  987. /*                                    should an error occur.         */
  988. /*                                                                   */
  989. /*   Output: A Partition_Information_Record is returned.  If there   */
  990. /*           is no error, then *Error_Code will be 0.  If an error   */
  991. /*           occurs, *Error_Code will be non-zero.                   */
  992. /*                                                                   */
  993. /*   Error Handling:  If the Partition_Handle is not a valid handle, */
  994. /*                    a trap could result.  If it is a handle for    */
  995. /*                    something other than a partition, an error code*/
  996. /*                    will be returned in *Error_Code.               */
  997. /*                                                                   */
  998. /*   Side Effects:  None.                                            */
  999. /*                                                                   */
  1000. /*   Notes:  None.                                                   */
  1001. /*                                                                   */
  1002. /*********************************************************************/
  1003. Partition_Information_Record  _System Get_Partition_Information( ADDRESS Partition_Handle, CARDINAL32 * Error_Code );
  1004.  
  1005. /*********************************************************************/
  1006. /*                                                                   */
  1007. /*   Function Name: Create_Partition                                 */
  1008. /*                                                                   */
  1009. /*   Descriptive Name: Creates a partition on a disk drive.          */
  1010. /*                                                                   */
  1011. /*   Input: ADDRESS         Handle - The handle of a disk drive or   */
  1012. /*                                   a block of free space.          */
  1013. /*          CARDINAL32      Size - The size, in sectors, of the      */
  1014. /*                                 partition to create.              */
  1015. /*          char            Name[] - The name to give to the newly   */
  1016. /*                                   created partition.              */
  1017. /*          Allocation_Algorithm algorithm - If Handle is a drive,   */
  1018. /*                                           then the engine will    */
  1019. /*                                           find a block of free    */
  1020. /*                                           space to use to create  */
  1021. /*                                           the partition.  This    */
  1022. /*                                           tells the engine which  */
  1023. /*                                           memory management       */
  1024. /*                                           algorithm to use.       */
  1025. /*          BOOLEAN         Bootable - If TRUE, then the engine will */
  1026. /*                                     only create the partition if  */
  1027. /*                                     it can be booted from.  If    */
  1028. /*                                     Primary_Partition is FALSE,   */
  1029. /*                                     then it is assumed that OS/2  */
  1030. /*                                     is the operating system that  */
  1031. /*                                     will be booted.               */
  1032. /*          BOOLEAN         Primary_Partition - If TRUE, then the    */
  1033. /*                                              engine will create   */
  1034. /*                                              a primary partition. */
  1035. /*                                              If FALSE, then the   */
  1036. /*                                              engine will create a */
  1037. /*                                              logical drive.       */
  1038. /*          BOOLEAN         Allocate_From_Start - If TRUE, then the  */
  1039. /*                                                engine will        */
  1040. /*                                                allocate the new   */
  1041. /*                                                partition from the */
  1042. /*                                                beginning of the   */
  1043. /*                                                selected block of  */
  1044. /*                                                free space.  If    */
  1045. /*                                                FALSE, then the    */
  1046. /*                                                partition will be  */
  1047. /*                                                allocated from the */
  1048. /*                                                end of the selected*/
  1049. /*                                                block of free      */
  1050. /*                                                space.             */
  1051. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1052. /*                                    in which to store an error code*/
  1053. /*                                    should an error occur.         */
  1054. /*                                                                   */
  1055. /*   Output: The function return value will be the handle of the     */
  1056. /*           partition created.  If the partition could not be       */
  1057. /*           created, then NULL will be returned.                    */
  1058. /*           *Error_Code will be 0 if the partition was created.     */
  1059. /*           *Error_Code will be > 0 if the partition could not be   */
  1060. /*           created.                                                */
  1061. /*                                                                   */
  1062. /*   Error Handling:  If the partition can not be created, then any  */
  1063. /*                    memory allocated by this function will be      */
  1064. /*                    freed and the partitioning of the disk in      */
  1065. /*                    question will be unchanged.                    */
  1066. /*                                                                   */
  1067. /*                    If Handle is not a valid handle, then a trap   */
  1068. /*                    may result.                                    */
  1069. /*                                                                   */
  1070. /*                    If Handle represents a partition or volume,    */
  1071. /*                    then the function will abort and set           */
  1072. /*                    *Error_Code to a non-zero value.               */
  1073. /*                                                                   */
  1074. /*   Side Effects:  A partition may be created on a disk drive.      */
  1075. /*                                                                   */
  1076. /*   Notes:  None.                                                   */
  1077. /*                                                                   */
  1078. /*********************************************************************/
  1079. ADDRESS _System Create_Partition( ADDRESS               Handle,
  1080. CARDINAL32            Size,
  1081. char                  Name[ PARTITION_NAME_SIZE ],
  1082. Allocation_Algorithm  algorithm,
  1083. BOOLEAN               Bootable,
  1084. BOOLEAN               Primary_Partition,
  1085. BOOLEAN               Allocate_From_Start,
  1086. CARDINAL32 *          Error_Code
  1087. );
  1088.  
  1089. /*********************************************************************/
  1090. /*                                                                   */
  1091. /*   Function Name: Delete_Partition                                 */
  1092. /*                                                                   */
  1093. /*   Descriptive Name: Deletes the partition specified by            */
  1094. /*                     Partition_Handle.                             */
  1095. /*                                                                   */
  1096. /*   Input: ADDRESS Partition_Handle - The handle associated with the*/
  1097. /*                                     partition to be deleted.      */
  1098. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1099. /*                                    in which to store an error code*/
  1100. /*                                    should an error occur.         */
  1101. /*                                                                   */
  1102. /*   Output: *Error_Code will be 0 if the partition was deleted      */
  1103. /*           successfully.  *Error_Code will be > 0 if the partition */
  1104. /*           could not be deleted.                                   */
  1105. /*                                                                   */
  1106. /*   Error Handling: If the partition can not be deleted, then       */
  1107. /*                   *Error_Code will be > 0.                        */
  1108. /*                                                                   */
  1109. /*                   If Partition_Handle is not a valid handle, a    */
  1110. /*                   trap may result.                                */
  1111. /*                                                                   */
  1112. /*                   If Partition_Handle is a volume or drive handle,*/
  1113. /*                   then this function will abort and set           */
  1114. /*                   *Error_Code to a non-zero value.                */
  1115. /*                                                                   */
  1116. /*   Side Effects: A partition on a disk drive may be deleted.       */
  1117. /*                                                                   */
  1118. /*   Notes:  A partition can not be deleted if it is part of a       */
  1119. /*           volume!                                                 */
  1120. /*                                                                   */
  1121. /*********************************************************************/
  1122. void _System Delete_Partition( ADDRESS Partition_Handle, CARDINAL32 * Error_Code );
  1123.  
  1124. /*********************************************************************/
  1125. /*                                                                   */
  1126. /*   Function Name: Set_Active_Flag                                  */
  1127. /*                                                                   */
  1128. /*   Descriptive Name: Sets the Active Flag field for a partition.   */
  1129. /*                                                                   */
  1130. /*   Input: ADDRESS Partition_Handle - The handle of the partition   */
  1131. /*                                     whose Active Flag is to be set*/
  1132. /*          BYTE Active_Flag - The new value for the Active Flag.    */
  1133. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1134. /*                                    in which to store an error code*/
  1135. /*                                    should an error occur.         */
  1136. /*                                                                   */
  1137. /*   Output: *Error_Code will be 0 if the Active Flag was            */
  1138. /*           successfully set, otherwise *Error_Code will contain a  */
  1139. /*           non-zero error code indicating what went wrong.         */
  1140. /*                                                                   */
  1141. /*   Error Handling: If the Active Flag can not be set, this function*/
  1142. /*                   will abort without changing any disk structures.*/
  1143. /*                                                                   */
  1144. /*                   If Partition_Handle is not a valid handle, a    */
  1145. /*                   trap may result.                                */
  1146. /*                                                                   */
  1147. /*                   If Partition_Handle is a volume or drive handle,*/
  1148. /*                   then this function will abort and set           */
  1149. /*                   *Error_Code to a non-zero value.                */
  1150. /*                                                                   */
  1151. /*                                                                   */
  1152. /*   Side Effects:  The Active Flag for a partition may be modified. */
  1153. /*                                                                   */
  1154. /*   Notes:  None.                                                   */
  1155. /*                                                                   */
  1156. /*********************************************************************/
  1157. void _System Set_Active_Flag ( ADDRESS      Partition_Handle,
  1158. BYTE         Active_Flag,
  1159. CARDINAL32 * Error_Code
  1160. );
  1161.  
  1162. /*********************************************************************/
  1163. /*                                                                   */
  1164. /*   Function Name: Set_OS_Flag                                      */
  1165. /*                                                                   */
  1166. /*   Descriptive Name: Sets the OS Flag field for a partition.  This */
  1167. /*                     field is typically used to indicate the       */
  1168. /*                     filesystem used on the partition, which       */
  1169. /*                     generally gives an indication of which OS is  */
  1170. /*                     using that partition.                         */
  1171. /*                                                                   */
  1172. /*   Input: ADDRESS Partition_Handle - The handle of the partition   */
  1173. /*                                     whose Active Flag is to be set*/
  1174. /*          BYTE OS_Flag - The new value for the OS Flag.            */
  1175. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1176. /*                                    in which to store an error code*/
  1177. /*                                    should an error occur.         */
  1178. /*                                                                   */
  1179. /*   Output: *Error_Code will be 0 if the OS Flag was successfully   */
  1180. /*           set, otherwise *Error_Code will contain a non-zero error*/
  1181. /*           code indicating what went wrong.                        */
  1182. /*                                                                   */
  1183. /*   Error Handling: If the OS Flag can not be set, this function    */
  1184. /*                   will abort without changing any disk structures.*/
  1185. /*                                                                   */
  1186. /*                   If Partition_Handle is not a valid handle, a    */
  1187. /*                   trap may result.                                */
  1188. /*                                                                   */
  1189. /*                   If Partition_Handle is a volume or drive handle,*/
  1190. /*                   then this function will abort and set           */
  1191. /*                   *Error_Code to a non-zero value.                */
  1192. /*                                                                   */
  1193. /*                                                                   */
  1194. /*   Side Effects:  The OS Flag for a partition may be modified.     */
  1195. /*                                                                   */
  1196. /*   Notes:  None.                                                   */
  1197. /*                                                                   */
  1198. /*********************************************************************/
  1199. void _System Set_OS_Flag ( ADDRESS      Partition_Handle,
  1200. BYTE         OS_Flag,
  1201. CARDINAL32 * Error_Code
  1202. );
  1203.  
  1204. /* ************************************************************************** *
  1205.  
  1206. Functions relating to Volumes
  1207.  
  1208. ************************************************************************** */
  1209.  
  1210. /*********************************************************************/
  1211. /*                                                                   */
  1212. /*   Function Name: Get_Volume_Control_Data                          */
  1213. /*                                                                   */
  1214. /*   Descriptive Name: This function returns a structure containing  */
  1215. /*                     an array of Volume_Control_Records.  These    */
  1216. /*                     records contain information about volumes     */
  1217. /*                     which is invariant - i.e. will not change for */
  1218. /*                     as long as the volume exists.  One of the     */
  1219. /*                     items in the Volume_Control_Record is the     */
  1220. /*                     handle for the volume.  This handle must be   */
  1221. /*                     used on all accesses to the volume.           */
  1222. /*                                                                   */
  1223. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1224. /*                                    in which to store an error code*/
  1225. /*                                    should an error occur.         */
  1226. /*                                                                   */
  1227. /*   Output: A Volume_Control_Array structure is returned.           */
  1228. /*                                                                   */
  1229. /*           If there are no errors, then the Volume_Control_Data    */
  1230. /*           pointer in the Volume_Control_Array will be non-NULL,   */
  1231. /*           the Count field of the Volume_Control_Array will be     */
  1232. /*           >= 0, and *Error_Code will be 0.                        */
  1233. /*                                                                   */
  1234. /*           If an error does occur, then the Volume_Control_Data    */
  1235. /*           pointer in the the Volume_Control_Array will be NULL,   */
  1236. /*           the Count field of the Volume_Control_Array will be 0,  */
  1237. /*           and *Error_Code will be > 0.                            */
  1238. /*                                                                   */
  1239. /*   Error Handling: If an error occurs, then any memory allocated by*/
  1240. /*                   this function will be freed.                    */
  1241. /*                                                                   */
  1242. /*   Side Effects:  Memory for the returned array is allocated.      */
  1243. /*                                                                   */
  1244. /*   Notes:  The caller becomes responsible for the memory allocated */
  1245. /*           for the array of Volume_Control_Records pointed to by   */
  1246. /*           Volume_Control_Data pointer in the Volume_Control_Array */
  1247. /*           structure returned by this function.  The caller should */
  1248. /*           free this memory when they are done using it.           */
  1249. /*                                                                   */
  1250. /*********************************************************************/
  1251. Volume_Control_Array _System Get_Volume_Control_Data( CARDINAL32 * Error_Code );
  1252.  
  1253. /*********************************************************************/
  1254. /*                                                                   */
  1255. /*   Function Name: Get_Volume_Information                           */
  1256. /*                                                                   */
  1257. /*   Descriptive Name:  This function returns the                    */
  1258. /*                      Volume_Information_Record for the volume     */
  1259. /*                      associated with Volume_Handle.               */
  1260. /*                                                                   */
  1261. /*   Input: ADDRESS Volume_Handle - The handle of the volume about   */
  1262. /*                                  which information is desired.    */
  1263. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1264. /*                                    in which to store an error code*/
  1265. /*                                    should an error occur.         */
  1266. /*                                                                   */
  1267. /*   Output: This function returns a Volume_Information_Record.      */
  1268. /*                                                                   */
  1269. /*           If this function is successful, then *Error_Code will be*/
  1270. /*              0.                                                   */
  1271. /*                                                                   */
  1272. /*           If this function fails, then *Error_Code will be > 0.   */
  1273. /*                                                                   */
  1274. /*   Error Handling:  If Volume_Handle is not a valid handle, a trap */
  1275. /*                    will be likely.  If Volume_Handle is a drive or*/
  1276. /*                    partition handle, *Error_Code will be > 0.     */
  1277. /*                                                                   */
  1278. /*   Side Effects:  None.                                            */
  1279. /*                                                                   */
  1280. /*   Notes:  None.                                                   */
  1281. /*                                                                   */
  1282. /*********************************************************************/
  1283. Volume_Information_Record _System Get_Volume_Information( ADDRESS Volume_Handle, CARDINAL32 * Error_Code );
  1284.  
  1285. /*********************************************************************/
  1286. /*                                                                   */
  1287. /*   Function Name: Create_Volume                                    */
  1288. /*                                                                   */
  1289. /*   Descriptive Name:  This function creates a volume from a list of*/
  1290. /*                      partitions.  The partitions are specified by */
  1291. /*                      their corresponding handles.                 */
  1292. /*                                                                   */
  1293. /*   Input: char         Name[] - The name to assign to the newly    */
  1294. /*                                created volume.                    */
  1295. /*          BOOLEAN      Create_LVM_Volume - If TRUE, then an LVM    */
  1296. /*                                           volume is created,      */
  1297. /*                                           otherwise a             */
  1298. /*                                           compatibility volume is */
  1299. /*                                           created.                */
  1300. /*          BOOLEAN      Bootable - If TRUE, the volume will not be  */
  1301. /*                                  created unless OS/2 can be booted*/
  1302. /*                                  from it.                         */
  1303. /*          char         Drive_Letter_Preference - This is the drive */
  1304. /*                                                 letter to use for */
  1305. /*                                                 accessing the     */
  1306. /*                                                 newly created     */
  1307. /*                                                 volume.           */
  1308. /*          CARDINAL32   FeaturesToUse - This is currently reserved  */
  1309. /*                                       for future use and should   */
  1310. /*                                       always be set to 0.         */
  1311. /*          CARDINAL32   Partition_Count - The number of partitions  */
  1312. /*                                         to link together to form  */
  1313. /*                                         the volume being created. */
  1314. /*          ADDRESS      Partition_Handles[] - An array of partition */
  1315. /*                                             handles with one entry*/
  1316. /*                                             for each partition    */
  1317. /*                                             that is to become part*/
  1318. /*                                             of the volume being   */
  1319. /*                                             created.              */
  1320. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1321. /*                                    in which to store an error code*/
  1322. /*                                    should an error occur.         */
  1323. /*                                                                   */
  1324. /*   Output: *Error_Code will be 0 if the volume was created.        */
  1325. /*           *Error_Code will be > 0 if the volume could not be      */
  1326. /*              created.                                             */
  1327. /*                                                                   */
  1328. /*   Error Handling: If any of the handles in the partition handles  */
  1329. /*                   array is not valid, then a trap is likely.  If  */
  1330. /*                   Partition_Count is greater than the number of   */
  1331. /*                   entries in the partition handles array, then a  */
  1332. /*                   trap is likely.  If any of the handles in the   */
  1333. /*                   partition array are not partition handles, then */
  1334. /*                   *Error_Code will be > 0.  If the volume can NOT */
  1335. /*                   be created, then *Error_Code will be > 0 and any*/
  1336. /*                   memory allocated by this function will be freed.*/
  1337. /*                   If the volume can NOT be created, then the      */
  1338. /*                   existing partition/volume structure of the disk */
  1339. /*                   will be unchanged.                              */
  1340. /*                                                                   */
  1341. /*   Side Effects:  A volume may be created.                         */
  1342. /*                                                                   */
  1343. /*   Notes:  This function provides limited compatibility for        */
  1344. /*           programs written to use the LVM Version 1 interface.    */
  1345. /*           Specifically, this function will only allow the         */
  1346. /*           creation of compatibility volumes.  Any attempt to      */
  1347. /*           create an LVM volume will result in an error code being */
  1348. /*           returned.                                               */
  1349. /*                                                                   */
  1350. /*********************************************************************/
  1351. void _System Create_Volume( char         Name[VOLUME_NAME_SIZE],
  1352. BOOLEAN      Create_LVM_Volume,
  1353. BOOLEAN      Bootable,
  1354. char         Drive_Letter_Preference,
  1355. CARDINAL32   FeaturesToUse,
  1356. CARDINAL32   Partition_Count,
  1357. ADDRESS      Partition_Handles[],
  1358. CARDINAL32 * Error_Code
  1359. );
  1360.  
  1361. /*********************************************************************/
  1362. /*                                                                   */
  1363. /*   Function Name: Create_Volume2                                   */
  1364. /*                                                                   */
  1365. /*   Descriptive Name:  This function creates a volume from a list of*/
  1366. /*                      partitions.  The partitions are specified by */
  1367. /*                      their corresponding handles.                 */
  1368. /*                                                                   */
  1369. /*   Input: char         Name[] - The name to assign to the newly    */
  1370. /*                                created volume.                    */
  1371. /*          BOOLEAN      Create_LVM_Volume - If TRUE, then an LVM    */
  1372. /*                                           volume is created,      */
  1373. /*                                           otherwise a             */
  1374. /*                                           compatibility volume is */
  1375. /*                                           created.                */
  1376. /*          BOOLEAN      Bootable - If TRUE, the volume will not be  */
  1377. /*                                  created unless OS/2 can be booted*/
  1378. /*                                  from it.                         */
  1379. /*          char         Drive_Letter_Preference - This is the drive */
  1380. /*                                                 letter to use for */
  1381. /*                                                 accessing the     */
  1382. /*                                                 newly created     */
  1383. /*                                                 volume.           */
  1384. /*          CARDINAL32   Feature_Count - The number of features to   */
  1385. /*                                       install on the volume being */
  1386. /*                                       created.  This field is     */
  1387. /*                                       ignored if Create_LVM_Volume*/
  1388. /*                                       is FALSE.                   */
  1389. /*          LVM_Feature_Specification_Record FeaturesToUse[] - An    */
  1390. /*                                         array of feature IDs and  */
  1391. /*                                         their associated LVM      */
  1392. /*                                         classes used to designate */
  1393. /*                                         which features to install */
  1394. /*                                         on the volume being       */
  1395. /*                                         created and the order in  */
  1396. /*                                         which to install them.    */
  1397. /*                                         This field is ignored if  */
  1398. /*                                         Create_LVM_Volume is      */
  1399. /*                                         FALSE.                    */
  1400. /*          CARDINAL32   Partition_Count - The number of partitions  */
  1401. /*                                         to link together to form  */
  1402. /*                                         the volume being created. */
  1403. /*          ADDRESS      Partition_Handles[] - An array of partition */
  1404. /*                                             handles with one entry*/
  1405. /*                                             for each partition    */
  1406. /*                                             that is to become part*/
  1407. /*                                             of the volume being   */
  1408. /*                                             created.              */
  1409. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1410. /*                                    in which to store an error code*/
  1411. /*                                    should an error occur.         */
  1412. /*                                                                   */
  1413. /*   Output: *Error_Code will be 0 if the volume was created.        */
  1414. /*           *Error_Code will be > 0 if the volume could not be      */
  1415. /*              created.                                             */
  1416. /*                                                                   */
  1417. /*   Error Handling: If any of the handles in the partition handles  */
  1418. /*                   array is not valid, then a trap is likely.  If  */
  1419. /*                   Partition_Count is greater than the number of   */
  1420. /*                   entries in the partition handles array, then a  */
  1421. /*                   trap is likely.  If any of the handles in the   */
  1422. /*                   partition array are not partition handles, then */
  1423. /*                   *Error_Code will be > 0.  If the volume can NOT */
  1424. /*                   be created, then *Error_Code will be > 0 and any*/
  1425. /*                   memory allocated by this function will be freed.*/
  1426. /*                   If the volume can NOT be created, then the      */
  1427. /*                   existing partition/volume structure of the disk */
  1428. /*                   will be unchanged.                              */
  1429. /*                                                                   */
  1430. /*   Side Effects:  A volume may be created.                         */
  1431. /*                                                                   */
  1432. /*   Notes:  None.                                                   */
  1433. /*                                                                   */
  1434. /*********************************************************************/
  1435. void _System Create_Volume2( char                               Name[VOLUME_NAME_SIZE],
  1436. BOOLEAN                            Create_LVM_Volume,
  1437. BOOLEAN                            Bootable,
  1438. char                               Drive_Letter_Preference,
  1439. CARDINAL32                         Feature_Count,
  1440. LVM_Feature_Specification_Record   FeaturesToUse[],
  1441. CARDINAL32                         Partition_Count,
  1442. ADDRESS                            Partition_Handles[],
  1443. CARDINAL32 *                       Error_Code
  1444. );
  1445.  
  1446. /*********************************************************************/
  1447. /*                                                                   */
  1448. /*   Function Name: Delete_Volume                                    */
  1449. /*                                                                   */
  1450. /*   Descriptive Name: Deletes the volume specified by Volume_Handle.*/
  1451. /*                                                                   */
  1452. /*   Input: ADDRESS Volume_Handle - The handle of the volume to      */
  1453. /*                                  delete.  All partitions which are*/
  1454. /*                                  part of the specified volume will*/
  1455. /*                                  be deleted also.                 */
  1456. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1457. /*                                    in which to store an error code*/
  1458. /*                                    should an error occur.         */
  1459. /*                                                                   */
  1460. /*   Output: *Error_Code will be 0 if the volume and its partitions  */
  1461. /*           are successfully deleted.  Otherwise, *Error_Code will  */
  1462. /*           be > 0.                                                 */
  1463. /*                                                                   */
  1464. /*   Error Handling: *Error_Code will be > 0 if an error occurs.  If */
  1465. /*                   the volume or any of its partitions can not be  */
  1466. /*                   deleted, then any changes made by this function */
  1467. /*                   will be undone.                                 */
  1468. /*                                                                   */
  1469. /*                   If Volume_Handle is not a valid handle, a trap  */
  1470. /*                   may result.                                     */
  1471. /*                                                                   */
  1472. /*                   If Volume_Handle is a partition or drive handle,*/
  1473. /*                   then this function will abort and set           */
  1474. /*                   *Error_Code to a non-zero value.                */
  1475. /*                                                                   */
  1476. /*   Side Effects:  A volume and its partitions may be deleted.      */
  1477. /*                  System memory may be freed as the internal       */
  1478. /*                  structures used to track the deleted volume      */
  1479. /*                  are no longer required.                          */
  1480. /*                                                                   */
  1481. /*   Notes:  None.                                                   */
  1482. /*                                                                   */
  1483. /*********************************************************************/
  1484. void _System Delete_Volume( ADDRESS Volume_Handle, CARDINAL32 * Error_Code );
  1485.  
  1486. /*********************************************************************/
  1487. /*                                                                   */
  1488. /*   Function Name: Hide_Volume                                      */
  1489. /*                                                                   */
  1490. /*   Descriptive Name: Hide volume "hides" a volume from OS/2 by     */
  1491. /*                     removing its drive letter assignment.  Without*/
  1492. /*                     a drive letter assignment, OS/2 can not access*/
  1493. /*                     (or "see") the volume.                        */
  1494. /*                                                                   */
  1495. /*   Input: ADDRESS Volume_Handle - The handle of the volume to hide.*/
  1496. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1497. /*                                    in which to store an error code*/
  1498. /*                                    should an error occur.         */
  1499. /*                                                                   */
  1500. /*   Output: *Error_Code will be 0 if the volume was successfully    */
  1501. /*           hidden.  If the volume could not be hidden, then        */
  1502. /*           *Error_Code will be > 0.                                */
  1503. /*                                                                   */
  1504. /*   Error Handling: *Error_Code will be > 0 if the volume can not be*/
  1505. /*                   hidden.  If the volume can not be hidden, then  */
  1506. /*                   nothing will be altered.                        */
  1507. /*                                                                   */
  1508. /*                   If Volume_Handle is not a valid handle, a trap  */
  1509. /*                   may result.                                     */
  1510. /*                                                                   */
  1511. /*                   If Volume_Handle is a partition or drive handle,*/
  1512. /*                   then this function will abort and set           */
  1513. /*                   *Error_Code to a non-zero value.                */
  1514. /*                                                                   */
  1515. /*   Side Effects:  None.                                            */
  1516. /*                                                                   */
  1517. /*   Notes:  None.                                                   */
  1518. /*                                                                   */
  1519. /*********************************************************************/
  1520. void _System Hide_Volume( ADDRESS Volume_Handle, CARDINAL32 * Error_Code );
  1521.  
  1522. /*********************************************************************/
  1523. /*                                                                   */
  1524. /*   Function Name: Expand_Volume                                    */
  1525. /*                                                                   */
  1526. /*   Descriptive Name: This function expands an existing volume by   */
  1527. /*                     linking additional partitions to it.          */
  1528. /*                                                                   */
  1529. /*   Input: ADDRESS Volume_Handle - The handle of the volume to be   */
  1530. /*                                  expanded.                        */
  1531. /*          CARDINAL32 Partition_Count - The number of partitions or */
  1532. /*                                       volumes to be added to the  */
  1533. /*                                       volume being expanded.      */
  1534. /*          ADDRESS Partition_Handles[] - An array of handles.  Each */
  1535. /*                                        handle in the array is the */
  1536. /*                                        handle of a partition      */
  1537. /*                                        which is to be added to    */
  1538. /*                                        the volume being expanded. */
  1539. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1540. /*                                    in which to store an error code*/
  1541. /*                                    should an error occur.         */
  1542. /*                                                                   */
  1543. /*   Output: *Error_Code will be 0 if the volume is successfully     */
  1544. /*           expanded.  If the volume can not be expanded,           */
  1545. /*           *Error_Code will be > 0.                                */
  1546. /*                                                                   */
  1547. /*   Error Handling: If the volume can not be expanded, the state of */
  1548. /*                   the volume is unchanged and any memory allocated*/
  1549. /*                   by this function is freed.                      */
  1550. /*                                                                   */
  1551. /*                   If Volume_Handle is not a valid handle, a trap  */
  1552. /*                   may result.                                     */
  1553. /*                                                                   */
  1554. /*                   If Volume_Handle is a partition or drive handle,*/
  1555. /*                   then this function will abort and set           */
  1556. /*                   *Error_Code to a non-zero value.                */
  1557. /*                                                                   */
  1558. /*                   If any of the partition handles in the          */
  1559. /*                   Partition_handles array are not valid handles,  */
  1560. /*                   then a trap may result.                         */
  1561. /*                                                                   */
  1562. /*                   If any of the partition handles in the          */
  1563. /*                   Partition_Handles array are actually drive      */
  1564. /*                   handles, then this function will abort and      */
  1565. /*                   set *Error_Code to a non-zero value.            */
  1566. /*                                                                   */
  1567. /*                   If Partition_Count is greater than the number of*/
  1568. /*                   entries in the Partition_Handles array, a trap  */
  1569. /*                   may result.                                     */
  1570. /*                                                                   */
  1571. /*   Side Effects:  A volume may be expanded.  If the volume is      */
  1572. /*                  expanded using another volume, the partitions    */
  1573. /*                  on the second volume will be linked to those of  */
  1574. /*                  the first volume and all data on the second      */
  1575. /*                  volume will be lost.                             */
  1576. /*                                                                   */
  1577. /*   Notes:  None.                                                   */
  1578. /*                                                                   */
  1579. /*********************************************************************/
  1580. void _System Expand_Volume ( ADDRESS         Volume_Handle,
  1581. CARDINAL32      Partition_Count,
  1582. ADDRESS         Partition_Handles[],
  1583. CARDINAL32 *    Error_Code
  1584. );
  1585.  
  1586. /*********************************************************************/
  1587. /*                                                                   */
  1588. /*   Function Name: Assign_Drive_Letter                              */
  1589. /*                                                                   */
  1590. /*   Descriptive Name: Assigns a drive letter to a volume.           */
  1591. /*                                                                   */
  1592. /*   Input: ADDRESS Volume_Handle - The handle of the volume which   */
  1593. /*                                  is to have its assigned drive    */
  1594. /*                                  letter changed.                  */
  1595. /*          char  New_Drive_Preference - The new drive letter to     */
  1596. /*                                       assign to the volume.       */
  1597. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1598. /*                                    in which to store an error code*/
  1599. /*                                    should an error occur.         */
  1600. /*                                                                   */
  1601. /*   Output: *Error_Code will be 0 if the drive letter was assigned  */
  1602. /*           successfully; otherwise *Error_Code will be > 0.        */
  1603. /*                                                                   */
  1604. /*   Error Handling: If the drive letter assignment can not be made, */
  1605. /*                   the volume will not be altered.                 */
  1606. /*                                                                   */
  1607. /*                   If Volume_Handle is not a valid handle, a trap  */
  1608. /*                   may result.                                     */
  1609. /*                                                                   */
  1610. /*                   If Volume_Handle is a partition or drive handle,*/
  1611. /*                   then this function will abort and set           */
  1612. /*                   *Error_Code to a non-zero value.                */
  1613. /*                                                                   */
  1614. /*   Side Effects:  A volume may have its drive letter assignment    */
  1615. /*                  changed.                                         */
  1616. /*                                                                   */
  1617. /*   Notes:  If the drive letter being assigned is already in use by */
  1618. /*           volume which does not lie on removable media, then the  */
  1619. /*           drive assignment will NOT be made.                      */
  1620. /*                                                                   */
  1621. /*********************************************************************/
  1622. void _System Assign_Drive_Letter( ADDRESS      Volume_Handle,
  1623. char         New_Drive_Preference,
  1624. CARDINAL32 * Error_Code
  1625. );
  1626.  
  1627. /*********************************************************************/
  1628. /*                                                                   */
  1629. /*   Function Name: Set_Installable                                  */
  1630. /*                                                                   */
  1631. /*   Descriptive Name: Marks a volume as being the volume to install */
  1632. /*                     OS/2 on.                                      */
  1633. /*                                                                   */
  1634. /*   Input: ADDRESS Volume_Handle - The handle of the volume to which*/
  1635. /*                                  OS/2 should be installed.        */
  1636. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1637. /*                                    in which to store an error code*/
  1638. /*                                    should an error occur.         */
  1639. /*                                                                   */
  1640. /*   Output: If the volume is successfully marked as installable,    */
  1641. /*           *Error_Code will be 0; otherwise *Error_Code will       */
  1642. /*           be > 0.                                                 */
  1643. /*                                                                   */
  1644. /*   Error Handling: If Volume_Handle is not a valid handle, a trap  */
  1645. /*                   may result.                                     */
  1646. /*                                                                   */
  1647. /*                   If Volume_Handle is a partition or drive handle,*/
  1648. /*                   then this function will abort and set           */
  1649. /*                   *Error_Code to a non-zero value.                */
  1650. /*                                                                   */
  1651. /*   Side Effects:  The specified volume may be marked as            */
  1652. /*                  installable.                                     */
  1653. /*                                                                   */
  1654. /*   Notes:  None.                                                   */
  1655. /*                                                                   */
  1656. /*********************************************************************/
  1657. void _System Set_Installable ( ADDRESS Volume_Handle, CARDINAL32 * Error_Code );
  1658.  
  1659. /*********************************************************************/
  1660. /*                                                                   */
  1661. /*   Function Name: Get_Installable_Volume                           */
  1662. /*                                                                   */
  1663. /*   Descriptive Name: Marks a volume as being the volume to install */
  1664. /*                     OS/2 on.                                      */
  1665. /*                                                                   */
  1666. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1667. /*                                    in which to store an error code*/
  1668. /*                                    should an error occur.         */
  1669. /*                                                                   */
  1670. /*   Output: If a volume is mared installable, its information will  */
  1671. /*           be returned and *Error_Code will be LVM_ENGINE_NO_ERROR.*/
  1672. /*           If there is no volume marked installable, then          */
  1673. /*           *Error_Code will be > 0.                                */
  1674. /*                                                                   */
  1675. /*   Error Handling: An error code is returned if there is an error. */
  1676. /*                                                                   */
  1677. /*   Side Effects:  None.                                            */
  1678. /*                                                                   */
  1679. /*   Notes:  None.                                                   */
  1680. /*                                                                   */
  1681. /*********************************************************************/
  1682. Volume_Information_Record _System Get_Installable_Volume ( CARDINAL32 * Error_Code );
  1683.  
  1684. /*********************************************************************/
  1685. /*                                                                   */
  1686. /*   Function Name: Convert_Volumes_To_V1                            */
  1687. /*                                                                   */
  1688. /*   Descriptive Name: This function attempts to convert all LVM     */
  1689. /*                     volumes in the system into a format that can  */
  1690. /*                     be used by LVM Version 1, which was shipped   */
  1691. /*                     with Warp Server for e-business.  This        */
  1692. /*                     function returns a bitmap of the drive letters*/
  1693. /*                     corresponding to Volumes that can not be      */
  1694. /*                     converted.                                    */
  1695. /*                                                                   */
  1696. /*   Input: BOOLEAN * Hidden_Volume_Conversion_Failure - The address */
  1697. /*                                 of a BOOLEAN variable in which    */
  1698. /*                                 to store a flag indicating if     */
  1699. /*                                 there were hidden volumes that    */
  1700. /*                                 could not be converted.  If       */
  1701. /*                                 *Hidden_Volume_Conversion_Failure */
  1702. /*                                 is TRUE, then there were hidden   */
  1703. /*                                 volumes that could not be         */
  1704. /*                                 converted.  If FALSE, then there  */
  1705. /*                                 were no hidden volumes, or the    */
  1706. /*                                 hidden volumes that existed were  */
  1707. /*                                 converted successfully.           */
  1708. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1709. /*                                    in which to store an error code*/
  1710. /*                                    should an error occur.         */
  1711. /*                                                                   */
  1712. /*   Output: This function returns a bitmap of the drive letters     */
  1713. /*           corresponding to volumes that could not be converted to */
  1714. /*           LVM Version 1 format.  If this function is successful   */
  1715. /*           and all volumes were converted, then *Error_Code will be*/
  1716. /*           set to LVM_ENGINE_NO_ERROR and the bitmap returned will */
  1717. /*           have no bits set.  If this function failes, *Error_Code */
  1718. /*           will contain a non-zero error code and the bitmap       */
  1719. /*           returned by this function may be non-zero.              */
  1720. /*                                                                   */
  1721. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  1722. /*                                                                   */
  1723. /*   Side Effects:  All LVM volumes that can be converted to LVM     */
  1724. /*                  Version 1 format will be.                        */
  1725. /*                                                                   */
  1726. /*   Notes:  Bit 0 in the bitmap returned by this function represents*/
  1727. /*           drive letter 'A'.                                       */
  1728. /*                                                                   */
  1729. /*********************************************************************/
  1730. CARDINAL32 _System Convert_Volumes_To_V1 ( BOOLEAN *    Hidden_Volume_Conversion_Failure,
  1731. CARDINAL32 * Error_Code ) ;
  1732.  
  1733. /* ************************************************************************** *
  1734.  
  1735. Functions relating to Partitions, Drives, and Volumes.
  1736.  
  1737. ************************************************************************** */
  1738.  
  1739. /*********************************************************************/
  1740. /*                                                                   */
  1741. /*   Function Name: Set_Name                                         */
  1742. /*                                                                   */
  1743. /*   Descriptive Name: Sets the name of a volume, drive, or partition*/
  1744. /*                                                                   */
  1745. /*   Input: ADDRESS Handle - The handle of the drive, partition, or  */
  1746. /*                           volume which is to have its name set.   */
  1747. /*          char New_Name[] - The new name for the drive/partition/  */
  1748. /*                            volume.                                */
  1749. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1750. /*                                    in which to store an error code*/
  1751. /*                                    should an error occur.         */
  1752. /*                                                                   */
  1753. /*   Output: *Error_Code will be 0 if the name is set as specified.  */
  1754. /*           If the name can not be set, *Error_Code will be > 0.    */
  1755. /*                                                                   */
  1756. /*   Error Handling: If the name can not be set, then drive/volume/  */
  1757. /*                   partition is not modified.                      */
  1758. /*                                                                   */
  1759. /*                   If Handle is not a valid handle, a trap may     */
  1760. /*                   result.                                         */
  1761. /*                                                                   */
  1762. /*   Side Effects:  A drive/volume/partition may have its name set.  */
  1763. /*                                                                   */
  1764. /*   Notes:  None.                                                   */
  1765. /*                                                                   */
  1766. /*********************************************************************/
  1767. void _System Set_Name ( ADDRESS      Handle,
  1768. char         New_Name[],
  1769. CARDINAL32 * Error_Code
  1770. );
  1771.  
  1772. /*********************************************************************/
  1773. /*                                                                   */
  1774. /*   Function Name: Set_Startable                                    */
  1775. /*                                                                   */
  1776. /*   Descriptive Name: Sets the specified volume or partition        */
  1777. /*                     startable.  If a volume is specified, it must */
  1778. /*                     be a compatibility volume whose partition is  */
  1779. /*                     a primary partition on the first drive.  If a */
  1780. /*                     partition is specified, it must be a primary  */
  1781. /*                     partition on the first drive in the system.   */
  1782. /*                                                                   */
  1783. /*   Input: ADDRESS Handle - The handle of the partition or volume   */
  1784. /*                           which is to be set startable.           */
  1785. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1786. /*                                    in which to store an error code*/
  1787. /*                                    should an error occur.         */
  1788. /*                                                                   */
  1789. /*   Output: *Error_Code will be 0 if the specified volume or        */
  1790. /*           partition was set startable.                            */
  1791. /*           If the name can not be set, *Error_Code will be > 0.    */
  1792. /*                                                                   */
  1793. /*   Error Handling: If the volume or partition could not be set     */
  1794. /*                   startable, then nothing in the system is        */
  1795. /*                   changed.                                        */
  1796. /*                                                                   */
  1797. /*                   If Handle is not a valid handle, a trap may     */
  1798. /*                   result.                                         */
  1799. /*                                                                   */
  1800. /*   Side Effects:  Any other partition or volume which is marked    */
  1801. /*                  startable will have its startable flag cleared.  */
  1802. /*                                                                   */
  1803. /*   Notes:  None.                                                   */
  1804. /*                                                                   */
  1805. /*********************************************************************/
  1806. void _System Set_Startable ( ADDRESS      Handle,
  1807. CARDINAL32 * Error_Code
  1808. );
  1809.  
  1810. /*********************************************************************/
  1811. /*                                                                   */
  1812. /*   Function Name: Get_Valid_Options                                */
  1813. /*                                                                   */
  1814. /*   Descriptive Name: Returns a bitmap where each bit in the bitmap */
  1815. /*                     corresponds to a possible operation that the  */
  1816. /*                     LVM Engine can perform.  Those bits which are */
  1817. /*                     1 represent operations which can be performed */
  1818. /*                     on the item specified by Handle.  Those bits  */
  1819. /*                     which are 0 are not allowed on the item       */
  1820. /*                     specified by Handle.                          */
  1821. /*                                                                   */
  1822. /*   Input: ADDRESS Handle - This is any valid drive, volume, or     */
  1823. /*                           partition handle.                       */
  1824. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1825. /*                                    in which to store an error code*/
  1826. /*                                    should an error occur.         */
  1827. /*                                                                   */
  1828. /*   Output:  A bitmap indicating which operations are valid on the  */
  1829. /*            item specified by Handle.                              */
  1830. /*                                                                   */
  1831. /*            If no errors occur, *Error_Code will be 0, otherwise   */
  1832. /*            *Error_Code will be > 0.                               */
  1833. /*                                                                   */
  1834. /*   Error Handling:  If Handle is not valid, a trap will be likely. */
  1835. /*                                                                   */
  1836. /*   Side Effects:  None.                                            */
  1837. /*                                                                   */
  1838. /*   Notes:  The values of the various bits in the bitmap returned   */
  1839. /*           by this function are defined near the beginning of this */
  1840. /*           file, immediately after all of the structure            */
  1841. /*           definitions.                                            */
  1842. /*                                                                   */
  1843. /*********************************************************************/
  1844. CARDINAL32 _System Get_Valid_Options( ADDRESS Handle, CARDINAL32 * Error_Code );
  1845.  
  1846. /*********************************************************************/
  1847. /*                                                                   */
  1848. /*   Function Name: Get_Child_Handles                                */
  1849. /*                                                                   */
  1850. /*   Descriptive Name: Given the handle of a volume or aggregate,    */
  1851. /*                     this function will return the handles of the  */
  1852. /*                     children of the volume or aggregate.  This    */
  1853. /*                     allows the entire tree representation of a    */
  1854. /*                     volume to be traversed, a level at a time.    */
  1855. /*                                                                   */
  1856. /*   Input: ADDRESS Handle - The handle of the volume or aggregate   */
  1857. /*                           whose children are required.            */
  1858. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1859. /*                                   in which to store an error code */
  1860. /*                                   should an error occur.          */
  1861. /*                                                                   */
  1862. /*   Output:  If successful, an LVM_Handle_Array_Record is returned  */
  1863. /*            with a non-zero Count.  Also, *Error_Code will be set  */
  1864. /*            to LVM_ENGINE_NO_ERROR.  If an error occurs, then      */
  1865. /*            the Count field will be 0 and *Error_Code will contain */
  1866. /*            a non-zero error code.                                 */
  1867. /*                                                                   */
  1868. /*   Error Handling: If Handle is not a valid handle, then a trap is */
  1869. /*                   likely.  If Handle is the handle of partition,  */
  1870. /*                   then *Error_Code will be set to                 */
  1871. /*                   LVM_ENGINE_NO_CHILDREN.  If Handle is not a     */
  1872. /*                   volume or aggregate handle, then *Error_Code    */
  1873. /*                   will be set to LVM_ENGINE_BAD_HANDLE.           */
  1874. /*                                                                   */
  1875. /*   Side Effects:  None.                                            */
  1876. /*                                                                   */
  1877. /*   Notes:  None.                                                   */
  1878. /*                                                                   */
  1879. /*********************************************************************/
  1880. LVM_Handle_Array_Record  _System Get_Child_Handles( ADDRESS Handle, CARDINAL32 * Error_Code);
  1881.  
  1882. /*********************************************************************/
  1883. /*                                                                   */
  1884. /*   Function Name: Get_Parent_Handle                                */
  1885. /*                                                                   */
  1886. /*   Descriptive Name: Given the handle of a partition or aggregate, */
  1887. /*                     this function will return the handle of the   */
  1888. /*                     parent of the partition or aggregate.         */
  1889. /*                                                                   */
  1890. /*   Input: ADDRESS Handle - The handle of the partition or aggregate*/
  1891. /*                           whose parent is required.               */
  1892. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1893. /*                                   in which to store an error code */
  1894. /*                                   should an error occur.          */
  1895. /*                                                                   */
  1896. /*   Output:  If successful, the handle of the parent is returned    */
  1897. /*            as the function result and *Error_Code will be set to  */
  1898. /*            LVM_ENGINE_NO_ERROR.                                   */
  1899. /*            If an error occurs, then NULL will be the function     */
  1900. /*            result and *Error_Code will contain a non-zero error   */
  1901. /*            code.                                                  */
  1902. /*                                                                   */
  1903. /*   Error Handling: If Handle is not a valid handle, then a trap is */
  1904. /*                   likely.  If Handle is the handle of volume,     */
  1905. /*                   then *Error_Code will be set to                 */
  1906. /*                   LVM_ENGINE_NO_PARENT.  If Handle is not the     */
  1907. /*                   handle of a volume, partition, or aggregate     */
  1908. /*                   then *Error_Code will be set to                 */
  1909. /*                   LVM_ENGINE_BAD_HANDLE.                          */
  1910. /*                                                                   */
  1911. /*   Side Effects:  None.                                            */
  1912. /*                                                                   */
  1913. /*   Notes:  None.                                                   */
  1914. /*                                                                   */
  1915. /*********************************************************************/
  1916. ADDRESS _System Get_Parent_Handle( ADDRESS Handle, CARDINAL32 * Error_Code);
  1917.  
  1918. /*********************************************************************/
  1919. /*                                                                   */
  1920. /*   Function Name: Get_Features                                     */
  1921. /*                                                                   */
  1922. /*   Descriptive Name: Returns the feature ID information for each of*/
  1923. /*                     the features that are installed on the        */
  1924. /*                     item specified by Handle.                     */
  1925. /*                                                                   */
  1926. /*   Input: ADDRESS Handle - The handle of the object to use.        */
  1927. /*                                                                   */
  1928. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1929. /*                                   in which to store an error code */
  1930. /*                                   should an error occur.          */
  1931. /*                                                                   */
  1932. /*   Output: If successful, a Feature_Information_Array structure is */
  1933. /*           returned with a non-zero Count.  Also, *Error_Code will */
  1934. /*           be set to LVM_ENGINE_NO_ERROR.  If an error occurs,     */
  1935. /*           then the Count field in the structure will be 0 and     */
  1936. /*           (*Error_Code) will contain a non-zero error code.       */
  1937. /*                                                                   */
  1938. /*   Error Handling:  If Handle is not a valid handle, a trap        */
  1939. /*                    will be likely.                                */
  1940. /*                                                                   */
  1941. /*   Side Effects:  Memory is allocated using the LVM Engine's memory*/
  1942. /*                  manager for the array of Feature_ID_Data items   */
  1943. /*                  being returned.                                  */
  1944. /*                                                                   */
  1945. /*   Notes:  None.                                                   */
  1946. /*                                                                   */
  1947. /*********************************************************************/
  1948. Feature_Information_Array _System Get_Features( ADDRESS Handle, CARDINAL32 * Error_Code );
  1949.  
  1950. /* ************************************************************************** *
  1951.  
  1952. Functions relating to Boot Manager
  1953.  
  1954. ************************************************************************** */
  1955.  
  1956. /*********************************************************************/
  1957. /*                                                                   */
  1958. /*   Function Name: Boot_Manager_Is_Installed                        */
  1959. /*                                                                   */
  1960. /*   Descriptive Name: Indicates whether or not Boot Manager is      */
  1961. /*                     installed on the first or second hard drives  */
  1962. /*                     in the system.                                */
  1963. /*                                                                   */
  1964. /*   Input: BOOLEAN * Active - *Active is set to TRUE if LVM found an*/
  1965. /*                             active copy of Boot Manager on the    */
  1966. /*                             system.  If LVM could not find an     */
  1967. /*                             active copy of Boot Manager on the    */
  1968. /*                             system, but did find an inactive copy */
  1969. /*                             of Boot Manager, then *Active will be */
  1970. /*                             set to FALSE.                         */
  1971. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  1972. /*                                    in which to store an error code*/
  1973. /*                                    should an error occur.         */
  1974. /*                                                                   */
  1975. /*   Output: TRUE is returned if Boot Manager is found.  If this     */
  1976. /*           copy of Boot Manager is Active, then *Active will be set*/
  1977. /*           to TRUE.  If the copy of Boot Manager is not currently  */
  1978. /*           active, then *Active will be set to FALSE.              */
  1979. /*                                                                   */
  1980. /*           FALSE is returned if Boot Manager is not found or if an */
  1981. /*           error occurs.  In this case, *Active is undefined.      */
  1982. /*                                                                   */
  1983. /*           *Error_Code will be 0 if no errors occur; otherwise it  */
  1984. /*           will be > 0.                                            */
  1985. /*                                                                   */
  1986. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  1987. /*                                                                   */
  1988. /*   Side Effects:  None.                                            */
  1989. /*                                                                   */
  1990. /*   Notes:  None.                                                   */
  1991. /*                                                                   */
  1992. /*********************************************************************/
  1993. BOOLEAN _System Boot_Manager_Is_Installed( BOOLEAN * Active, CARDINAL32 * Error_Code);
  1994.  
  1995. /*********************************************************************/
  1996. /*                                                                   */
  1997. /*   Function Name: Get_Boot_Manager_Handle                          */
  1998. /*                                                                   */
  1999. /*   Descriptive Name: Returns the handle of the partition containing*/
  2000. /*                     Boot Manager.                                 */
  2001. /*                                                                   */
  2002. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2003. /*                                    in which to store an error code*/
  2004. /*                                    should an error occur.         */
  2005. /*                                                                   */
  2006. /*   Output: If Boot Manager is NOT installed, NULL is returned.     */
  2007. /*           If Boot Manager is installed, whether it is active or   */
  2008. /*           not, the handle of the partition it resides in is       */
  2009. /*           returned.                                               */
  2010. /*                                                                   */
  2011. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  2012. /*                                                                   */
  2013. /*   Side Effects:  None.                                            */
  2014. /*                                                                   */
  2015. /*   Notes:                                                          */
  2016. /*                                                                   */
  2017. /*********************************************************************/
  2018. ADDRESS _System Get_Boot_Manager_Handle( CARDINAL32 * Error_Code);
  2019.  
  2020. /*********************************************************************/
  2021. /*                                                                   */
  2022. /*   Function Name: Add_To_Boot_Manager                              */
  2023. /*                                                                   */
  2024. /*   Descriptive Name: Adds the volume/partition to the Boot Manager */
  2025. /*                     menu.                                         */
  2026. /*                                                                   */
  2027. /*   Input: ADDRESS Handle - The handle of a partition or volume that*/
  2028. /*                           is to be added to the Boot Manager menu.*/
  2029. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2030. /*                                    in which to store an error code*/
  2031. /*                                    should an error occur.         */
  2032. /*                                                                   */
  2033. /*   Output: *Error_Code will be 0 if the partition or volume was    */
  2034. /*           successfully added to the Boot Manager menu; otherwise  */
  2035. /*           *Error_Code will be > 0.                                */
  2036. /*                                                                   */
  2037. /*   Error Handling: If the partition/volume can not be added to the */
  2038. /*                   Boot Manager menu, no action is taken and       */
  2039. /*                   *Error_Code will contain a non-zero error code. */
  2040. /*                                                                   */
  2041. /*                   If Handle is not a valid handle, a trap may     */
  2042. /*                   result.                                         */
  2043. /*                                                                   */
  2044. /*                   If Handle represents a drive, then this function*/
  2045. /*                   will abort and set *Error_Code to a non-zero    */
  2046. /*                   value.                                          */
  2047. /*                                                                   */
  2048. /*   Side Effects:  The Boot Manager menu may be altered.            */
  2049. /*                                                                   */
  2050. /*   Notes:  None.                                                   */
  2051. /*                                                                   */
  2052. /*********************************************************************/
  2053. void _System Add_To_Boot_Manager ( ADDRESS Handle, CARDINAL32 * Error_Code );
  2054.  
  2055. /*********************************************************************/
  2056. /*                                                                   */
  2057. /*   Function Name: Remove_From_Boot_Manager                         */
  2058. /*                                                                   */
  2059. /*   Descriptive Name: Removes the specified partition or volume     */
  2060. /*                     from the Boot Manager menu.                   */
  2061. /*                                                                   */
  2062. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2063. /*                                    in which to store an error code*/
  2064. /*                                    should an error occur.         */
  2065. /*                                                                   */
  2066. /*                                                                   */
  2067. /*   Output: *Error_Code will be 0 if the partition or volume was    */
  2068. /*           successfully removed to the Boot Manager menu;          */
  2069. /*           otherwise *Error_Code will be > 0.                      */
  2070. /*                                                                   */
  2071. /*   Error Handling: If Handle is not a valid handle, a trap may     */
  2072. /*                   result.                                         */
  2073. /*                                                                   */
  2074. /*                   If Handle represents a drive, or if Handle      */
  2075. /*                   represents a volume or partition which is NOT on*/
  2076. /*                   the boot manager menu, then this function       */
  2077. /*                   will abort and set *Error_Code to a non-zero    */
  2078. /*                   value.                                          */
  2079. /*                                                                   */
  2080. /*   Side Effects:  The Boot Manager menu may be altered.            */
  2081. /*                                                                   */
  2082. /*   Notes:  None.                                                   */
  2083. /*                                                                   */
  2084. /*********************************************************************/
  2085. void _System Remove_From_Boot_Manager ( ADDRESS Handle, CARDINAL32 * Error_Code );
  2086.  
  2087. /*********************************************************************/
  2088. /*                                                                   */
  2089. /*   Function Name: Get_Boot_Manager_Menu                            */
  2090. /*                                                                   */
  2091. /*   Descriptive Name: Returns an array containing the handles of the*/
  2092. /*                     partitions and volumes appearing on the       */
  2093. /*                     Boot Manager menu.                            */
  2094. /*                                                                   */
  2095. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2096. /*                                    in which to store an error code*/
  2097. /*                                    should an error occur.         */
  2098. /*                                                                   */
  2099. /*   Output: The function returns a Boot_Manager_Menu structure.     */
  2100. /*           This structure contains two items: a pointer to an array*/
  2101. /*           of Boot_Manager_Menu_Items and a count of how many items*/
  2102. /*           are in the array.  Each Boot_Manager_Menu_Item contains */
  2103. /*           a handle and a BOOLEAN variable to indicate whether the */
  2104. /*           handle is for a partition or a volume.                  */
  2105. /*                                                                   */
  2106. /*           If this function is successful, then *Error_Code will   */
  2107. /*           be 0.                                                   */
  2108. /*                                                                   */
  2109. /*           If an error occurs, the Count field in the              */
  2110. /*           Boot_Manager_Menu will be 0 and the corresponding       */
  2111. /*           pointer will be NULL.  *Error_Code will be > 0.         */
  2112. /*                                                                   */
  2113. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  2114. /*                   any memory allocated by this function will be   */
  2115. /*                   freed.                                          */
  2116. /*                                                                   */
  2117. /*   Side Effects:  None.                                            */
  2118. /*                                                                   */
  2119. /*   Notes:  None.                                                   */
  2120. /*                                                                   */
  2121. /*********************************************************************/
  2122. Boot_Manager_Menu  _System Get_Boot_Manager_Menu ( CARDINAL32 * Error_Code);
  2123.  
  2124. /*********************************************************************/
  2125. /*                                                                   */
  2126. /*   Function Name: Install_Boot_Manager                             */
  2127. /*                                                                   */
  2128. /*   Descriptive Name: This function installs Boot Manager.  It can  */
  2129. /*                     be used to replace an existing Boot Manager   */
  2130. /*                     as well.                                      */
  2131. /*                                                                   */
  2132. /*   Input: CARDINAL32  Drive_Number - The number of the drive to    */
  2133. /*                                     install Boot Manager on.  Must*/
  2134. /*                                     be 1 or 2.                    */
  2135. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2136. /*                                    in which to store an error code*/
  2137. /*                                    should an error occur.         */
  2138. /*                                                                   */
  2139. /*   Output: If this function is successful, then *Error_Code will be*/
  2140. /*           0; otherwise it will be > 0.                            */
  2141. /*                                                                   */
  2142. /*   Error Handling: If an error occurs, *Error_Code will be set to a*/
  2143. /*                   non-zero value.  Depending upon the error, it   */
  2144. /*                   is possible that the Boot Manager partition can */
  2145. /*                   be left in an unusuable state (such as for a    */
  2146. /*                   write error).                                   */
  2147. /*                                                                   */
  2148. /*   Side Effects: Boot Manager may be installed on drive 1 or 2.    */
  2149. /*                 The MBR for drive 1 may be altered.               */
  2150. /*                                                                   */
  2151. /*   Notes:  None.                                                   */
  2152. /*                                                                   */
  2153. /*********************************************************************/
  2154. void _System Install_Boot_Manager ( CARDINAL32   Drive_Number, CARDINAL32 * Error_Code );           /* Only drives 0 and 1 are acceptable. */
  2155.  
  2156. /*********************************************************************/
  2157. /*                                                                   */
  2158. /*   Function Name: Remove_Boot_Manager                              */
  2159. /*                                                                   */
  2160. /*   Descriptive Name: Removes Boot Manager from the system.         */
  2161. /*                                                                   */
  2162. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2163. /*                                    in which to store an error code*/
  2164. /*                                    should an error occur.         */
  2165. /*                                                                   */
  2166. /*   Output: *Error_Code will be 0 if Boot Manager was successfully  */
  2167. /*           removed from the system; otherwise *Error_Code will     */
  2168. /*           be 0.                                                   */
  2169. /*                                                                   */
  2170. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  2171. /*                                                                   */
  2172. /*   Side Effects:  Boot Manager will be removed from the system.    */
  2173. /*                                                                   */
  2174. /*   Notes:  None.                                                   */
  2175. /*                                                                   */
  2176. /*********************************************************************/
  2177. void _System Remove_Boot_Manager( CARDINAL32 * Error_Code );
  2178.  
  2179. /*********************************************************************/
  2180. /*                                                                   */
  2181. /*   Function Name: Set_Boot_Manager_Options                         */
  2182. /*                                                                   */
  2183. /*   Descriptive Name: Sets the Boot Managers Options.  The options  */
  2184. /*                     that can be set are: whether or not the time- */
  2185. /*                     out timer is active, how long the timer-out   */
  2186. /*                     is, the partition to boot by default, and     */
  2187. /*                     whether or not Boot Manager should display its*/
  2188. /*                     menu using default mode or advanced mode.     */
  2189. /*                                                                   */
  2190. /*   Input: ADDRESS Handle - The handle of the partition or volume   */
  2191. /*                           to boot if the time-out timer is active */
  2192. /*                           and the time-out value is reached.      */
  2193. /*          BOOLEAN Timer_Active - If TRUE, then the time-out timer  */
  2194. /*                                 is active.                        */
  2195. /*          CARDINAL32 Time_Out_Value - If the time-out timer is     */
  2196. /*                                      active, this is the time-out */
  2197. /*                                      value, in seconds.           */
  2198. /*          BOOLEAN Advanced_Mode - If TRUE, then Boot Manager will  */
  2199. /*                                  operate in advanced mode.  If    */
  2200. /*                                  FALSE, then normal mode will be  */
  2201. /*                                  in effect.                       */
  2202. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2203. /*                                    in which to store an error code*/
  2204. /*                                    should an error occur.         */
  2205. /*                                                                   */
  2206. /*   Output: *Error_Code will be 0 if no errors occur.  If an error  */
  2207. /*           does occur, then *Error_Code will be > 0.               */
  2208. /*                                                                   */
  2209. /*   Error Handling: If an error occurs, no changes will be made to  */
  2210. /*                   Boot Manager and *Error_Code will be set a      */
  2211. /*                   non-zero error code.                            */
  2212. /*                                                                   */
  2213. /*   Side Effects:  Boot Manager may be modified.                    */
  2214. /*                                                                   */
  2215. /*   Notes:  None.                                                   */
  2216. /*                                                                   */
  2217. /*********************************************************************/
  2218. void _System Set_Boot_Manager_Options( ADDRESS      Handle,
  2219. BOOLEAN      Timer_Active,
  2220. CARDINAL32   Time_Out_Value,
  2221. BOOLEAN      Advanced_Mode,
  2222. CARDINAL32 * Error_Code
  2223. );
  2224.  
  2225. /*********************************************************************/
  2226. /*                                                                   */
  2227. /*   Function Name: Get_Boot_Manager_Options                         */
  2228. /*                                                                   */
  2229. /*   Descriptive Name: This function returns the current Boot Manager*/
  2230. /*                     settings for the various Boot Manager options.*/
  2231. /*                                                                   */
  2232. /*   Input: ADDRESS * Handle - The handle for the default boot volume*/
  2233. /*                             or partition.                         */
  2234. /*          BOOLEAN * Handle_Is_Volume - If TRUE, then Handle        */
  2235. /*                                       represents a volume.  If    */
  2236. /*                                       FALSE, then Handle          */
  2237. /*                                       represents a partition.     */
  2238. /*          BOOLEAN * Timer_Active - If TRUE, then the time-out timer*/
  2239. /*                                   is active.  If FALSE, then the  */
  2240. /*                                   time-out timer is not active.   */
  2241. /*          CARDINAL32 * Time_Out_Value - If the time-out timer is   */
  2242. /*                                        active, then this is the   */
  2243. /*                                        number of seconds that Boot*/
  2244. /*                                        Manager will wait for user */
  2245. /*                                        input before booting the   */
  2246. /*                                        default volume/partition.  */
  2247. /*          BOOLEAN * Advanced_Mode - If TRUE, the Boot Manager is   */
  2248. /*                                    operating in advanced mode.  If*/
  2249. /*                                    FALSE, then Boot Manager is    */
  2250. /*                                    operating in normal mode.      */
  2251. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2252. /*                                    in which to store an error code*/
  2253. /*                                    should an error occur.         */
  2254. /*                                                                   */
  2255. /*   Output: *Handle, *Handle_Is_Volume, *Timer_Active,              */
  2256. /*           *Time_out_value, *Advanced_Mode, and *Error_Code are all*/
  2257. /*           set by this function.  If there are no errors, then     */
  2258. /*           *Error_Code will be set to 0.  If any errors occur, then*/
  2259. /*           *Error_Code will be > 0.                                */
  2260. /*                                                                   */
  2261. /*   Error Handling: If any of the parameters are invalid, then a    */
  2262. /*                   trap is likely.  If Boot Manager is not         */
  2263. /*                   installed, then *Error_Code will be > 0.        */
  2264. /*                                                                   */
  2265. /*   Side Effects:  None.                                            */
  2266. /*                                                                   */
  2267. /*   Notes:  None.                                                   */
  2268. /*                                                                   */
  2269. /*********************************************************************/
  2270. void _System Get_Boot_Manager_Options( ADDRESS    *  Handle,
  2271. BOOLEAN    *  Handle_Is_Volume,
  2272. BOOLEAN    *  Timer_Active,
  2273. CARDINAL32 *  Time_Out_Value,
  2274. BOOLEAN    *  Advanced_Mode,
  2275. CARDINAL32 * Error_Code
  2276. );
  2277.  
  2278. /* ************************************************************************** *
  2279.  
  2280. Other Functions
  2281.  
  2282. ************************************************************************** */
  2283.  
  2284. /*********************************************************************/
  2285. /*                                                                   */
  2286. /*   Function Name:  Allocate_Engine_Memory                          */
  2287. /*                                                                   */
  2288. /*   Descriptive Name:  Allocates a block of memory using LVM.DLL's  */
  2289. /*                      memory management functions.                 */
  2290. /*                                                                   */
  2291. /*   Input: CARDINAL32 Size - The number of bytes of memory to       */
  2292. /*                            allocate.                              */
  2293. /*                                                                   */
  2294. /*   Output: The address of the block of memory which was allocated, */
  2295. /*           or NULL if the requested amount of memory could not be  */
  2296. /*           allocated.                                              */
  2297. /*                                                                   */
  2298. /*   Error Handling: None.                                           */
  2299. /*                                                                   */
  2300. /*   Side Effects:  The specified number of bytes is allocated from  */
  2301. /*                  the memory manager imbedded in LVM.DLL.  Memory  */
  2302. /*                  allocated by this function must be freed using   */
  2303. /*                  Free_Engine_Memory function.  The use of any     */
  2304. /*                  memory manager to free the memory could result in*/
  2305. /*                  Bad Things Happening!                            */
  2306. /*                                                                   */
  2307. /*   Notes:  None.                                                   */
  2308. /*                                                                   */
  2309. /*********************************************************************/
  2310. ADDRESS _System Allocate_Engine_Memory( CARDINAL32 Size );
  2311.  
  2312. /*********************************************************************/
  2313. /*                                                                   */
  2314. /*   Function Name:  Free_Engine_Memory                              */
  2315. /*                                                                   */
  2316. /*   Descriptive Name: Frees a memory object created by LVM.DLL and  */
  2317. /*                     returned to a user of LVM.DLL.                */
  2318. /*                                                                   */
  2319. /*   Input: ADDRESS Object : The address of the memory object to     */
  2320. /*                           free.  This could be the                */
  2321. /*                           Drive_Control_Data field of a           */
  2322. /*                           Drive_Control_Record, the               */
  2323. /*                           Partition_Array field of a              */
  2324. /*                           Partition_Information_Array structure,  */
  2325. /*                           or any other dynamically allocated      */
  2326. /*                           memory object created by LVM.DLL and    */
  2327. /*                           returned by a function in LVM.DLL.      */
  2328. /*                                                                   */
  2329. /*   Output: None.                                                   */
  2330. /*                                                                   */
  2331. /*   Error Handling: None.                                           */
  2332. /*                                                                   */
  2333. /*   Side Effects:  None.                                            */
  2334. /*                                                                   */
  2335. /*   Notes:  A trap or exception could occur if a bad address is     */
  2336. /*           passed into this function.                              */
  2337. /*                                                                   */
  2338. /*********************************************************************/
  2339. void _System Free_Engine_Memory( ADDRESS Object );
  2340.  
  2341. /*********************************************************************/
  2342. /*                                                                   */
  2343. /*   Function Name: New_MBR                                          */
  2344. /*                                                                   */
  2345. /*   Descriptive Name: This function lays down a new MBR on the      */
  2346. /*                     specified drive.                              */
  2347. /*                                                                   */
  2348. /*   Input: ADDRESS Drive_Handle - The handle of the drive on which  */
  2349. /*                                 the new MBR is to be placed.      */
  2350. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2351. /*                                    in which to store an error code*/
  2352. /*                                    should an error occur.         */
  2353. /*                                                                   */
  2354. /*   Output: *Error_Code will be 0 if the new MBR was successfully   */
  2355. /*           placed on the specified drive.  If the operation failed */
  2356. /*           for any reason, then *Error_Code will contain a non-zero*/
  2357. /*           error code.                                             */
  2358. /*                                                                   */
  2359. /*   Error Handling: If an error occurs, then the existing MBR is not*/
  2360. /*                   altered and *Error_Code will be > 0.            */
  2361. /*                                                                   */
  2362. /*   Side Effects:  A new MBR may be placed on the specified drive.  */
  2363. /*                                                                   */
  2364. /*   Notes:  None.                                                   */
  2365. /*                                                                   */
  2366. /*********************************************************************/
  2367. void _System New_MBR( ADDRESS Drive_Handle, CARDINAL32 * Error_Code );
  2368.  
  2369. /*********************************************************************/
  2370. /*                                                                   */
  2371. /*   Function Name: Get_Available_Drive_Letters                      */
  2372. /*                                                                   */
  2373. /*   Descriptive Name: This function returns a bitmap indicating     */
  2374. /*                     which drive letters are available for use.    */
  2375. /*                                                                   */
  2376. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2377. /*                                    in which to store an error code*/
  2378. /*                                    should an error occur.         */
  2379. /*                                                                   */
  2380. /*   Output: This function returns a bitmap of the available drive   */
  2381. /*           letters.  If this function is successful, then          */
  2382. /*           *Error_Code will be set to 0.  Otherwise, *Error_Code   */
  2383. /*           will be > 0 and the bitmap returned will have all bits  */
  2384. /*           set to 0.                                               */
  2385. /*                                                                   */
  2386. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  2387. /*                                                                   */
  2388. /*   Side Effects:  None.                                            */
  2389. /*                                                                   */
  2390. /*   Notes:  A drive letter is available if it is not associated     */
  2391. /*           with a volume located on a disk drive controlled        */
  2392. /*           by OS2DASD.                                             */
  2393. /*                                                                   */
  2394. /*********************************************************************/
  2395. CARDINAL32 _System Get_Available_Drive_Letters ( CARDINAL32 * Error_Code ) ;
  2396.  
  2397. /*********************************************************************/
  2398. /*                                                                   */
  2399. /*   Function Name: Get_Reserved_Drive_Letters                       */
  2400. /*                                                                   */
  2401. /*   Descriptive Name: This function returns a bitmap indicating     */
  2402. /*                     which drive letters are reserved for use by   */
  2403. /*                     devices NOT under the control of LVM.         */
  2404. /*                                                                   */
  2405. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2406. /*                                    in which to store an error code*/
  2407. /*                                    should an error occur.         */
  2408. /*                                                                   */
  2409. /*   Output: This function returns a bitmap of the drive letters     */
  2410. /*           which are being used by devices which are NOT controlled*/
  2411. /*           by LVM.  While a Volume CAN be assigned a drive letter  */
  2412. /*           from this list, a reboot will almost always be required */
  2413. /*           in order for the assignment to take place.              */
  2414. /*           If this function is successful, then *Error_Code will be*/
  2415. /*           set to 0.  Otherwise, *Error_Code will be > 0 and the   */
  2416. /*           bitmap returned will have all bits set to 0.            */
  2417. /*                                                                   */
  2418. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  2419. /*                                                                   */
  2420. /*   Side Effects:  None.                                            */
  2421. /*                                                                   */
  2422. /*   Notes:  Devices which are assigned drive letters but which are  */
  2423. /*           NOT under LVM control include:  CD-ROM, Network drives, */
  2424. /*           parallel port attached devices, and any DASD devices    */
  2425. /*           not controlled by OS2DASD.                              */
  2426. /*                                                                   */
  2427. /*********************************************************************/
  2428. CARDINAL32 _System Get_Reserved_Drive_Letters ( CARDINAL32 * Error_Code ) ;
  2429.  
  2430. /*********************************************************************/
  2431. /*                                                                   */
  2432. /*   Function Name: Reboot_Required                                  */
  2433. /*                                                                   */
  2434. /*   Descriptive Name: This function indicates whether or not any    */
  2435. /*                     changes were made to the partitioning of the  */
  2436. /*                     disks in the system which would require a     */
  2437. /*                     reboot to make functional.                    */
  2438. /*                                                                   */
  2439. /*   Input: None.                                                    */
  2440. /*                                                                   */
  2441. /*   Output: The function return value will be TRUE if the system    */
  2442. /*           must be rebooted as a result of disk partitioning       */
  2443. /*           changes.                                                */
  2444. /*                                                                   */
  2445. /*   Error Handling: None required.                                  */
  2446. /*                                                                   */
  2447. /*   Side Effects:  None.                                            */
  2448. /*                                                                   */
  2449. /*   Notes:  None.                                                   */
  2450. /*                                                                   */
  2451. /*********************************************************************/
  2452. BOOLEAN _System Reboot_Required ( void );
  2453.  
  2454. /*********************************************************************/
  2455. /*                                                                   */
  2456. /*   Function Name: Changes_Pending                                  */
  2457. /*                                                                   */
  2458. /*   Descriptive Name: This function indicates whether or not any    */
  2459. /*                     changes were made to the partitioning of the  */
  2460. /*                     disks in the system which have not yet been   */
  2461. /*                     comitted to disk.                             */
  2462. /*                                                                   */
  2463. /*   Input: None.                                                    */
  2464. /*                                                                   */
  2465. /*   Output: The function return value will be TRUE if there are     */
  2466. /*           uncomitted changes to the partitioning of one or more of*/
  2467. /*           the drives in the system.                               */
  2468. /*                                                                   */
  2469. /*   Error Handling: None required.                                  */
  2470. /*                                                                   */
  2471. /*   Side Effects:  None.                                            */
  2472. /*                                                                   */
  2473. /*   Notes:  None.                                                   */
  2474. /*                                                                   */
  2475. /*********************************************************************/
  2476. BOOLEAN _System Changes_Pending ( void );
  2477.  
  2478. /*********************************************************************/
  2479. /*                                                                   */
  2480. /*   Function Name: Set_Reboot_Flag                                  */
  2481. /*                                                                   */
  2482. /*   Descriptive Name: This function sets the Reboot Flag.  The      */
  2483. /*                     Reboot Flag is a special flag on the boot     */
  2484. /*                     disk used by the install program to keep      */
  2485. /*                     track of whether or not the system was just   */
  2486. /*                     rebooted.  It is used by the various phases   */
  2487. /*                     of install.                                   */
  2488. /*                                                                   */
  2489. /*   Input: BOOLEAN Reboot - The new value for the Reboot Flag.  If  */
  2490. /*                           TRUE, then the reboot flag will be set. */
  2491. /*                           If FALSE, then the reboot flag will be  */
  2492. /*                           cleared.                                */
  2493. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2494. /*                                    in which to store an error code*/
  2495. /*                                    should an error occur.         */
  2496. /*                                                                   */
  2497. /*   Output: *Error_Code will be set to 0 if there are no errors.    */
  2498. /*           *Error_Code will be > 0 if an error occurs.             */
  2499. /*                                                                   */
  2500. /*   Error Handling: If an error occurs, then the value of the Reboot*/
  2501. /*                   Flag will be unchanged.                         */
  2502. /*                                                                   */
  2503. /*   Side Effects:  The value of the Reboot Flag may be changed.     */
  2504. /*                                                                   */
  2505. /*   Notes:  None.                                                   */
  2506. /*                                                                   */
  2507. /*********************************************************************/
  2508. void _System Set_Reboot_Flag( BOOLEAN Reboot, CARDINAL32 * Error_Code );
  2509.  
  2510. /*********************************************************************/
  2511. /*                                                                   */
  2512. /*   Function Name: Get_Reboot_Flag                                  */
  2513. /*                                                                   */
  2514. /*   Descriptive Name: This function returns the value of the Reboot */
  2515. /*                     Flag.  The Reboot Flag is a special flag on   */
  2516. /*                     the boot disk used by the install program to  */
  2517. /*                     keep track of whether or not the system was   */
  2518. /*                     just rebooted.  It is used by the various     */
  2519. /*                     phases of install.                            */
  2520. /*                                                                   */
  2521. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2522. /*                                    in which to store an error code*/
  2523. /*                                    should an error occur.         */
  2524. /*                                                                   */
  2525. /*   Output: The function return value will be TRUE if no errors     */
  2526. /*           occur and the Reboot Flag is set.  *Error_Code will be  */
  2527. /*           0 under these conditions.  If an error occurs, the      */
  2528. /*           function return value will be FALSE and *Error_Code     */
  2529. /*           will be > 0.                                            */
  2530. /*                                                                   */
  2531. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  2532. /*                   The value of the reboot flag will be unchanged. */
  2533. /*                                                                   */
  2534. /*   Side Effects:  None.                                            */
  2535. /*                                                                   */
  2536. /*   Notes:  None.                                                   */
  2537. /*                                                                   */
  2538. /*********************************************************************/
  2539. BOOLEAN _System Get_Reboot_Flag( CARDINAL32 * Error_Code );
  2540.  
  2541. /*********************************************************************/
  2542. /*                                                                   */
  2543. /*                                                                   */
  2544. /*   Function Name: Set_Install_Flags                                */
  2545. /*                                                                   */
  2546. /*   Descriptive Name: This function sets the value of the Install   */
  2547. /*                     Flags.  The Install Flags reside in a 32 bit  */
  2548. /*                     field in the LVM dataspace.  These flags are  */
  2549. /*                     not used by LVM, thereby leaving Install free */
  2550. /*                     to use them for whatever it wants.            */
  2551. /*                                                                   */
  2552. /*   Input: CARDINAL32 Install_Flags - The new value for the Install */
  2553. /*                                     Flags.                        */
  2554. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32    */
  2555. /*                                    in which to store an error code*/
  2556. /*                                    should an error occur.         */
  2557. /*                                                                   */
  2558. /*   Output: *Error_Code will be set to 0 if there are no errors.    */
  2559. /*           *Error_Code will be > 0 if an error occurs.             */
  2560. /*                                                                   */
  2561. /*   Error Handling: If an error occurs, then the value of the       */
  2562. /*                   Install Flags will be unchanged.                */
  2563. /*                                                                   */
  2564. /*   Side Effects:  The value of the Install Flags may be changed.   */
  2565. /*                                                                   */
  2566. /*   Notes:  None.                                                   */
  2567. /*                                                                   */
  2568. /*********************************************************************/
  2569. void _System Set_Install_Flags( CARDINAL32 Install_Flags, CARDINAL32 * Error_Code );
  2570.  
  2571. /*********************************************************************/
  2572. /*                                                                   */
  2573. /*   Function Name: Get_Install_Flags                                */
  2574. /*                                                                   */
  2575. /*   Descriptive Name: This function returns the value of the Install*/
  2576. /*                     Flags.  The Install Flags reside in a 32 bit  */
  2577. /*                     field in the LVM dataspace.  These flags are  */
  2578. /*                     not used by LVM, thereby leaving Install free */
  2579. /*                     to use them for whatever it wants.            */
  2580. /*                                                                   */
  2581. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2582. /*                                    in which to store an error code*/
  2583. /*                                    should an error occur.         */
  2584. /*                                                                   */
  2585. /*   Output: The function returns the current value of the Install   */
  2586. /*           Flags stored in the LVM Dataspace.                      */
  2587. /*           *Error_Code will be LVM_ENGINE_NO_ERROR if the function */
  2588. /*           is successful.  If an error occurs, the function will   */
  2589. /*           return 0 and *Error_Code will be > 0.                   */
  2590. /*                                                                   */
  2591. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  2592. /*                                                                   */
  2593. /*   Side Effects:  None.                                            */
  2594. /*                                                                   */
  2595. /*   Notes:  None.                                                   */
  2596. /*                                                                   */
  2597. /*********************************************************************/
  2598. CARDINAL32 _System Get_Install_Flags( CARDINAL32 * Error_Code );
  2599.  
  2600. /*********************************************************************/
  2601. /*                                                                   */
  2602. /*   Function Name: Set_Min_Install_Size                             */
  2603. /*                                                                   */
  2604. /*   Descriptive Name: This function tells the LVM Engine how big a  */
  2605. /*                     partition/volume must be in order for it to   */
  2606. /*                     marked installable.  If this function is not  */
  2607. /*                     used to set the minimum size for an           */
  2608. /*                     installable partition/volume, the LVM Engine  */
  2609. /*                     will use a default value of 300 MB.           */
  2610. /*                                                                   */
  2611. /*   Input: CARDINAL32 Min_Sectors - The minimum size, in sectors,   */
  2612. /*                                   that a partition must be in     */
  2613. /*                                   order for it to be marked as    */
  2614. /*                                   installable.                    */
  2615. /*                                                                   */
  2616. /*   Output: None.                                                   */
  2617. /*                                                                   */
  2618. /*   Error Handling: None required.                                  */
  2619. /*                                                                   */
  2620. /*   Side Effects:  None.                                            */
  2621. /*                                                                   */
  2622. /*   Notes:  None.                                                   */
  2623. /*                                                                   */
  2624. /*********************************************************************/
  2625. void _System Set_Min_Install_Size ( CARDINAL32  Min_Sectors );
  2626.  
  2627. /*********************************************************************/
  2628. /*                                                                   */
  2629. /*   Function Name: Set_Free_Space_Threshold                         */
  2630. /*                                                                   */
  2631. /*   Descriptive Name: This function tells the LVM Engine not to     */
  2632. /*                     report blocks of free space which are less    */
  2633. /*                     than the size specified.  The engine defaults */
  2634. /*                     to not reporting blocks of free space which   */
  2635. /*                     are smaller than 2048 sectors (1 MB).         */
  2636. /*                                                                   */
  2637. /*   Input: CARDINAL32 Min_Sectors - The minimum size, in sectors,   */
  2638. /*                                   that a block of free space must */
  2639. /*                                   be in order for the LVM engine  */
  2640. /*                                   to report it.                   */
  2641. /*                                                                   */
  2642. /*   Output: None.                                                   */
  2643. /*                                                                   */
  2644. /*   Error Handling: None required.                                  */
  2645. /*                                                                   */
  2646. /*   Side Effects:  None.                                            */
  2647. /*                                                                   */
  2648. /*   Notes:  None.                                                   */
  2649. /*                                                                   */
  2650. /*********************************************************************/
  2651. void _System Set_Free_Space_Threshold( CARDINAL32  Min_Sectors );
  2652.  
  2653. /*********************************************************************/
  2654. /*                                                                   */
  2655. /*   Function Name: Read_Sectors                                     */
  2656. /*                                                                   */
  2657. /*   Descriptive Name: This function reads one or more sectors from  */
  2658. /*                     the specified drive and places the data read  */
  2659. /*                     in Buffer.                                    */
  2660. /*                                                                   */
  2661. /*   Input: CARDINAL32 Drive_Number : The number of the hard drive to*/
  2662. /*                                    read from.  The drives in the  */
  2663. /*                                    system are numbered from 1 to  */
  2664. /*                                    n, where n is the total number */
  2665. /*                                    of hard drives in the system.  */
  2666. /*          LBA Starting_Sector : The first sector to read from.     */
  2667. /*          CARDINAL32 Sectors_To_Read : The number of sectors to    */
  2668. /*                                       read into memory.           */
  2669. /*          ADDRESS Buffer : The location to put the data read into. */
  2670. /*          CARDINAL32 * Error : The address of a variable to hold   */
  2671. /*                               the error return code.              */
  2672. /*                                                                   */
  2673. /*   Output: If Successful, then the data read will be placed in     */
  2674. /*              memory starting at Buffer, and *Error will be        */
  2675. /*              LVM_ENGINE_NO_ERROR.                                 */
  2676. /*           If Unsuccessful, then *Error will be > 0 and the        */
  2677. /*              contents of memory starting at Buffer is undefined.  */
  2678. /*                                                                   */
  2679. /*   Error Handling: *Error will be > 0 if an error occurs.          */
  2680. /*                                                                   */
  2681. /*   Side Effects: Data may be read into memory starting at Buffer.  */
  2682. /*                                                                   */
  2683. /*   Notes:  None.                                                   */
  2684. /*                                                                   */
  2685. /*********************************************************************/
  2686. void _System Read_Sectors ( CARDINAL32          Drive_Number,
  2687. LBA                 Starting_Sector,
  2688. CARDINAL32          Sectors_To_Read,
  2689. ADDRESS             Buffer,
  2690. CARDINAL32 *        Error);
  2691.  
  2692. /*********************************************************************/
  2693. /*                                                                   */
  2694. /*   Function Name: Write_Sectors                                    */
  2695. /*                                                                   */
  2696. /*   Descriptive Name: This function writes data from memory to one  */
  2697. /*                     or more sectors on the specified drive.       */
  2698. /*                                                                   */
  2699. /*   Input: CARDINAL32 Drive_Number : The number of the hard drive to*/
  2700. /*                                    write to.  The drives in the   */
  2701. /*                                    system are numbered from 1 to  */
  2702. /*                                    n, where n is the total number */
  2703. /*                                    of hard drives in the system.  */
  2704. /*          LBA Starting_Sector : The first sector to write to.      */
  2705. /*          CARDINAL32 Sectors_To_Read : The number of sectors to    */
  2706. /*                                       be written.                 */
  2707. /*          ADDRESS Buffer : The location of the data to be written  */
  2708. /*                           to disk.                                */
  2709. /*          CARDINAL32 * Error : The address of a variable to hold   */
  2710. /*                               the error return code.              */
  2711. /*                                                                   */
  2712. /*   Output: If Successful, then the data at Buffer will be placed   */
  2713. /*              on the disk starting at the sector specified, and    */
  2714. /*              *Error will be LVM_ENGINE_NO_ERROR.                  */
  2715. /*           If Unsuccessful, then *Error will be > 0 and the        */
  2716. /*              contents of the disk starting at sector              */
  2717. /*              Starting_Sector is undefined.                        */
  2718. /*                                                                   */
  2719. /*   Error Handling: *Error will be > 0 if an error occurs.          */
  2720. /*                                                                   */
  2721. /*   Side Effects: Data may be written to disk.                      */
  2722. /*                                                                   */
  2723. /*   Notes:  None.                                                   */
  2724. /*                                                                   */
  2725. /*********************************************************************/
  2726. void _System Write_Sectors ( CARDINAL32          Drive_Number,
  2727. LBA                 Starting_Sector,
  2728. CARDINAL32          Sectors_To_Write,
  2729. ADDRESS             Buffer,
  2730. CARDINAL32 *        Error);
  2731.  
  2732. /*********************************************************************/
  2733. /*                                                                   */
  2734. /*   Function Name: Rediscover_PRMs                                  */
  2735. /*                                                                   */
  2736. /*   Descriptive Name: Causes OS2LVM and OS2DASD to check PRMs for   */
  2737. /*                     new or changed media.                         */
  2738. /*                                                                   */
  2739. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2740. /*                                    in which to store an error code*/
  2741. /*                                    should an error occur.         */
  2742. /*                                                                   */
  2743. /*   Output: If the Rediscover PRM operation was successful, then    */
  2744. /*           *Error_Code will be LVM_ENGINE_NO_ERROR.  If there      */
  2745. /*           was an error, then *Error_Code will be > 0.             */
  2746. /*                                                                   */
  2747. /*   Error Handling: None.                                           */
  2748. /*                                                                   */
  2749. /*   Side Effects:  New volumes may be discovered and assigned drive */
  2750. /*                  letters by OS2LVM and OS2DASD.                   */
  2751. /*                                                                   */
  2752. /*   Notes: The LVM Engine must be CLOSED when this function is      */
  2753. /*          called as this function is disabled while it is open!    */
  2754. /*                                                                   */
  2755. /*********************************************************************/
  2756. void _System Rediscover_PRMs( CARDINAL32 * Error_Code );
  2757.  
  2758. /*********************************************************************/
  2759. /*                                                                   */
  2760. /*   Function Name: Get_LVM_View                                     */
  2761. /*                                                                   */
  2762. /*   Descriptive Name:  This function gets the OS2LVM data for the   */
  2763. /*                      specified drive letter.  The intent is to    */
  2764. /*                      allow the determination of what drive letter */
  2765. /*                      a volume really has given the possibilities  */
  2766. /*                      of conflict or a drive preference of '*'.    */
  2767. /*                                                                   */
  2768. /*   Input:  char  IFSM_Drive_Letter : The drive letter for which the*/
  2769. /*                                     OS2LVM data is requested.     */
  2770. /*           CARDINAL32 * Drive_Number : The address of a variable   */
  2771. /*                                       to hold the OS/2 drive      */
  2772. /*                                       number of the drive         */
  2773. /*                                       containing the first        */
  2774. /*                                       partition of the volume     */
  2775. /*                                       currently assigned to the   */
  2776. /*                                       requested drive letter.     */
  2777. /*           CARDINAL32 * Partition_LBA : The address of a variable  */
  2778. /*                                        to hold the LBA of the     */
  2779. /*                                        first partition of the     */
  2780. /*                                        volume currently assigned  */
  2781. /*                                        to the requested drive     */
  2782. /*                                        letter.                    */
  2783. /*           char * LVM_Drive_Letter : The address of a variable to  */
  2784. /*                                     hold the drive letter that    */
  2785. /*                                     OS2LVM thinks the volume      */
  2786. /*                                     assigned to the requested     */
  2787. /*                                     drive letter should have.     */
  2788. /*           BYTE * UnitID : The address of a variable to hold the   */
  2789. /*                           OS2LVM unit ID for the volume associated*/
  2790. /*                           with the requested drive letter.        */
  2791. /*                                                                   */
  2792. /*   Output:  The function return value will be TRUE if the function */
  2793. /*            completed successfully.                                */
  2794. /*                                                                   */
  2795. /*   Error Handling: If this function fails, the specified drive     */
  2796. /*                   letter is either not in use, or is in use by a  */
  2797. /*                   device not controlled by OS2LVM.                */
  2798. /*                                                                   */
  2799. /*   Side Effects: None.                                             */
  2800. /*                                                                   */
  2801. /*   Notes: This function can be used with the LVM Engine open or    */
  2802. /*          closed.                                                  */
  2803. /*                                                                   */
  2804. /*********************************************************************/
  2805. BOOLEAN _System Get_LVM_View( char         IFSM_Drive_Letter,
  2806. CARDINAL32 * Drive_Number,
  2807. CARDINAL32 * Partition_LBA,
  2808. char *       LVM_Drive_Letter,
  2809. BYTE *       UnitID);
  2810.  
  2811. /*********************************************************************/
  2812. /*                                                                   */
  2813. /*   Function Name: Start_Logging                                    */
  2814. /*                                                                   */
  2815. /*   Descriptive Name: Enables the LVM Engine logging.  Once enabled,*/
  2816. /*                     the LVM Engine logging function will log all  */
  2817. /*                     LVM Engine activity to the specified log file.*/
  2818. /*                     The data is logged in a binary format for     */
  2819. /*                     compactness and speed.                        */
  2820. /*                                                                   */
  2821. /*   Input: char * Filename - The filename of the file to use as the */
  2822. /*                            log file.                              */
  2823. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2824. /*                                    in which to store an error code*/
  2825. /*                                    should an error occur.         */
  2826. /*                                                                   */
  2827. /*   Output: If the logging file was successfully created, then      */
  2828. /*           *Error_Code will be 0.  If the log file could not be    */
  2829. /*           created, then *Error_Code will be > 0.                  */
  2830. /*                                                                   */
  2831. /*   Error Handling: If the log file can not be created, then        */
  2832. /*                   *Error_Code will be > 0.                        */
  2833. /*                                                                   */
  2834. /*   Side Effects:  A file may be created/opened for logging of      */
  2835. /*                  LVM Engine actions.                              */
  2836. /*                                                                   */
  2837. /*   Notes:  None.                                                   */
  2838. /*                                                                   */
  2839. /*********************************************************************/
  2840. void _System Start_Logging( char * Filename, CARDINAL32 * Error_Code );
  2841.  
  2842. /*********************************************************************/
  2843. /*                                                                   */
  2844. /*   Function Name: Stop_Logging                                     */
  2845. /*                                                                   */
  2846. /*   Descriptive Name: This function ends LVM Engine logging and     */
  2847. /*                     closes the log file.                          */
  2848. /*                                                                   */
  2849. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2850. /*                                    in which to store an error code*/
  2851. /*                                    should an error occur.         */
  2852. /*                                                                   */
  2853. /*   Output: *Error_Code will be 0 if this function completes        */
  2854. /*           successfully; otherwise it will be > 0.                 */
  2855. /*                                                                   */
  2856. /*   Error Handling: If the log file is not currently opened, or if  */
  2857. /*                   the close operation fails on the log file, then */
  2858. /*                   *Error_Code will be > 0.                        */
  2859. /*                                                                   */
  2860. /*   Side Effects:  The log file may be closed.                      */
  2861. /*                                                                   */
  2862. /*   Notes:  None.                                                   */
  2863. /*                                                                   */
  2864. /*********************************************************************/
  2865. void _System Stop_Logging ( CARDINAL32 * Error_Code );
  2866.  
  2867. #ifdef BUILD_LVM_ENGINE
  2868.  
  2869. /* ************************************************************************** *
  2870.  
  2871. 16 Bit Functions relating to the LVM Engine itself
  2872.  
  2873. ************************************************************************** */
  2874.  
  2875. /****************************************************************************************************/
  2876. /*                                                                                                  */
  2877. /*   Function Name: OPEN_LVM_ENGINE16                                                               */
  2878. /*                                                                                                  */
  2879. /*   Descriptive Name: Opens the LVM Engine and readies it for use.                                 */
  2880. /*                                                                                                  */
  2881. /*   Input: BOOLEAN Ignore_CHS : If TRUE, then the LVM engine will not check the CHS values in the  */
  2882. /*                               MBR/EBR partition tables for validity.  This is useful if there    */
  2883. /*                               are drive geometry problems, such as the drive was partitioned and */
  2884. /*                               formatted with one geometry and then moved to a different machine  */
  2885. /*                               which uses a different geometry for the drive.  This would cause   */
  2886. /*                               the starting and ending CHS values in the partition tables to      */
  2887. /*                               be inconsistent with the size and partition offset entries in the  */
  2888. /*                               partition tables.  Setting Ignore_CHS to TRUE will disable the     */
  2889. /*                               LVM Engine's CHS consistency checks, thereby allowing the drive    */
  2890. /*                               to be partitioned.                                                 */
  2891. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in which to store an error code   */
  2892. /*                                    should an error occur.                                        */
  2893. /*                                                                                                  */
  2894. /*   Output:  *Error_Code will be 0 if this function completes successfully.  If an error occurs,   */
  2895. /*            *Error_Code will contain a non-zero error code.                                       */
  2896. /*                                                                                                  */
  2897. /*   Error Handling: If this function aborts with an error, all memory allocated during the course  */
  2898. /*                   of this function will be released.  Disk read errors will be reported to the   */
  2899. /*                   user via pop-up error messages.  Disk read errors will only cause this         */
  2900. /*                   function to abort if none of the disk drives in the system could be            */
  2901. /*                   successfully read.                                                             */
  2902. /*                                                                                                  */
  2903. /*   Side Effects:  The LVM Engine will be initialized.  The partition tables for all OS2DASD       */
  2904. /*                  controlled disk drives will be read into memory.  Memory will be allocated for  */
  2905. /*                  the data structures used by the LVM Engine.                                     */
  2906. /*                                                                                                  */
  2907. /*   Notes:  This is provided for programs that used LVM Version 1.  This function assumes an       */
  2908. /*           LVM_Interface_Type of VIO_Interface.                                                   */
  2909. /*                                                                                                  */
  2910. /****************************************************************************************************/
  2911. void _Far16 _Pascal _loadds OPEN_LVM_ENGINE16( BOOLEAN Ignore_CHS, CARDINAL32 * _Seg16 Error_Code );
  2912.  
  2913. /****************************************************************************************************/
  2914. /*                                                                                                  */
  2915. /*   Function Name: OPEN_LVM_ENGINE216                                                              */
  2916. /*                                                                                                  */
  2917. /*   Descriptive Name: Opens the LVM Engine and readies it for use.                                 */
  2918. /*                                                                                                  */
  2919. /*   Input: BOOLEAN Ignore_CHS : If TRUE, then the LVM engine will not check the CHS values in the  */
  2920. /*                               MBR/EBR partition tables for validity.  This is useful if there    */
  2921. /*                               are drive geometry problems, such as the drive was partitioned and */
  2922. /*                               formatted with one geometry and then moved to a different machine  */
  2923. /*                               which uses a different geometry for the drive.  This would cause   */
  2924. /*                               the starting and ending CHS values in the partition tables to      */
  2925. /*                               be inconsistent with the size and partition offset entries in the  */
  2926. /*                               partition tables.  Setting Ignore_CHS to TRUE will disable the     */
  2927. /*                               LVM Engine's CHS consistency checks, thereby allowing the drive    */
  2928. /*                               to be partitioned.                                                 */
  2929. /*          LVM_Interface_Types Interface_Type - Indicate the type of user interface being used:    */
  2930. /*                               PM_Interface, VIO_Interface, or Java_Interface.  This lets the     */
  2931. /*                               LVM Engine know which interface support routines to call in any    */
  2932. /*                               plugin modules which may be loaded.                                */
  2933. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in which to store an error code   */
  2934. /*                                    should an error occur.                                        */
  2935. /*                                                                                                  */
  2936. /*   Output:  *Error_Code will be 0 if this function completes successfully.  If an error occurs,   */
  2937. /*            *Error_Code will contain a non-zero error code.                                       */
  2938. /*                                                                                                  */
  2939. /*   Error Handling: If this function aborts with an error, all memory allocated during the course  */
  2940. /*                   of this function will be released.  Disk read errors will be reported to the   */
  2941. /*                   user via pop-up error messages.  Disk read errors will only cause this         */
  2942. /*                   function to abort if none of the disk drives in the system could be            */
  2943. /*                   successfully read.                                                             */
  2944. /*                                                                                                  */
  2945. /*   Side Effects:  The LVM Engine will be initialized.  The partition tables for all OS2DASD       */
  2946. /*                  controlled disk drives will be read into memory.  Memory will be allocated for  */
  2947. /*                  the data structures used by the LVM Engine.                                     */
  2948. /*                                                                                                  */
  2949. /*   Notes:  None.                                                                                  */
  2950. /*                                                                                                  */
  2951. /****************************************************************************************************/
  2952. void _Far16 _Pascal _loadds OPEN_LVM_ENGINE216( BOOLEAN Ignore_CHS, LVM_Interface_Types Interface_Type, CARDINAL32 * _Seg16 Error_Code );
  2953.  
  2954. /*********************************************************************/
  2955. /*                                                                   */
  2956. /*   Function Name: COMMIT_CHANGES16                                 */
  2957. /*                                                                   */
  2958. /*   Descriptive Name: Saves any changes made to the partitioning    */
  2959. /*                     information of the OS2DASD controlled disk    */
  2960. /*                     drives in the system.                         */
  2961. /*                                                                   */
  2962. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  2963. /*                                   in which to store an error code */
  2964. /*                                   should an error occur.          */
  2965. /*                                                                   */
  2966. /*   Output:  The function return value will be TRUE if all of the   */
  2967. /*            partitioning/volume changes made were successfully     */
  2968. /*            written to disk.  Also, *Error_Code will be 0 if no    */
  2969. /*            errors occur.                                          */
  2970. /*                                                                   */
  2971. /*            If an error occurs, then the furnction return value    */
  2972. /*            will be FALSE and *Error_Code will contain a non-zero  */
  2973. /*            error code.                                            */
  2974. /*                                                                   */
  2975. /*   Error Handling:  If an error occurs, the function return value  */
  2976. /*                    will be false and *Error_Code will be > 0.     */
  2977. /*                                                                   */
  2978. /*                    Disk read and write errors will be indicated by*/
  2979. /*                    setting the IO_Error field of the              */
  2980. /*                    Drive_Information_Record to TRUE.  Thus, if    */
  2981. /*                    the function return value is FALSE, and        */
  2982. /*                    *Error_Code indicates an I/O error, the caller */
  2983. /*                    of this function should call the               */
  2984. /*                    Get_Drive_Status function on each drive to     */
  2985. /*                    determine which drives had I/O errors.         */
  2986. /*                                                                   */
  2987. /*                    If a read or write error occurs, then the      */
  2988. /*                    engine may not have been able to create a      */
  2989. /*                    partition or volume.  Thus, the caller         */
  2990. /*                    may want to refresh all partition and volume   */
  2991. /*                    data to see what the engine was and was not    */
  2992. /*                    able to create.                                */
  2993. /*                                                                   */
  2994. /*   Side Effects:  The partitioning information of the disk drives  */
  2995. /*                  in the system may be altered.                    */
  2996. /*                                                                   */
  2997. /*   Notes:  None.                                                   */
  2998. /*                                                                   */
  2999. /*********************************************************************/
  3000. BOOLEAN _Far16 _Pascal _loadds COMMIT_CHANGES16( CARDINAL32 * _Seg16 Error_Code );
  3001.  
  3002. /*********************************************************************/
  3003. /*                                                                   */
  3004. /*   Function Name: CLOSE_LVM_ENGINE16                               */
  3005. /*                                                                   */
  3006. /*   Descriptive Name: Closes the LVM Engine and frees any memory    */
  3007. /*                     held by the LVM Engine.                       */
  3008. /*                                                                   */
  3009. /*   Input: None.                                                    */
  3010. /*                                                                   */
  3011. /*   Output:  None.                                                  */
  3012. /*                                                                   */
  3013. /*   Error Handling: N/A                                             */
  3014. /*                                                                   */
  3015. /*   Side Effects:  Any memory held by the LVM Engine is released.   */
  3016. /*                                                                   */
  3017. /*   Notes:  None.                                                   */
  3018. /*                                                                   */
  3019. /*********************************************************************/
  3020. void _Far16 _Pascal _loadds CLOSE_LVM_ENGINE16 ( void );
  3021.  
  3022. /*********************************************************************/
  3023. /*                                                                   */
  3024. /*   Function Name: REFRESH_LVM_ENGINE 16                            */
  3025. /*                                                                   */
  3026. /*   Descriptive Name: This function causes the LVM Engine to look   */
  3027. /*                     for changes in the current system             */
  3028. /*                     configuration and update its internal tables  */
  3029. /*                     accordingly.                                  */
  3030. /*                                                                   */
  3031. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3032. /*                                   in which to store an error code */
  3033. /*                                   should an error occur.          */
  3034. /*                                                                   */
  3035. /*   Output:  None.                                                  */
  3036. /*                                                                   */
  3037. /*   Error Handling: If an error occurs, *Error_Code will be set to  */
  3038. /*                   a non-zero value.                               */
  3039. /*                                                                   */
  3040. /*   Side Effects: Volumes which represent non-LVM devices may have  */
  3041. /*                 their handles changed!                            */
  3042. /*                                                                   */
  3043. /*   Notes:  After calling this function, Get_Volume_Control_Data    */
  3044. /*           should be called to get the updated list of volumes.    */
  3045. /*           This is necessary as the handles of some volumes may    */
  3046. /*           have changed.                                           */
  3047. /*                                                                   */
  3048. /*********************************************************************/
  3049. void _Far16 _Pascal _loadds  REFRESH_LVM_ENGINE16( CARDINAL32 * _Seg16 Error_Code );
  3050.  
  3051. /* ************************************************************************** *
  3052.  
  3053. 16 Bit Functions relating to Drives
  3054.  
  3055. ************************************************************************** */
  3056.  
  3057. /*********************************************************************/
  3058. /*                                                                   */
  3059. /*   Function Name:  Get_Drive_Control_Data16                        */
  3060. /*                                                                   */
  3061. /*   Descriptive Name:  This function returns an array of            */
  3062. /*                      Drive_Control_Records.  These records provide*/
  3063. /*                      important information about the drives in the*/
  3064. /*                      system and provide the handles required to   */
  3065. /*                      access them.                                 */
  3066. /*                                                                   */
  3067. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3068. /*                                   in which to store an error code */
  3069. /*                                   should an error occur.          */
  3070. /*                                                                   */
  3071. /*   Output:  A Drive_Control_Array structure is returned.  If no    */
  3072. /*            errors occur, Drive_Control_Data will be non-NULL,     */
  3073. /*            Count will be greater than zero, and *Error_Code will  */
  3074. /*            be 0.                                                  */
  3075. /*                                                                   */
  3076. /*   Error Handling:  If an error occurs, the Drive_Control_Array    */
  3077. /*                    returned by this function will have NULL for   */
  3078. /*                    Drive_Control_Data, and 0 for Count.           */
  3079. /*                    *Error_Code will be greater than 0.            */
  3080. /*                                                                   */
  3081. /*   Side Effects:  None.                                            */
  3082. /*                                                                   */
  3083. /*   Notes:  The caller becomes responsible for the memory allocated */
  3084. /*           for the array of Drive_Control_Records pointed to by    */
  3085. /*           Drive_Control_Data pointer in the Drive_Control_Array   */
  3086. /*           structure returned by this function.  The caller should */
  3087. /*           free this memory when they are done using it.           */
  3088. /*                                                                   */
  3089. /*********************************************************************/
  3090. void _Far16 _Pascal _loadds GET_DRIVE_CONTROL_DATA16( Drive_Control_Record * _Seg16 * _Seg16 Drive_Control_Data,
  3091. CARDINAL32 *                    _Seg16 Count,
  3092. CARDINAL32 *                    _Seg16 Error_Code
  3093. );
  3094.  
  3095. /*********************************************************************/
  3096. /*                                                                   */
  3097. /*   Function Name:  Get_Drive_Status16                              */
  3098. /*                                                                   */
  3099. /*   Descriptive Name:  Returns the Drive_Information_Record for the */
  3100. /*                      drive specified by Drive_Handle.             */
  3101. /*                                                                   */
  3102. /*   Input: CARDINAL32 Drive_Handle - The handle of the drive to use.*/
  3103. /*                             Drive handles are obtained through the*/
  3104. /*                             Get_Drive_Control_Data function.      */
  3105. /*         CARDINAL32 * Error_Code - The address of a CARDINAL32 in  */
  3106. /*                                   in which to store an error code */
  3107. /*                                   should an error occur.          */
  3108. /*                                                                   */
  3109. /*   Output: This function returns the Drive_Information_Record for  */
  3110. /*           the drive associated with the specified Drive_Handle.   */
  3111. /*           If no errors occur, *Error_Code will be set to 0.  If an*/
  3112. /*           error does occur, then *Error_Code will be non-zero.    */
  3113. /*                                                                   */
  3114. /*   Error Handling:  If an error occurs, then *Error_Code will be   */
  3115. /*                    non-zero.                                      */
  3116. /*                                                                   */
  3117. /*   Side Effects:  None.                                            */
  3118. /*                                                                   */
  3119. /*   Notes:  None.                                                   */
  3120. /*                                                                   */
  3121. /*********************************************************************/
  3122. void _Far16 _Pascal _loadds GET_DRIVE_STATUS16( CARDINAL32                          Drive_Handle,
  3123. Drive_Information_Record *   _Seg16 Drive_Status,
  3124. CARDINAL32 *                 _Seg16 Error_Code
  3125. );
  3126.  
  3127. /* ************************************************************************** *
  3128.  
  3129. 16 Bit Functions relating to Partitions
  3130.  
  3131. ************************************************************************** */
  3132.  
  3133. /*********************************************************************/
  3134. /*                                                                   */
  3135. /*   Function Name: Get_Partitions16                                 */
  3136. /*                                                                   */
  3137. /*   Descriptive Name: Returns an array of partitions associated     */
  3138. /*                     with the object specified by Handle.          */
  3139. /*                                                                   */
  3140. /*   Input:CARDINAL32 Handle - This is the handle of a drive or      */
  3141. /*                      volume.  Drive handles are obtained through  */
  3142. /*                      the Get_Drive_Control_Data function.  Volume */
  3143. /*                      handles are obtained through the             */
  3144. /*                      Get_Volume_Control_Data function.            */
  3145. /*         CARDINAL32 * Error_Code - The address of a CARDINAL32 in  */
  3146. /*                                   in which to store an error code */
  3147. /*                                   should an error occur.          */
  3148. /*                                                                   */
  3149. /*   Output: This function returns a structure.  The structure has   */
  3150. /*           two components: an array of partition information       */
  3151. /*           records and the number of entries in the array.  If     */
  3152. /*           Handle is the handle of a disk drive, then the returned */
  3153. /*           array will contain a partition information record for   */
  3154. /*           each partition and block of free space on that drive.   */
  3155. /*           If Handle is the handle of a volume, then the returned  */
  3156. /*           array will contain a partition information record for   */
  3157. /*           each partition which is part of the specified volume.   */
  3158. /*           If no errors occur, then *Error_Code will be 0.  If an  */
  3159. /*           error does occur, then *Error_Code will be non-zero.    */
  3160. /*                                                                   */
  3161. /*   Error Handling: Any memory allocated for the return value will  */
  3162. /*                   be freed.  The Partition_Information_Array      */
  3163. /*                   returned by this function will contain a NULL   */
  3164. /*                   pointer for Partition_Array, and have a Count of*/
  3165. /*                   0.  *Error_Code will be non-zero.               */
  3166. /*                                                                   */
  3167. /*                   If Handle is non-NULL and is invalid, a trap    */
  3168. /*                   is likely.                                      */
  3169. /*                                                                   */
  3170. /*   Side Effects:  Memory will be allocated to hold the array       */
  3171. /*                  returned by this function.                       */
  3172. /*                                                                   */
  3173. /*   Notes:  The caller becomes responsible for the memory allocated */
  3174. /*           for the array of Partition_Information_Records pointed  */
  3175. /*           to by Partition_Array pointer in the                    */
  3176. /*           Partition_Information_Array structure returned by this  */
  3177. /*           function.  The caller should free this memory when they */
  3178. /*           are done using it.                                      */
  3179. /*                                                                   */
  3180. /*********************************************************************/
  3181. void _Far16 _Pascal _loadds GET_PARTITIONS16( CARDINAL32                                      Handle,
  3182. Partition_Information_Record * _Seg16 * _Seg16  Partition_Array,
  3183. CARDINAL32 *                            _Seg16  Count,
  3184. CARDINAL32 *                            _Seg16  Error_Code
  3185. );
  3186.  
  3187. /*********************************************************************/
  3188. /*                                                                   */
  3189. /*   Function Name: GET_PARTITION_HANDLE16                           */
  3190. /*                                                                   */
  3191. /*   Descriptive Name: Returns the handle of the partition whose     */
  3192. /*                     serial number matches the one provided.       */
  3193. /*                                                                   */
  3194. /*   Input: CARDINAL32 Serial_Number - This is the serial number to  */
  3195. /*                                     look for.  If a partition with*/
  3196. /*                                     a matching serial number is   */
  3197. /*                                     found, its handle will be     */
  3198. /*                                     returned.                     */
  3199. /*          CARDINAL32 * Handle - The address of a variable (32 bits)*/
  3200. /*                                to hold the handle being returned. */
  3201. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3202. /*                                    in which to store an error code*/
  3203. /*                                    should an error occur.         */
  3204. /*                                                                   */
  3205. /*   Output: If a partition with a matching serial number is found,  */
  3206. /*              then the function return value will be the handle    */
  3207. /*              of the partition found.  If no matching partition is */
  3208. /*              found, then the function return value will be NULL.  */
  3209. /*                                                                   */
  3210. /*   Error Handling:  If no errors occur, *Error_Code will be        */
  3211. /*                    LVM_ENGINE_NO_ERROR.  If an error occurs, then */
  3212. /*                    *Error_Code will be a non-zero error code.     */
  3213. /*                                                                   */
  3214. /*   Side Effects:  None.                                            */
  3215. /*                                                                   */
  3216. /*   Notes:  None.                                                   */
  3217. /*                                                                   */
  3218. /*********************************************************************/
  3219. void _Far16 _Pascal _loadds GET_PARTITION_HANDLE16( CARDINAL32          Serial_Number,
  3220. CARDINAL32 * _Seg16 Handle,
  3221. CARDINAL32 * _Seg16 Error_Code );
  3222.  
  3223. /*********************************************************************/
  3224. /*                                                                   */
  3225. /*   Function Name: Get_Partition_Information16                      */
  3226. /*                                                                   */
  3227. /*   Descriptive Name: Returns the Partition_Information_Record for  */
  3228. /*                     the partition specified by Partition_Handle.  */
  3229. /*                                                                   */
  3230. /*   Input: CARDINAL32 Partition_Handle - The handle associated with */
  3231. /*                                     the partition for which the   */
  3232. /*                                     Partition_Information_Record  */
  3233. /*                                     is desired.                   */
  3234. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3235. /*                                    in which to store an error code*/
  3236. /*                                    should an error occur.         */
  3237. /*                                                                   */
  3238. /*   Output: A Partition_Information_Record is returned.  If there   */
  3239. /*           is no error, then *Error_Code will be 0.  If an error   */
  3240. /*           occurs, *Error_Code will be non-zero.                   */
  3241. /*                                                                   */
  3242. /*   Error Handling:  If the Partition_Handle is not a valid handle, */
  3243. /*                    a trap could result.  If it is a handle for    */
  3244. /*                    something other than a partition, an error code*/
  3245. /*                    will be returned in *Error_Code.               */
  3246. /*                                                                   */
  3247. /*   Side Effects:  None.                                            */
  3248. /*                                                                   */
  3249. /*   Notes:  None.                                                   */
  3250. /*                                                                   */
  3251. /*********************************************************************/
  3252. void _Far16 _Pascal _loadds  GET_PARTITION_INFORMATION16( CARDINAL32                             Partition_Handle,
  3253. Partition_Information_Record * _Seg16  Partition_Information,
  3254. CARDINAL32 *                   _Seg16  Error_Code
  3255. );
  3256.  
  3257. /*********************************************************************/
  3258. /*                                                                   */
  3259. /*   Function Name: Create_Partition16                               */
  3260. /*                                                                   */
  3261. /*   Descriptive Name: Creates a partition on a disk drive.          */
  3262. /*                                                                   */
  3263. /*   Input: CARDINAL32      Handle - The handle of a disk drive or   */
  3264. /*                                   a block of free space.          */
  3265. /*          CARDINAL32      Size - The size, in sectors, of the      */
  3266. /*                                 partition to create.              */
  3267. /*          char            Name[] - The name to give to the newly   */
  3268. /*                                   created partition.              */
  3269. /*          Allocation_Algorithm algorithm - If Handle is a drive,   */
  3270. /*                                           then the engine will    */
  3271. /*                                           find a block of free    */
  3272. /*                                           space to use to create  */
  3273. /*                                           the partition.  This    */
  3274. /*                                           tells the engine which  */
  3275. /*                                           memory management       */
  3276. /*                                           algorithm to use.       */
  3277. /*          BOOLEAN         Bootable - If TRUE, then the engine will */
  3278. /*                                     only create the partition if  */
  3279. /*                                     it can be booted from.  If    */
  3280. /*                                     Primary_Partition is FALSE,   */
  3281. /*                                     then it is assumed that OS/2  */
  3282. /*                                     is the operating system that  */
  3283. /*                                     will be booted.               */
  3284. /*          BOOLEAN         Primary_Partition - If TRUE, then the    */
  3285. /*                                              engine will create   */
  3286. /*                                              a primary partition. */
  3287. /*                                              If FALSE, then the   */
  3288. /*                                              engine will create a */
  3289. /*                                              logical drive.       */
  3290. /*          BOOLEAN         Allocate_From_Start - If TRUE, then the  */
  3291. /*                                                engine will        */
  3292. /*                                                allocate the new   */
  3293. /*                                                partition from the */
  3294. /*                                                beginning of the   */
  3295. /*                                                selected block of  */
  3296. /*                                                free space.  If    */
  3297. /*                                                FALSE, then the    */
  3298. /*                                                partition will be  */
  3299. /*                                                allocated from the */
  3300. /*                                                end of the selected*/
  3301. /*                                                block of free      */
  3302. /*                                                space.             */
  3303. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3304. /*                                    in which to store an error code*/
  3305. /*                                    should an error occur.         */
  3306. /*                                                                   */
  3307. /*   Output: The function return value will be the handle of the     */
  3308. /*           partition created.  If the partition could not be       */
  3309. /*           created, then NULL will be returned.                    */
  3310. /*           *Error_Code will be 0 if the partition was created.     */
  3311. /*           *Error_Code will be > 0 if the partition could not be   */
  3312. /*           created.                                                */
  3313. /*                                                                   */
  3314. /*   Error Handling:  If the partition can not be created, then any  */
  3315. /*                    memory allocated by this function will be      */
  3316. /*                    freed and the partitioning of the disk in      */
  3317. /*                    question will be unchanged.                    */
  3318. /*                                                                   */
  3319. /*                    If Handle is not a valid handle, then a trap   */
  3320. /*                    may result.                                    */
  3321. /*                                                                   */
  3322. /*                    If Handle represents a partition or volume,    */
  3323. /*                    then the function will abort and set           */
  3324. /*                    *Error_Code to a non-zero value.               */
  3325. /*                                                                   */
  3326. /*   Side Effects:  A partition may be created on a disk drive.      */
  3327. /*                                                                   */
  3328. /*   Notes:  None.                                                   */
  3329. /*                                                                   */
  3330. /*********************************************************************/
  3331. CARDINAL32 _Far16 _Pascal _loadds CREATE_PARTITION16( CARDINAL32            Handle,
  3332. CARDINAL32            Size,
  3333. char  *     _Seg16    Name,
  3334. Allocation_Algorithm  algorithm,
  3335. BOOLEAN               Bootable,
  3336. BOOLEAN               Primary_Partition,
  3337. BOOLEAN               Allocate_From_Start,
  3338. CARDINAL32 * _Seg16   Error_Code
  3339. );
  3340.  
  3341. /*********************************************************************/
  3342. /*                                                                   */
  3343. /*   Function Name: Delete_Partition16                               */
  3344. /*                                                                   */
  3345. /*   Descriptive Name: Deletes the partition specified by            */
  3346. /*                     Partition_Handle.                             */
  3347. /*                                                                   */
  3348. /*   Input: CARDINAL32 Partition_Handle - The handle associated with */
  3349. /*                                     the partition to be deleted.  */
  3350. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3351. /*                                    in which to store an error code*/
  3352. /*                                    should an error occur.         */
  3353. /*                                                                   */
  3354. /*   Output: *Error_Code will be 0 if the partition was deleted      */
  3355. /*           successfully.  *Error_Code will be > 0 if the partition */
  3356. /*           could not be deleted.                                   */
  3357. /*                                                                   */
  3358. /*   Error Handling: If the partition can not be deleted, then       */
  3359. /*                   *Error_Code will be > 0.                        */
  3360. /*                                                                   */
  3361. /*                   If Partition_Handle is not a valid handle, a    */
  3362. /*                   trap may result.                                */
  3363. /*                                                                   */
  3364. /*                   If Partition_Handle is a volume or drive handle,*/
  3365. /*                   then this function will abort and set           */
  3366. /*                   *Error_Code to a non-zero value.                */
  3367. /*                                                                   */
  3368. /*   Side Effects: A partition on a disk drive may be deleted.       */
  3369. /*                                                                   */
  3370. /*   Notes:  A partition can not be deleted if it is part of a       */
  3371. /*           volume!                                                 */
  3372. /*                                                                   */
  3373. /*********************************************************************/
  3374. void _Far16 _Pascal _loadds DELETE_PARTITION16( CARDINAL32          Partition_Handle,
  3375. CARDINAL32 * _Seg16 Error_Code
  3376. );
  3377.  
  3378. /*********************************************************************/
  3379. /*                                                                   */
  3380. /*   Function Name: Set_Active_Flag16                                */
  3381. /*                                                                   */
  3382. /*   Descriptive Name: Sets the Active Flag field for a partition.   */
  3383. /*                                                                   */
  3384. /*   Input: CARDINAL32 Partition_Handle - The handle of the partition*/
  3385. /*                                     whose Active Flag is to be set*/
  3386. /*          BYTE Active_Flag - The new value for the Active Flag.    */
  3387. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3388. /*                                    in which to store an error code*/
  3389. /*                                    should an error occur.         */
  3390. /*                                                                   */
  3391. /*   Output: *Error_Code will be 0 if the Active Flag was            */
  3392. /*           successfully set, otherwise *Error_Code will contain a  */
  3393. /*           non-zero error code indicating what went wrong.         */
  3394. /*                                                                   */
  3395. /*   Error Handling: If the Active Flag can not be set, this function*/
  3396. /*                   will abort without changing any disk structures.*/
  3397. /*                                                                   */
  3398. /*                   If Partition_Handle is not a valid handle, a    */
  3399. /*                   trap may result.                                */
  3400. /*                                                                   */
  3401. /*                   If Partition_Handle is a volume or drive handle,*/
  3402. /*                   then this function will abort and set           */
  3403. /*                   *Error_Code to a non-zero value.                */
  3404. /*                                                                   */
  3405. /*                                                                   */
  3406. /*   Side Effects:  The Active Flag for a partition may be modified. */
  3407. /*                                                                   */
  3408. /*   Notes:  None.                                                   */
  3409. /*                                                                   */
  3410. /*********************************************************************/
  3411. void _Far16 _Pascal _loadds SET_ACTIVE_FLAG16 ( CARDINAL32          Partition_Handle,
  3412. BYTE                Active_Flag,
  3413. CARDINAL32 * _Seg16 Error_Code
  3414. );
  3415.  
  3416. /*********************************************************************/
  3417. /*                                                                   */
  3418. /*   Function Name: Set_OS_Flag16                                    */
  3419. /*                                                                   */
  3420. /*   Descriptive Name: Sets the OS Flag field for a partition.  This */
  3421. /*                     field is typically used to indicate the       */
  3422. /*                     filesystem used on the partition, which       */
  3423. /*                     generally gives an indication of which OS is  */
  3424. /*                     using that partition.                         */
  3425. /*                                                                   */
  3426. /*   Input: CARDINAL32 Partition_Handle - The handle of the partition*/
  3427. /*                                     whose Active Flag is to be set*/
  3428. /*          BYTE OS_Flag - The new value for the OS Flag.            */
  3429. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3430. /*                                    in which to store an error code*/
  3431. /*                                    should an error occur.         */
  3432. /*                                                                   */
  3433. /*   Output: *Error_Code will be 0 if the OS Flag was successfully   */
  3434. /*           set, otherwise *Error_Code will contain a non-zero error*/
  3435. /*           code indicating what went wrong.                        */
  3436. /*                                                                   */
  3437. /*   Error Handling: If the OS Flag can not be set, this function    */
  3438. /*                   will abort without changing any disk structures.*/
  3439. /*                                                                   */
  3440. /*                   If Partition_Handle is not a valid handle, a    */
  3441. /*                   trap may result.                                */
  3442. /*                                                                   */
  3443. /*                   If Partition_Handle is a volume or drive handle,*/
  3444. /*                   then this function will abort and set           */
  3445. /*                   *Error_Code to a non-zero value.                */
  3446. /*                                                                   */
  3447. /*                                                                   */
  3448. /*   Side Effects:  The OS Flag for a partition may be modified.     */
  3449. /*                                                                   */
  3450. /*   Notes:  None.                                                   */
  3451. /*                                                                   */
  3452. /*********************************************************************/
  3453. void _Far16 _Pascal _loadds SET_OS_FLAG16 ( CARDINAL32          Partition_Handle,
  3454. BYTE                OS_Flag,
  3455. CARDINAL32 * _Seg16 Error_Code
  3456. );
  3457.  
  3458. /* ************************************************************************** *
  3459.  
  3460. 16 Bit Functions relating to Volumes
  3461.  
  3462. ************************************************************************** */
  3463.  
  3464. /*********************************************************************/
  3465. /*                                                                   */
  3466. /*   Function Name: Get_Volume_Control_Data16                        */
  3467. /*                                                                   */
  3468. /*   Descriptive Name: This function returns a structure containing  */
  3469. /*                     an array of Volume_Control_Records.  These    */
  3470. /*                     records contain information about volumes     */
  3471. /*                     which is invariant - i.e. will not change for */
  3472. /*                     as long as the volume exists.  One of the     */
  3473. /*                     items in the Volume_Control_Record is the     */
  3474. /*                     handle for the volume.  This handle must be   */
  3475. /*                     used on all accesses to the volume.           */
  3476. /*                                                                   */
  3477. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3478. /*                                    in which to store an error code*/
  3479. /*                                    should an error occur.         */
  3480. /*                                                                   */
  3481. /*   Output: A Volume_Control_Array structure is returned.           */
  3482. /*                                                                   */
  3483. /*           If there are no errors, then the Volume_Control_Data    */
  3484. /*           pointer in the Volume_Control_Array will be non-NULL,   */
  3485. /*           the Count field of the Volume_Control_Array will be     */
  3486. /*           >= 0, and *Error_Code will be 0.                        */
  3487. /*                                                                   */
  3488. /*           If an error does occur, then the Volume_Control_Data    */
  3489. /*           pointer in the the Volume_Control_Array will be NULL,   */
  3490. /*           the Count field of the Volume_Control_Array will be 0,  */
  3491. /*           and *Error_Code will be > 0.                            */
  3492. /*                                                                   */
  3493. /*   Error Handling: If an error occurs, then any memory allocated by*/
  3494. /*                   this function will be freed.                    */
  3495. /*                                                                   */
  3496. /*   Side Effects:  Memory for the returned array is allocated.      */
  3497. /*                                                                   */
  3498. /*   Notes:  The caller becomes responsible for the memory allocated */
  3499. /*           for the array of Volume_Control_Records pointed to by   */
  3500. /*           Volume_Control_Data pointer in the Volume_Control_Array */
  3501. /*           structure returned by this function.  The caller should */
  3502. /*           free this memory when they are done using it.           */
  3503. /*                                                                   */
  3504. /*********************************************************************/
  3505. void _Far16 _Pascal _loadds GET_VOLUME_CONTROL_DATA16( Volume_Control_Record  *  _Seg16 * _Seg16 Volume_Control_Data,
  3506. CARDINAL32 *                       _Seg16 Count,
  3507. CARDINAL32 *                       _Seg16 Error_Code );
  3508.  
  3509. /*********************************************************************/
  3510. /*                                                                   */
  3511. /*   Function Name: Get_Volume_Information16                         */
  3512. /*                                                                   */
  3513. /*   Descriptive Name:  This function returns the                    */
  3514. /*                      Volume_Information_Record for the volume     */
  3515. /*                      associated with Volume_Handle.               */
  3516. /*                                                                   */
  3517. /*   Input: CARDINAL32 Volume_Handle - The handle of the volume about*/
  3518. /*                                  which information is desired.    */
  3519. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3520. /*                                    in which to store an error code*/
  3521. /*                                    should an error occur.         */
  3522. /*                                                                   */
  3523. /*   Output: This function returns a Volume_Information_Record.      */
  3524. /*                                                                   */
  3525. /*           If this function is successful, then *Error_Code will be*/
  3526. /*              0.                                                   */
  3527. /*                                                                   */
  3528. /*           If this function fails, then *Error_Code will be > 0.   */
  3529. /*                                                                   */
  3530. /*   Error Handling:  If Volume_Handle is not a valid handle, a trap */
  3531. /*                    will be likely.  If Volume_Handle is a drive or*/
  3532. /*                    partition handle, *Error_Code will be > 0.     */
  3533. /*                                                                   */
  3534. /*   Side Effects:  None.                                            */
  3535. /*                                                                   */
  3536. /*   Notes:  None.                                                   */
  3537. /*                                                                   */
  3538. /*********************************************************************/
  3539. void _Far16 _Pascal _loadds GET_VOLUME_INFORMATION16( CARDINAL32                           Volume_Handle,
  3540. Volume_Information_Record  * _Seg16  Volume_Information,
  3541. CARDINAL32 *                 _Seg16  Error_Code
  3542. );
  3543.  
  3544. /*********************************************************************/
  3545. /*                                                                   */
  3546. /*   Function Name: CREATE_VOLUME16                                  */
  3547. /*                                                                   */
  3548. /*   Descriptive Name:  This function creates a volume from a list of*/
  3549. /*                      partitions.  The partitions are specified by */
  3550. /*                      their corresponding handles.                 */
  3551. /*                                                                   */
  3552. /*   Input: char         Name[] - The name to assign to the newly    */
  3553. /*                                created volume.                    */
  3554. /*          BOOLEAN      Create_LVM_Volume - If TRUE, then an LVM    */
  3555. /*                                           volume is created,      */
  3556. /*                                           otherwise a             */
  3557. /*                                           compatibility volume is */
  3558. /*                                           created.                */
  3559. /*          BOOLEAN      Bootable - If TRUE, the volume will not be  */
  3560. /*                                  created unless OS/2 can be booted*/
  3561. /*                                  from it.                         */
  3562. /*          char         Drive_Letter_Preference - This is the drive */
  3563. /*                                                 letter to use for */
  3564. /*                                                 accessing the     */
  3565. /*                                                 newly created     */
  3566. /*                                                 volume.           */
  3567. /*          CARDINAL32   FeaturesToUse - This is currently reserved  */
  3568. /*                                       for future use and should   */
  3569. /*                                       always be set to 0.         */
  3570. /*          CARDINAL32   Partition_Count - The number of partitions  */
  3571. /*                                         to link together to form  */
  3572. /*                                         the volume being created. */
  3573. /*          ADDRESS      Partition_Handles[] - An array of partition */
  3574. /*                                             handles with one entry*/
  3575. /*                                             for each partition    */
  3576. /*                                             that is to become part*/
  3577. /*                                             of the volume being   */
  3578. /*                                             created.              */
  3579. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3580. /*                                    in which to store an error code*/
  3581. /*                                    should an error occur.         */
  3582. /*                                                                   */
  3583. /*   Output: *Error_Code will be 0 if the volume was created.        */
  3584. /*           *Error_Code will be > 0 if the volume could not be      */
  3585. /*              created.                                             */
  3586. /*                                                                   */
  3587. /*   Error Handling: If any of the handles in the partition handles  */
  3588. /*                   array is not valid, then a trap is likely.  If  */
  3589. /*                   Partition_Count is greater than the number of   */
  3590. /*                   entries in the partition handles array, then a  */
  3591. /*                   trap is likely.  If any of the handles in the   */
  3592. /*                   partition array are not partition handles, then */
  3593. /*                   *Error_Code will be > 0.  If the volume can NOT */
  3594. /*                   be created, then *Error_Code will be > 0 and any*/
  3595. /*                   memory allocated by this function will be freed.*/
  3596. /*                   If the volume can NOT be created, then the      */
  3597. /*                   existing partition/volume structure of the disk */
  3598. /*                   will be unchanged.                              */
  3599. /*                                                                   */
  3600. /*   Side Effects:  A volume may be created.                         */
  3601. /*                                                                   */
  3602. /*   Notes:  This function provides limited compatibility for        */
  3603. /*           programs written to use the LVM Version 1 interface.    */
  3604. /*           Specifically, this function will only allow the         */
  3605. /*           creation of compatibility volumes.  Any attempt to      */
  3606. /*           create an LVM volume will result in an error code being */
  3607. /*           returned.                                               */
  3608. /*                                                                   */
  3609. /*********************************************************************/
  3610. void _Far16 _Pascal _loadds CREATE_VOLUME16( char   *     _Seg16 Name,
  3611. BOOLEAN             Create_LVM_Volume,
  3612. BOOLEAN             Bootable,
  3613. char                Drive_Letter_Preference,
  3614. CARDINAL32          FeaturesToUse,
  3615. CARDINAL32          Partition_Count,
  3616. CARDINAL32 * _Seg16 Partition_Handles,
  3617. CARDINAL32 * _Seg16 Error_Code
  3618. );
  3619.  
  3620. /*********************************************************************/
  3621. /*                                                                   */
  3622. /*   Function Name: CREATE_VOLUME216                                 */
  3623. /*                                                                   */
  3624. /*   Descriptive Name:  This function creates a volume from a list of*/
  3625. /*                      partitions.  The partitions are specified by */
  3626. /*                      their corresponding handles.                 */
  3627. /*                                                                   */
  3628. /*   Input: char         Name[] - The name to assign to the newly    */
  3629. /*                                created volume.                    */
  3630. /*          BOOLEAN      Create_LVM_Volume - If TRUE, then an LVM    */
  3631. /*                                           volume is created,      */
  3632. /*                                           otherwise a             */
  3633. /*                                           compatibility volume is */
  3634. /*                                           created.                */
  3635. /*          BOOLEAN      Bootable - If TRUE, the volume will not be  */
  3636. /*                                  created unless OS/2 can be booted*/
  3637. /*                                  from it.                         */
  3638. /*          char         Drive_Letter_Preference - This is the drive */
  3639. /*                                                 letter to use for */
  3640. /*                                                 accessing the     */
  3641. /*                                                 newly created     */
  3642. /*                                                 volume.           */
  3643. /*          CARDINAL32   Feature_Count - The number of features to   */
  3644. /*                                       install on the volume being */
  3645. /*                                       created.  This field is     */
  3646. /*                                       ignored if Create_LVM_Volume*/
  3647. /*                                       is FALSE.                   */
  3648. /*          LVM_Feature_Specification_Record FeaturesToUse[] - An    */
  3649. /*                                         array of feature IDs and  */
  3650. /*                                         their associated LVM      */
  3651. /*                                         classes used to designate */
  3652. /*                                         which features to install */
  3653. /*                                         on the volume being       */
  3654. /*                                         created and the order in  */
  3655. /*                                         which to install them.    */
  3656. /*                                         This field is ignored if  */
  3657. /*                                         Create_LVM_Volume is      */
  3658. /*                                         FALSE.                    */
  3659. /*          CARDINAL32   Partition_Count - The number of partitions  */
  3660. /*                                         to link together to form  */
  3661. /*                                         the volume being created. */
  3662. /*          ADDRESS      Partition_Handles[] - An array of partition */
  3663. /*                                             handles with one entry*/
  3664. /*                                             for each partition    */
  3665. /*                                             that is to become part*/
  3666. /*                                             of the volume being   */
  3667. /*                                             created.              */
  3668. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3669. /*                                    in which to store an error code*/
  3670. /*                                    should an error occur.         */
  3671. /*                                                                   */
  3672. /*   Output: *Error_Code will be 0 if the volume was created.        */
  3673. /*           *Error_Code will be > 0 if the volume could not be      */
  3674. /*              created.                                             */
  3675. /*                                                                   */
  3676. /*   Error Handling: If any of the handles in the partition handles  */
  3677. /*                   array is not valid, then a trap is likely.  If  */
  3678. /*                   Partition_Count is greater than the number of   */
  3679. /*                   entries in the partition handles array, then a  */
  3680. /*                   trap is likely.  If any of the handles in the   */
  3681. /*                   partition array are not partition handles, then */
  3682. /*                   *Error_Code will be > 0.  If the volume can NOT */
  3683. /*                   be created, then *Error_Code will be > 0 and any*/
  3684. /*                   memory allocated by this function will be freed.*/
  3685. /*                   If the volume can NOT be created, then the      */
  3686. /*                   existing partition/volume structure of the disk */
  3687. /*                   will be unchanged.                              */
  3688. /*                                                                   */
  3689. /*   Side Effects:  A volume may be created.                         */
  3690. /*                                                                   */
  3691. /*   Notes:  None.                                                   */
  3692. /*                                                                   */
  3693. /*********************************************************************/
  3694. void _Far16 _Pascal _loadds  CREATE_VOLUME216( char   * _Seg16                            Name,
  3695. BOOLEAN                                    Create_LVM_Volume,
  3696. BOOLEAN                                    Bootable,
  3697. char                                       Drive_Letter_Preference,
  3698. CARDINAL32                                 Feature_Count,
  3699. LVM_Feature_Specification_Record * _Seg16  FeaturesToUse,
  3700. CARDINAL32                                 Partition_Count,
  3701. CARDINAL32 * _Seg16                        Partition_Handles,
  3702. CARDINAL32 * _Seg16                        Error_Code
  3703. );
  3704.  
  3705. /*********************************************************************/
  3706. /*                                                                   */
  3707. /*   Function Name: Delete_Volume16                                  */
  3708. /*                                                                   */
  3709. /*   Descriptive Name: Deletes the volume specified by Volume_Handle.*/
  3710. /*                                                                   */
  3711. /*   Input: CARDINAL32 Volume_Handle - The handle of the volume to   */
  3712. /*                                  delete.  All partitions which are*/
  3713. /*                                  part of the specified volume will*/
  3714. /*                                  be deleted also.                 */
  3715. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3716. /*                                    in which to store an error code*/
  3717. /*                                    should an error occur.         */
  3718. /*                                                                   */
  3719. /*   Output: *Error_Code will be 0 if the volume and its partitions  */
  3720. /*           are successfully deleted.  Otherwise, *Error_Code will  */
  3721. /*           be > 0.                                                 */
  3722. /*                                                                   */
  3723. /*   Error Handling: *Error_Code will be > 0 if an error occurs.  If */
  3724. /*                   the volume or any of its partitions can not be  */
  3725. /*                   deleted, then any changes made by this function */
  3726. /*                   will be undone.                                 */
  3727. /*                                                                   */
  3728. /*                   If Volume_Handle is not a valid handle, a trap  */
  3729. /*                   may result.                                     */
  3730. /*                                                                   */
  3731. /*                   If Volume_Handle is a partition or drive handle,*/
  3732. /*                   then this function will abort and set           */
  3733. /*                   *Error_Code to a non-zero value.                */
  3734. /*                                                                   */
  3735. /*   Side Effects:  A volume and its partitions may be deleted.      */
  3736. /*                  System memory may be freed as the internal       */
  3737. /*                  structures used to track the deleted volume      */
  3738. /*                  are no longer required.                          */
  3739. /*                                                                   */
  3740. /*   Notes:  None.                                                   */
  3741. /*                                                                   */
  3742. /*********************************************************************/
  3743. void _Far16 _Pascal _loadds DELETE_VOLUME16( CARDINAL32          Volume_Handle,
  3744. CARDINAL32 * _Seg16 Error_Code
  3745. );
  3746.  
  3747. /*********************************************************************/
  3748. /*                                                                   */
  3749. /*   Function Name: Hide_Volume16                                    */
  3750. /*                                                                   */
  3751. /*   Descriptive Name: Hide volume "hides" a volume from OS/2 by     */
  3752. /*                     removing its drive letter assignment.  Without*/
  3753. /*                     a drive letter assignment, OS/2 can not access*/
  3754. /*                     (or "see") the volume.                        */
  3755. /*                                                                   */
  3756. /*   Input: CARDINAL32 Volume_Handle - The handle of the volume to   */
  3757. /*                                     hide.                         */
  3758. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3759. /*                                    in which to store an error code*/
  3760. /*                                    should an error occur.         */
  3761. /*                                                                   */
  3762. /*   Output: *Error_Code will be 0 if the volume was successfully    */
  3763. /*           hidden.  If the volume could not be hidden, then        */
  3764. /*           *Error_Code will be > 0.                                */
  3765. /*                                                                   */
  3766. /*   Error Handling: *Error_Code will be > 0 if the volume can not be*/
  3767. /*                   hidden.  If the volume can not be hidden, then  */
  3768. /*                   nothing will be altered.                        */
  3769. /*                                                                   */
  3770. /*                   If Volume_Handle is not a valid handle, a trap  */
  3771. /*                   may result.                                     */
  3772. /*                                                                   */
  3773. /*                   If Volume_Handle is a partition or drive handle,*/
  3774. /*                   then this function will abort and set           */
  3775. /*                   *Error_Code to a non-zero value.                */
  3776. /*                                                                   */
  3777. /*   Side Effects:  None.                                            */
  3778. /*                                                                   */
  3779. /*   Notes:  None.                                                   */
  3780. /*                                                                   */
  3781. /*********************************************************************/
  3782. void _Far16 _Pascal _loadds HIDE_VOLUME16( CARDINAL32          Volume_Handle,
  3783. CARDINAL32 * _Seg16 Error_Code
  3784. );
  3785.  
  3786. /*********************************************************************/
  3787. /*                                                                   */
  3788. /*   Function Name: Expand_Volume16                                  */
  3789. /*                                                                   */
  3790. /*   Descriptive Name: This function expands an existing volume by   */
  3791. /*                     linking additional partitions to it.          */
  3792. /*                                                                   */
  3793. /*   Input: CARDINAL32 Volume_Handle - The handle of the volume to be*/
  3794. /*                                  expanded.                        */
  3795. /*          CARDINAL32 Partition_Count - The number of partitions or */
  3796. /*                                       volumes to be added to the  */
  3797. /*                                       volume being expanded.      */
  3798. /*          CARDINAL32 Partition_Handles[] - An array of handles.    */
  3799. /*                                        Each handle in the array is*/
  3800. /*                                        the handle of a partition  */
  3801. /*                                        which is to be added to    */
  3802. /*                                        the volume being expanded. */
  3803. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3804. /*                                    in which to store an error code*/
  3805. /*                                    should an error occur.         */
  3806. /*                                                                   */
  3807. /*   Output: *Error_Code will be 0 if the volume is successfully     */
  3808. /*           expanded.  If the volume can not be expanded,           */
  3809. /*           *Error_Code will be > 0.                                */
  3810. /*                                                                   */
  3811. /*   Error Handling: If the volume can not be expanded, the state of */
  3812. /*                   the volume is unchanged and any memory allocated*/
  3813. /*                   by this function is freed.                      */
  3814. /*                                                                   */
  3815. /*                   If Volume_Handle is not a valid handle, a trap  */
  3816. /*                   may result.                                     */
  3817. /*                                                                   */
  3818. /*                   If Volume_Handle is a partition or drive handle,*/
  3819. /*                   then this function will abort and set           */
  3820. /*                   *Error_Code to a non-zero value.                */
  3821. /*                                                                   */
  3822. /*                   If any of the partition handles in the          */
  3823. /*                   Partition_handles array are not valid handles,  */
  3824. /*                   then a trap may result.                         */
  3825. /*                                                                   */
  3826. /*                   If any of the partition handles in the          */
  3827. /*                   Partition_Handles array are actually drive      */
  3828. /*                   handles, then this function will abort and      */
  3829. /*                   set *Error_Code to a non-zero value.            */
  3830. /*                                                                   */
  3831. /*                   If Partition_Count is greater than the number of*/
  3832. /*                   entries in the Partition_Handles array, a trap  */
  3833. /*                   may result.                                     */
  3834. /*                                                                   */
  3835. /*   Side Effects:  A volume may be expanded.  If the volume is      */
  3836. /*                  expanded using another volume, the partitions    */
  3837. /*                  on the second volume will be linked to those of  */
  3838. /*                  the first volume and all data on the second      */
  3839. /*                  volume will be lost.                             */
  3840. /*                                                                   */
  3841. /*   Notes:  None.                                                   */
  3842. /*                                                                   */
  3843. /*********************************************************************/
  3844. void _Far16 _Pascal _loadds EXPAND_VOLUME16 ( CARDINAL32               Volume_Handle,
  3845. CARDINAL32               Partition_Count,
  3846. CARDINAL32    * _Seg16   Partition_Handles,
  3847. CARDINAL32 * _Seg16      Error_Code
  3848. );
  3849.  
  3850. /*********************************************************************/
  3851. /*                                                                   */
  3852. /*   Function Name: Assign_Drive_Letter16                            */
  3853. /*                                                                   */
  3854. /*   Descriptive Name: Assigns a drive letter to a volume.           */
  3855. /*                                                                   */
  3856. /*   Input: CARDINAL32 Volume_Handle - The handle of the volume which*/
  3857. /*                                  is to have its assigned drive    */
  3858. /*                                  letter changed.                  */
  3859. /*          char  New_Drive_Preference - The new drive letter to     */
  3860. /*                                       assign to the volume.       */
  3861. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3862. /*                                    in which to store an error code*/
  3863. /*                                    should an error occur.         */
  3864. /*                                                                   */
  3865. /*   Output: *Error_Code will be 0 if the drive letter was assigned  */
  3866. /*           successfully; otherwise *Error_Code will be > 0.        */
  3867. /*                                                                   */
  3868. /*   Error Handling: If the drive letter assignment can not be made, */
  3869. /*                   the volume will not be altered.                 */
  3870. /*                                                                   */
  3871. /*                   If Volume_Handle is not a valid handle, a trap  */
  3872. /*                   may result.                                     */
  3873. /*                                                                   */
  3874. /*                   If Volume_Handle is a partition or drive handle,*/
  3875. /*                   then this function will abort and set           */
  3876. /*                   *Error_Code to a non-zero value.                */
  3877. /*                                                                   */
  3878. /*   Side Effects:  A volume may have its drive letter assignment    */
  3879. /*                  changed.                                         */
  3880. /*                                                                   */
  3881. /*   Notes:  If the drive letter being assigned is already in use by */
  3882. /*           volume which does not lie on removable media, then the  */
  3883. /*           drive assignment will NOT be made.                      */
  3884. /*                                                                   */
  3885. /*********************************************************************/
  3886. void _Far16 _Pascal _loadds ASSIGN_DRIVE_LETTER16( CARDINAL32          Volume_Handle,
  3887. char                New_Drive_Preference,
  3888. CARDINAL32 * _Seg16 Error_Code
  3889. );
  3890.  
  3891. /*********************************************************************/
  3892. /*                                                                   */
  3893. /*   Function Name: Set_Installable16                                */
  3894. /*                                                                   */
  3895. /*   Descriptive Name: Marks a volume as being the volume to install */
  3896. /*                     OS/2 on.                                      */
  3897. /*                                                                   */
  3898. /*   Input: CARDINAL32 Volume_Handle - The handle of the volume to   */
  3899. /*                                  which OS/2 should be installed.  */
  3900. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3901. /*                                    in which to store an error code*/
  3902. /*                                    should an error occur.         */
  3903. /*                                                                   */
  3904. /*   Output: If the volume is successfully marked as installable,    */
  3905. /*           *Error_Code will be 0; otherwise *Error_Code will       */
  3906. /*           be > 0.                                                 */
  3907. /*                                                                   */
  3908. /*   Error Handling: If Volume_Handle is not a valid handle, a trap  */
  3909. /*                   may result.                                     */
  3910. /*                                                                   */
  3911. /*                   If Volume_Handle is a partition or drive handle,*/
  3912. /*                   then this function will abort and set           */
  3913. /*                   *Error_Code to a non-zero value.                */
  3914. /*                                                                   */
  3915. /*   Side Effects:  The specified volume may be marked as            */
  3916. /*                  installable.                                     */
  3917. /*                                                                   */
  3918. /*   Notes:  None.                                                   */
  3919. /*                                                                   */
  3920. /*********************************************************************/
  3921. void _Far16 _Pascal _loadds SET_INSTALLABLE16 ( CARDINAL32          Volume_Handle,
  3922. CARDINAL32 * _Seg16 Error_Code
  3923. );
  3924.  
  3925. /*********************************************************************/
  3926. /*                                                                   */
  3927. /*   Function Name: Get_Installable_Volume16                         */
  3928. /*                                                                   */
  3929. /*   Descriptive Name: Marks a volume as being the volume to install */
  3930. /*                     OS/2 on.                                      */
  3931. /*                                                                   */
  3932. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3933. /*                                    in which to store an error code*/
  3934. /*                                    should an error occur.         */
  3935. /*                                                                   */
  3936. /*   Output: If a volume is mared installable, its information will  */
  3937. /*           be returned and *Error_Code will be LVM_ENGINE_NO_ERROR.*/
  3938. /*           If there is no volume marked installable, then          */
  3939. /*           *Error_Code will be > 0.                                */
  3940. /*                                                                   */
  3941. /*   Error Handling: An error code is returned if there is an error. */
  3942. /*                                                                   */
  3943. /*   Side Effects:  None.                                            */
  3944. /*                                                                   */
  3945. /*   Notes:  None.                                                   */
  3946. /*                                                                   */
  3947. /*********************************************************************/
  3948. void _Far16 _Pascal _loadds GET_INSTALLABLE_VOLUME16 ( Volume_Information_Record * _Seg16  Volume_Information,
  3949. CARDINAL32 *                _Seg16  Error_Code
  3950. );
  3951.  
  3952. /* ************************************************************************** *
  3953.  
  3954. 16 Bit Functions relating to Partitions, Drives, and Volumes.
  3955.  
  3956. ************************************************************************** */
  3957.  
  3958. /*********************************************************************/
  3959. /*                                                                   */
  3960. /*   Function Name: Set_Name16                                       */
  3961. /*                                                                   */
  3962. /*   Descriptive Name: Sets the name of a volume, drive, or partition*/
  3963. /*                                                                   */
  3964. /*   Input: CARDINAL32 Handle - The handle of the drive, partition,  */
  3965. /*                           or volume which is to have its name set.*/
  3966. /*          char New_Name[] - The new name for the drive/partition/  */
  3967. /*                            volume.                                */
  3968. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  3969. /*                                    in which to store an error code*/
  3970. /*                                    should an error occur.         */
  3971. /*                                                                   */
  3972. /*   Output: *Error_Code will be 0 if the name is set as specified.  */
  3973. /*           If the name can not be set, *Error_Code will be > 0.    */
  3974. /*                                                                   */
  3975. /*   Error Handling: If the name can not be set, then drive/volume/  */
  3976. /*                   partition is not modified.                      */
  3977. /*                                                                   */
  3978. /*                   If Handle is not a valid handle, a trap may     */
  3979. /*                   result.                                         */
  3980. /*                                                                   */
  3981. /*   Side Effects:  A drive/volume/partition may have its name set.  */
  3982. /*                                                                   */
  3983. /*   Notes:  None.                                                   */
  3984. /*                                                                   */
  3985. /*********************************************************************/
  3986. void _Far16 _Pascal _loadds SET_NAME16 ( CARDINAL32          Handle,
  3987. char       * _Seg16 New_Name,
  3988. CARDINAL32 * _Seg16 Error_Code
  3989. );
  3990.  
  3991. /*********************************************************************/
  3992. /*                                                                   */
  3993. /*   Function Name: SET_STARTABLE16                                  */
  3994. /*                                                                   */
  3995. /*   Descriptive Name: Sets the specified volume or partition        */
  3996. /*                     startable.  If a volume is specified, it must */
  3997. /*                     be a compatibility volume whose partition is  */
  3998. /*                     a primary partition on the first drive.  If a */
  3999. /*                     partition is specified, it must be a primary  */
  4000. /*                     partition on the first drive in the system.   */
  4001. /*                                                                   */
  4002. /*   Input: CARDINAL32 Handle - The handle of the partition or volume*/
  4003. /*                           which is to be set startable.           */
  4004. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4005. /*                                    in which to store an error code*/
  4006. /*                                    should an error occur.         */
  4007. /*                                                                   */
  4008. /*   Output: *Error_Code will be 0 if the specified volume or        */
  4009. /*           partition was set startable.                            */
  4010. /*           If the name can not be set, *Error_Code will be > 0.    */
  4011. /*                                                                   */
  4012. /*   Error Handling: If the volume or partition could not be set     */
  4013. /*                   startable, then nothing in the system is        */
  4014. /*                   changed.                                        */
  4015. /*                                                                   */
  4016. /*                   If Handle is not a valid handle, a trap may     */
  4017. /*                   result.                                         */
  4018. /*                                                                   */
  4019. /*   Side Effects:  Any other partition or volume which is marked    */
  4020. /*                  startable will have its startable flag cleared.  */
  4021. /*                                                                   */
  4022. /*   Notes:  None.                                                   */
  4023. /*                                                                   */
  4024. /*********************************************************************/
  4025. void  _Far16 _Pascal _loadds SET_STARTABLE16 ( CARDINAL32           Handle,
  4026. CARDINAL32 *  _Seg16 Error_Code
  4027. );
  4028.  
  4029. /*********************************************************************/
  4030. /*                                                                   */
  4031. /*   Function Name: Get_Valid_Options16                              */
  4032. /*                                                                   */
  4033. /*   Descriptive Name: Returns a bitmap where each bit in the bitmap */
  4034. /*                     corresponds to a possible operation that the  */
  4035. /*                     LVM Engine can perform.  Those bits which are */
  4036. /*                     1 represent operations which can be performed */
  4037. /*                     on the item specified by Handle.  Those bits  */
  4038. /*                     which are 0 are not allowed on the item       */
  4039. /*                     specified by Handle.                          */
  4040. /*                                                                   */
  4041. /*   Input: CARDINAL32 Handle - This is any valid drive, volume, or  */
  4042. /*                           partition handle.                       */
  4043. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4044. /*                                    in which to store an error code*/
  4045. /*                                    should an error occur.         */
  4046. /*                                                                   */
  4047. /*   Output:  A bitmap indicating which operations are valid on the  */
  4048. /*            item specified by Handle.                              */
  4049. /*                                                                   */
  4050. /*            If no errors occur, *Error_Code will be 0, otherwise   */
  4051. /*            *Error_Code will be > 0.                               */
  4052. /*                                                                   */
  4053. /*   Error Handling:  If Handle is not valid, a trap will be likely. */
  4054. /*                                                                   */
  4055. /*   Side Effects:  None.                                            */
  4056. /*                                                                   */
  4057. /*   Notes:  The values of the various bits in the bitmap returned   */
  4058. /*           by this function are defined near the beginning of this */
  4059. /*           file, immediately after all of the structure            */
  4060. /*           definitions.                                            */
  4061. /*                                                                   */
  4062. /*********************************************************************/
  4063. CARDINAL32 _Far16 _Pascal _loadds GET_VALID_OPTIONS16( CARDINAL32          Handle,
  4064. CARDINAL32 * _Seg16 Error_Code
  4065. );
  4066.  
  4067. /* ************************************************************************** *
  4068.  
  4069. 16 Bit Functions relating to Boot Manager
  4070.  
  4071. ************************************************************************** */
  4072.  
  4073. /*********************************************************************/
  4074. /*                                                                   */
  4075. /*   Function Name: BOOT_MANAGER_IS_INSTALLED16                      */
  4076. /*                                                                   */
  4077. /*   Descriptive Name: Indicates whether or not Boot Manager is      */
  4078. /*                     installed on the first or second hard drives  */
  4079. /*                     in the system.                                */
  4080. /*                                                                   */
  4081. /*   Input: BOOLEAN * Active - *Active is set to TRUE if LVM found an*/
  4082. /*                             active copy of Boot Manager on the    */
  4083. /*                             system.  If LVM could not find an     */
  4084. /*                             active copy of Boot Manager on the    */
  4085. /*                             system, but did find an inactive copy */
  4086. /*                             of Boot Manager, then *Active will be */
  4087. /*                             set to FALSE.                         */
  4088. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4089. /*                                    in which to store an error code*/
  4090. /*                                    should an error occur.         */
  4091. /*                                                                   */
  4092. /*   Output: TRUE is returned if Boot Manager is found.  If this     */
  4093. /*           copy of Boot Manager is Active, then *Active will be set*/
  4094. /*           to TRUE.  If the copy of Boot Manager is not currently  */
  4095. /*           active, then *Active will be set to FALSE.              */
  4096. /*                                                                   */
  4097. /*           FALSE is returned if Boot Manager is not found or if an */
  4098. /*           error occurs.  In this case, *Active is undefined.      */
  4099. /*                                                                   */
  4100. /*           *Error_Code will be 0 if no errors occur; otherwise it  */
  4101. /*           will be > 0.                                            */
  4102. /*                                                                   */
  4103. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  4104. /*                                                                   */
  4105. /*   Side Effects:  None.                                            */
  4106. /*                                                                   */
  4107. /*   Notes:  None.                                                   */
  4108. /*                                                                   */
  4109. /*********************************************************************/
  4110. BOOLEAN _Far16 _Pascal _loadds BOOT_MANAGER_IS_INSTALLED16( BOOLEAN * _Seg16 Active, CARDINAL32 * _Seg16 Error_Code);
  4111.  
  4112. /*********************************************************************/
  4113. /*                                                                   */
  4114. /*   Function Name: GET_BOOT_MANAGER_HANDLE16                        */
  4115. /*                                                                   */
  4116. /*   Descriptive Name: Returns the handle of the partition containing*/
  4117. /*                     Boot Manager.                                 */
  4118. /*                                                                   */
  4119. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4120. /*                                    in which to store an error code*/
  4121. /*                                    should an error occur.         */
  4122. /*                                                                   */
  4123. /*   Output: If Boot Manager is NOT installed, NULL is returned.     */
  4124. /*           If Boot Manager is installed, whether it is active or   */
  4125. /*           not, the handle of the partition it resides in is       */
  4126. /*           returned.                                               */
  4127. /*                                                                   */
  4128. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  4129. /*                                                                   */
  4130. /*   Side Effects:  None.                                            */
  4131. /*                                                                   */
  4132. /*   Notes:                                                          */
  4133. /*                                                                   */
  4134. /*********************************************************************/
  4135. ADDRESS _Far16 _Pascal _loadds GET_BOOT_MANAGER_HANDLE16( CARDINAL32 * _Seg16 Error_Code);
  4136.  
  4137. /*********************************************************************/
  4138. /*                                                                   */
  4139. /*   Function Name: Add_To_Boot_Manager16                            */
  4140. /*                                                                   */
  4141. /*   Descriptive Name: Adds the volume/partition to the Boot Manager */
  4142. /*                     menu.                                         */
  4143. /*                                                                   */
  4144. /*   Input: CARDINAL32 Handle - The handle of a partition or volume  */
  4145. /*                      that is to be added to the Boot Manager menu.*/
  4146. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4147. /*                                    in which to store an error code*/
  4148. /*                                    should an error occur.         */
  4149. /*                                                                   */
  4150. /*   Output: *Error_Code will be 0 if the partition or volume was    */
  4151. /*           successfully added to the Boot Manager menu; otherwise  */
  4152. /*           *Error_Code will be > 0.                                */
  4153. /*                                                                   */
  4154. /*   Error Handling: If the partition/volume can not be added to the */
  4155. /*                   Boot Manager menu, no action is taken and       */
  4156. /*                   *Error_Code will contain a non-zero error code. */
  4157. /*                                                                   */
  4158. /*                   If Handle is not a valid handle, a trap may     */
  4159. /*                   result.                                         */
  4160. /*                                                                   */
  4161. /*                   If Handle represents a drive, then this function*/
  4162. /*                   will abort and set *Error_Code to a non-zero    */
  4163. /*                   value.                                          */
  4164. /*                                                                   */
  4165. /*   Side Effects:  The Boot Manager menu may be altered.            */
  4166. /*                                                                   */
  4167. /*   Notes:  None.                                                   */
  4168. /*                                                                   */
  4169. /*********************************************************************/
  4170. void _Far16 _Pascal _loadds ADD_TO_BOOT_MANAGER16 ( CARDINAL32 Handle, CARDINAL32 * _Seg16 Error_Code );
  4171.  
  4172. /*********************************************************************/
  4173. /*                                                                   */
  4174. /*   Function Name: Remove_From_Boot_Manager16                       */
  4175. /*                                                                   */
  4176. /*   Descriptive Name: Removes the specified partition or volume     */
  4177. /*                     from the Boot Manager menu.                   */
  4178. /*                                                                   */
  4179. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4180. /*                                    in which to store an error code*/
  4181. /*                                    should an error occur.         */
  4182. /*                                                                   */
  4183. /*                                                                   */
  4184. /*   Output: *Error_Code will be 0 if the partition or volume was    */
  4185. /*           successfully removed to the Boot Manager menu;          */
  4186. /*           otherwise *Error_Code will be > 0.                      */
  4187. /*                                                                   */
  4188. /*   Error Handling: If Handle is not a valid handle, a trap may     */
  4189. /*                   result.                                         */
  4190. /*                                                                   */
  4191. /*                   If Handle represents a drive, or if Handle      */
  4192. /*                   represents a volume or partition which is NOT on*/
  4193. /*                   the boot manager menu, then this function       */
  4194. /*                   will abort and set *Error_Code to a non-zero    */
  4195. /*                   value.                                          */
  4196. /*                                                                   */
  4197. /*   Side Effects:  The Boot Manager menu may be altered.            */
  4198. /*                                                                   */
  4199. /*   Notes:  None.                                                   */
  4200. /*                                                                   */
  4201. /*********************************************************************/
  4202. void _Far16 _Pascal _loadds REMOVE_FROM_BOOT_MANAGER16 ( CARDINAL32 Handle, CARDINAL32 * _Seg16 Error_Code );
  4203.  
  4204. /*********************************************************************/
  4205. /*                                                                   */
  4206. /*   Function Name: Get_Boot_Manager_Menu16                          */
  4207. /*                                                                   */
  4208. /*   Descriptive Name: Returns an array containing the handles of the*/
  4209. /*                     partitions and volumes appearing on the       */
  4210. /*                     Boot Manager menu.                            */
  4211. /*                                                                   */
  4212. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4213. /*                                    in which to store an error code*/
  4214. /*                                    should an error occur.         */
  4215. /*                                                                   */
  4216. /*   Output: The function returns a Boot_Manager_Menu structure.     */
  4217. /*           This structure contains two items: a pointer to an array*/
  4218. /*           of Boot_Manager_Menu_Items and a count of how many items*/
  4219. /*           are in the array.  Each Boot_Manager_Menu_Item contains */
  4220. /*           a handle and a BOOLEAN variable to indicate whether the */
  4221. /*           handle is for a partition or a volume.                  */
  4222. /*                                                                   */
  4223. /*           If this function is successful, then *Error_Code will   */
  4224. /*           be 0.                                                   */
  4225. /*                                                                   */
  4226. /*           If an error occurs, the Count field in the              */
  4227. /*           Boot_Manager_Menu will be 0 and the corresponding       */
  4228. /*           pointer will be NULL.  *Error_Code will be > 0.         */
  4229. /*                                                                   */
  4230. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  4231. /*                   any memory allocated by this function will be   */
  4232. /*                   freed.                                          */
  4233. /*                                                                   */
  4234. /*   Side Effects:  None.                                            */
  4235. /*                                                                   */
  4236. /*   Notes:  None.                                                   */
  4237. /*                                                                   */
  4238. /*********************************************************************/
  4239. void _Far16 _Pascal _loadds GET_BOOT_MANAGER_MENU16 ( Boot_Manager_Menu_Item * _Seg16 * _Seg16 Menu_Items,
  4240. CARDINAL32 *                      _Seg16 Count,
  4241. CARDINAL32 *                      _Seg16 Error_Code
  4242. );
  4243.  
  4244. /*********************************************************************/
  4245. /*                                                                   */
  4246. /*   Function Name: Install_Boot_Manager16                           */
  4247. /*                                                                   */
  4248. /*   Descriptive Name: This function installs Boot Manager.  It can  */
  4249. /*                     be used to replace an existing Boot Manager   */
  4250. /*                     as well.                                      */
  4251. /*                                                                   */
  4252. /*   Input: CARDINAL32  Drive_Number - The number of the drive to    */
  4253. /*                                     install Boot Manager on.  Must*/
  4254. /*                                     be 1 or 2.                    */
  4255. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4256. /*                                    in which to store an error code*/
  4257. /*                                    should an error occur.         */
  4258. /*                                                                   */
  4259. /*   Output: If this function is successful, then *Error_Code will be*/
  4260. /*           0; otherwise it will be > 0.                            */
  4261. /*                                                                   */
  4262. /*   Error Handling: If an error occurs, *Error_Code will be set to a*/
  4263. /*                   non-zero value.  Depending upon the error, it   */
  4264. /*                   is possible that the Boot Manager partition can */
  4265. /*                   be left in an unusuable state (such as for a    */
  4266. /*                   write error).                                   */
  4267. /*                                                                   */
  4268. /*   Side Effects: Boot Manager may be installed on drive 1 or 2.    */
  4269. /*                 The MBR for drive 1 may be altered.               */
  4270. /*                                                                   */
  4271. /*   Notes:  None.                                                   */
  4272. /*                                                                   */
  4273. /*********************************************************************/
  4274. void _Far16 _Pascal _loadds INSTALL_BOOT_MANAGER16 ( CARDINAL32   Drive_Number, CARDINAL32 * _Seg16 Error_Code );
  4275.  
  4276. /*********************************************************************/
  4277. /*                                                                   */
  4278. /*   Function Name: Remove_Boot_Manager16                            */
  4279. /*                                                                   */
  4280. /*   Descriptive Name: Removes Boot Manager from the system.         */
  4281. /*                                                                   */
  4282. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4283. /*                                    in which to store an error code*/
  4284. /*                                    should an error occur.         */
  4285. /*                                                                   */
  4286. /*   Output: *Error_Code will be 0 if Boot Manager was successfully  */
  4287. /*           removed from the system; otherwise *Error_Code will     */
  4288. /*           be 0.                                                   */
  4289. /*                                                                   */
  4290. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  4291. /*                                                                   */
  4292. /*   Side Effects:  Boot Manager will be removed from the system.    */
  4293. /*                                                                   */
  4294. /*   Notes:  None.                                                   */
  4295. /*                                                                   */
  4296. /*********************************************************************/
  4297. void _Far16 _Pascal _loadds REMOVE_BOOT_MANAGER16( CARDINAL32 * _Seg16 Error_Code );
  4298.  
  4299. /*********************************************************************/
  4300. /*                                                                   */
  4301. /*   Function Name: Set_Boot_Manager_Options16                       */
  4302. /*                                                                   */
  4303. /*   Descriptive Name: Sets the Boot Managers Options.  The options  */
  4304. /*                     that can be set are: whether or not the time- */
  4305. /*                     out timer is active, how long the timer-out   */
  4306. /*                     is, the partition to boot by default, and     */
  4307. /*                     whether or not Boot Manager should display its*/
  4308. /*                     menu using default mode or advanced mode.     */
  4309. /*                                                                   */
  4310. /*   Input: CARDINAL32 Handle - The handle of the partition or volume*/
  4311. /*                           to boot if the time-out timer is active */
  4312. /*                           and the time-out value is reached.      */
  4313. /*          BOOLEAN Timer_Active - If TRUE, then the time-out timer  */
  4314. /*                                 is active.                        */
  4315. /*          CARDINAL32 Time_Out_Value - If the time-out timer is     */
  4316. /*                                      active, this is the time-out */
  4317. /*                                      value, in seconds.           */
  4318. /*          BOOLEAN Advanced_Mode - If TRUE, then Boot Manager will  */
  4319. /*                                  operate in advanced mode.  If    */
  4320. /*                                  FALSE, then normal mode will be  */
  4321. /*                                  in effect.                       */
  4322. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4323. /*                                    in which to store an error code*/
  4324. /*                                    should an error occur.         */
  4325. /*                                                                   */
  4326. /*   Output: *Error_Code will be 0 if no errors occur.  If an error  */
  4327. /*           does occur, then *Error_Code will be > 0.               */
  4328. /*                                                                   */
  4329. /*   Error Handling: If an error occurs, no changes will be made to  */
  4330. /*                   Boot Manager and *Error_Code will be set a      */
  4331. /*                   non-zero error code.                            */
  4332. /*                                                                   */
  4333. /*   Side Effects:  Boot Manager may be modified.                    */
  4334. /*                                                                   */
  4335. /*   Notes:  None.                                                   */
  4336. /*                                                                   */
  4337. /*********************************************************************/
  4338. void _Far16 _Pascal _loadds SET_BOOT_MANAGER_OPTIONS16( CARDINAL32             Handle,
  4339. BOOLEAN             Timer_Active,
  4340. CARDINAL32          Time_Out_Value,
  4341. BOOLEAN             Advanced_Mode,
  4342. CARDINAL32 * _Seg16 Error_Code
  4343. );
  4344.  
  4345. /*********************************************************************/
  4346. /*                                                                   */
  4347. /*   Function Name: Get_Boot_Manager_Options16                       */
  4348. /*                                                                   */
  4349. /*   Descriptive Name: This function returns the current Boot Manager*/
  4350. /*                     settings for the various Boot Manager options.*/
  4351. /*                                                                   */
  4352. /*   Input: CARDINAL32 * Handle - The handle for the default boot    */
  4353. /*                             volume or partition.                  */
  4354. /*          BOOLEAN * Handle_Is_Volume - If TRUE, then Handle        */
  4355. /*                                       represents a volume.  If    */
  4356. /*                                       FALSE, then Handle          */
  4357. /*                                       represents a partition.     */
  4358. /*          BOOLEAN * Timer_Active - If TRUE, then the time-out timer*/
  4359. /*                                   is active.  If FALSE, then the  */
  4360. /*                                   time-out timer is not active.   */
  4361. /*          CARDINAL32 * Time_Out_Value - If the time-out timer is   */
  4362. /*                                        active, then this is the   */
  4363. /*                                        number of seconds that Boot*/
  4364. /*                                        Manager will wait for user */
  4365. /*                                        input before booting the   */
  4366. /*                                        default volume/partition.  */
  4367. /*          BOOLEAN * Advanced_Mode - If TRUE, the Boot Manager is   */
  4368. /*                                    operating in advanced mode.  If*/
  4369. /*                                    FALSE, then Boot Manager is    */
  4370. /*                                    operating in normal mode.      */
  4371. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4372. /*                                    in which to store an error code*/
  4373. /*                                    should an error occur.         */
  4374. /*                                                                   */
  4375. /*   Output: *Handle, *Handle_Is_Volume, *Timer_Active,              */
  4376. /*           *Time_out_value, *Advanced_Mode, and *Error_Code are all*/
  4377. /*           set by this function.  If there are no errors, then     */
  4378. /*           *Error_Code will be set to 0.  If any errors occur, then*/
  4379. /*           *Error_Code will be > 0.                                */
  4380. /*                                                                   */
  4381. /*   Error Handling: If any of the parameters are invalid, then a    */
  4382. /*                   trap is likely.  If Boot Manager is not         */
  4383. /*                   installed, then *Error_Code will be > 0.        */
  4384. /*                                                                   */
  4385. /*   Side Effects:  None.                                            */
  4386. /*                                                                   */
  4387. /*   Notes:  None.                                                   */
  4388. /*                                                                   */
  4389. /*********************************************************************/
  4390. void _Far16 _Pascal _loadds GET_BOOT_MANAGER_OPTIONS16( CARDINAL32 * _Seg16 Handle,
  4391. BOOLEAN    * _Seg16 Handle_Is_Volume,
  4392. BOOLEAN    * _Seg16 Timer_Active,
  4393. CARDINAL32 * _Seg16 Time_Out_Value,
  4394. BOOLEAN    * _Seg16 Advanced_Mode,
  4395. CARDINAL32 * _Seg16 Error_Code
  4396. );
  4397.  
  4398. /* ************************************************************************** *
  4399.  
  4400. Other 16 Bit Functions
  4401.  
  4402. ************************************************************************** */
  4403.  
  4404. /*********************************************************************/
  4405. /*                                                                   */
  4406. /*   Function Name:  Free_Engine_Memory16                            */
  4407. /*                                                                   */
  4408. /*   Descriptive Name: Frees a memory object created by LVM.DLL and  */
  4409. /*                     returned to a user of LVM.DLL.                */
  4410. /*                                                                   */
  4411. /*   Input: ADDRESS Object : The address of the memory object to     */
  4412. /*                           free.  This could be the                */
  4413. /*                           Drive_Control_Data field of a           */
  4414. /*                           Drive_Control_Record, the               */
  4415. /*                           Partition_Array field of a              */
  4416. /*                           Partition_Information_Array structure,  */
  4417. /*                           or any other dynamically allocated      */
  4418. /*                           memory object created by LVM.DLL and    */
  4419. /*                           returned by a function in LVM.DLL.      */
  4420. /*                                                                   */
  4421. /*   Output: None.                                                   */
  4422. /*                                                                   */
  4423. /*   Error Handling: None.                                           */
  4424. /*                                                                   */
  4425. /*   Side Effects:  None.                                            */
  4426. /*                                                                   */
  4427. /*   Notes:  A trap or exception could occur if a bad address is     */
  4428. /*           passed into this function.                              */
  4429. /*                                                                   */
  4430. /*********************************************************************/
  4431. void _Far16 _Pascal _loadds FREE_ENGINE_MEMORY16( ADDRESS _Seg16 Object );
  4432.  
  4433. /*********************************************************************/
  4434. /*                                                                   */
  4435. /*   Function Name: New_MBR16                                        */
  4436. /*                                                                   */
  4437. /*   Descriptive Name: This function lays down a new MBR on the      */
  4438. /*                     specified drive.                              */
  4439. /*                                                                   */
  4440. /*   Input: CARDINAL32 Drive_Handle - The handle of the drive on     */
  4441. /*                                 which the new MBR is to be placed.*/
  4442. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4443. /*                                    in which to store an error code*/
  4444. /*                                    should an error occur.         */
  4445. /*                                                                   */
  4446. /*   Output: *Error_Code will be 0 if the new MBR was successfully   */
  4447. /*           placed on the specified drive.  If the operation failed */
  4448. /*           for any reason, then *Error_Code will contain a non-zero*/
  4449. /*           error code.                                             */
  4450. /*                                                                   */
  4451. /*   Error Handling: If an error occurs, then the existing MBR is not*/
  4452. /*                   altered and *Error_Code will be > 0.            */
  4453. /*                                                                   */
  4454. /*   Side Effects:  A new MBR may be placed on the specified drive.  */
  4455. /*                                                                   */
  4456. /*   Notes:  None.                                                   */
  4457. /*                                                                   */
  4458. /*********************************************************************/
  4459. void _Far16 _Pascal _loadds NEW_MBR16( CARDINAL32 Drive_Handle, CARDINAL32 * _Seg16 Error_Code );
  4460.  
  4461. /*********************************************************************/
  4462. /*                                                                   */
  4463. /*   Function Name: Get_Available_Drive_Letters16                    */
  4464. /*                                                                   */
  4465. /*   Descriptive Name: This function returns a bitmap indicating     */
  4466. /*                     which drive letters are available for use.    */
  4467. /*                                                                   */
  4468. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4469. /*                                    in which to store an error code*/
  4470. /*                                    should an error occur.         */
  4471. /*                                                                   */
  4472. /*   Output: This function returns a bitmap of the available drive   */
  4473. /*           letters.  If this function is successful, then          */
  4474. /*           *Error_Code will be set to 0.  Otherwise, *Error_Code   */
  4475. /*           will be > 0 and the bitmap returned will have all bits  */
  4476. /*           set to 0.                                               */
  4477. /*                                                                   */
  4478. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  4479. /*                                                                   */
  4480. /*   Side Effects:  None.                                            */
  4481. /*                                                                   */
  4482. /*   Notes:  A drive letter is available if it is not associated     */
  4483. /*           with a volume located on a disk drive controlled        */
  4484. /*           by OS2DASD.                                             */
  4485. /*                                                                   */
  4486. /*********************************************************************/
  4487. CARDINAL32 _Far16 _Pascal _loadds GET_AVAILABLE_DRIVE_LETTERS16 ( CARDINAL32 * _Seg16 Error_Code ) ;
  4488.  
  4489. /*********************************************************************/
  4490. /*                                                                   */
  4491. /*   Function Name: GET_RESERVED_DRIVE_LETTERS16                     */
  4492. /*                                                                   */
  4493. /*   Descriptive Name: This function returns a bitmap indicating     */
  4494. /*                     which drive letters are reserved for use by   */
  4495. /*                     devices NOT under the control of LVM.         */
  4496. /*                                                                   */
  4497. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4498. /*                                    in which to store an error code*/
  4499. /*                                    should an error occur.         */
  4500. /*                                                                   */
  4501. /*   Output: This function returns a bitmap of the drive letters     */
  4502. /*           which are being used by devices which are NOT controlled*/
  4503. /*           by LVM.  While a Volume CAN be assigned a drive letter  */
  4504. /*           from this list, a reboot will almost always be required */
  4505. /*           in order for the assignment to take place.              */
  4506. /*           If this function is successful, then *Error_Code will be*/
  4507. /*           set to 0.  Otherwise, *Error_Code will be > 0 and the   */
  4508. /*           bitmap returned will have all bits set to 0.            */
  4509. /*                                                                   */
  4510. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  4511. /*                                                                   */
  4512. /*   Side Effects:  None.                                            */
  4513. /*                                                                   */
  4514. /*   Notes:  Devices which are assigned drive letters but which are  */
  4515. /*           NOT under LVM control include:  CD-ROM, Network drives, */
  4516. /*           parallel port attached devices, and any DASD devices    */
  4517. /*           not controlled by OS2DASD.                              */
  4518. /*                                                                   */
  4519. /*********************************************************************/
  4520. CARDINAL32 _Far16 _Pascal _loadds GET_RESERVED_DRIVE_LETTERS16 ( CARDINAL32 *  _Seg16 Error_Code ) ;
  4521.  
  4522. /*********************************************************************/
  4523. /*                                                                   */
  4524. /*   Function Name: Reboot_Required16                                */
  4525. /*                                                                   */
  4526. /*   Descriptive Name: This function indicates whether or not any    */
  4527. /*                     changes were made to the partitioning of the  */
  4528. /*                     disks in the system which would require a     */
  4529. /*                     reboot to make functional.                    */
  4530. /*                                                                   */
  4531. /*   Input: None.                                                    */
  4532. /*                                                                   */
  4533. /*   Output: The function return value will be TRUE if the system    */
  4534. /*           must be rebooted as a result of disk partitioning       */
  4535. /*           changes.                                                */
  4536. /*                                                                   */
  4537. /*   Error Handling: None required.                                  */
  4538. /*                                                                   */
  4539. /*   Side Effects:  None.                                            */
  4540. /*                                                                   */
  4541. /*   Notes:  None.                                                   */
  4542. /*                                                                   */
  4543. /*********************************************************************/
  4544. BOOLEAN _Far16 _Pascal _loadds REBOOT_REQUIRED16 ( void );
  4545.  
  4546. /*********************************************************************/
  4547. /*                                                                   */
  4548. /*   Function Name: CHANGES_PENDING16                                */
  4549. /*                                                                   */
  4550. /*   Descriptive Name: This function indicates whether or not any    */
  4551. /*                     changes were made to the partitioning of the  */
  4552. /*                     disks in the system which have not yet been   */
  4553. /*                     comitted to disk.                             */
  4554. /*                                                                   */
  4555. /*   Input: None.                                                    */
  4556. /*                                                                   */
  4557. /*   Output: The function return value will be TRUE if there are     */
  4558. /*           uncomitted changes to the partitioning of one or more of*/
  4559. /*           the drives in the system.                               */
  4560. /*                                                                   */
  4561. /*   Error Handling: None required.                                  */
  4562. /*                                                                   */
  4563. /*   Side Effects:  None.                                            */
  4564. /*                                                                   */
  4565. /*   Notes:  None.                                                   */
  4566. /*                                                                   */
  4567. /*********************************************************************/
  4568. BOOLEAN _Far16 _Pascal _loadds CHANGES_PENDING16 ( void );
  4569.  
  4570. /*********************************************************************/
  4571. /*                                                                   */
  4572. /*   Function Name: Set_Reboot_Flag16                                */
  4573. /*                                                                   */
  4574. /*   Descriptive Name: This function sets the Reboot Flag.  The      */
  4575. /*                     Reboot Flag is a special flag on the boot     */
  4576. /*                     disk used by the install program to keep      */
  4577. /*                     track of whether or not the system was just   */
  4578. /*                     rebooted.  It is used by the various phases   */
  4579. /*                     of install.                                   */
  4580. /*                                                                   */
  4581. /*   Input: BOOLEAN Reboot - The new value for the Reboot Flag.  If  */
  4582. /*                           TRUE, then the reboot flag will be set. */
  4583. /*                           If FALSE, then the reboot flag will be  */
  4584. /*                           cleared.                                */
  4585. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4586. /*                                    in which to store an error code*/
  4587. /*                                    should an error occur.         */
  4588. /*                                                                   */
  4589. /*   Output: *Error_Code will be set to 0 if there are no errors.    */
  4590. /*           *Error_Code will be > 0 if an error occurs.             */
  4591. /*                                                                   */
  4592. /*   Error Handling: If an error occurs, then the value of the Reboot*/
  4593. /*                   Flag will be unchanged.                         */
  4594. /*                                                                   */
  4595. /*   Side Effects:  The value of the Reboot Flag may be changed.     */
  4596. /*                                                                   */
  4597. /*   Notes:  None.                                                   */
  4598. /*                                                                   */
  4599. /*********************************************************************/
  4600. void _Far16 _Pascal _loadds SET_REBOOT_FLAG16( BOOLEAN Reboot, CARDINAL32 * _Seg16 Error_Code );
  4601.  
  4602. /*********************************************************************/
  4603. /*                                                                   */
  4604. /*   Function Name: Get_Reboot_Flag16                                */
  4605. /*                                                                   */
  4606. /*   Descriptive Name: This function returns the value of the Reboot */
  4607. /*                     Flag.  The Reboot Flag is a special flag on   */
  4608. /*                     the boot disk used by the install program to  */
  4609. /*                     keep track of whether or not the system was   */
  4610. /*                     just rebooted.  It is used by the various     */
  4611. /*                     phases of install.                            */
  4612. /*                                                                   */
  4613. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4614. /*                                    in which to store an error code*/
  4615. /*                                    should an error occur.         */
  4616. /*                                                                   */
  4617. /*   Output: The function return value will be TRUE if no errors     */
  4618. /*           occur and the Reboot Flag is set.  *Error_Code will be  */
  4619. /*           0 under these conditions.  If an error occurs, the      */
  4620. /*           function return value will be FALSE and *Error_Code     */
  4621. /*           will be > 0.                                            */
  4622. /*                                                                   */
  4623. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  4624. /*                   The value of the reboot flag will be unchanged. */
  4625. /*                                                                   */
  4626. /*   Side Effects:  None.                                            */
  4627. /*                                                                   */
  4628. /*   Notes:  None.                                                   */
  4629. /*                                                                   */
  4630. /*********************************************************************/
  4631. BOOLEAN _Far16 _Pascal _loadds GET_REBOOT_FLAG16( CARDINAL32 * _Seg16 Error_Code );
  4632.  
  4633. /*********************************************************************/
  4634. /*                                                                   */
  4635. /*                                                                   */
  4636. /*   Function Name: Set_Install_Flags16                              */
  4637. /*                                                                   */
  4638. /*   Descriptive Name: This function sets the value of the Install   */
  4639. /*                     Flags.  The Install Flags reside in a 32 bit  */
  4640. /*                     field in the LVM dataspace.  These flags are  */
  4641. /*                     not used by LVM, thereby leaving Install free */
  4642. /*                     to use them for whatever it wants.            */
  4643. /*                                                                   */
  4644. /*   Input: CARDINAL32 Install_Flags - The new value for the Install */
  4645. /*                                     Flags.                        */
  4646. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4647. /*                                    in which to store an error code*/
  4648. /*                                    should an error occur.         */
  4649. /*                                                                   */
  4650. /*   Output: *Error_Code will be set to 0 if there are no errors.    */
  4651. /*           *Error_Code will be > 0 if an error occurs.             */
  4652. /*                                                                   */
  4653. /*   Error Handling: If an error occurs, then the value of the       */
  4654. /*                   Install Flags will be unchanged.                */
  4655. /*                                                                   */
  4656. /*   Side Effects:  The value of the Install Flags may be changed.   */
  4657. /*                                                                   */
  4658. /*   Notes:  None.                                                   */
  4659. /*                                                                   */
  4660. /*********************************************************************/
  4661. void _Far16 _Pascal _loadds Set_Install_Flags16( CARDINAL32 Install_Flags, CARDINAL32 * _Seg16 Error_Code );
  4662.  
  4663. /*********************************************************************/
  4664. /*                                                                   */
  4665. /*   Function Name: Get_Install_Flags16                              */
  4666. /*                                                                   */
  4667. /*   Descriptive Name: This function returns the value of the Install*/
  4668. /*                     Flags.  The Install Flags reside in a 32 bit  */
  4669. /*                     field in the LVM dataspace.  These flags are  */
  4670. /*                     not used by LVM, thereby leaving Install free */
  4671. /*                     to use them for whatever it wants.            */
  4672. /*                                                                   */
  4673. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4674. /*                                    in which to store an error code*/
  4675. /*                                    should an error occur.         */
  4676. /*                                                                   */
  4677. /*   Output: The function returns the current value of the Install   */
  4678. /*           Flags stored in the LVM Dataspace.                      */
  4679. /*           *Error_Code will be LVM_ENGINE_NO_ERROR if the function */
  4680. /*           is successful.  If an error occurs, the function will   */
  4681. /*           return 0 and *Error_Code will be > 0.                   */
  4682. /*                                                                   */
  4683. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  4684. /*                                                                   */
  4685. /*   Side Effects:  None.                                            */
  4686. /*                                                                   */
  4687. /*   Notes:  None.                                                   */
  4688. /*                                                                   */
  4689. /*********************************************************************/
  4690. void _Far16 _Pascal _loadds Get_Install_Flags16( CARDINAL32 * _Seg16 Install_Flags, CARDINAL32 * _Seg16 Error_Code );
  4691.  
  4692. /*********************************************************************/
  4693. /*                                                                   */
  4694. /*   Function Name: Set_Min_Install_Size16                           */
  4695. /*                                                                   */
  4696. /*   Descriptive Name: This function tells the LVM Engine how big a  */
  4697. /*                     partition/volume must be in order for it to   */
  4698. /*                     marked installable.  If this function is not  */
  4699. /*                     used to set the minimum size for an           */
  4700. /*                     installable partition/volume, the LVM Engine  */
  4701. /*                     will use a default value of 300 MB.           */
  4702. /*                                                                   */
  4703. /*   Input: CARDINAL32 Min_Sectors - The minimum size, in sectors,   */
  4704. /*                                   that a partition must be in     */
  4705. /*                                   order for it to be marked as    */
  4706. /*                                   installable.                    */
  4707. /*                                                                   */
  4708. /*   Output: None.                                                   */
  4709. /*                                                                   */
  4710. /*   Error Handling: None required.                                  */
  4711. /*                                                                   */
  4712. /*   Side Effects:  None.                                            */
  4713. /*                                                                   */
  4714. /*   Notes:  None.                                                   */
  4715. /*                                                                   */
  4716. /*********************************************************************/
  4717. void _Far16 _Pascal _loadds SET_MIN_INSTALL_SIZE16 ( CARDINAL32  Min_Sectors );
  4718.  
  4719. /*********************************************************************/
  4720. /*                                                                   */
  4721. /*   Function Name: SET_FREE_SPACE_THRESHOLD16                       */
  4722. /*                                                                   */
  4723. /*   Descriptive Name: This function tells the LVM Engine not to     */
  4724. /*                     report blocks of free space which are less    */
  4725. /*                     than the size specified.  The engine defaults */
  4726. /*                     to not reporting blocks of free space which   */
  4727. /*                     are smaller than 2048 sectors (1 MB).         */
  4728. /*                                                                   */
  4729. /*   Input: CARDINAL32 Min_Sectors - The minimum size, in sectors,   */
  4730. /*                                   that a block of free space must */
  4731. /*                                   be in order for the LVM engine  */
  4732. /*                                   to report it.                   */
  4733. /*                                                                   */
  4734. /*   Output: None.                                                   */
  4735. /*                                                                   */
  4736. /*   Error Handling: None required.                                  */
  4737. /*                                                                   */
  4738. /*   Side Effects:  None.                                            */
  4739. /*                                                                   */
  4740. /*   Notes:  None.                                                   */
  4741. /*                                                                   */
  4742. /*********************************************************************/
  4743. void _Far16 _Pascal _loadds SET_FREE_SPACE_THRESHOLD16( CARDINAL32  Min_Sectors );
  4744.  
  4745. /*********************************************************************/
  4746. /*                                                                   */
  4747. /*   Function Name: READ_SECTORS16                                   */
  4748. /*                                                                   */
  4749. /*   Descriptive Name: This function reads one or more sectors from  */
  4750. /*                     the specified drive and places the data read  */
  4751. /*                     in Buffer.                                    */
  4752. /*                                                                   */
  4753. /*   Input: CARDINAL32 Drive_Number : The number of the hard drive to*/
  4754. /*                                    read from.  The drives in the  */
  4755. /*                                    system are numbered from 1 to  */
  4756. /*                                    n, where n is the total number */
  4757. /*                                    of hard drives in the system.  */
  4758. /*          LBA Starting_Sector : The first sector to read from.     */
  4759. /*          CARDINAL32 Sectors_To_Read : The number of sectors to    */
  4760. /*                                       read into memory.           */
  4761. /*          ADDRESS Buffer : The location to put the data read into. */
  4762. /*          CARDINAL32 * Error : The address of a variable to hold   */
  4763. /*                               the error return code.              */
  4764. /*                                                                   */
  4765. /*   Output: If Successful, then the data read will be placed in     */
  4766. /*              memory starting at Buffer, and *Error will be        */
  4767. /*              LVM_ENGINE_NO_ERROR.                                 */
  4768. /*           If Unsuccessful, then *Error will be > 0 and the        */
  4769. /*              contents of memory starting at Buffer is undefined.  */
  4770. /*                                                                   */
  4771. /*   Error Handling: *Error will be > 0 if an error occurs.          */
  4772. /*                                                                   */
  4773. /*   Side Effects: Data may be read into memory starting at Buffer.  */
  4774. /*                                                                   */
  4775. /*   Notes:  None.                                                   */
  4776. /*                                                                   */
  4777. /*********************************************************************/
  4778. void _Far16 _Pascal _loadds READ_SECTORS16 ( CARDINAL32          Drive_Number,
  4779. LBA                 Starting_Sector,
  4780. CARDINAL32          Sectors_To_Read,
  4781. ADDRESS      _Seg16 Buffer,
  4782. CARDINAL32 * _Seg16 Error);
  4783.  
  4784. /*********************************************************************/
  4785. /*                                                                   */
  4786. /*   Function Name: WRITE_SECTORS16                                  */
  4787. /*                                                                   */
  4788. /*   Descriptive Name: This function writes data from memory to one  */
  4789. /*                     or more sectors on the specified drive.       */
  4790. /*                                                                   */
  4791. /*   Input: CARDINAL32 Drive_Number : The number of the hard drive to*/
  4792. /*                                    write to.  The drives in the   */
  4793. /*                                    system are numbered from 1 to  */
  4794. /*                                    n, where n is the total number */
  4795. /*                                    of hard drives in the system.  */
  4796. /*          LBA Starting_Sector : The first sector to write to.      */
  4797. /*          CARDINAL32 Sectors_To_Read : The number of sectors to    */
  4798. /*                                       be written.                 */
  4799. /*          ADDRESS Buffer : The location of the data to be written  */
  4800. /*                           to disk.                                */
  4801. /*          CARDINAL32 * Error : The address of a variable to hold   */
  4802. /*                               the error return code.              */
  4803. /*                                                                   */
  4804. /*   Output: If Successful, then the data at Buffer will be placed   */
  4805. /*              on the disk starting at the sector specified, and    */
  4806. /*              *Error will be LVM_ENGINE_NO_ERROR.                  */
  4807. /*           If Unsuccessful, then *Error will be > 0 and the        */
  4808. /*              contents of the disk starting at sector              */
  4809. /*              Starting_Sector is undefined.                        */
  4810. /*                                                                   */
  4811. /*   Error Handling: *Error will be > 0 if an error occurs.          */
  4812. /*                                                                   */
  4813. /*   Side Effects: Data may be written to disk.                      */
  4814. /*                                                                   */
  4815. /*   Notes:  None.                                                   */
  4816. /*                                                                   */
  4817. /*********************************************************************/
  4818. void _Far16 _Pascal _loadds WRITE_SECTORS16 ( CARDINAL32          Drive_Number,
  4819. LBA                 Starting_Sector,
  4820. CARDINAL32          Sectors_To_Write,
  4821. ADDRESS      _Seg16 Buffer,
  4822. CARDINAL32 * _Seg16 Error);
  4823.  
  4824. /*********************************************************************/
  4825. /*                                                                   */
  4826. /*   Function Name: REDISCOVER_PRMS16                                */
  4827. /*                                                                   */
  4828. /*   Descriptive Name: Causes OS2LVM and OS2DASD to check PRMs for   */
  4829. /*                     new or changed media.                         */
  4830. /*                                                                   */
  4831. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4832. /*                                    in which to store an error code*/
  4833. /*                                    should an error occur.         */
  4834. /*                                                                   */
  4835. /*   Output: If the Rediscover PRM operation was successful, then    */
  4836. /*           *Error_Code will be LVM_ENGINE_NO_ERROR.  If there      */
  4837. /*           was an error, then *Error_Code will be > 0.             */
  4838. /*                                                                   */
  4839. /*   Error Handling: None.                                           */
  4840. /*                                                                   */
  4841. /*   Side Effects:  New volumes may be discovered and assigned drive */
  4842. /*                  letters by OS2LVM and OS2DASD.                   */
  4843. /*                                                                   */
  4844. /*   Notes: The LVM Engine must be CLOSED when this function is      */
  4845. /*          called as this function is disabled while it is open!    */
  4846. /*                                                                   */
  4847. /*********************************************************************/
  4848. void _Far16 _Pascal _loadds REDISCOVER_PRMS16( CARDINAL32 * _Seg16 Error_Code );
  4849.  
  4850. /*********************************************************************/
  4851. /*                                                                   */
  4852. /*   Function Name: GET_LVM_VIEW16                                   */
  4853. /*                                                                   */
  4854. /*   Descriptive Name:  This function gets the OS2LVM data for the   */
  4855. /*                      specified drive letter.  The intent is to    */
  4856. /*                      allow the determination of what drive letter */
  4857. /*                      a volume really has given the possibilities  */
  4858. /*                      of conflict or a drive preference of '*'.    */
  4859. /*                                                                   */
  4860. /*   Input:  char  IFSM_Drive_Letter : The drive letter for which the*/
  4861. /*                                     OS2LVM data is requested.     */
  4862. /*           CARDINAL32 * Drive_Number : The address of a variable   */
  4863. /*                                       to hold the OS/2 drive      */
  4864. /*                                       number of the drive         */
  4865. /*                                       containing the first        */
  4866. /*                                       partition of the volume     */
  4867. /*                                       currently assigned to the   */
  4868. /*                                       requested drive letter.     */
  4869. /*           CARDINAL32 * Partition_LBA : The address of a variable  */
  4870. /*                                        to hold the LBA of the     */
  4871. /*                                        first partition of the     */
  4872. /*                                        volume currently assigned  */
  4873. /*                                        to the requested drive     */
  4874. /*                                        letter.                    */
  4875. /*           char * LVM_Drive_Letter : The address of a variable to  */
  4876. /*                                     hold the drive letter that    */
  4877. /*                                     OS2LVM thinks the volume      */
  4878. /*                                     assigned to the requested     */
  4879. /*                                     drive letter should have.     */
  4880. /*           BYTE * UnitID : The address of a variable to hold the   */
  4881. /*                           OS2LVM unit ID for the volume associated*/
  4882. /*                           with the requested drive letter.        */
  4883. /*                                                                   */
  4884. /*   Output:  The function return value will be TRUE if the function */
  4885. /*            completed successfully.                                */
  4886. /*                                                                   */
  4887. /*   Error Handling: If this function fails, the specified drive     */
  4888. /*                   letter is either not in use, or is in use by a  */
  4889. /*                   device not controlled by OS2LVM.                */
  4890. /*                                                                   */
  4891. /*   Side Effects: None.                                             */
  4892. /*                                                                   */
  4893. /*   Notes: This function can be used with the LVM Engine open or    */
  4894. /*          closed.                                                  */
  4895. /*                                                                   */
  4896. /*********************************************************************/
  4897. BOOLEAN _Far16 _Pascal _loadds GET_LVM_VIEW16( char                IFSM_Drive_Letter,
  4898. CARDINAL32 * _Seg16 Drive_Number,
  4899. CARDINAL32 * _Seg16 Partition_LBA,
  4900. char *       _Seg16 LVM_Drive_Letter,
  4901. BYTE *       _Seg16 UnitID);
  4902.  
  4903. /*********************************************************************/
  4904. /*                                                                   */
  4905. /*   Function Name: Start_Logging16                                  */
  4906. /*                                                                   */
  4907. /*   Descriptive Name: Enables the LVM Engine logging.  Once enabled,*/
  4908. /*                     the LVM Engine logging function will log all  */
  4909. /*                     LVM Engine activity to the specified log file.*/
  4910. /*                     The data is logged in a binary format for     */
  4911. /*                     compactness and speed.                        */
  4912. /*                                                                   */
  4913. /*   Input: char * Filename - The filename of the file to use as the */
  4914. /*                            log file.                              */
  4915. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4916. /*                                    in which to store an error code*/
  4917. /*                                    should an error occur.         */
  4918. /*                                                                   */
  4919. /*   Output: If the logging file was successfully created, then      */
  4920. /*           *Error_Code will be 0.  If the log file could not be    */
  4921. /*           created, then *Error_Code will be > 0.                  */
  4922. /*                                                                   */
  4923. /*   Error Handling: If the log file can not be created, then        */
  4924. /*                   *Error_Code will be > 0.                        */
  4925. /*                                                                   */
  4926. /*   Side Effects:  A file may be created/opened for logging of      */
  4927. /*                  LVM Engine actions.                              */
  4928. /*                                                                   */
  4929. /*   Notes:  None.                                                   */
  4930. /*                                                                   */
  4931. /*********************************************************************/
  4932. void _Far16 _Pascal _loadds START_LOGGING16( char * _Seg16 Filename, CARDINAL32 * _Seg16 Error_Code );
  4933.  
  4934. /*********************************************************************/
  4935. /*                                                                   */
  4936. /*   Function Name: Stop_Logging16                                   */
  4937. /*                                                                   */
  4938. /*   Descriptive Name: This function ends LVM Engine logging and     */
  4939. /*                     closes the log file.                          */
  4940. /*                                                                   */
  4941. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  4942. /*                                    in which to store an error code*/
  4943. /*                                    should an error occur.         */
  4944. /*                                                                   */
  4945. /*   Output: *Error_Code will be 0 if this function completes        */
  4946. /*           successfully; otherwise it will be > 0.                 */
  4947. /*                                                                   */
  4948. /*   Error Handling: If the log file is not currently opened, or if  */
  4949. /*                   the close operation fails on the log file, then */
  4950. /*                   *Error_Code will be > 0.                        */
  4951. /*                                                                   */
  4952. /*   Side Effects:  The log file may be closed.                      */
  4953. /*                                                                   */
  4954. /*   Notes:  None.                                                   */
  4955. /*                                                                   */
  4956. /*********************************************************************/
  4957. void _Far16 _Pascal _loadds STOP_LOGGING16 ( CARDINAL32 * _Seg16 Error_Code );
  4958.  
  4959. #endif
  4960.  
  4961. /* ************************************************************************** *
  4962.  
  4963. End of Functions Prototypes for use with Visual Age C/C++
  4964.  
  4965. ************************************************************************** */
  4966.  
  4967. #else
  4968.  
  4969. /* ************************************************************************** *
  4970.  
  4971. Functions Prototypes for use with 16 Bit Compilers
  4972.  
  4973. ************************************************************************** */
  4974.  
  4975. /* ************************************************************************** *
  4976.  
  4977. 16 Bit Functions relating to the LVM Engine itself
  4978.  
  4979. ************************************************************************** */
  4980.  
  4981. /****************************************************************************************************/
  4982. /*                                                                                                  */
  4983. /*   Function Name: OPEN_LVM_ENGINE16                                                                 */
  4984. /*                                                                                                  */
  4985. /*   Descriptive Name: Opens the LVM Engine and readies it for use.                                 */
  4986. /*                                                                                                  */
  4987. /*   Input: BOOLEAN Ignore_CHS : If TRUE, then the LVM engine will not check the CHS values in the  */
  4988. /*                               MBR/EBR partition tables for validity.  This is useful if there    */
  4989. /*                               are drive geometry problems, such as the drive was partitioned and */
  4990. /*                               formatted with one geometry and then moved to a different machine  */
  4991. /*                               which uses a different geometry for the drive.  This would cause   */
  4992. /*                               the starting and ending CHS values in the partition tables to      */
  4993. /*                               be inconsistent with the size and partition offset entries in the  */
  4994. /*                               partition tables.  Setting Ignore_CHS to TRUE will disable the     */
  4995. /*                               LVM Engine's CHS consistency checks, thereby allowing the drive    */
  4996. /*                               to be partitioned.                                                 */
  4997. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in which to store an error code   */
  4998. /*                                    should an error occur.                                        */
  4999. /*                                                                                                  */
  5000. /*   Output:  *Error_Code will be 0 if this function completes successfully.  If an error occurs,   */
  5001. /*            *Error_Code will contain a non-zero error code.                                       */
  5002. /*                                                                                                  */
  5003. /*   Error Handling: If this function aborts with an error, all memory allocated during the course  */
  5004. /*                   of this function will be released.  Disk read errors will be reported to the   */
  5005. /*                   user via pop-up error messages.  Disk read errors will only cause this         */
  5006. /*                   function to abort if none of the disk drives in the system could be            */
  5007. /*                   successfully read.                                                             */
  5008. /*                                                                                                  */
  5009. /*   Side Effects:  The LVM Engine will be initialized.  The partition tables for all OS2DASD       */
  5010. /*                  controlled disk drives will be read into memory.  Memory will be allocated for  */
  5011. /*                  the data structures used by the LVM Engine.                                     */
  5012. /*                                                                                                  */
  5013. /*   Notes:  This is provided for programs that used LVM Version 1.  This function assumes an       */
  5014. /*           LVM_Interface_Type of VIO_Interface.                            */
  5015. /*                                                                                                  */
  5016. /****************************************************************************************************/
  5017. void far pascal _loadds OPEN_LVM_ENGINE16( BOOLEAN Ignore_CHS, CARDINAL32 far * Error_Code );
  5018.  
  5019. /****************************************************************************************************/
  5020. /*                                                                                                  */
  5021. /*   Function Name: OPEN_LVM_ENGINE216                                                              */
  5022. /*                                                                                                  */
  5023. /*   Descriptive Name: Opens the LVM Engine and readies it for use.                                 */
  5024. /*                                                                                                  */
  5025. /*   Input: BOOLEAN Ignore_CHS : If TRUE, then the LVM engine will not check the CHS values in the  */
  5026. /*                               MBR/EBR partition tables for validity.  This is useful if there    */
  5027. /*                               are drive geometry problems, such as the drive was partitioned and */
  5028. /*                               formatted with one geometry and then moved to a different machine  */
  5029. /*                               which uses a different geometry for the drive.  This would cause   */
  5030. /*                               the starting and ending CHS values in the partition tables to      */
  5031. /*                               be inconsistent with the size and partition offset entries in the  */
  5032. /*                               partition tables.  Setting Ignore_CHS to TRUE will disable the     */
  5033. /*                               LVM Engine's CHS consistency checks, thereby allowing the drive    */
  5034. /*                               to be partitioned.                                                 */
  5035. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in which to store an error code   */
  5036. /*                                    should an error occur.                                        */
  5037. /*                                                                                                  */
  5038. /*   Output:  *Error_Code will be 0 if this function completes successfully.  If an error occurs,   */
  5039. /*            *Error_Code will contain a non-zero error code.                                       */
  5040. /*                                                                                                  */
  5041. /*   Error Handling: If this function aborts with an error, all memory allocated during the course  */
  5042. /*                   of this function will be released.  Disk read errors will be reported to the   */
  5043. /*                   user via pop-up error messages.  Disk read errors will only cause this         */
  5044. /*                   function to abort if none of the disk drives in the system could be            */
  5045. /*                   successfully read.                                                             */
  5046. /*                                                                                                  */
  5047. /*   Side Effects:  The LVM Engine will be initialized.  The partition tables for all OS2DASD       */
  5048. /*                  controlled disk drives will be read into memory.  Memory will be allocated for  */
  5049. /*                  the data structures used by the LVM Engine.                                     */
  5050. /*                                                                                                  */
  5051. /*   Notes:  None.                                                                                  */
  5052. /*                                                                                                  */
  5053. /****************************************************************************************************/
  5054. void far pascal _loadds OPEN_LVM_ENGINE216( BOOLEAN Ignore_CHS, CARDINAL32 far * Error_Code );
  5055.  
  5056. /*********************************************************************/
  5057. /*                                                                   */
  5058. /*   Function Name: COMMIT_CHANGES16                                 */
  5059. /*                                                                   */
  5060. /*   Descriptive Name: Saves any changes made to the partitioning    */
  5061. /*                     information of the OS2DASD controlled disk    */
  5062. /*                     drives in the system.                         */
  5063. /*                                                                   */
  5064. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5065. /*                                   in which to store an error code */
  5066. /*                                   should an error occur.          */
  5067. /*                                                                   */
  5068. /*   Output:  The function return value will be TRUE if all of the   */
  5069. /*            partitioning/volume changes made were successfully     */
  5070. /*            written to disk.  Also, *Error_Code will be 0 if no    */
  5071. /*            errors occur.                                          */
  5072. /*                                                                   */
  5073. /*            If an error occurs, then the furnction return value    */
  5074. /*            will be FALSE and *Error_Code will contain a non-zero  */
  5075. /*            error code.                                            */
  5076. /*                                                                   */
  5077. /*   Error Handling:  If an error occurs, the function return value  */
  5078. /*                    will be false and *Error_Code will be > 0.     */
  5079. /*                                                                   */
  5080. /*                    Disk read and write errors will be indicated by*/
  5081. /*                    setting the IO_Error field of the              */
  5082. /*                    Drive_Information_Record to TRUE.  Thus, if    */
  5083. /*                    the function return value is FALSE, and        */
  5084. /*                    *Error_Code indicates an I/O error, the caller */
  5085. /*                    of this function should call the               */
  5086. /*                    Get_Drive_Status function on each drive to     */
  5087. /*                    determine which drives had I/O errors.         */
  5088. /*                                                                   */
  5089. /*                    If a read or write error occurs, then the      */
  5090. /*                    engine may not have been able to create a      */
  5091. /*                    partition or volume.  Thus, the caller         */
  5092. /*                    may want to refresh all partition and volume   */
  5093. /*                    data to see what the engine was and was not    */
  5094. /*                    able to create.                                */
  5095. /*                                                                   */
  5096. /*   Side Effects:  The partitioning information of the disk drives  */
  5097. /*                  in the system may be altered.                    */
  5098. /*                                                                   */
  5099. /*   Notes:  None.                                                   */
  5100. /*                                                                   */
  5101. /*********************************************************************/
  5102. BOOLEAN far pascal _loadds COMMIT_CHANGES16( CARDINAL32 far * Error_Code );
  5103.  
  5104. /*********************************************************************/
  5105. /*                                                                   */
  5106. /*   Function Name: CLOSE_LVM_ENGINE16                               */
  5107. /*                                                                   */
  5108. /*   Descriptive Name: Closes the LVM Engine and frees any memory    */
  5109. /*                     held by the LVM Engine.                       */
  5110. /*                                                                   */
  5111. /*   Input: None.                                                    */
  5112. /*                                                                   */
  5113. /*   Output:  None.                                                  */
  5114. /*                                                                   */
  5115. /*   Error Handling: N/A                                             */
  5116. /*                                                                   */
  5117. /*   Side Effects:  Any memory held by the LVM Engine is released.   */
  5118. /*                                                                   */
  5119. /*   Notes:  None.                                                   */
  5120. /*                                                                   */
  5121. /*********************************************************************/
  5122. void far pascal _loadds CLOSE_LVM_ENGINE16 ( void );
  5123.  
  5124. /*********************************************************************/
  5125. /*                                                                   */
  5126. /*   Function Name: REFRESH_LVM_ENGINE16                             */
  5127. /*                                                                   */
  5128. /*   Descriptive Name: This function causes the LVM Engine to look   */
  5129. /*                     for changes in the current system             */
  5130. /*                     configuration and update its internal tables  */
  5131. /*                     accordingly.                                  */
  5132. /*                                                                   */
  5133. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5134. /*                                   in which to store an error code */
  5135. /*                                   should an error occur.          */
  5136. /*                                                                   */
  5137. /*   Output:  None.                                                  */
  5138. /*                                                                   */
  5139. /*   Error Handling: If an error occurs, *Error_Code will be set to  */
  5140. /*                   a non-zero value.                               */
  5141. /*                                                                   */
  5142. /*   Side Effects: Volumes which represent non-LVM devices may have  */
  5143. /*                 their handles changed!                            */
  5144. /*                                                                   */
  5145. /*   Notes:  After calling this function, Get_Volume_Control_Data    */
  5146. /*           should be called to get the updated list of volumes.    */
  5147. /*           This is necessary as the handles of some volumes may    */
  5148. /*           have changed.                                           */
  5149. /*                                                                   */
  5150. /*********************************************************************/
  5151. void far pascal _loadds  REFRESH_LVM_ENGINE16( CARDINAL32 far * Error_Code );
  5152.  
  5153. /* ************************************************************************** *
  5154.  
  5155. 16 Bit Functions relating to Drives
  5156.  
  5157. ************************************************************************** */
  5158.  
  5159. /*********************************************************************/
  5160. /*                                                                   */
  5161. /*   Function Name:  GET_DRIVE_CONTROL_DATA16                        */
  5162. /*                                                                   */
  5163. /*   Descriptive Name:  This function returns an array of            */
  5164. /*                      Drive_Control_Records.  These records provide*/
  5165. /*                      important information about the drives in the*/
  5166. /*                      system and provide the handles required to   */
  5167. /*                      access them.                                 */
  5168. /*                                                                   */
  5169. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5170. /*                                   in which to store an error code */
  5171. /*                                   should an error occur.          */
  5172. /*                                                                   */
  5173. /*   Output:  A Drive_Control_Array structure is returned.  If no    */
  5174. /*            errors occur, Drive_Control_Data will be non-NULL,     */
  5175. /*            Count will be greater than zero, and *Error_Code will  */
  5176. /*            be 0.                                                  */
  5177. /*                                                                   */
  5178. /*   Error Handling:  If an error occurs, the Drive_Control_Array    */
  5179. /*                    returned by this function will have NULL for   */
  5180. /*                    Drive_Control_Data, and 0 for Count.           */
  5181. /*                    *Error_Code will be greater than 0.            */
  5182. /*                                                                   */
  5183. /*   Side Effects:  None.                                            */
  5184. /*                                                                   */
  5185. /*   Notes:  The caller becomes responsible for the memory allocated */
  5186. /*           for the array of Drive_Control_Records pointed to by    */
  5187. /*           Drive_Control_Data pointer in the Drive_Control_Array   */
  5188. /*           structure returned by this function.  The caller should */
  5189. /*           free this memory when they are done using it.           */
  5190. /*                                                                   */
  5191. /*********************************************************************/
  5192. void far pascal _loadds GET_DRIVE_CONTROL_DATA16( Drive_Control_Record far ** Drive_Control_Data,
  5193. CARDINAL32 far *            Count,
  5194. CARDINAL32 far *            Error_Code
  5195. );
  5196.  
  5197. /*********************************************************************/
  5198. /*                                                                   */
  5199. /*   Function Name:  GET_DRIVE_STATUS16                              */
  5200. /*                                                                   */
  5201. /*   Descriptive Name:  Returns the Drive_Information_Record for the */
  5202. /*                      drive specified by Drive_Handle.             */
  5203. /*                                                                   */
  5204. /*   Input: CARDINAL32 Drive_Handle - The handle of the drive to use.*/
  5205. /*                             Drive handles are obtained through the*/
  5206. /*                             Get_Drive_Control_Data function.      */
  5207. /*         CARDINAL32 * Error_Code - The address of a CARDINAL32 in  */
  5208. /*                                   in which to store an error code */
  5209. /*                                   should an error occur.          */
  5210. /*                                                                   */
  5211. /*   Output: This function returns the Drive_Information_Record for  */
  5212. /*           the drive associated with the specified Drive_Handle.   */
  5213. /*           If no errors occur, *Error_Code will be set to 0.  If an*/
  5214. /*           error does occur, then *Error_Code will be non-zero.    */
  5215. /*                                                                   */
  5216. /*   Error Handling:  If an error occurs, then *Error_Code will be   */
  5217. /*                    non-zero.                                      */
  5218. /*                                                                   */
  5219. /*   Side Effects:  None.                                            */
  5220. /*                                                                   */
  5221. /*   Notes:  None.                                                   */
  5222. /*                                                                   */
  5223. /*********************************************************************/
  5224. void far pascal _loadds GET_DRIVE_STATUS16( CARDINAL32                      Drive_Handle,
  5225. Drive_Information_Record far *  Drive_Status,
  5226. CARDINAL32 *                    Error_Code
  5227. );
  5228.  
  5229. /* ************************************************************************** *
  5230.  
  5231. 16 Bit Functions relating to Partitions
  5232.  
  5233. ************************************************************************** */
  5234.  
  5235. /*********************************************************************/
  5236. /*                                                                   */
  5237. /*   Function Name: GET_PARTITIONS16                                 */
  5238. /*                                                                   */
  5239. /*   Descriptive Name: Returns an array of partitions associated     */
  5240. /*                     with the object specified by Handle.          */
  5241. /*                                                                   */
  5242. /*   Input:CARDINAL32 Handle - This is the handle of a drive or      */
  5243. /*                      volume. Drive handles are obtained through   */
  5244. /*                      the Get_Drive_Control_Data function.  Volume */
  5245. /*                      handles are obtained through the             */
  5246. /*                      Get_Volume_Control_Data function.            */
  5247. /*         CARDINAL32 * Error_Code - The address of a CARDINAL32 in  */
  5248. /*                                   in which to store an error code */
  5249. /*                                   should an error occur.          */
  5250. /*                                                                   */
  5251. /*   Output: This function returns a structure.  The structure has   */
  5252. /*           two components: an array of partition information       */
  5253. /*           records and the number of entries in the array.  If     */
  5254. /*           Handle is the handle of a disk drive, then the returned */
  5255. /*           array will contain a partition information record for   */
  5256. /*           each partition and block of free space on that drive.   */
  5257. /*           If Handle is the handle of a volume, then the returned  */
  5258. /*           array will contain a partition information record for   */
  5259. /*           each partition which is part of the specified volume.   */
  5260. /*           If no errors occur, then *Error_Code will be 0.  If an  */
  5261. /*           error does occur, then *Error_Code will be non-zero.    */
  5262. /*                                                                   */
  5263. /*   Error Handling: Any memory allocated for the return value will  */
  5264. /*                   be freed.  The Partition_Information_Array      */
  5265. /*                   returned by this function will contain a NULL   */
  5266. /*                   pointer for Partition_Array, and have a Count of*/
  5267. /*                   0.  *Error_Code will be non-zero.               */
  5268. /*                                                                   */
  5269. /*                   If Handle is non-NULL and is invalid, a trap    */
  5270. /*                   is likely.                                      */
  5271. /*                                                                   */
  5272. /*   Side Effects:  Memory will be allocated to hold the array       */
  5273. /*                  returned by this function.                       */
  5274. /*                                                                   */
  5275. /*   Notes:  The caller becomes responsible for the memory allocated */
  5276. /*           for the array of Partition_Information_Records pointed  */
  5277. /*           to by Partition_Array pointer in the                    */
  5278. /*           Partition_Information_Array structure returned by this  */
  5279. /*           function.  The caller should free this memory when they */
  5280. /*           are done using it.                                      */
  5281. /*                                                                   */
  5282. /*********************************************************************/
  5283. void far pascal _loadds GET_PARTITIONS16( CARDINAL32                             Handle,
  5284. Partition_Information_Record far * *   Partition_Array,
  5285. CARDINAL32 far *                       Count,
  5286. CARDINAL32 far *                       Error_Code
  5287. );
  5288.  
  5289. /*********************************************************************/
  5290. /*                                                                   */
  5291. /*   Function Name: GET_PARTITION_HANDLE16                           */
  5292. /*                                                                   */
  5293. /*   Descriptive Name: Returns the handle of the partition whose     */
  5294. /*                     serial number matches the one provided.       */
  5295. /*                                                                   */
  5296. /*   Input: CARDINAL32 Serial_Number - This is the serial number to  */
  5297. /*                                     look for.  If a partition with*/
  5298. /*                                     a matching serial number is   */
  5299. /*                                     found, its handle will be     */
  5300. /*                                     returned.                     */
  5301. /*          CARDINAL32 * Handle - The address of a variable (32 bits)*/
  5302. /*                                to hold the handle being returned. */
  5303. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5304. /*                                    in which to store an error code*/
  5305. /*                                    should an error occur.         */
  5306. /*                                                                   */
  5307. /*   Output: If a partition with a matching serial number is found,  */
  5308. /*              then the function return value will be the handle    */
  5309. /*              of the partition found.  If no matching partition is */
  5310. /*              found, then the function return value will be NULL.  */
  5311. /*                                                                   */
  5312. /*   Error Handling:  If no errors occur, *Error_Code will be        */
  5313. /*                    LVM_ENGINE_NO_ERROR.  If an error occurs, then */
  5314. /*                    *Error_Code will be a non-zero error code.     */
  5315. /*                                                                   */
  5316. /*   Side Effects:  None.                                            */
  5317. /*                                                                   */
  5318. /*   Notes:  None.                                                   */
  5319. /*                                                                   */
  5320. /*********************************************************************/
  5321. void far pascal _loadds GET_PARTITION_HANDLE16( CARDINAL32       Serial_Number,
  5322. CARDINAL32 far * Handle,
  5323. CARDINAL32 far * Error_Code );
  5324.  
  5325. /*********************************************************************/
  5326. /*                                                                   */
  5327. /*   Function Name: GET_PARTITION_INFORMATION16                      */
  5328. /*                                                                   */
  5329. /*   Descriptive Name: Returns the Partition_Information_Record for  */
  5330. /*                     the partition specified by Partition_Handle.  */
  5331. /*                                                                   */
  5332. /*   Input: CARDINAL32 Partition_Handle - The handle associated with */
  5333. /*                                     the partition for which the   */
  5334. /*                                     Partition_Information_Record  */
  5335. /*                                     is desired.                   */
  5336. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5337. /*                                    in which to store an error code*/
  5338. /*                                    should an error occur.         */
  5339. /*                                                                   */
  5340. /*   Output: A Partition_Information_Record is returned.  If there   */
  5341. /*           is no error, then *Error_Code will be 0.  If an error   */
  5342. /*           occurs, *Error_Code will be non-zero.                   */
  5343. /*                                                                   */
  5344. /*   Error Handling:  If the Partition_Handle is not a valid handle, */
  5345. /*                    a trap could result.  If it is a handle for    */
  5346. /*                    something other than a partition, an error code*/
  5347. /*                    will be returned in *Error_Code.               */
  5348. /*                                                                   */
  5349. /*   Side Effects:  None.                                            */
  5350. /*                                                                   */
  5351. /*   Notes:  None.                                                   */
  5352. /*                                                                   */
  5353. /*********************************************************************/
  5354. void far pascal _loadds  GET_PARTITION_INFORMATION16( CARDINAL32                                Partition_Handle,
  5355. Partition_Information_Record far *     Partition_Information,
  5356. CARDINAL32 far *                       Error_Code
  5357. );
  5358.  
  5359. /*********************************************************************/
  5360. /*                                                                   */
  5361. /*   Function Name: CREATE_PARTITION16                               */
  5362. /*                                                                   */
  5363. /*   Descriptive Name: Creates a partition on a disk drive.          */
  5364. /*                                                                   */
  5365. /*   Input: CARDINAL32      Handle - The handle of a disk drive or   */
  5366. /*                                   a block of free space.          */
  5367. /*          CARDINAL32      Size - The size, in sectors, of the      */
  5368. /*                                 partition to create.              */
  5369. /*          char            Name[] - The name to give to the newly   */
  5370. /*                                   created partition.              */
  5371. /*          Allocation_Algorithm algorithm - If Handle is a drive,   */
  5372. /*                                           then the engine will    */
  5373. /*                                           find a block of free    */
  5374. /*                                           space to use to create  */
  5375. /*                                           the partition.  This    */
  5376. /*                                           tells the engine which  */
  5377. /*                                           memory management       */
  5378. /*                                           algorithm to use.       */
  5379. /*          BOOLEAN         Bootable - If TRUE, then the engine will */
  5380. /*                                     only create the partition if  */
  5381. /*                                     it can be booted from.  If    */
  5382. /*                                     Primary_Partition is FALSE,   */
  5383. /*                                     then it is assumed that OS/2  */
  5384. /*                                     is the operating system that  */
  5385. /*                                     will be booted.               */
  5386. /*          BOOLEAN         Primary_Partition - If TRUE, then the    */
  5387. /*                                              engine will create   */
  5388. /*                                              a primary partition. */
  5389. /*                                              If FALSE, then the   */
  5390. /*                                              engine will create a */
  5391. /*                                              logical drive.       */
  5392. /*          BOOLEAN         Allocate_From_Start - If TRUE, then the  */
  5393. /*                                                engine will        */
  5394. /*                                                allocate the new   */
  5395. /*                                                partition from the */
  5396. /*                                                beginning of the   */
  5397. /*                                                selected block of  */
  5398. /*                                                free space.  If    */
  5399. /*                                                FALSE, then the    */
  5400. /*                                                partition will be  */
  5401. /*                                                allocated from the */
  5402. /*                                                end of the selected*/
  5403. /*                                                block of free      */
  5404. /*                                                space.             */
  5405. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5406. /*                                    in which to store an error code*/
  5407. /*                                    should an error occur.         */
  5408. /*                                                                   */
  5409. /*   Output: The function return value will be the handle of the     */
  5410. /*           partition created.  If the partition could not be       */
  5411. /*           created, then NULL will be returned.                    */
  5412. /*           *Error_Code will be 0 if the partition was created.     */
  5413. /*           *Error_Code will be > 0 if the partition could not be   */
  5414. /*           created.                                                */
  5415. /*                                                                   */
  5416. /*   Error Handling:  If the partition can not be created, then any  */
  5417. /*                    memory allocated by this function will be      */
  5418. /*                    freed and the partitioning of the disk in      */
  5419. /*                    question will be unchanged.                    */
  5420. /*                                                                   */
  5421. /*                    If Handle is not a valid handle, then a trap   */
  5422. /*                    may result.                                    */
  5423. /*                                                                   */
  5424. /*                    If Handle represents a partition or volume,    */
  5425. /*                    then the function will abort and set           */
  5426. /*                    *Error_Code to a non-zero value.               */
  5427. /*                                                                   */
  5428. /*   Side Effects:  A partition may be created on a disk drive.      */
  5429. /*                                                                   */
  5430. /*   Notes:  None.                                                   */
  5431. /*                                                                   */
  5432. /*********************************************************************/
  5433. CARDINAL32 far pascal _loadds CREATE_PARTITION16( CARDINAL32            Handle,
  5434. CARDINAL32            Size,
  5435. char far              Name[ PARTITION_NAME_SIZE ],
  5436. Allocation_Algorithm  algorithm,
  5437. BOOLEAN               Bootable,
  5438. BOOLEAN               Primary_Partition,
  5439. BOOLEAN               Allocate_From_Start,
  5440. CARDINAL32 far *      Error_Code
  5441. );
  5442.  
  5443. /*********************************************************************/
  5444. /*                                                                   */
  5445. /*   Function Name: DELETE_PARTITION16                               */
  5446. /*                                                                   */
  5447. /*   Descriptive Name: Deletes the partition specified by            */
  5448. /*                     Partition_Handle.                             */
  5449. /*                                                                   */
  5450. /*   Input: CARDINAL32 Partition_Handle - The handle associated with */
  5451. /*                                     the partition to be deleted.  */
  5452. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5453. /*                                    in which to store an error code*/
  5454. /*                                    should an error occur.         */
  5455. /*                                                                   */
  5456. /*   Output: *Error_Code will be 0 if the partition was deleted      */
  5457. /*           successfully.  *Error_Code will be > 0 if the partition */
  5458. /*           could not be deleted.                                   */
  5459. /*                                                                   */
  5460. /*   Error Handling: If the partition can not be deleted, then       */
  5461. /*                   *Error_Code will be > 0.                        */
  5462. /*                                                                   */
  5463. /*                   If Partition_Handle is not a valid handle, a    */
  5464. /*                   trap may result.                                */
  5465. /*                                                                   */
  5466. /*                   If Partition_Handle is a volume or drive handle,*/
  5467. /*                   then this function will abort and set           */
  5468. /*                   *Error_Code to a non-zero value.                */
  5469. /*                                                                   */
  5470. /*   Side Effects: A partition on a disk drive may be deleted.       */
  5471. /*                                                                   */
  5472. /*   Notes:  A partition can not be deleted if it is part of a       */
  5473. /*           volume!                                                 */
  5474. /*                                                                   */
  5475. /*********************************************************************/
  5476. void far pascal _loadds DELETE_PARTITION16( CARDINAL32        Partition_Handle,
  5477. CARDINAL32 far *  Error_Code
  5478. );
  5479.  
  5480. /*********************************************************************/
  5481. /*                                                                   */
  5482. /*   Function Name: SET_ACTIVE_FLAG16                                */
  5483. /*                                                                   */
  5484. /*   Descriptive Name: Sets the Active Flag field for a partition.   */
  5485. /*                                                                   */
  5486. /*   Input: CARDINAL32 Partition_Handle - The handle of the partition*/
  5487. /*                                     whose Active Flag is to be set*/
  5488. /*          BYTE Active_Flag - The new value for the Active Flag.    */
  5489. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5490. /*                                    in which to store an error code*/
  5491. /*                                    should an error occur.         */
  5492. /*                                                                   */
  5493. /*   Output: *Error_Code will be 0 if the Active Flag was            */
  5494. /*           successfully set, otherwise *Error_Code will contain a  */
  5495. /*           non-zero error code indicating what went wrong.         */
  5496. /*                                                                   */
  5497. /*   Error Handling: If the Active Flag can not be set, this function*/
  5498. /*                   will abort without changing any disk structures.*/
  5499. /*                                                                   */
  5500. /*                   If Partition_Handle is not a valid handle, a    */
  5501. /*                   trap may result.                                */
  5502. /*                                                                   */
  5503. /*                   If Partition_Handle is a volume or drive handle,*/
  5504. /*                   then this function will abort and set           */
  5505. /*                   *Error_Code to a non-zero value.                */
  5506. /*                                                                   */
  5507. /*                                                                   */
  5508. /*   Side Effects:  The Active Flag for a partition may be modified. */
  5509. /*                                                                   */
  5510. /*   Notes:  None.                                                   */
  5511. /*                                                                   */
  5512. /*********************************************************************/
  5513. void far pascal _loadds SET_ACTIVE_FLAG16 ( CARDINAL32          Partition_Handle,
  5514. BYTE                Active_Flag,
  5515. CARDINAL32 far *    Error_Code
  5516. );
  5517.  
  5518. /*********************************************************************/
  5519. /*                                                                   */
  5520. /*   Function Name: SET_OS_FLAG16                                    */
  5521. /*                                                                   */
  5522. /*   Descriptive Name: Sets the OS Flag field for a partition.  This */
  5523. /*                     field is typically used to indicate the       */
  5524. /*                     filesystem used on the partition, which       */
  5525. /*                     generally gives an indication of which OS is  */
  5526. /*                     using that partition.                         */
  5527. /*                                                                   */
  5528. /*   Input: CARDINAL32 Partition_Handle - The handle of the partition*/
  5529. /*                                     whose Active Flag is to be set*/
  5530. /*          BYTE OS_Flag - The new value for the OS Flag.            */
  5531. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5532. /*                                    in which to store an error code*/
  5533. /*                                    should an error occur.         */
  5534. /*                                                                   */
  5535. /*   Output: *Error_Code will be 0 if the OS Flag was successfully   */
  5536. /*           set, otherwise *Error_Code will contain a non-zero error*/
  5537. /*           code indicating what went wrong.                        */
  5538. /*                                                                   */
  5539. /*   Error Handling: If the OS Flag can not be set, this function    */
  5540. /*                   will abort without changing any disk structures.*/
  5541. /*                                                                   */
  5542. /*                   If Partition_Handle is not a valid handle, a    */
  5543. /*                   trap may result.                                */
  5544. /*                                                                   */
  5545. /*                   If Partition_Handle is a volume or drive handle,*/
  5546. /*                   then this function will abort and set           */
  5547. /*                   *Error_Code to a non-zero value.                */
  5548. /*                                                                   */
  5549. /*                                                                   */
  5550. /*   Side Effects:  The OS Flag for a partition may be modified.     */
  5551. /*                                                                   */
  5552. /*   Notes:  None.                                                   */
  5553. /*                                                                   */
  5554. /*********************************************************************/
  5555. void far pascal _loadds SET_OS_FLAG16 ( CARDINAL32          Partition_Handle,
  5556. BYTE                OS_Flag,
  5557. CARDINAL32 far *    Error_Code
  5558. );
  5559.  
  5560. /* ************************************************************************** *
  5561.  
  5562. 16 Bit Functions relating to Volumes
  5563.  
  5564. ************************************************************************** */
  5565.  
  5566. /*********************************************************************/
  5567. /*                                                                   */
  5568. /*   Function Name: GET_VOLUME_CONTROL_DATA16                        */
  5569. /*                                                                   */
  5570. /*   Descriptive Name: This function returns a structure containing  */
  5571. /*                     an array of Volume_Control_Records.  These    */
  5572. /*                     records contain information about volumes     */
  5573. /*                     which is invariant - i.e. will not change for */
  5574. /*                     as long as the volume exists.  One of the     */
  5575. /*                     items in the Volume_Control_Record is the     */
  5576. /*                     handle for the volume.  This handle must be   */
  5577. /*                     used on all accesses to the volume.           */
  5578. /*                                                                   */
  5579. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5580. /*                                    in which to store an error code*/
  5581. /*                                    should an error occur.         */
  5582. /*                                                                   */
  5583. /*   Output: A Volume_Control_Array structure is returned.           */
  5584. /*                                                                   */
  5585. /*           If there are no errors, then the Volume_Control_Data    */
  5586. /*           pointer in the Volume_Control_Array will be non-NULL,   */
  5587. /*           the Count field of the Volume_Control_Array will be     */
  5588. /*           >= 0, and *Error_Code will be 0.                        */
  5589. /*                                                                   */
  5590. /*           If an error does occur, then the Volume_Control_Data    */
  5591. /*           pointer in the the Volume_Control_Array will be NULL,   */
  5592. /*           the Count field of the Volume_Control_Array will be 0,  */
  5593. /*           and *Error_Code will be > 0.                            */
  5594. /*                                                                   */
  5595. /*   Error Handling: If an error occurs, then any memory allocated by*/
  5596. /*                   this function will be freed.                    */
  5597. /*                                                                   */
  5598. /*   Side Effects:  Memory for the returned array is allocated.      */
  5599. /*                                                                   */
  5600. /*   Notes:  The caller becomes responsible for the memory allocated */
  5601. /*           for the array of Volume_Control_Records pointed to by   */
  5602. /*           Volume_Control_Data pointer in the Volume_Control_Array */
  5603. /*           structure returned by this function.  The caller should */
  5604. /*           free this memory when they are done using it.           */
  5605. /*                                                                   */
  5606. /*********************************************************************/
  5607. void far pascal _loadds GET_VOLUME_CONTROL_DATA16( Volume_Control_Record  far **  Volume_Control_Data,
  5608. CARDINAL32 far *              Count,
  5609. CARDINAL32 far *              Error_Code
  5610. );
  5611.  
  5612. /*********************************************************************/
  5613. /*                                                                   */
  5614. /*   Function Name: GET_VOLUME_INFORMATION16                         */
  5615. /*                                                                   */
  5616. /*   Descriptive Name:  This function returns the                    */
  5617. /*                      Volume_Information_Record for the volume     */
  5618. /*                      associated with Volume_Handle.               */
  5619. /*                                                                   */
  5620. /*   Input: CARDINAL32 Volume_Handle - The handle of the volume about*/
  5621. /*                                  which information is desired.    */
  5622. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5623. /*                                    in which to store an error code*/
  5624. /*                                    should an error occur.         */
  5625. /*                                                                   */
  5626. /*   Output: This function returns a Volume_Information_Record.      */
  5627. /*                                                                   */
  5628. /*           If this function is successful, then *Error_Code will be*/
  5629. /*              0.                                                   */
  5630. /*                                                                   */
  5631. /*           If this function fails, then *Error_Code will be > 0.   */
  5632. /*                                                                   */
  5633. /*   Error Handling:  If Volume_Handle is not a valid handle, a trap */
  5634. /*                    will be likely.  If Volume_Handle is a drive or*/
  5635. /*                    partition handle, *Error_Code will be > 0.     */
  5636. /*                                                                   */
  5637. /*   Side Effects:  None.                                            */
  5638. /*                                                                   */
  5639. /*   Notes:  None.                                                   */
  5640. /*                                                                   */
  5641. /*********************************************************************/
  5642. void far pascal _loadds GET_VOLUME_INFORMATION16( CARDINAL32                           Volume_Handle,
  5643. Volume_Information_Record  far *     Volume_Information,
  5644. CARDINAL32 far *                     Error_Code
  5645. );
  5646.  
  5647. /*********************************************************************/
  5648. /*                                                                   */
  5649. /*   Function Name: CREATE_VOLUME16                                  */
  5650. /*                                                                   */
  5651. /*   Descriptive Name:  This function creates a volume from a list of*/
  5652. /*                      partitions.  The partitions are specified by */
  5653. /*                      their corresponding handles.                 */
  5654. /*                                                                   */
  5655. /*   Input: char         Name[] - The name to assign to the newly    */
  5656. /*                                created volume.                    */
  5657. /*          BOOLEAN      Create_LVM_Volume - If TRUE, then an LVM    */
  5658. /*                                           volume is created,      */
  5659. /*                                           otherwise a             */
  5660. /*                                           compatibility volume is */
  5661. /*                                           created.                */
  5662. /*          BOOLEAN      Bootable - If TRUE, the volume will not be  */
  5663. /*                                  created unless OS/2 can be booted*/
  5664. /*                                  from it.                         */
  5665. /*          char         Drive_Letter_Preference - This is the drive */
  5666. /*                                                 letter to use for */
  5667. /*                                                 accessing the     */
  5668. /*                                                 newly created     */
  5669. /*                                                 volume.           */
  5670. /*          CARDINAL32   FeaturesToUse - This is currently reserved  */
  5671. /*                                       for future use and should   */
  5672. /*                                       always be set to 0.         */
  5673. /*          CARDINAL32   Partition_Count - The number of partitions  */
  5674. /*                                         to link together to form  */
  5675. /*                                         the volume being created. */
  5676. /*          ADDRESS      Partition_Handles[] - An array of partition */
  5677. /*                                             handles with one entry*/
  5678. /*                                             for each partition    */
  5679. /*                                             that is to become part*/
  5680. /*                                             of the volume being   */
  5681. /*                                             created.              */
  5682. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5683. /*                                    in which to store an error code*/
  5684. /*                                    should an error occur.         */
  5685. /*                                                                   */
  5686. /*   Output: *Error_Code will be 0 if the volume was created.        */
  5687. /*           *Error_Code will be > 0 if the volume could not be      */
  5688. /*              created.                                             */
  5689. /*                                                                   */
  5690. /*   Error Handling: If any of the handles in the partition handles  */
  5691. /*                   array is not valid, then a trap is likely.  If  */
  5692. /*                   Partition_Count is greater than the number of   */
  5693. /*                   entries in the partition handles array, then a  */
  5694. /*                   trap is likely.  If any of the handles in the   */
  5695. /*                   partition array are not partition handles, then */
  5696. /*                   *Error_Code will be > 0.  If the volume can NOT */
  5697. /*                   be created, then *Error_Code will be > 0 and any*/
  5698. /*                   memory allocated by this function will be freed.*/
  5699. /*                   If the volume can NOT be created, then the      */
  5700. /*                   existing partition/volume structure of the disk */
  5701. /*                   will be unchanged.                              */
  5702. /*                                                                   */
  5703. /*   Side Effects:  A volume may be created.                         */
  5704. /*                                                                   */
  5705. /*   Notes:  This function provides limited compatibility for        */
  5706. /*           programs written to use the LVM Version 1 interface.    */
  5707. /*           Specifically, this function will only allow the         */
  5708. /*           creation of compatibility volumes.  Any attempt to      */
  5709. /*           create an LVM volume will result in an error code being */
  5710. /*           returned.                                               */
  5711. /*                                                                   */
  5712. /*********************************************************************/
  5713. void far pascal _loadds CREATE_VOLUME16( char far         Name[VOLUME_NAME_SIZE],
  5714. BOOLEAN          Create_LVM_Volume,
  5715. BOOLEAN          Bootable,
  5716. char             Drive_Letter_Preference,
  5717. CARDINAL32       FeaturesToUse,
  5718. CARDINAL32       Partition_Count,
  5719. CARDINAL32       Partition_Handles[],
  5720. CARDINAL32 far * Error_Code
  5721. );
  5722.  
  5723. /*********************************************************************/
  5724. /*                                                                   */
  5725. /*   Function Name: CREATE_VOLUME216                                 */
  5726. /*                                                                   */
  5727. /*   Descriptive Name:  This function creates a volume from a list of*/
  5728. /*                      partitions.  The partitions are specified by */
  5729. /*                      their corresponding handles.                 */
  5730. /*                                                                   */
  5731. /*   Input: char         Name[] - The name to assign to the newly    */
  5732. /*                                created volume.                    */
  5733. /*          BOOLEAN      Create_LVM_Volume - If TRUE, then an LVM    */
  5734. /*                                           volume is created,      */
  5735. /*                                           otherwise a             */
  5736. /*                                           compatibility volume is */
  5737. /*                                           created.                */
  5738. /*          BOOLEAN      Bootable - If TRUE, the volume will not be  */
  5739. /*                                  created unless OS/2 can be booted*/
  5740. /*                                  from it.                         */
  5741. /*          char         Drive_Letter_Preference - This is the drive */
  5742. /*                                                 letter to use for */
  5743. /*                                                 accessing the     */
  5744. /*                                                 newly created     */
  5745. /*                                                 volume.           */
  5746. /*          CARDINAL32   Feature_Count - The number of features to   */
  5747. /*                                       install on the volume being */
  5748. /*                                       created.  This field is     */
  5749. /*                                       ignored if Create_LVM_Volume*/
  5750. /*                                       is FALSE.                   */
  5751. /*          LVM_Feature_Specification_Record FeaturesToUse[] - An    */
  5752. /*                                         array of feature IDs and  */
  5753. /*                                         their associated LVM      */
  5754. /*                                         classes used to designate */
  5755. /*                                         which features to install */
  5756. /*                                         on the volume being       */
  5757. /*                                         created and the order in  */
  5758. /*                                         which to install them.    */
  5759. /*                                         This field is ignored if  */
  5760. /*                                         Create_LVM_Volume is      */
  5761. /*                                         FALSE.                    */
  5762. /*          CARDINAL32   Partition_Count - The number of partitions  */
  5763. /*                                         to link together to form  */
  5764. /*                                         the volume being created. */
  5765. /*          ADDRESS      Partition_Handles[] - An array of partition */
  5766. /*                                             handles with one entry*/
  5767. /*                                             for each partition    */
  5768. /*                                             that is to become part*/
  5769. /*                                             of the volume being   */
  5770. /*                                             created.              */
  5771. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5772. /*                                    in which to store an error code*/
  5773. /*                                    should an error occur.         */
  5774. /*                                                                   */
  5775. /*   Output: *Error_Code will be 0 if the volume was created.        */
  5776. /*           *Error_Code will be > 0 if the volume could not be      */
  5777. /*              created.                                             */
  5778. /*                                                                   */
  5779. /*   Error Handling: If any of the handles in the partition handles  */
  5780. /*                   array is not valid, then a trap is likely.  If  */
  5781. /*                   Partition_Count is greater than the number of   */
  5782. /*                   entries in the partition handles array, then a  */
  5783. /*                   trap is likely.  If any of the handles in the   */
  5784. /*                   partition array are not partition handles, then */
  5785. /*                   *Error_Code will be > 0.  If the volume can NOT */
  5786. /*                   be created, then *Error_Code will be > 0 and any*/
  5787. /*                   memory allocated by this function will be freed.*/
  5788. /*                   If the volume can NOT be created, then the      */
  5789. /*                   existing partition/volume structure of the disk */
  5790. /*                   will be unchanged.                              */
  5791. /*                                                                   */
  5792. /*   Side Effects:  A volume may be created.                         */
  5793. /*                                                                   */
  5794. /*   Notes:  None.                                                   */
  5795. /*                                                                   */
  5796. /*********************************************************************/
  5797. void far pascal _loadds CREATE_VOLUME216( char far  *                             Name,
  5798. BOOLEAN                                 Create_LVM_Volume,
  5799. BOOLEAN                                 Bootable,
  5800. char                                    Drive_Letter_Preference,
  5801. CARDINAL32                              Feature_Count,
  5802. LVM_Feature_Specification_Record far *  FeaturesToUse,
  5803. CARDINAL32                              Partition_Count,
  5804. CARDINAL32 far *                        Partition_Handles,
  5805. CARDINAL32 far *                        Error_Code
  5806. );
  5807.  
  5808. /*********************************************************************/
  5809. /*                                                                   */
  5810. /*   Function Name: DELETE_VOLUME16                                  */
  5811. /*                                                                   */
  5812. /*   Descriptive Name: Deletes the volume specified by Volume_Handle.*/
  5813. /*                                                                   */
  5814. /*   Input: CARDINAL32 Volume_Handle - The handle of the volume to   */
  5815. /*                                  delete.  All partitions which are*/
  5816. /*                                  part of the specified volume will*/
  5817. /*                                  be deleted also.                 */
  5818. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5819. /*                                    in which to store an error code*/
  5820. /*                                    should an error occur.         */
  5821. /*                                                                   */
  5822. /*   Output: *Error_Code will be 0 if the volume and its partitions  */
  5823. /*           are successfully deleted.  Otherwise, *Error_Code will  */
  5824. /*           be > 0.                                                 */
  5825. /*                                                                   */
  5826. /*   Error Handling: *Error_Code will be > 0 if an error occurs.  If */
  5827. /*                   the volume or any of its partitions can not be  */
  5828. /*                   deleted, then any changes made by this function */
  5829. /*                   will be undone.                                 */
  5830. /*                                                                   */
  5831. /*                   If Volume_Handle is not a valid handle, a trap  */
  5832. /*                   may result.                                     */
  5833. /*                                                                   */
  5834. /*                   If Volume_Handle is a partition or drive handle,*/
  5835. /*                   then this function will abort and set           */
  5836. /*                   *Error_Code to a non-zero value.                */
  5837. /*                                                                   */
  5838. /*   Side Effects:  A volume and its partitions may be deleted.      */
  5839. /*                  System memory may be freed as the internal       */
  5840. /*                  structures used to track the deleted volume      */
  5841. /*                  are no longer required.                          */
  5842. /*                                                                   */
  5843. /*   Notes:  None.                                                   */
  5844. /*                                                                   */
  5845. /*********************************************************************/
  5846. void far pascal _loadds DELETE_VOLUME16( CARDINAL32          Volume_Handle,
  5847. CARDINAL32 far *    Error_Code
  5848. );
  5849.  
  5850. /*********************************************************************/
  5851. /*                                                                   */
  5852. /*   Function Name: HIDE_VOLUME16                                    */
  5853. /*                                                                   */
  5854. /*   Descriptive Name: Hide volume "hides" a volume from OS/2 by     */
  5855. /*                     removing its drive letter assignment.  Without*/
  5856. /*                     a drive letter assignment, OS/2 can not access*/
  5857. /*                     (or "see") the volume.                        */
  5858. /*                                                                   */
  5859. /*   Input: CARDINAL32 Volume_Handle - The handle of the volume to   */
  5860. /*                                     hide.                         */
  5861. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5862. /*                                    in which to store an error code*/
  5863. /*                                    should an error occur.         */
  5864. /*                                                                   */
  5865. /*   Output: *Error_Code will be 0 if the volume was successfully    */
  5866. /*           hidden.  If the volume could not be hidden, then        */
  5867. /*           *Error_Code will be > 0.                                */
  5868. /*                                                                   */
  5869. /*   Error Handling: *Error_Code will be > 0 if the volume can not be*/
  5870. /*                   hidden.  If the volume can not be hidden, then  */
  5871. /*                   nothing will be altered.                        */
  5872. /*                                                                   */
  5873. /*                   If Volume_Handle is not a valid handle, a trap  */
  5874. /*                   may result.                                     */
  5875. /*                                                                   */
  5876. /*                   If Volume_Handle is a partition or drive handle,*/
  5877. /*                   then this function will abort and set           */
  5878. /*                   *Error_Code to a non-zero value.                */
  5879. /*                                                                   */
  5880. /*   Side Effects:  None.                                            */
  5881. /*                                                                   */
  5882. /*   Notes:  None.                                                   */
  5883. /*                                                                   */
  5884. /*********************************************************************/
  5885. void far pascal _loadds HIDE_VOLUME16( CARDINAL32          Volume_Handle,
  5886. CARDINAL32 far *    Error_Code
  5887. );
  5888.  
  5889. /*********************************************************************/
  5890. /*                                                                   */
  5891. /*   Function Name: EXPAND_VOLUME16                                  */
  5892. /*                                                                   */
  5893. /*   Descriptive Name: This function expands an existing volume by   */
  5894. /*                     linking additional partitions to it.          */
  5895. /*                                                                   */
  5896. /*   Input: CARDINAL32 Volume_Handle - The handle of the volume to be*/
  5897. /*                                  expanded.                        */
  5898. /*          CARDINAL32 Partition_Count - The number of partitions or */
  5899. /*                                       volumes to be added to the  */
  5900. /*                                       volume being expanded.      */
  5901. /*          CARDINAL32 Partition_Handles[] - An array of handles.    */
  5902. /*                                        Each handle in the array is*/
  5903. /*                                        the handle of a partition  */
  5904. /*                                        which is to be added to the*/
  5905. /*                                        volume being expanded.     */
  5906. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5907. /*                                    in which to store an error code*/
  5908. /*                                    should an error occur.         */
  5909. /*                                                                   */
  5910. /*   Output: *Error_Code will be 0 if the volume is successfully     */
  5911. /*           expanded.  If the volume can not be expanded,           */
  5912. /*           *Error_Code will be > 0.                                */
  5913. /*                                                                   */
  5914. /*   Error Handling: If the volume can not be expanded, the state of */
  5915. /*                   the volume is unchanged and any memory allocated*/
  5916. /*                   by this function is freed.                      */
  5917. /*                                                                   */
  5918. /*                   If Volume_Handle is not a valid handle, a trap  */
  5919. /*                   may result.                                     */
  5920. /*                                                                   */
  5921. /*                   If Volume_Handle is a partition or drive handle,*/
  5922. /*                   then this function will abort and set           */
  5923. /*                   *Error_Code to a non-zero value.                */
  5924. /*                                                                   */
  5925. /*                   If any of the partition handles in the          */
  5926. /*                   Partition_handles array are not valid handles,  */
  5927. /*                   then a trap may result.                         */
  5928. /*                                                                   */
  5929. /*                   If any of the partition handles in the          */
  5930. /*                   Partition_Handles array are actually drive      */
  5931. /*                   handles, then this function will abort and      */
  5932. /*                   set *Error_Code to a non-zero value.            */
  5933. /*                                                                   */
  5934. /*                   If Partition_Count is greater than the number of*/
  5935. /*                   entries in the Partition_Handles array, a trap  */
  5936. /*                   may result.                                     */
  5937. /*                                                                   */
  5938. /*   Side Effects:  A volume may be expanded.  If the volume is      */
  5939. /*                  expanded using another volume, the partitions    */
  5940. /*                  on the second volume will be linked to those of  */
  5941. /*                  the first volume and all data on the second      */
  5942. /*                  volume will be lost.                             */
  5943. /*                                                                   */
  5944. /*   Notes:  None.                                                   */
  5945. /*                                                                   */
  5946. /*********************************************************************/
  5947. void far pascal _loadds EXPAND_VOLUME16 ( CARDINAL32        Volume_Handle,
  5948. CARDINAL32        Partition_Count,
  5949. CARDINAL32 far    Partition_Handles[],
  5950. CARDINAL32 far *  Error_Code
  5951. );
  5952.  
  5953. /*********************************************************************/
  5954. /*                                                                   */
  5955. /*   Function Name: ASSIGN_DRIVE_LETTER16                            */
  5956. /*                                                                   */
  5957. /*   Descriptive Name: Assigns a drive letter to a volume.           */
  5958. /*                                                                   */
  5959. /*   Input: CARDINAL32 Volume_Handle - The handle of the volume which*/
  5960. /*                                  is to have its assigned drive    */
  5961. /*                                  letter changed.                  */
  5962. /*          char  New_Drive_Preference - The new drive letter to     */
  5963. /*                                       assign to the volume.       */
  5964. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  5965. /*                                    in which to store an error code*/
  5966. /*                                    should an error occur.         */
  5967. /*                                                                   */
  5968. /*   Output: *Error_Code will be 0 if the drive letter was assigned  */
  5969. /*           successfully; otherwise *Error_Code will be > 0.        */
  5970. /*                                                                   */
  5971. /*   Error Handling: If the drive letter assignment can not be made, */
  5972. /*                   the volume will not be altered.                 */
  5973. /*                                                                   */
  5974. /*                   If Volume_Handle is not a valid handle, a trap  */
  5975. /*                   may result.                                     */
  5976. /*                                                                   */
  5977. /*                   If Volume_Handle is a partition or drive handle,*/
  5978. /*                   then this function will abort and set           */
  5979. /*                   *Error_Code to a non-zero value.                */
  5980. /*                                                                   */
  5981. /*   Side Effects:  A volume may have its drive letter assignment    */
  5982. /*                  changed.                                         */
  5983. /*                                                                   */
  5984. /*   Notes:  If the drive letter being assigned is already in use by */
  5985. /*           volume which does not lie on removable media, then the  */
  5986. /*           drive assignment will NOT be made.                      */
  5987. /*                                                                   */
  5988. /*********************************************************************/
  5989. void far pascal _loadds ASSIGN_DRIVE_LETTER16( CARDINAL32          Volume_Handle,
  5990. char                New_Drive_Preference,
  5991. CARDINAL32 far *    Error_Code
  5992. );
  5993.  
  5994. /*********************************************************************/
  5995. /*                                                                   */
  5996. /*   Function Name: SET_INSTALLABLE16                                */
  5997. /*                                                                   */
  5998. /*   Descriptive Name: Marks a volume as being the volume to install */
  5999. /*                     OS/2 on.                                      */
  6000. /*                                                                   */
  6001. /*   Input: CARDINAL32 Volume_Handle - The handle of the volume to   */
  6002. /*                                  which OS/2 should be installed.  */
  6003. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6004. /*                                    in which to store an error code*/
  6005. /*                                    should an error occur.         */
  6006. /*                                                                   */
  6007. /*   Output: If the volume is successfully marked as installable,    */
  6008. /*           *Error_Code will be 0; otherwise *Error_Code will       */
  6009. /*           be > 0.                                                 */
  6010. /*                                                                   */
  6011. /*   Error Handling: If Volume_Handle is not a valid handle, a trap  */
  6012. /*                   may result.                                     */
  6013. /*                                                                   */
  6014. /*                   If Volume_Handle is a partition or drive handle,*/
  6015. /*                   then this function will abort and set           */
  6016. /*                   *Error_Code to a non-zero value.                */
  6017. /*                                                                   */
  6018. /*   Side Effects:  The specified volume may be marked as            */
  6019. /*                  installable.                                     */
  6020. /*                                                                   */
  6021. /*   Notes:  None.                                                   */
  6022. /*                                                                   */
  6023. /*********************************************************************/
  6024. void far pascal _loadds SET_INSTALLABLE16 ( CARDINAL32          Volume_Handle,
  6025. CARDINAL32 far *    Error_Code
  6026. );
  6027.  
  6028. /*********************************************************************/
  6029. /*                                                                   */
  6030. /*   Function Name: GET_INSTALLABLE_VOLUME16                         */
  6031. /*                                                                   */
  6032. /*   Descriptive Name: Marks a volume as being the volume to install */
  6033. /*                     OS/2 on.                                      */
  6034. /*                                                                   */
  6035. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6036. /*                                    in which to store an error code*/
  6037. /*                                    should an error occur.         */
  6038. /*                                                                   */
  6039. /*   Output: If a volume is mared installable, its information will  */
  6040. /*           be returned and *Error_Code will be LVM_ENGINE_NO_ERROR.*/
  6041. /*           If there is no volume marked installable, then          */
  6042. /*           *Error_Code will be > 0.                                */
  6043. /*                                                                   */
  6044. /*   Error Handling: An error code is returned if there is an error. */
  6045. /*                                                                   */
  6046. /*   Side Effects:  None.                                            */
  6047. /*                                                                   */
  6048. /*   Notes:  None.                                                   */
  6049. /*                                                                   */
  6050. /*********************************************************************/
  6051. void far pascal _loadds GET_INSTALLABLE_VOLUME16 ( Volume_Information_Record * Volume_Information,
  6052. CARDINAL32 far *            Error_Code
  6053. );
  6054.  
  6055. /* ************************************************************************** *
  6056.  
  6057. 16 Bit Functions relating to Partitions, Drives, and Volumes.
  6058.  
  6059. ************************************************************************** */
  6060.  
  6061. /*********************************************************************/
  6062. /*                                                                   */
  6063. /*   Function Name: SET_NAME16                                       */
  6064. /*                                                                   */
  6065. /*   Descriptive Name: Sets the name of a volume, drive, or partition*/
  6066. /*                                                                   */
  6067. /*   Input: CARDINAL32 Handle - The handle of the drive, partition,  */
  6068. /*                           or volume which is to have its name set.*/
  6069. /*          char New_Name[] - The new name for the drive/partition/  */
  6070. /*                            volume.                                */
  6071. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6072. /*                                    in which to store an error code*/
  6073. /*                                    should an error occur.         */
  6074. /*                                                                   */
  6075. /*   Output: *Error_Code will be 0 if the name is set as specified.  */
  6076. /*           If the name can not be set, *Error_Code will be > 0.    */
  6077. /*                                                                   */
  6078. /*   Error Handling: If the name can not be set, then drive/volume/  */
  6079. /*                   partition is not modified.                      */
  6080. /*                                                                   */
  6081. /*                   If Handle is not a valid handle, a trap may     */
  6082. /*                   result.                                         */
  6083. /*                                                                   */
  6084. /*   Side Effects:  A drive/volume/partition may have its name set.  */
  6085. /*                                                                   */
  6086. /*   Notes:  None.                                                   */
  6087. /*                                                                   */
  6088. /*********************************************************************/
  6089. void far pascal _loadds SET_NAME16 ( CARDINAL32       Handle,
  6090. char  far        New_Name[],
  6091. CARDINAL32 far * Error_Code
  6092. );
  6093.  
  6094. /*********************************************************************/
  6095. /*                                                                   */
  6096. /*   Function Name: SET_STARTABLE16                                  */
  6097. /*                                                                   */
  6098. /*   Descriptive Name: Sets the specified volume or partition        */
  6099. /*                     startable.  If a volume is specified, it must */
  6100. /*                     be a compatibility volume whose partition is  */
  6101. /*                     a primary partition on the first drive.  If a */
  6102. /*                     partition is specified, it must be a primary  */
  6103. /*                     partition on the first drive in the system.   */
  6104. /*                                                                   */
  6105. /*   Input: CARDINAL32 Handle - The handle of the partition or volume*/
  6106. /*                           which is to be set startable.           */
  6107. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6108. /*                                    in which to store an error code*/
  6109. /*                                    should an error occur.         */
  6110. /*                                                                   */
  6111. /*   Output: *Error_Code will be 0 if the specified volume or        */
  6112. /*           partition was set startable.                            */
  6113. /*           If the name can not be set, *Error_Code will be > 0.    */
  6114. /*                                                                   */
  6115. /*   Error Handling: If the volume or partition could not be set     */
  6116. /*                   startable, then nothing in the system is        */
  6117. /*                   changed.                                        */
  6118. /*                                                                   */
  6119. /*                   If Handle is not a valid handle, a trap may     */
  6120. /*                   result.                                         */
  6121. /*                                                                   */
  6122. /*   Side Effects:  Any other partition or volume which is marked    */
  6123. /*                  startable will have its startable flag cleared.  */
  6124. /*                                                                   */
  6125. /*   Notes:  None.                                                   */
  6126. /*                                                                   */
  6127. /*********************************************************************/
  6128. void  far pascal _loadds SET_STARTABLE16 ( CARDINAL32       Handle,
  6129. CARDINAL32 far * Error_Code
  6130. );
  6131.  
  6132. /*********************************************************************/
  6133. /*                                                                   */
  6134. /*   Function Name: GET_VALID_OPTIONS16                              */
  6135. /*                                                                   */
  6136. /*   Descriptive Name: Returns a bitmap where each bit in the bitmap */
  6137. /*                     corresponds to a possible operation that the  */
  6138. /*                     LVM Engine can perform.  Those bits which are */
  6139. /*                     1 represent operations which can be performed */
  6140. /*                     on the item specified by Handle.  Those bits  */
  6141. /*                     which are 0 are not allowed on the item       */
  6142. /*                     specified by Handle.                          */
  6143. /*                                                                   */
  6144. /*   Input: CARDINAL32 Handle - This is any valid drive, volume, or  */
  6145. /*                           partition handle.                       */
  6146. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6147. /*                                    in which to store an error code*/
  6148. /*                                    should an error occur.         */
  6149. /*                                                                   */
  6150. /*   Output:  A bitmap indicating which operations are valid on the  */
  6151. /*            item specified by Handle.                              */
  6152. /*                                                                   */
  6153. /*            If no errors occur, *Error_Code will be 0, otherwise   */
  6154. /*            *Error_Code will be > 0.                               */
  6155. /*                                                                   */
  6156. /*   Error Handling:  If Handle is not valid, a trap will be likely. */
  6157. /*                                                                   */
  6158. /*   Side Effects:  None.                                            */
  6159. /*                                                                   */
  6160. /*   Notes:  The values of the various bits in the bitmap returned   */
  6161. /*           by this function are defined near the beginning of this */
  6162. /*           file, immediately after all of the structure            */
  6163. /*           definitions.                                            */
  6164. /*                                                                   */
  6165. /*********************************************************************/
  6166. CARDINAL32 far pascal _loadds GET_VALID_OPTIONS16( CARDINAL32        Handle,
  6167. CARDINAL32 far *    Error_Code
  6168. );
  6169.  
  6170. /* ************************************************************************** *
  6171.  
  6172. 16 Bit Functions relating to Boot Manager
  6173.  
  6174. ************************************************************************** */
  6175.  
  6176. /*********************************************************************/
  6177. /*                                                                   */
  6178. /*   Function Name: BOOT_MANAGER_IS_INSTALLED16                      */
  6179. /*                                                                   */
  6180. /*   Descriptive Name: Indicates whether or not Boot Manager is      */
  6181. /*                     installed on the first or second hard drives  */
  6182. /*                     in the system.                                */
  6183. /*                                                                   */
  6184. /*   Input: BOOLEAN * Active - *Active is set to TRUE if LVM found an*/
  6185. /*                             active copy of Boot Manager on the    */
  6186. /*                             system.  If LVM could not find an     */
  6187. /*                             active copy of Boot Manager on the    */
  6188. /*                             system, but did find an inactive copy */
  6189. /*                             of Boot Manager, then *Active will be */
  6190. /*                             set to FALSE.                         */
  6191. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6192. /*                                    in which to store an error code*/
  6193. /*                                    should an error occur.         */
  6194. /*                                                                   */
  6195. /*   Output: TRUE is returned if Boot Manager is found.  If this     */
  6196. /*           copy of Boot Manager is Active, then *Active will be set*/
  6197. /*           to TRUE.  If the copy of Boot Manager is not currently  */
  6198. /*           active, then *Active will be set to FALSE.              */
  6199. /*                                                                   */
  6200. /*           FALSE is returned if Boot Manager is not found or if an */
  6201. /*           error occurs.  In this case, *Active is undefined.      */
  6202. /*                                                                   */
  6203. /*           *Error_Code will be 0 if no errors occur; otherwise it  */
  6204. /*           will be > 0.                                            */
  6205. /*                                                                   */
  6206. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  6207. /*                                                                   */
  6208. /*   Side Effects:  None.                                            */
  6209. /*                                                                   */
  6210. /*   Notes:  None.                                                   */
  6211. /*                                                                   */
  6212. /*********************************************************************/
  6213. BOOLEAN far pascal _loadds BOOT_MANAGER_IS_INSTALLED16( BOOLEAN far * Active, CARDINAL32 far * Error_Code);
  6214.  
  6215. /*********************************************************************/
  6216. /*                                                                   */
  6217. /*   Function Name: GET_BOOT_MANAGER_HANDLE16                        */
  6218. /*                                                                   */
  6219. /*   Descriptive Name: Returns the handle of the partition containing*/
  6220. /*                     Boot Manager.                                 */
  6221. /*                                                                   */
  6222. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6223. /*                                    in which to store an error code*/
  6224. /*                                    should an error occur.         */
  6225. /*                                                                   */
  6226. /*   Output: If Boot Manager is NOT installed, NULL is returned.     */
  6227. /*           If Boot Manager is installed, whether it is active or   */
  6228. /*           not, the handle of the partition it resides in is       */
  6229. /*           returned.                                               */
  6230. /*                                                                   */
  6231. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  6232. /*                                                                   */
  6233. /*   Side Effects:  None.                                            */
  6234. /*                                                                   */
  6235. /*   Notes:  If Boot_Manager_Is_Installed returns FALSE, but this    */
  6236. /*           function does not return NULL, then the handle returned */
  6237. /*           represents an inactive copy of Boot Manager.  To        */
  6238. /*           activate an inactive Boot Manager, pass its handle to   */
  6239. /*           the Set_Startable function.                             */
  6240. /*                                                                   */
  6241. /*           See the Notes for the Boot_Manager_Is_Installed function*/
  6242. /*           for additional information.                             */
  6243. /*                                                                   */
  6244. /*********************************************************************/
  6245. ADDRESS far _pascal _loadds GET_BOOT_MANAGER_HANDLE16( CARDINAL32 far * Error_Code);
  6246.  
  6247. /*********************************************************************/
  6248. /*                                                                   */
  6249. /*   Function Name: ADD_TO_BOOT_MANAGER16                            */
  6250. /*                                                                   */
  6251. /*   Descriptive Name: Adds the volume/partition to the Boot Manager */
  6252. /*                     menu.                                         */
  6253. /*                                                                   */
  6254. /*   Input: CARDINAL32 Handle - The handle of a partition or volume  */
  6255. /*                      that is to be added to the Boot Manager menu.*/
  6256. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6257. /*                                    in which to store an error code*/
  6258. /*                                    should an error occur.         */
  6259. /*                                                                   */
  6260. /*   Output: *Error_Code will be 0 if the partition or volume was    */
  6261. /*           successfully added to the Boot Manager menu; otherwise  */
  6262. /*           *Error_Code will be > 0.                                */
  6263. /*                                                                   */
  6264. /*   Error Handling: If the partition/volume can not be added to the */
  6265. /*                   Boot Manager menu, no action is taken and       */
  6266. /*                   *Error_Code will contain a non-zero error code. */
  6267. /*                                                                   */
  6268. /*                   If Handle is not a valid handle, a trap may     */
  6269. /*                   result.                                         */
  6270. /*                                                                   */
  6271. /*                   If Handle represents a drive, then this function*/
  6272. /*                   will abort and set *Error_Code to a non-zero    */
  6273. /*                   value.                                          */
  6274. /*                                                                   */
  6275. /*   Side Effects:  The Boot Manager menu may be altered.            */
  6276. /*                                                                   */
  6277. /*   Notes:  None.                                                   */
  6278. /*                                                                   */
  6279. /*********************************************************************/
  6280. void far pascal _loadds ADD_TO_BOOT_MANAGER16 ( CARDINAL32 Handle, CARDINAL32 far * Error_Code );
  6281.  
  6282. /*********************************************************************/
  6283. /*                                                                   */
  6284. /*   Function Name: REMOVE_FROM_BOOT_MANAGER16                       */
  6285. /*                                                                   */
  6286. /*   Descriptive Name: Removes the specified partition or volume     */
  6287. /*                     from the Boot Manager menu.                   */
  6288. /*                                                                   */
  6289. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6290. /*                                    in which to store an error code*/
  6291. /*                                    should an error occur.         */
  6292. /*                                                                   */
  6293. /*                                                                   */
  6294. /*   Output: *Error_Code will be 0 if the partition or volume was    */
  6295. /*           successfully removed to the Boot Manager menu;          */
  6296. /*           otherwise *Error_Code will be > 0.                      */
  6297. /*                                                                   */
  6298. /*   Error Handling: If Handle is not a valid handle, a trap may     */
  6299. /*                   result.                                         */
  6300. /*                                                                   */
  6301. /*                   If Handle represents a drive, or if Handle      */
  6302. /*                   represents a volume or partition which is NOT on*/
  6303. /*                   the boot manager menu, then this function       */
  6304. /*                   will abort and set *Error_Code to a non-zero    */
  6305. /*                   value.                                          */
  6306. /*                                                                   */
  6307. /*   Side Effects:  The Boot Manager menu may be altered.            */
  6308. /*                                                                   */
  6309. /*   Notes:  None.                                                   */
  6310. /*                                                                   */
  6311. /*********************************************************************/
  6312. void far pascal _loadds REMOVE_FROM_BOOT_MANAGER16 ( CARDINAL32 Handle, CARDINAL32 far * Error_Code );
  6313.  
  6314. /*********************************************************************/
  6315. /*                                                                   */
  6316. /*   Function Name: GET_BOOT_MANAGER_MENU16                          */
  6317. /*                                                                   */
  6318. /*   Descriptive Name: Returns an array containing the handles of the*/
  6319. /*                     partitions and volumes appearing on the       */
  6320. /*                     Boot Manager menu.                            */
  6321. /*                                                                   */
  6322. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6323. /*                                    in which to store an error code*/
  6324. /*                                    should an error occur.         */
  6325. /*                                                                   */
  6326. /*   Output: The function returns a Boot_Manager_Menu structure.     */
  6327. /*           This structure contains two items: a pointer to an array*/
  6328. /*           of Boot_Manager_Menu_Items and a count of how many items*/
  6329. /*           are in the array.  Each Boot_Manager_Menu_Item contains */
  6330. /*           a handle and a BOOLEAN variable to indicate whether the */
  6331. /*           handle is for a partition or a volume.                  */
  6332. /*                                                                   */
  6333. /*           If this function is successful, then *Error_Code will   */
  6334. /*           be 0.                                                   */
  6335. /*                                                                   */
  6336. /*           If an error occurs, the Count field in the              */
  6337. /*           Boot_Manager_Menu will be 0 and the corresponding       */
  6338. /*           pointer will be NULL.  *Error_Code will be > 0.         */
  6339. /*                                                                   */
  6340. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  6341. /*                   any memory allocated by this function will be   */
  6342. /*                   freed.                                          */
  6343. /*                                                                   */
  6344. /*   Side Effects:  None.                                            */
  6345. /*                                                                   */
  6346. /*   Notes:  None.                                                   */
  6347. /*                                                                   */
  6348. /*********************************************************************/
  6349. void far pascal _loadds GET_BOOT_MANAGER_MENU16 ( Boot_Manager_Menu_Item **  Menu_Items,
  6350. CARDINAL32 *               Count,
  6351. CARDINAL32 *               Error_Code
  6352. );
  6353.  
  6354. /*********************************************************************/
  6355. /*                                                                   */
  6356. /*   Function Name: INSTALL_BOOT_MANAGER16                           */
  6357. /*                                                                   */
  6358. /*   Descriptive Name: This function installs Boot Manager.  It can  */
  6359. /*                     be used to replace an existing Boot Manager   */
  6360. /*                     as well.                                      */
  6361. /*                                                                   */
  6362. /*   Input: CARDINAL32  Drive_Number - The number of the drive to    */
  6363. /*                                     install Boot Manager on.  Must*/
  6364. /*                                     be 1 or 2.                    */
  6365. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6366. /*                                    in which to store an error code*/
  6367. /*                                    should an error occur.         */
  6368. /*                                                                   */
  6369. /*   Output: If this function is successful, then *Error_Code will be*/
  6370. /*           0; otherwise it will be > 0.                            */
  6371. /*                                                                   */
  6372. /*   Error Handling: If an error occurs, *Error_Code will be set to a*/
  6373. /*                   non-zero value.  Depending upon the error, it   */
  6374. /*                   is possible that the Boot Manager partition can */
  6375. /*                   be left in an unusuable state (such as for a    */
  6376. /*                   write error).                                   */
  6377. /*                                                                   */
  6378. /*   Side Effects: Boot Manager may be installed on drive 1 or 2.    */
  6379. /*                 The MBR for drive 1 may be altered.               */
  6380. /*                                                                   */
  6381. /*   Notes:  None.                                                   */
  6382. /*                                                                   */
  6383. /*********************************************************************/
  6384. void far pascal _loadds INSTALL_BOOT_MANAGER16 ( CARDINAL32   Drive_Number, CARDINAL32 far * Error_Code );
  6385.  
  6386. /*********************************************************************/
  6387. /*                                                                   */
  6388. /*   Function Name: REMOVE_BOOT_MANAGER16                            */
  6389. /*                                                                   */
  6390. /*   Descriptive Name: Removes Boot Manager from the system.         */
  6391. /*                                                                   */
  6392. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6393. /*                                    in which to store an error code*/
  6394. /*                                    should an error occur.         */
  6395. /*                                                                   */
  6396. /*   Output: *Error_Code will be 0 if Boot Manager was successfully  */
  6397. /*           removed from the system; otherwise *Error_Code will     */
  6398. /*           be 0.                                                   */
  6399. /*                                                                   */
  6400. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  6401. /*                                                                   */
  6402. /*   Side Effects:  Boot Manager will be removed from the system.    */
  6403. /*                                                                   */
  6404. /*   Notes:  None.                                                   */
  6405. /*                                                                   */
  6406. /*********************************************************************/
  6407. void far pascal _loadds REMOVE_BOOT_MANAGER16( CARDINAL32 far * Error_Code );
  6408.  
  6409. /*********************************************************************/
  6410. /*                                                                   */
  6411. /*   Function Name: SET_BOOT_MANAGER_OPTIONS16                       */
  6412. /*                                                                   */
  6413. /*   Descriptive Name: Sets the Boot Managers Options.  The options  */
  6414. /*                     that can be set are: whether or not the time- */
  6415. /*                     out timer is active, how long the timer-out   */
  6416. /*                     is, the partition to boot by default, and     */
  6417. /*                     whether or not Boot Manager should display its*/
  6418. /*                     menu using default mode or advanced mode.     */
  6419. /*                                                                   */
  6420. /*   Input: CARDINAL32 Handle - The handle of the partition or volume*/
  6421. /*                           to boot if the time-out timer is active */
  6422. /*                           and the time-out value is reached.      */
  6423. /*          BOOLEAN Timer_Active - If TRUE, then the time-out timer  */
  6424. /*                                 is active.                        */
  6425. /*          CARDINAL32 Time_Out_Value - If the time-out timer is     */
  6426. /*                                      active, this is the time-out */
  6427. /*                                      value, in seconds.           */
  6428. /*          BOOLEAN Advanced_Mode - If TRUE, then Boot Manager will  */
  6429. /*                                  operate in advanced mode.  If    */
  6430. /*                                  FALSE, then normal mode will be  */
  6431. /*                                  in effect.                       */
  6432. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6433. /*                                    in which to store an error code*/
  6434. /*                                    should an error occur.         */
  6435. /*                                                                   */
  6436. /*   Output: *Error_Code will be 0 if no errors occur.  If an error  */
  6437. /*           does occur, then *Error_Code will be > 0.               */
  6438. /*                                                                   */
  6439. /*   Error Handling: If an error occurs, no changes will be made to  */
  6440. /*                   Boot Manager and *Error_Code will be set a      */
  6441. /*                   non-zero error code.                            */
  6442. /*                                                                   */
  6443. /*   Side Effects:  Boot Manager may be modified.                    */
  6444. /*                                                                   */
  6445. /*   Notes:  None.                                                   */
  6446. /*                                                                   */
  6447. /*********************************************************************/
  6448. void far pascal _loadds SET_BOOT_MANAGER_OPTIONS16( CARDINAL32          Handle,
  6449. BOOLEAN             Timer_Active,
  6450. CARDINAL32          Time_Out_Value,
  6451. BOOLEAN             Advanced_Mode,
  6452. CARDINAL32 far *    Error_Code
  6453. );
  6454.  
  6455. /*********************************************************************/
  6456. /*                                                                   */
  6457. /*   Function Name: GET_BOOT_MANAGER_OPTIONS16                       */
  6458. /*                                                                   */
  6459. /*   Descriptive Name: This function returns the current Boot Manager*/
  6460. /*                     settings for the various Boot Manager options.*/
  6461. /*                                                                   */
  6462. /*   Input: CARDINAL32 * Handle - The handle for the default boot    */
  6463. /*                             volume or partition.                  */
  6464. /*          BOOLEAN * Handle_Is_Volume - If TRUE, then Handle        */
  6465. /*                                       represents a volume.  If    */
  6466. /*                                       FALSE, then Handle          */
  6467. /*                                       represents a partition.     */
  6468. /*          BOOLEAN * Timer_Active - If TRUE, then the time-out timer*/
  6469. /*                                   is active.  If FALSE, then the  */
  6470. /*                                   time-out timer is not active.   */
  6471. /*          CARDINAL32 * Time_Out_Value - If the time-out timer is   */
  6472. /*                                        active, then this is the   */
  6473. /*                                        number of seconds that Boot*/
  6474. /*                                        Manager will wait for user */
  6475. /*                                        input before booting the   */
  6476. /*                                        default volume/partition.  */
  6477. /*          BOOLEAN * Advanced_Mode - If TRUE, the Boot Manager is   */
  6478. /*                                    operating in advanced mode.  If*/
  6479. /*                                    FALSE, then Boot Manager is    */
  6480. /*                                    operating in normal mode.      */
  6481. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6482. /*                                    in which to store an error code*/
  6483. /*                                    should an error occur.         */
  6484. /*                                                                   */
  6485. /*   Output: *Handle, *Handle_Is_Volume, *Timer_Active,              */
  6486. /*           *Time_out_value, *Advanced_Mode, and *Error_Code are all*/
  6487. /*           set by this function.  If there are no errors, then     */
  6488. /*           *Error_Code will be set to 0.  If any errors occur, then*/
  6489. /*           *Error_Code will be > 0.                                */
  6490. /*                                                                   */
  6491. /*   Error Handling: If any of the parameters are invalid, then a    */
  6492. /*                   trap is likely.  If Boot Manager is not         */
  6493. /*                   installed, then *Error_Code will be > 0.        */
  6494. /*                                                                   */
  6495. /*   Side Effects:  None.                                            */
  6496. /*                                                                   */
  6497. /*   Notes:  None.                                                   */
  6498. /*                                                                   */
  6499. /*********************************************************************/
  6500. void far pascal _loadds GET_BOOT_MANAGER_OPTIONS16( CARDINAL32 far * Handle,
  6501. BOOLEAN    far * Handle_Is_Volume,
  6502. BOOLEAN    far * Timer_Active,
  6503. CARDINAL32 far * Time_Out_Value,
  6504. BOOLEAN    far * Advanced_Mode,
  6505. CARDINAL32 far * Error_Code
  6506. );
  6507.  
  6508. /* ************************************************************************** *
  6509.  
  6510. Other 16 Bit Functions
  6511.  
  6512. ************************************************************************** */
  6513.  
  6514. /*********************************************************************/
  6515. /*                                                                   */
  6516. /*   Function Name:  FREE_ENGINE_MEMORY16                            */
  6517. /*                                                                   */
  6518. /*   Descriptive Name: Frees a memory object created by LVM.DLL and  */
  6519. /*                     returned to a user of LVM.DLL.                */
  6520. /*                                                                   */
  6521. /*   Input: CARDINAL32 Object : The address of the memory object to  */
  6522. /*                           free.  This could be the                */
  6523. /*                           Drive_Control_Data field of a           */
  6524. /*                           Drive_Control_Record, the               */
  6525. /*                           Partition_Array field of a              */
  6526. /*                           Partition_Information_Array structure,  */
  6527. /*                           or any other dynamically allocated      */
  6528. /*                           memory object created by LVM.DLL and    */
  6529. /*                           returned by a function in LVM.DLL.      */
  6530. /*                                                                   */
  6531. /*   Output: None.                                                   */
  6532. /*                                                                   */
  6533. /*   Error Handling: None.                                           */
  6534. /*                                                                   */
  6535. /*   Side Effects:  None.                                            */
  6536. /*                                                                   */
  6537. /*   Notes:  A trap or exception could occur if a bad address is     */
  6538. /*           passed into this function.                              */
  6539. /*                                                                   */
  6540. /*********************************************************************/
  6541. void far pascal _loadds FREE_ENGINE_MEMORY16( CARDINAL32 Object );
  6542.  
  6543. /*********************************************************************/
  6544. /*                                                                   */
  6545. /*   Function Name: New_MBR16                                        */
  6546. /*                                                                   */
  6547. /*   Descriptive Name: This function lays down a new MBR on the      */
  6548. /*                     specified drive.                              */
  6549. /*                                                                   */
  6550. /*   Input: CARDINAL32 Drive_Handle - The handle of the drive on     */
  6551. /*                                 which the new MBR is to be placed.*/
  6552. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6553. /*                                    in which to store an error code*/
  6554. /*                                    should an error occur.         */
  6555. /*                                                                   */
  6556. /*   Output: *Error_Code will be 0 if the new MBR was successfully   */
  6557. /*           placed on the specified drive.  If the operation failed */
  6558. /*           for any reason, then *Error_Code will contain a non-zero*/
  6559. /*           error code.                                             */
  6560. /*                                                                   */
  6561. /*   Error Handling: If an error occurs, then the existing MBR is not*/
  6562. /*                   altered and *Error_Code will be > 0.            */
  6563. /*                                                                   */
  6564. /*   Side Effects:  A new MBR may be placed on the specified drive.  */
  6565. /*                                                                   */
  6566. /*   Notes:  None.                                                   */
  6567. /*                                                                   */
  6568. /*********************************************************************/
  6569. void far pascal _loadds NEW_MBR16( CARDINAL32 Drive_Handle, CARDINAL32 far * Error_Code );
  6570.  
  6571. /*********************************************************************/
  6572. /*                                                                   */
  6573. /*   Function Name: GET_AVAILABLE_DRIVE_LETTERS16                    */
  6574. /*                                                                   */
  6575. /*   Descriptive Name: This function returns a bitmap indicating     */
  6576. /*                     which drive letters are available for use.    */
  6577. /*                                                                   */
  6578. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6579. /*                                    in which to store an error code*/
  6580. /*                                    should an error occur.         */
  6581. /*                                                                   */
  6582. /*   Output: This function returns a bitmap of the available drive   */
  6583. /*           letters.  If this function is successful, then          */
  6584. /*           *Error_Code will be set to 0.  Otherwise, *Error_Code   */
  6585. /*           will be > 0 and the bitmap returned will have all bits  */
  6586. /*           set to 0.                                               */
  6587. /*                                                                   */
  6588. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  6589. /*                                                                   */
  6590. /*   Side Effects:  None.                                            */
  6591. /*                                                                   */
  6592. /*   Notes:  A drive letter is available if it is not associated     */
  6593. /*           with a volume located on a disk drive controlled        */
  6594. /*           by OS2DASD.                                             */
  6595. /*                                                                   */
  6596. /*********************************************************************/
  6597. CARDINAL32 far pascal _loadds GET_AVAILABLE_DRIVE_LETTERS16 ( CARDINAL32 far * Error_Code ) ;
  6598.  
  6599. /*********************************************************************/
  6600. /*                                                                   */
  6601. /*   Function Name: GET_RESERVED_DRIVE_LETTERS16                     */
  6602. /*                                                                   */
  6603. /*   Descriptive Name: This function returns a bitmap indicating     */
  6604. /*                     which drive letters are reserved for use by   */
  6605. /*                     devices NOT under the control of LVM.         */
  6606. /*                                                                   */
  6607. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6608. /*                                    in which to store an error code*/
  6609. /*                                    should an error occur.         */
  6610. /*                                                                   */
  6611. /*   Output: This function returns a bitmap of the drive letters     */
  6612. /*           which are being used by devices which are NOT controlled*/
  6613. /*           by LVM.  While a Volume CAN be assigned a drive letter  */
  6614. /*           from this list, a reboot will almost always be required */
  6615. /*           in order for the assignment to take place.              */
  6616. /*           If this function is successful, then *Error_Code will be*/
  6617. /*           set to 0.  Otherwise, *Error_Code will be > 0 and the   */
  6618. /*           bitmap returned will have all bits set to 0.            */
  6619. /*                                                                   */
  6620. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  6621. /*                                                                   */
  6622. /*   Side Effects:  None.                                            */
  6623. /*                                                                   */
  6624. /*   Notes:  Devices which are assigned drive letters but which are  */
  6625. /*           NOT under LVM control include:  CD-ROM, Network drives, */
  6626. /*           parallel port attached devices, and any DASD devices    */
  6627. /*           not controlled by OS2DASD.                              */
  6628. /*                                                                   */
  6629. /*********************************************************************/
  6630. CARDINAL32 far pascal _loadds GET_RESERVED_DRIVE_LETTERS16 ( CARDINAL32 far * Error_Code ) ;
  6631.  
  6632. /*********************************************************************/
  6633. /*                                                                   */
  6634. /*   Function Name: REBOOT_REQUIRED16                                */
  6635. /*                                                                   */
  6636. /*   Descriptive Name: This function indicates whether or not any    */
  6637. /*                     changes were made to the partitioning of the  */
  6638. /*                     disks in the system which would require a     */
  6639. /*                     reboot to make functional.                    */
  6640. /*                                                                   */
  6641. /*   Input: None.                                                    */
  6642. /*                                                                   */
  6643. /*   Output: The function return value will be TRUE if the system    */
  6644. /*           must be rebooted as a result of disk partitioning       */
  6645. /*           changes.                                                */
  6646. /*                                                                   */
  6647. /*   Error Handling: None required.                                  */
  6648. /*                                                                   */
  6649. /*   Side Effects:  None.                                            */
  6650. /*                                                                   */
  6651. /*   Notes:  None.                                                   */
  6652. /*                                                                   */
  6653. /*********************************************************************/
  6654. BOOLEAN far pascal _loadds REBOOT_REQUIRED16 ( void );
  6655.  
  6656. /*********************************************************************/
  6657. /*                                                                   */
  6658. /*   Function Name: CHANGES_PENDING16                                */
  6659. /*                                                                   */
  6660. /*   Descriptive Name: This function indicates whether or not any    */
  6661. /*                     changes were made to the partitioning of the  */
  6662. /*                     disks in the system which have not yet been   */
  6663. /*                     comitted to disk.                             */
  6664. /*                                                                   */
  6665. /*   Input: None.                                                    */
  6666. /*                                                                   */
  6667. /*   Output: The function return value will be TRUE if there are     */
  6668. /*           uncomitted changes to the partitioning of one or more of*/
  6669. /*           the drives in the system.                               */
  6670. /*                                                                   */
  6671. /*   Error Handling: None required.                                  */
  6672. /*                                                                   */
  6673. /*   Side Effects:  None.                                            */
  6674. /*                                                                   */
  6675. /*   Notes:  None.                                                   */
  6676. /*                                                                   */
  6677. /*********************************************************************/
  6678. BOOLEAN far pascal _loadds CHANGES_PENDING16 ( void );
  6679.  
  6680. /*********************************************************************/
  6681. /*                                                                   */
  6682. /*   Function Name: SET_REBOOT_FLAG16                                */
  6683. /*                                                                   */
  6684. /*   Descriptive Name: This function sets the Reboot Flag.  The      */
  6685. /*                     Reboot Flag is a special flag on the boot     */
  6686. /*                     disk used by the install program to keep      */
  6687. /*                     track of whether or not the system was just   */
  6688. /*                     rebooted.  It is used by the various phases   */
  6689. /*                     of install.                                   */
  6690. /*                                                                   */
  6691. /*   Input: BOOLEAN Reboot - The new value for the Reboot Flag.  If  */
  6692. /*                           TRUE, then the reboot flag will be set. */
  6693. /*                           If FALSE, then the reboot flag will be  */
  6694. /*                           cleared.                                */
  6695. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6696. /*                                    in which to store an error code*/
  6697. /*                                    should an error occur.         */
  6698. /*                                                                   */
  6699. /*   Output: *Error_Code will be set to 0 if there are no errors.    */
  6700. /*           *Error_Code will be > 0 if an error occurs.             */
  6701. /*                                                                   */
  6702. /*   Error Handling: If an error occurs, then the value of the Reboot*/
  6703. /*                   Flag will be unchanged.                         */
  6704. /*                                                                   */
  6705. /*   Side Effects:  The value of the Reboot Flag may be changed.     */
  6706. /*                                                                   */
  6707. /*   Notes:  None.                                                   */
  6708. /*                                                                   */
  6709. /*********************************************************************/
  6710. void far pascal _loadds SET_REBOOT_FLAG16( BOOLEAN Reboot, CARDINAL32 far * Error_Code );
  6711.  
  6712. /*********************************************************************/
  6713. /*                                                                   */
  6714. /*   Function Name: GET_REBOOT_FLAG16                                */
  6715. /*                                                                   */
  6716. /*   Descriptive Name: This function returns the value of the Reboot */
  6717. /*                     Flag.  The Reboot Flag is a special flag on   */
  6718. /*                     the boot disk used by the install program to  */
  6719. /*                     keep track of whether or not the system was   */
  6720. /*                     just rebooted.  It is used by the various     */
  6721. /*                     phases of install.                            */
  6722. /*                                                                   */
  6723. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6724. /*                                    in which to store an error code*/
  6725. /*                                    should an error occur.         */
  6726. /*                                                                   */
  6727. /*   Output: The function return value will be TRUE if no errors     */
  6728. /*           occur and the Reboot Flag is set.  *Error_Code will be  */
  6729. /*           0 under these conditions.  If an error occurs, the      */
  6730. /*           function return value will be FALSE and *Error_Code     */
  6731. /*           will be > 0.                                            */
  6732. /*                                                                   */
  6733. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  6734. /*                   The value of the reboot flag will be unchanged. */
  6735. /*                                                                   */
  6736. /*   Side Effects:  None.                                            */
  6737. /*                                                                   */
  6738. /*   Notes:  None.                                                   */
  6739. /*                                                                   */
  6740. /*********************************************************************/
  6741. BOOLEAN far pascal _loadds GET_REBOOT_FLAG16( CARDINAL32 far * Error_Code );
  6742.  
  6743. /*********************************************************************/
  6744. /*                                                                   */
  6745. /*                                                                   */
  6746. /*   Function Name: SET_INSTALL_FLAGS16                              */
  6747. /*                                                                   */
  6748. /*   Descriptive Name: This function sets the value of the Install   */
  6749. /*                     Flags.  The Install Flags reside in a 32 bit  */
  6750. /*                     field in the LVM dataspace.  These flags are  */
  6751. /*                     not used by LVM, thereby leaving Install free */
  6752. /*                     to use them for whatever it wants.            */
  6753. /*                                                                   */
  6754. /*   Input: CARDINAL32 Install_Flags - The new value for the Install */
  6755. /*                                     Flags.                        */
  6756. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6757. /*                                    in which to store an error code*/
  6758. /*                                    should an error occur.         */
  6759. /*                                                                   */
  6760. /*   Output: *Error_Code will be set to 0 if there are no errors.    */
  6761. /*           *Error_Code will be > 0 if an error occurs.             */
  6762. /*                                                                   */
  6763. /*   Error Handling: If an error occurs, then the value of the       */
  6764. /*                   Install Flags will be unchanged.                */
  6765. /*                                                                   */
  6766. /*   Side Effects:  The value of the Install Flags may be changed.   */
  6767. /*                                                                   */
  6768. /*   Notes:  None.                                                   */
  6769. /*                                                                   */
  6770. /*********************************************************************/
  6771. void far pascal _loadds SET_INSTALL_FLAGS16( CARDINAL32 Install_Flags, CARDINAL32 far * Error_Code );
  6772.  
  6773. /*********************************************************************/
  6774. /*                                                                   */
  6775. /*   Function Name: GET_INSTALL_FLAGS16                              */
  6776. /*                                                                   */
  6777. /*   Descriptive Name: This function returns the value of the Install*/
  6778. /*                     Flags.  The Install Flags reside in a 32 bit  */
  6779. /*                     field in the LVM dataspace.  These flags are  */
  6780. /*                     not used by LVM, thereby leaving Install free */
  6781. /*                     to use them for whatever it wants.            */
  6782. /*                                                                   */
  6783. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6784. /*                                    in which to store an error code*/
  6785. /*                                    should an error occur.         */
  6786. /*                                                                   */
  6787. /*   Output: The function returns the current value of the Install   */
  6788. /*           Flags stored in the LVM Dataspace.                      */
  6789. /*           *Error_Code will be LVM_ENGINE_NO_ERROR if the function */
  6790. /*           is successful.  If an error occurs, the function will   */
  6791. /*           return 0 and *Error_Code will be > 0.                   */
  6792. /*                                                                   */
  6793. /*   Error Handling: If an error occurs, *Error_Code will be > 0.    */
  6794. /*                                                                   */
  6795. /*   Side Effects:  None.                                            */
  6796. /*                                                                   */
  6797. /*   Notes:  None.                                                   */
  6798. /*                                                                   */
  6799. /*********************************************************************/
  6800. void far pascal _loadds GET_INSTALL_FLAGS16( CARDINAL32 far * Install_Flags, CARDINAL32 far * Error_Code );
  6801.  
  6802. /*********************************************************************/
  6803. /*                                                                   */
  6804. /*   Function Name: Set_Min_Install_Size16                           */
  6805. /*                                                                   */
  6806. /*   Descriptive Name: This function tells the LVM Engine how big a  */
  6807. /*                     partition/volume must be in order for it to   */
  6808. /*                     marked installable.  If this function is not  */
  6809. /*                     used to set the minimum size for an           */
  6810. /*                     installable partition/volume, the LVM Engine  */
  6811. /*                     will use a default value of 300 MB.           */
  6812. /*                                                                   */
  6813. /*   Input: CARDINAL32 Min_Sectors - The minimum size, in sectors,   */
  6814. /*                                   that a partition must be in     */
  6815. /*                                   order for it to be marked as    */
  6816. /*                                   installable.                    */
  6817. /*                                                                   */
  6818. /*   Output: None.                                                   */
  6819. /*                                                                   */
  6820. /*   Error Handling: None required.                                  */
  6821. /*                                                                   */
  6822. /*   Side Effects:  None.                                            */
  6823. /*                                                                   */
  6824. /*   Notes:  None.                                                   */
  6825. /*                                                                   */
  6826. /*********************************************************************/
  6827. void far pascal _loadds SET_MIN_INSTALL_SIZE16 ( CARDINAL32  Min_Sectors );
  6828.  
  6829. /*********************************************************************/
  6830. /*                                                                   */
  6831. /*   Function Name: SET_FREE_SPACE_THRESHOLD16                       */
  6832. /*                                                                   */
  6833. /*   Descriptive Name: This function tells the LVM Engine not to     */
  6834. /*                     report blocks of free space which are less    */
  6835. /*                     than the size specified.  The engine defaults */
  6836. /*                     to not reporting blocks of free space which   */
  6837. /*                     are smaller than 2048 sectors (1 MB).         */
  6838. /*                                                                   */
  6839. /*   Input: CARDINAL32 Min_Sectors - The minimum size, in sectors,   */
  6840. /*                                   that a block of free space must */
  6841. /*                                   be in order for the LVM engine  */
  6842. /*                                   to report it.                   */
  6843. /*                                                                   */
  6844. /*   Output: None.                                                   */
  6845. /*                                                                   */
  6846. /*   Error Handling: None required.                                  */
  6847. /*                                                                   */
  6848. /*   Side Effects:  None.                                            */
  6849. /*                                                                   */
  6850. /*   Notes:  None.                                                   */
  6851. /*                                                                   */
  6852. /*********************************************************************/
  6853. void far pascal _loadds SET_FREE_SPACE_THRESHOLD16( CARDINAL32  Min_Sectors );
  6854.  
  6855. /*********************************************************************/
  6856. /*                                                                   */
  6857. /*   Function Name: READ_SECTORS16                                   */
  6858. /*                                                                   */
  6859. /*   Descriptive Name: This function reads one or more sectors from  */
  6860. /*                     the specified drive and places the data read  */
  6861. /*                     in Buffer.                                    */
  6862. /*                                                                   */
  6863. /*   Input: CARDINAL32 Drive_Number : The number of the hard drive to*/
  6864. /*                                    read from.  The drives in the  */
  6865. /*                                    system are numbered from 1 to  */
  6866. /*                                    n, where n is the total number */
  6867. /*                                    of hard drives in the system.  */
  6868. /*          LBA Starting_Sector : The first sector to read from.     */
  6869. /*          CARDINAL32 Sectors_To_Read : The number of sectors to    */
  6870. /*                                       read into memory.           */
  6871. /*          ADDRESS Buffer : The location to put the data read into. */
  6872. /*          CARDINAL32 * Error : The address of a variable to hold   */
  6873. /*                               the error return code.              */
  6874. /*                                                                   */
  6875. /*   Output: If Successful, then the data read will be placed in     */
  6876. /*              memory starting at Buffer, and *Error will be        */
  6877. /*              LVM_ENGINE_NO_ERROR.                                 */
  6878. /*           If Unsuccessful, then *Error will be > 0 and the        */
  6879. /*              contents of memory starting at Buffer is undefined.  */
  6880. /*                                                                   */
  6881. /*   Error Handling: *Error will be > 0 if an error occurs.          */
  6882. /*                                                                   */
  6883. /*   Side Effects: Data may be read into memory starting at Buffer.  */
  6884. /*                                                                   */
  6885. /*   Notes:  None.                                                   */
  6886. /*                                                                   */
  6887. /*********************************************************************/
  6888. void far pascal _loadds READ_SECTORS16 ( CARDINAL32          Drive_Number,
  6889. LBA                 Starting_Sector,
  6890. CARDINAL32          Sectors_To_Read,
  6891. void far *          Buffer,
  6892. CARDINAL32 far *    Error);
  6893.  
  6894. /*********************************************************************/
  6895. /*                                                                   */
  6896. /*   Function Name: WRITE_SECTORS16                                  */
  6897. /*                                                                   */
  6898. /*   Descriptive Name: This function writes data from memory to one  */
  6899. /*                     or more sectors on the specified drive.       */
  6900. /*                                                                   */
  6901. /*   Input: CARDINAL32 Drive_Number : The number of the hard drive to*/
  6902. /*                                    write to.  The drives in the   */
  6903. /*                                    system are numbered from 1 to  */
  6904. /*                                    n, where n is the total number */
  6905. /*                                    of hard drives in the system.  */
  6906. /*          LBA Starting_Sector : The first sector to write to.      */
  6907. /*          CARDINAL32 Sectors_To_Read : The number of sectors to    */
  6908. /*                                       be written.                 */
  6909. /*          ADDRESS Buffer : The location of the data to be written  */
  6910. /*                           to disk.                                */
  6911. /*          CARDINAL32 * Error : The address of a variable to hold   */
  6912. /*                               the error return code.              */
  6913. /*                                                                   */
  6914. /*   Output: If Successful, then the data at Buffer will be placed   */
  6915. /*              on the disk starting at the sector specified, and    */
  6916. /*              *Error will be LVM_ENGINE_NO_ERROR.                  */
  6917. /*           If Unsuccessful, then *Error will be > 0 and the        */
  6918. /*              contents of the disk starting at sector              */
  6919. /*              Starting_Sector is undefined.                        */
  6920. /*                                                                   */
  6921. /*   Error Handling: *Error will be > 0 if an error occurs.          */
  6922. /*                                                                   */
  6923. /*   Side Effects: Data may be written to disk.                      */
  6924. /*                                                                   */
  6925. /*   Notes:  None.                                                   */
  6926. /*                                                                   */
  6927. /*********************************************************************/
  6928. void far pascal _loadds WRITE_SECTORS16 ( CARDINAL32          Drive_Number,
  6929. LBA                 Starting_Sector,
  6930. CARDINAL32          Sectors_To_Write,
  6931. void far *          Buffer,
  6932. CARDINAL32 far *    Error);
  6933.  
  6934. /*********************************************************************/
  6935. /*                                                                   */
  6936. /*   Function Name: REDISCOVER_PRMS16                                */
  6937. /*                                                                   */
  6938. /*   Descriptive Name: Causes OS2LVM and OS2DASD to check PRMs for   */
  6939. /*                     new or changed media.                         */
  6940. /*                                                                   */
  6941. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  6942. /*                                    in which to store an error code*/
  6943. /*                                    should an error occur.         */
  6944. /*                                                                   */
  6945. /*   Output: If the Rediscover PRM operation was successful, then    */
  6946. /*           *Error_Code will be LVM_ENGINE_NO_ERROR.  If there      */
  6947. /*           was an error, then *Error_Code will be > 0.             */
  6948. /*                                                                   */
  6949. /*   Error Handling: None.                                           */
  6950. /*                                                                   */
  6951. /*   Side Effects:  New volumes may be discovered and assigned drive */
  6952. /*                  letters by OS2LVM and OS2DASD.                   */
  6953. /*                                                                   */
  6954. /*   Notes: The LVM Engine must be CLOSED when this function is      */
  6955. /*          called as this function is disabled while it is open!    */
  6956. /*                                                                   */
  6957. /*********************************************************************/
  6958. void far pascal _loadds REDISCOVER_PRMS16( CARDINAL32 far * Error_Code );
  6959.  
  6960. /*********************************************************************/
  6961. /*                                                                   */
  6962. /*   Function Name: GET_LVM_VIEW16                                   */
  6963. /*                                                                   */
  6964. /*   Descriptive Name:  This function gets the OS2LVM data for the   */
  6965. /*                      specified drive letter.  The intent is to    */
  6966. /*                      allow the determination of what drive letter */
  6967. /*                      a volume really has given the possibilities  */
  6968. /*                      of conflict or a drive preference of '*'.    */
  6969. /*                                                                   */
  6970. /*   Input:  char  IFSM_Drive_Letter : The drive letter for which the*/
  6971. /*                                     OS2LVM data is requested.     */
  6972. /*           CARDINAL32 * Drive_Number : The address of a variable   */
  6973. /*                                       to hold the OS/2 drive      */
  6974. /*                                       number of the drive         */
  6975. /*                                       containing the first        */
  6976. /*                                       partition of the volume     */
  6977. /*                                       currently assigned to the   */
  6978. /*                                       requested drive letter.     */
  6979. /*           CARDINAL32 * Partition_LBA : The address of a variable  */
  6980. /*                                        to hold the LBA of the     */
  6981. /*                                        first partition of the     */
  6982. /*                                        volume currently assigned  */
  6983. /*                                        to the requested drive     */
  6984. /*                                        letter.                    */
  6985. /*           char * LVM_Drive_Letter : The address of a variable to  */
  6986. /*                                     hold the drive letter that    */
  6987. /*                                     OS2LVM thinks the volume      */
  6988. /*                                     assigned to the requested     */
  6989. /*                                     drive letter should have.     */
  6990. /*           BYTE * UnitID : The address of a variable to hold the   */
  6991. /*                           OS2LVM unit ID for the volume associated*/
  6992. /*                           with the requested drive letter.        */
  6993. /*                                                                   */
  6994. /*   Output:  The function return value will be TRUE if the function */
  6995. /*            completed successfully.                                */
  6996. /*                                                                   */
  6997. /*   Error Handling: If this function fails, the specified drive     */
  6998. /*                   letter is either not in use, or is in use by a  */
  6999. /*                   device not controlled by OS2LVM.                */
  7000. /*                                                                   */
  7001. /*   Side Effects: None.                                             */
  7002. /*                                                                   */
  7003. /*   Notes: This function can be used with the LVM Engine open or    */
  7004. /*          closed.                                                  */
  7005. /*                                                                   */
  7006. /*********************************************************************/
  7007. BOOLEAN far   pascal _loadds GET_LVM_VIEW16( char             IFSM_Drive_Letter,
  7008. CARDINAL32 far * Drive_Number,
  7009. CARDINAL32 far * Partition_LBA,
  7010. char far *       LVM_Drive_Letter,
  7011. BYTE far *       UnitID);
  7012.  
  7013. /*********************************************************************/
  7014. /*                                                                   */
  7015. /*   Function Name: Start_Logging16                                  */
  7016. /*                                                                   */
  7017. /*   Descriptive Name: Enables the LVM Engine logging.  Once enabled,*/
  7018. /*                     the LVM Engine logging function will log all  */
  7019. /*                     LVM Engine activity to the specified log file.*/
  7020. /*                     The data is logged in a binary format for     */
  7021. /*                     compactness and speed.                        */
  7022. /*                                                                   */
  7023. /*   Input: char * Filename - The filename of the file to use as the */
  7024. /*                            log file.                              */
  7025. /*          CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  7026. /*                                    in which to store an error code*/
  7027. /*                                    should an error occur.         */
  7028. /*                                                                   */
  7029. /*   Output: If the logging file was successfully created, then      */
  7030. /*           *Error_Code will be 0.  If the log file could not be    */
  7031. /*           created, then *Error_Code will be > 0.                  */
  7032. /*                                                                   */
  7033. /*   Error Handling: If the log file can not be created, then        */
  7034. /*                   *Error_Code will be > 0.                        */
  7035. /*                                                                   */
  7036. /*   Side Effects:  A file may be created/opened for logging of      */
  7037. /*                  LVM Engine actions.                              */
  7038. /*                                                                   */
  7039. /*   Notes:  None.                                                   */
  7040. /*                                                                   */
  7041. /*********************************************************************/
  7042. void far pascal _loadds START_LOGGING16( char far * Filename, CARDINAL32 far * Error_Code );
  7043.  
  7044. /*********************************************************************/
  7045. /*                                                                   */
  7046. /*   Function Name: Stop_Logging16                                   */
  7047. /*                                                                   */
  7048. /*   Descriptive Name: This function ends LVM Engine logging and     */
  7049. /*                     closes the log file.                          */
  7050. /*                                                                   */
  7051. /*   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
  7052. /*                                    in which to store an error code*/
  7053. /*                                    should an error occur.         */
  7054. /*                                                                   */
  7055. /*   Output: *Error_Code will be 0 if this function completes        */
  7056. /*           successfully; otherwise it will be > 0.                 */
  7057. /*                                                                   */
  7058. /*   Error Handling: If the log file is not currently opened, or if  */
  7059. /*                   the close operation fails on the log file, then */
  7060. /*                   *Error_Code will be > 0.                        */
  7061. /*                                                                   */
  7062. /*   Side Effects:  The log file may be closed.                      */
  7063. /*                                                                   */
  7064. /*   Notes:  None.                                                   */
  7065. /*                                                                   */
  7066. /*********************************************************************/
  7067. void far pascal _loadds STOP_LOGGING16 ( CARDINAL32 far *  Error_Code );
  7068.  
  7069. #endif
  7070.  
  7071. #endif
  7072.