home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xwplascr.zip / XWPL0208.ZIP / tools / xlvm / lvm_intr.h < prev    next >
C/C++ Source or Header  |  2002-04-16  |  137KB  |  2,899 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. #pragma pack(1)
  82.  
  83. // The following are invariant for a disk drive.
  84. typedef struct _Drive_Control_Record {
  85. CARDINAL32   Drive_Number;                   // OS/2 Drive Number for this drive.
  86. CARDINAL32   Drive_Size;                     // The total number of sectors on the drive.
  87. DoubleWord   Drive_Serial_Number;            // The serial number assigned to this drive.  For info. purposes only.
  88. ADDRESS      Drive_Handle;                   // Handle used for operations on the disk that this record corresponds to.
  89. CARDINAL32   Cylinder_Count;                 // The number of cylinders on the drive.
  90. CARDINAL32   Heads_Per_Cylinder;             // The number of heads per cylinder for this drive.
  91. CARDINAL32   Sectors_Per_Track;              // The number of sectors per track for this drive.
  92. BOOLEAN      Drive_Is_PRM;                   // Set to TRUE if this drive is a PRM.
  93. BYTE         Reserved[3];                    // Alignment.
  94. } Drive_Control_Record;
  95.  
  96. // The following structure is returned by the Get_Drive_Control_Data function.
  97. typedef struct _Drive_Control_Array{
  98. Drive_Control_Record *   Drive_Control_Data;       // An array of drive control records.
  99. CARDINAL32               Count;                    // The number of entries in the array of drive control records.
  100. } Drive_Control_Array;
  101.  
  102. // The following structure defines the information that can be changed for a specific disk drive.
  103. typedef struct _Drive_Information_Record {
  104. CARDINAL32   Total_Available_Sectors;        // The number of sectors on the disk which are not currently assigned to a partition.
  105. CARDINAL32   Largest_Free_Block_Of_Sectors;  // The number of sectors in the largest contiguous block of available sectors.
  106. BOOLEAN      Corrupt_Partition_Table;        // If TRUE, then the partitioning information found on the drive is incorrect!
  107. BOOLEAN      Unusable;                       // If TRUE, the drive's MBR is not accessible and the drive can not be partitioned.
  108. BOOLEAN      IO_Error;                       // If TRUE, then the last I/O operation on this drive failed!
  109. 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).
  110. char         Drive_Name[DISK_NAME_SIZE];     // User assigned name for this disk drive.
  111. } Drive_Information_Record;
  112.  
  113. /*
  114.  *@@ _Partition_Information_Record:
  115.  *
  116.  */
  117.  
  118. typedef struct _Partition_Information_Record
  119. {
  120.     ADDRESS      Partition_Handle;
  121.             // The handle used to perform operations on this partition.
  122.     ADDRESS      Volume_Handle;
  123.             // If this partition is part of a volume, this will be the handle of
  124.             // the volume.  If this partition is NOT part of a volume, then this
  125.             // handle will be 0.
  126.     ADDRESS      Drive_Handle;
  127.             // The handle for the drive this partition resides on.
  128.     DoubleWord   Partition_Serial_Number;
  129.             // The serial number assigned to this partition.
  130.     CARDINAL32   Partition_Start;
  131.             // The LBA of the first sector of the partition.
  132.     CARDINAL32   True_Partition_Size;
  133.             // The total number of sectors comprising the partition.
  134.     CARDINAL32   Usable_Partition_Size;
  135.             // The size of the partition as reported to the IFSM.  This is the
  136.             // size of the partition less any LVM overhead.
  137.     CARDINAL32   Boot_Limit;
  138.             // The maximum number of sectors from this block of free space that
  139.             // can be used to create a bootable partition if you allocate from the
  140.             // beginning of the block of free space.
  141.     BOOLEAN      Spanned_Volume;
  142.             // TRUE if this partition is part of a multi-partition volume.
  143.     BOOLEAN      Primary_Partition;
  144.             // True or False.  Any non-zero value here indicates that this partition
  145.             // is a primary partition.  Zero here indicates that this partition is
  146.             // a "logical drive" - i.e. it resides inside of an extended partition.
  147.     BYTE         Active_Flag;
  148.             // 80 = Partition is marked as being active.
  149.             // 0 = Partition is not active.
  150.     BYTE         OS_Flag;
  151.             // This field is from the partition table.  It is known as the OS flag,
  152.             // the Partition Type Field, Filesystem Type, and various other names.
  153.             //      Values of interest
  154.             //      If this field is: (values are in hex)
  155.             //      07 = The partition is a compatibility partition formatted for use
  156.             //      with an installable filesystem, such as HPFS or JFS.
  157.             //      00 = Unformatted partition
  158.             //      01 = FAT12 filesystem is in use on this partition.
  159.             //      04 = FAT16 filesystem is in use on this partition.
  160.             //      0A = OS/2 Boot Manager Partition
  161.             //      35 = LVM partition
  162.             //      84 = OS/2 FAT16 partition which has been relabeled by Boot Manager to "Hide" it.
  163.     BYTE         Partition_Type;
  164.             // 0 = Free Space
  165.             // 1 = LVM Partition (Part of an LVM Volume.)
  166.             // 2 = Compatibility Partition
  167.             // All other values are reserved for future use.
  168.     BYTE         Partition_Status;
  169.             // 0 = Free Space
  170.             // 1 = In Use - i.e. already assigned to a volume.
  171.             // 2 = Available - i.e. not currently assigned to a volume.
  172.     BOOLEAN      On_Boot_Manager_Menu;
  173.             // Set to TRUE if this partition is not part of a Volume yet is on the
  174.             // Boot Manager Menu.
  175.     BYTE         Reserved;
  176.             // Alignment.
  177.     char         Volume_Drive_Letter;
  178.             // The drive letter assigned to the volume that this partition is a part of.
  179.     char         Drive_Name[DISK_NAME_SIZE];
  180.             // User assigned name for this disk drive.
  181.     char         File_System_Name[FILESYSTEM_NAME_SIZE];
  182.             // The name of the filesystem in use on this partition, if it is known.
  183.     char         Partition_Name[PARTITION_NAME_SIZE];
  184.             // The user assigned name for this partition.
  185.     char         Volume_Name[VOLUME_NAME_SIZE];
  186.             // If this partition is part of a volume, then this will be the
  187.             // name of the volume that this partition is a part of.  If this
  188.             // record represents free space, then the Volume_Name will be
  189.             // "FREE SPACE xx", where xx is a unique numeric ID generated by
  190.             // LVM.DLL.  Otherwise it will be an empty string.
  191. } Partition_Information_Record;
  192.  
  193. // The following defines are for use with the Partition_Type field in the
  194. // Partition_Information_Record.
  195. #define FREE_SPACE_PARTITION     0
  196. #define LVM_PARTITION            1
  197. #define COMPATIBILITY_PARTITION  2
  198.  
  199. // The following defines are for use with the Partition_Status field in the
  200. // Partition_Information_Record.
  201. #define PARTITION_IS_IN_USE      1
  202. #define PARTITION_IS_AVAILABLE   2
  203. #define PARTITION_IS_FREE_SPACE  0
  204.  
  205. // The following structure is returned by various functions in the LVM Engine.
  206. typedef struct _Partition_Information_Array {
  207. Partition_Information_Record * Partition_Array; // An array of Partition_Information_Records.
  208. CARDINAL32                     Count;           // The number of entries in the Partition_Array.
  209. } Partition_Information_Array;
  210.  
  211. // The following items are invariant for a volume.
  212. typedef struct _Volume_Control_Record {
  213. DoubleWord Volume_Serial_Number;            // The serial number assigned to this volume.
  214. ADDRESS    Volume_Handle;                   // The handle used to perform operations on this volume.
  215. BOOLEAN    Compatibility_Volume;            /* TRUE indicates that this volume is compatible with older versions of OS/2.
  216. FALSE indicates that this is an LVM specific volume and can not be used without OS2LVM.DMD. */
  217. BYTE       Device_Type;                     /* Indicates what type of device the Volume resides on:
  218. 0 = Hard Drive under LVM Control
  219. 1 = PRM under LVM Control
  220. 2 = CD-ROM
  221. 3 = Network drive
  222. 4 = Unknown device NOT under LVM Control
  223. */
  224. BYTE       Reserved[2];                     // Alignment.
  225. } Volume_Control_Record;
  226.  
  227. // The following define the device types used in the Device_Type field of the Volume_Control_Record.
  228. #define LVM_HARD_DRIVE  0
  229. #define LVM_PRM         1
  230. #define NON_LVM_CDROM   2
  231. #define NETWORK_DRIVE   3
  232. #define NON_LVM_DEVICE  4
  233.  
  234. // The following structure is returned by the Get_Volume_Control_Data function.
  235. typedef struct _Volume_Control_Array{
  236. Volume_Control_Record *  Volume_Control_Data;      // An array of volume control records.
  237. CARDINAL32               Count;                    // The number of entries in the array of volume control records.
  238. } Volume_Control_Array;
  239.  
  240. // The following information about a volume can (and often does) vary.
  241. typedef struct _Volume_Information_Record {
  242. CARDINAL32 Volume_Size;                           // The number of sectors comprising the volume.
  243. CARDINAL32 Partition_Count;                       // The number of partitions which comprise this volume.
  244. CARDINAL32 Drive_Letter_Conflict;                 /* 0 indicates that the drive letter preference for this volume is unique.
  245. 1 indicates that the drive letter preference for this volume
  246. is not unique, but this volume got its preferred drive letter anyway.
  247. 2 indicates that the drive letter preference for this volume
  248. is not unique, and this volume did NOT get its preferred drive letter.
  249. 4 indicates that this volume is currently "hidden" - i.e. it has
  250. no drive letter preference at the current time.                        */
  251. BOOLEAN    Compatibility_Volume;                  // TRUE if this is for a compatibility volume, FALSE otherwise.
  252. BOOLEAN    Bootable;                              /* Set to TRUE if this volume appears on the Boot Manager menu, or if it is
  253. a compatibility volume and its corresponding partition is the first active
  254. primary partition on the first drive.                                         */
  255. char       Drive_Letter_Preference;               // The drive letter that this volume desires to be.
  256. char       Current_Drive_Letter;                  /* The drive letter currently used to access this volume.  May be different than
  257. Drive_Letter_Preference if there was a conflict ( i.e. Drive_Letter_Preference
  258. is already in use by another volume ).                                          */
  259. char       Initial_Drive_Letter;                  /* The drive letter assigned to this volume by the operating system when LVM was started.
  260. This may be different from the Drive_Letter_Preference if there were conflicts, and
  261. may be different from the Current_Drive_Letter.  This will be 0x0 if the Volume did
  262. not exist when the LVM Engine was opened (i.e. it was created during this LVM session). */
  263. BOOLEAN    New_Volume;                            /* Set to FALSE if this volume existed before the LVM Engine was opened.  Set to
  264. TRUE if this volume was created after the LVM Engine was opened.                */
  265. BYTE       Status;                                /* 0 = None.
  266. 1 = Bootable
  267. 2 = Startable
  268. 3 = Installable.           */
  269. BYTE       Reserved_1;
  270. char       Volume_Name[VOLUME_NAME_SIZE];         // The user assigned name for this volume.
  271. char       File_System_Name[FILESYSTEM_NAME_SIZE];// The name of the filesystem in use on this partition, if it is known.
  272. } Volume_Information_Record;
  273.  
  274. // The following structure is used to return the feature information for the installed features, or the features on a volume.
  275. typedef struct _Feature_Information_Array {
  276. CARDINAL32        Count;
  277. Feature_ID_Data * Feature_Data;
  278. } Feature_Information_Array;
  279.  
  280. // The following structure defines an item on the Boot Manager Menu.
  281. typedef struct _Boot_Manager_Menu_Item {
  282. ADDRESS     Handle;            // A Volume or Partition handle.
  283. BOOLEAN     Volume;            // If TRUE, then Handle is the handle of a Volume.  Otherwise, Handle is the handle of a partition.
  284. } Boot_Manager_Menu_Item;
  285.  
  286. // The following structure is used to get a list of the items on the partition manager menu.
  287. typedef struct _Boot_Manager_Menu {
  288. Boot_Manager_Menu_Item *  Menu_Items;
  289. CARDINAL32                Count;
  290. } Boot_Manager_Menu;
  291.  
  292. /* The following structure is used to specify an LVM Feature when creating a volume.  Since LVM Features may be part of
  293. more than one LVM Class, the specific class to be used with the feature must also be specified.                        */
  294. typedef struct _LVM_Feature_Specification_Record {
  295. CARDINAL32       Feature_ID;     // The feature ID of the feature to use.
  296. LVM_Classes      Actual_Class;   // The LVM Class (supported by the specified feature) to use.
  297. ADDRESS          Init_Data;      /* The address of a buffer containing initialization data for this feature.
  298. NULL if there is no initialization data being provided for this feature. */
  299. } LVM_Feature_Specification_Record;
  300.  
  301. // The following structure is used with the Get_Child_Handles function.
  302. typedef struct {
  303. CARDINAL32   Count;
  304. ADDRESS *    Handles;
  305. } LVM_Handle_Array_Record;
  306.  
  307. /* The following preprocessor directives define the operations that can be performed on a partition, volume, or a block of free space.
  308. These definitions represent bits in a 32 bit value returned by the Get_Valid_Options function.                                         */
  309.  
  310. #define CREATE_PRIMARY_PARTITION           1
  311.  
  312. #define CREATE_LOGICAL_DRIVE               2
  313.  
  314. #define DELETE_PARTITION                   4
  315.  
  316. #define SET_ACTIVE_PRIMARY                 8
  317.  
  318. #define SET_PARTITION_ACTIVE              0x10
  319.  
  320. #define SET_PARTITION_INACTIVE            0x20
  321.  
  322. #define SET_STARTABLE                     0x40
  323.  
  324. #define INSTALL_BOOT_MANAGER              0x80
  325.  
  326. #define REMOVE_BOOT_MANAGER               0x100
  327.  
  328. #define SET_BOOT_MANAGER_DEFAULTS         0x200
  329.  
  330. #define ADD_TO_BOOT_MANAGER_MENU          0x400
  331.  
  332. #define REMOVE_FROM_BOOT_MANAGER_MENU     0x800
  333.  
  334. #define DELETE_VOLUME                     0x1000
  335.  
  336. #define HIDE_VOLUME                       0x2000
  337.  
  338. #define EXPAND_VOLUME                     0x4000
  339.  
  340. #define SET_VOLUME_INSTALLABLE            0x8000
  341.  
  342. #define ASSIGN_DRIVE_LETTER               0x10000
  343.  
  344. #define CAN_BOOT_PRIMARY                  0x20000      // If a primary is created from this block of free space, then it can be made bootable.
  345.  
  346. #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.
  347.  
  348. #define CAN_SET_NAME                      0x80000
  349.  
  350. #define SET_BOOT_MANAGER_STARTABLE        0x100000
  351.  
  352. // The following enumeration defines the allocation strategies used by the Create_Partition function.
  353. typedef enum _Allocation_Algorithm {
  354. Automatic,               // Let LVM decide which block of free space to use to create the partition.
  355. Best_Fit,                // Use the block of free space which is closest in size to the partition being created.
  356. First_Fit,               // Use the first block of free space on the disk which is large enough to hold a partition of the specified size.
  357. Last_Fit,                // Use the last block of free space on the disk which is large enough to hold a partition of the specified size.
  358. From_Largest,            // Find the largest block of free space and allocate the partition from that block of free space.
  359. From_Smallest,           // Find the smallest block of free space that can accommodate a partition of the size specified.
  360. All                      // Turn the specified drive or block of free space into a single partition.
  361. } Allocation_Algorithm;
  362.  
  363. // Error codes returned by the LVM Engine.
  364. #define LVM_ENGINE_NO_ERROR                            0
  365. #define LVM_ENGINE_OUT_OF_MEMORY                       1
  366. #define LVM_ENGINE_IO_ERROR                            2
  367. #define LVM_ENGINE_BAD_HANDLE                          3
  368. #define LVM_ENGINE_INTERNAL_ERROR                      4
  369. #define LVM_ENGINE_ALREADY_OPEN                        5
  370. #define LVM_ENGINE_NOT_OPEN                            6
  371. #define LVM_ENGINE_NAME_TOO_BIG                        7
  372. #define LVM_ENGINE_OPERATION_NOT_ALLOWED               8
  373. #define LVM_ENGINE_DRIVE_OPEN_FAILURE                  9
  374. #define LVM_ENGINE_BAD_PARTITION                      10
  375. #define LVM_ENGINE_CAN_NOT_MAKE_PRIMARY_PARTITION     11
  376. #define LVM_ENGINE_TOO_MANY_PRIMARY_PARTITIONS        12
  377. #define LVM_ENGINE_CAN_NOT_MAKE_LOGICAL_DRIVE         13
  378. #define LVM_ENGINE_REQUESTED_SIZE_TOO_BIG             14
  379. #define LVM_ENGINE_1024_CYLINDER_LIMIT                15
  380. #define LVM_ENGINE_PARTITION_ALIGNMENT_ERROR          16
  381. #define LVM_ENGINE_REQUESTED_SIZE_TOO_SMALL           17
  382. #define LVM_ENGINE_NOT_ENOUGH_FREE_SPACE              18
  383. #define LVM_ENGINE_BAD_ALLOCATION_ALGORITHM           19
  384. #define LVM_ENGINE_DUPLICATE_NAME                     20
  385. #define LVM_ENGINE_BAD_NAME                           21
  386. #define LVM_ENGINE_BAD_DRIVE_LETTER_PREFERENCE        22
  387. #define LVM_ENGINE_NO_DRIVES_FOUND                    23
  388. #define LVM_ENGINE_WRONG_VOLUME_TYPE                  24
  389. #define LVM_ENGINE_VOLUME_TOO_SMALL                   25
  390. #define LVM_ENGINE_BOOT_MANAGER_ALREADY_INSTALLED     26
  391. #define LVM_ENGINE_BOOT_MANAGER_NOT_FOUND             27
  392. #define LVM_ENGINE_INVALID_PARAMETER                  28
  393. #define LVM_ENGINE_BAD_FEATURE_SET                    29
  394. #define LVM_ENGINE_TOO_MANY_PARTITIONS_SPECIFIED      30
  395. #define LVM_ENGINE_LVM_PARTITIONS_NOT_BOOTABLE        31
  396. #define LVM_ENGINE_PARTITION_ALREADY_IN_USE           32
  397. #define LVM_ENGINE_SELECTED_PARTITION_NOT_BOOTABLE    33
  398. #define LVM_ENGINE_VOLUME_NOT_FOUND                   34
  399. #define LVM_ENGINE_DRIVE_NOT_FOUND                    35
  400. #define LVM_ENGINE_PARTITION_NOT_FOUND                36
  401. #define LVM_ENGINE_TOO_MANY_FEATURES_ACTIVE           37
  402. #define LVM_ENGINE_PARTITION_TOO_SMALL                38
  403. #define LVM_ENGINE_MAX_PARTITIONS_ALREADY_IN_USE      39
  404. #define LVM_ENGINE_IO_REQUEST_OUT_OF_RANGE            40
  405. #define LVM_ENGINE_SPECIFIED_PARTITION_NOT_STARTABLE  41
  406. #define LVM_ENGINE_SELECTED_VOLUME_NOT_STARTABLE      42
  407. #define LVM_ENGINE_EXTENDFS_FAILED                    43
  408. #define LVM_ENGINE_REBOOT_REQUIRED                    44
  409. #define LVM_ENGINE_CAN_NOT_OPEN_LOG_FILE              45
  410. #define LVM_ENGINE_CAN_NOT_WRITE_TO_LOG_FILE          46
  411. #define LVM_ENGINE_REDISCOVER_FAILED                  47
  412. #define LVM_ENGINE_INTERNAL_VERSION_FAILURE           48
  413. #define LVM_ENGINE_PLUGIN_OPERATION_INCOMPLETE        49
  414. #define LVM_ENGINE_BAD_FEATURE_ID                     50
  415. #define LVM_ENGINE_NO_INIT_DATA                       51
  416. #define LVM_ENGINE_NO_CONTEXT_DATA                    52
  417. #define LVM_ENGINE_WRONG_CLASS_FOR_FEATURE            53
  418. #define LVM_ENGINE_INCOMPATIBLE_FEATURES_SELECTED     54
  419. #define LVM_ENGINE_NO_CHILDREN                        55
  420. #define LVM_ENGINE_FEATURE_NOT_SUPPORTED_BY_INTERFACE 56
  421. #define LVM_ENGINE_NO_PARENT                          57
  422. #define LVM_ENGINE_VOLUME_HAS_NOT_BEEN_COMMITTED_YET  58
  423. #define LVM_ENGINE_UNABLE_TO_REFERENCE_VOLUME         59
  424. #define LVM_ENGINE_PARSING_ERROR                      60
  425. #define LVM_ENGINE_INTERNAL_FEATURE_ERROR             61
  426. #define LVM_ENGINE_VOLUME_NOT_CONVERTED               62
  427.  
  428. // Function Prototypes
  429.  
  430. #ifndef USE_16_BIT_FUNCTIONS
  431.  
  432. /* ************************************************************************** *
  433.  
  434. Functions relating to the LVM Engine itself
  435.  
  436. ************************************************************************** */
  437.  
  438. /****************************************************************************************************/
  439. //
  440. //   Function Name: Open_LVM_Engine
  441. //
  442. //   Descriptive Name: Opens the LVM Engine and readies it for use.
  443. //
  444. //   Input: BOOLEAN Ignore_CHS : If TRUE, then the LVM engine will not check the CHS values in the
  445. //                               MBR/EBR partition tables for validity.  This is useful if there
  446. //                               are drive geometry problems, such as the drive was partitioned and
  447. //                               formatted with one geometry and then moved to a different machine
  448. //                               which uses a different geometry for the drive.  This would cause
  449. //                               the starting and ending CHS values in the partition tables to
  450. //                               be inconsistent with the size and partition offset entries in the
  451. //                               partition tables.  Setting Ignore_CHS to TRUE will disable the
  452. //                               LVM Engine's CHS consistency checks, thereby allowing the drive
  453. //                               to be partitioned.
  454. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in which to store an error code
  455. //                                    should an error occur.
  456. //
  457. //   Output:  *Error_Code will be 0 if this function completes successfully.  If an error occurs,
  458. //            *Error_Code will contain a non-zero error code.
  459. //
  460. //   Error Handling: If this function aborts with an error, all memory allocated during the course
  461. //                   of this function will be released.  Disk read errors will be reported to the
  462. //                   user via pop-up error messages.  Disk read errors will only cause this
  463. //                   function to abort if none of the disk drives in the system could be
  464. //                   successfully read.
  465. //
  466. //   Side Effects:  The LVM Engine will be initialized.  The partition tables for all OS2DASD
  467. //                  controlled disk drives will be read into memory.  Memory will be allocated for
  468. //                  the data structures used by the LVM Engine.
  469. //
  470. //   Notes:  This is provided for programs that used LVM Version 1.  This function assumes an
  471. //           LVM_Interface_Type of VIO_Interface.
  472. //
  473. /****************************************************************************************************/
  474. void _System Open_LVM_Engine( BOOLEAN Ignore_CHS, CARDINAL32 * Error_Code );
  475.  
  476. /****************************************************************************************************/
  477. //
  478. //   Function Name: Open_LVM_Engine2
  479. //
  480. //   Descriptive Name: Opens the LVM Engine and readies it for use.
  481. //
  482. //   Input: BOOLEAN Ignore_CHS : If TRUE, then the LVM engine will not check the CHS values in the
  483. //                               MBR/EBR partition tables for validity.  This is useful if there
  484. //                               are drive geometry problems, such as the drive was partitioned and
  485. //                               formatted with one geometry and then moved to a different machine
  486. //                               which uses a different geometry for the drive.  This would cause
  487. //                               the starting and ending CHS values in the partition tables to
  488. //                               be inconsistent with the size and partition offset entries in the
  489. //                               partition tables.  Setting Ignore_CHS to TRUE will disable the
  490. //                               LVM Engine's CHS consistency checks, thereby allowing the drive
  491. //                               to be partitioned.
  492. //          LVM_Interface_Types Interface_Type - Indicate the type of user interface being used:
  493. //                               PM_Interface, VIO_Interface, or Java_Interface.  This lets the
  494. //                               LVM Engine know which interface support routines to call in any
  495. //                               plugin modules which may be loaded.
  496. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in which to store an error code
  497. //                                    should an error occur.
  498. //
  499. //   Output:  *Error_Code will be 0 if this function completes successfully.  If an error occurs,
  500. //            *Error_Code will contain a non-zero error code.
  501. //
  502. //   Error Handling: If this function aborts with an error, all memory allocated during the course
  503. //                   of this function will be released.  Disk read errors will be reported to the
  504. //                   user via pop-up error messages.  Disk read errors will only cause this
  505. //                   function to abort if none of the disk drives in the system could be
  506. //                   successfully read.
  507. //
  508. //   Side Effects:  The LVM Engine will be initialized.  The partition tables for all OS2DASD
  509. //                  controlled disk drives will be read into memory.  Memory will be allocated for
  510. //                  the data structures used by the LVM Engine.
  511. //
  512. //   Notes:  None.
  513. //
  514. /****************************************************************************************************/
  515. void _System Open_LVM_Engine2( BOOLEAN Ignore_CHS, LVM_Interface_Types Interface_Type, CARDINAL32 * Error_Code );
  516.  
  517. /*********************************************************************/
  518. //
  519. //   Function Name: Commit_Changes
  520. //
  521. //   Descriptive Name: Saves any changes made to the partitioning
  522. //                     information of the OS2DASD controlled disk
  523. //                     drives in the system.
  524. //
  525. //   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  526. //                                   in which to store an error code
  527. //                                   should an error occur.
  528. //
  529. //   Output:  The function return value will be TRUE if all of the
  530. //            partitioning/volume changes made were successfully
  531. //            written to disk.  Also, *Error_Code will be 0 if no
  532. //            errors occur.
  533. //
  534. //            If an error occurs, then the furnction return value
  535. //            will be FALSE and *Error_Code will contain a non-zero
  536. //            error code.
  537. //
  538. //   Error Handling:  If an error occurs, the function return value
  539. //                    will be false and *Error_Code will be > 0.
  540. //
  541. /*                    Disk read and write errors will be indicated by*/
  542. //                    setting the IO_Error field of the
  543. //                    Drive_Information_Record to TRUE.  Thus, if
  544. //                    the function return value is FALSE, and
  545. //                    *Error_Code indicates an I/O error, the caller
  546. //                    of this function should call the
  547. //                    Get_Drive_Status function on each drive to
  548. //                    determine which drives had I/O errors.
  549. //
  550. //                    If a read or write error occurs, then the
  551. //                    engine may not have been able to create a
  552. //                    partition or volume.  Thus, the caller
  553. //                    may want to refresh all partition and volume
  554. //                    data to see what the engine was and was not
  555. //                    able to create.
  556. //
  557. //   Side Effects:  The partitioning information of the disk drives
  558. //                  in the system may be altered.
  559. //
  560. //   Notes:  None.
  561. //
  562. /*********************************************************************/
  563. BOOLEAN _System Commit_Changes( CARDINAL32 * Error_Code );
  564.  
  565. /*********************************************************************/
  566. //
  567. //   Function Name: Set_Java_Call_Back
  568. //
  569. //   Descriptive Name: This function allows the calling Java program
  570. //                     to set the call back address.  The call back
  571. //                     address is used when the LVM Engine or one of
  572. //                     its plug-ins, needs to run a Java class to
  573. //                     gather information from the user.
  574. //
  575. //   Input: void (* Execute_Java_Class) ... - The address of a
  576. //                                            function that the LVM
  577. //                                            engine may call when
  578. //                                            it needs a Java class
  579. //                                            to be executed.  This
  580. /*                                            is only required if the*/
  581. //                                            user interface being
  582. /*                                            used is written in Java*/
  583. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  584. //                                   in which to store an error code
  585. //                                   should an error occur.
  586. //
  587. /*   Output: If the function completes successfully, then *Error_Code*/
  588. //           will be set to LVM_ENGINE_NO_ERROR.  Otherwise,
  589. //           *Error_Code will be set to a non-zero error code.
  590. //
  591. /*   Error Handling:  If an error occurs, the function will abort and*/
  592. //                    *Error_Code will be set to a non-zero error
  593. //                    code.
  594. //
  595. /*   Side Effects:  The Java call back address is set to point to the*/
  596. //                  specified function.  Once the Java call back
  597. //                  address is set, LVM plug-ins which require the
  598. //                  Java call back will be enabled and can be used
  599. //                  during the creation of LVM Volumes.
  600. //
  601. //   Notes:  If a Java interface is in use (as specified on the
  602. /*           Open_LVM_Engine call), then this function must be called*/
  603. //           in order to enable those LVM plug-ins which require
  604. //           initialization information during the creation of an
  605. //           LVM Volume.  If these plug-ins are not enabled, then
  606. //           they will not be reported by the Get_Available_Features
  607. //           API, nor can they be used or accessed by any other LVM
  608. //           Engine APIs.  Thus, this function should be called
  609. //           immediately after the Open_LVM_Engine API is called.
  610. //
  611. /*********************************************************************/
  612. void _System Set_Java_Call_Back( void (* _System Execute_Java_Class) ( char *       Class_Name,
  613. ADDRESS      InputBuffer,
  614. CARDINAL32   InputBufferSize,
  615. ADDRESS    * OutputBuffer,
  616. CARDINAL32 * OutputBufferSize,
  617. CARDINAL32 * Error_Code),
  618. CARDINAL32 * Error_Code );
  619.  
  620. /*********************************************************************/
  621. //
  622. //   Function Name: Close_LVM_Engine
  623. //
  624. //   Descriptive Name: Closes the LVM Engine and frees any memory
  625. //                     held by the LVM Engine.
  626. //
  627. //   Input: None.
  628. //
  629. //   Output:  None.
  630. //
  631. //   Error Handling: N/A
  632. //
  633. //   Side Effects:  Any memory held by the LVM Engine is released.
  634. //
  635. //   Notes:  None.
  636. //
  637. /*********************************************************************/
  638. void _System Close_LVM_Engine ( void );
  639.  
  640. /*********************************************************************/
  641. //
  642. //   Function Name: Get_Available_Features
  643. //
  644. /*   Descriptive Name: Returns the feature ID information for each of*/
  645. //                     the features that the LVM Engine knows about.
  646. //
  647. //   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  648. //                                   in which to store an error code
  649. //                                   should an error occur.
  650. //
  651. //   Output: If successful, a Feature_Information_Array structure is
  652. //           returned with a non-zero Count.  Also, *Error_Code will
  653. //           be set to LVM_ENGINE_NO_ERROR.  If an error occurs,
  654. //           then the Count field in the structure will be 0 and
  655. //           (*Error_Code) will contain a non-zero error code.
  656. //
  657. //   Error Handling: The only expected error is if this function is
  658. //                   called while the LVM Engine is not open.  This
  659. //                   should be the only error condition.
  660. //
  661. /*   Side Effects:  Memory is allocated using the LVM Engine's memory*/
  662. //                  manager for the array of Feature_ID_Data items
  663. //                  being returned.
  664. //
  665. //   Notes:  None.
  666. //
  667. /*********************************************************************/
  668. Feature_Information_Array _System Get_Available_Features( CARDINAL32 * Error_Code );
  669.  
  670. /*********************************************************************/
  671. //
  672. //   Function Name: Issue_Feature_Command
  673. //
  674. //   Descriptive Name: Issues a feature specific command to either
  675. //                     the Ring 0 or Ring 3 portion of the feature.
  676. //
  677. //   Input: CARDINAL32 Feature_ID - The numeric ID assigned to the
  678. //                                  feature which is to receive the
  679. //                                  command being issued.
  680. //          ADDRESS Handle - The handle of the volume, partition, or
  681. //                           aggregate to which the feature command
  682. //                           is to be directed.
  683. //          BOOLEAN Ring0 - If TRUE, then the command will be sent
  684. //                          to the Ring 0 portion of the feature.
  685. //                          If FALSE, then the command will be sent
  686. //                          to the Ring 3 portion of the feature.
  687. /*          ADDRESS InputBuffer - A buffer containing the command and*/
  688. //                                any necessary information for the
  689. //                                feature to process the command.
  690. //          CARDINAL32 InputSize - The number of bytes in the
  691. //                                 InputBuffer.
  692. //          ADDRESS * OutputBuffer - The address of a variable used
  693. //                                   to hold the location of the
  694. //                                   output buffer created by the
  695. //                                   feature in response to the
  696. //                                   command in InputBuffer.
  697. //          CARDINAL32 * OutputSize - The address of a variable used
  698. //                                    to hold the number of bytes in
  699. //                                    *OutputBuffer.
  700. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  701. //                                   in which to store an error code
  702. //                                   should an error occur.
  703. //
  704. //   Output: If successful, then *Error_Code will be set to
  705. //           LVM_ENGINE_NO_ERROR.  If unsuccessful, then *Error_Code
  706. /*           will be set to a non-zero error code.  *OutputBuffer and*/
  707. //           *OutputSize are set by the feature.  If the feature
  708. //           specified does not exist, then *OutputBuffer will be
  709. //           NULL and *Outputsize will be 0.  If the feature does
  710. //           exist, then the value of *OutputBuffer and *OutputSize
  711. //           depend upon the feature.
  712. //
  713. //   Error Handling: If the specified feature does not exist, then
  714. //                   *Error_Code will contain a non-zero error code,
  715. /*                   *OutputBuffer will be NULL, and *OutputSize will*/
  716. //                   be set to 0.  All other error conditions are
  717. //                   feature dependent.
  718. //
  719. //   Side Effects:  Side effects are feature dependent.
  720. //
  721. //   Notes:  None.
  722. //
  723. /*********************************************************************/
  724. void _System Issue_Feature_Command( CARDINAL32 Feature_ID,
  725. ADDRESS Handle,
  726. BOOLEAN Ring0,
  727. ADDRESS InputBuffer,
  728. CARDINAL32 InputSize,
  729. ADDRESS * OutputBuffer,
  730. CARDINAL32 * OutputSize,
  731. CARDINAL32 * Error_Code );
  732.  
  733. /*********************************************************************/
  734. //
  735. //   Function Name: Parse_Feature_Parameters
  736. //
  737. //   Descriptive Name: This function allows access to the parsing
  738. //                     function of an LVM Plug-in Feature.  The
  739. //                     specified feature will be passed a list of
  740. //                     tokens to parse, and, if it parses the tokens
  741. /*                     successfully, will produce a buffer containing*/
  742. //                     initialization data that can be used with the
  743. /*                     Create_Volume API.  If it encounters an error,*/
  744. //                     the current item in the Tokens list will be
  745. //                     the offending item, and a pointer to an error
  746. //                     message will be returned.
  747. //
  748. /*   Input: DLIST  Tokens - A DLIST of tokens to parse.  Parsing will*/
  749. //                          begin with the current entry in the list
  750. //                          and proceed until there is an error or
  751. //                          until the specified feature has found a
  752. //                          complete command.  Each feature defines
  753. //                          what commands it will accept.
  754. //          LVM_Feature_Specification_Record * Feature_Data - A
  755. //                          pointer to a record which contains the
  756. //                          ID of the feature which is to parse the
  757. //                          DLIST of Tokens.  The other fields in
  758. //                          this record will be filled in by the
  759. //                          feature if it successfully parses the
  760. //                          tokens.
  761. /*          char ** Error_Message - The address of a pointer to char.*/
  762. //                          This will be set to NULL if the feature
  763. //                          successfully parses the list of tokens,
  764. //                          or it will be set to point to an error
  765. //                          message if an error occurs.
  766. //          CARDINAL32 * Error_Code - The address of a CARDINAL32
  767. //                          variable into which an error code may
  768. //                          be placed.  The error code will be
  769. //                          LVM_ENGINE_NO_ERROR if this function
  770. //                          completes successfully, or a non-zero
  771. //                          error code if an error occurs.
  772. //
  773. //   Output: If there are no errors, the Actual_Class and Init_Data
  774. /*           fields of *Feature_Data will be set, *Error_Message will*/
  775. //           be set to NULL, and Error_Code will be set to
  776. //           LVM_ENGINE_NO_ERROR.  The current item in the Tokens
  777. //           list will be the first token that was not parsed by the
  778. /*           feature (i.e. the first token after the command accepted*/
  779. //           by the plug-in).
  780. //
  781. //           If an error occurs, the values of Actual_Class and
  782. //           Init_Data in *Feature_Data are undefined.  *Error_Code
  783. //           will be set to LVM_ENGINE_PARSING_ERROR if the error is
  784. //           parsing related, or some other non-zero value if the
  785. //           error is not parsing related.  If the error is parsing
  786. //           related, then *Error_Message will point to an error
  787. //           message which can be displayed for the user.  The
  788. //           current item in the Tokens list will be the token which
  789. //           failed.
  790. //
  791. //   Error Handling: If an parsing related error occurs, i.e. the
  792. //                   tokens in the Tokens list do not form a valid
  793. //                   command accepted by the specified feature, then
  794. //                   the current item in the Tokens list will be the
  795. //                   offending token, *Error_Message will be set to
  796. //                   point to an error message, and *Error_Code will
  797. //                   be set to LVM_ENGINE_PARSING_ERROR.
  798. //                   If any other error occurs, the current item in
  799. /*                   the Tokens list will be the token that was being*/
  800. /*                   processed when the error occurs, and *Error_Code*/
  801. //                   will be set to a non-zero value.
  802. //
  803. //   Side Effects:  The current item in the Tokens list may change.
  804. //
  805. //   Notes:  Each feature defines which commands it will accept, and
  806. //           therefore which commands it will successfully parse.
  807. //
  808. /*********************************************************************/
  809. void _System Parse_Feature_Parameters( DLIST                               Tokens,
  810. LVM_Feature_Specification_Record  * Feature_Data,
  811. char **                             Error_Message,
  812. CARDINAL32 *                        Error_Code);
  813.  
  814. /*********************************************************************/
  815. //
  816. //   Function Name: Refresh_LVM_Engine
  817. //
  818. //   Descriptive Name: This function causes the LVM Engine to look
  819. //                     for changes in the current system
  820. //                     configuration and update its internal tables
  821. //                     accordingly.
  822. //
  823. //   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  824. //                                   in which to store an error code
  825. //                                   should an error occur.
  826. //
  827. //   Output:  None.
  828. //
  829. //   Error Handling: If an error occurs, *Error_Code will be set to
  830. //                   a non-zero value.
  831. //
  832. //   Side Effects: Volumes which represent non-LVM devices may have
  833. //                 their handles changed!
  834. //
  835. //   Notes:  After calling this function, Get_Volume_Control_Data
  836. //           should be called to get the updated list of volumes.
  837. //           This is necessary as the handles of some volumes may
  838. //           have changed.
  839. //
  840. /*********************************************************************/
  841. void _System  Refresh_LVM_Engine( CARDINAL32 * Error_Code );
  842.  
  843. /* ************************************************************************** *
  844.  
  845. Functions relating to Drives
  846.  
  847. ************************************************************************** */
  848.  
  849. /*********************************************************************/
  850. //
  851. //   Function Name:  Get_Drive_Control_Data
  852. //
  853. //   Descriptive Name:  This function returns an array of
  854. /*                      Drive_Control_Records.  These records provide*/
  855. /*                      important information about the drives in the*/
  856. //                      system and provide the handles required to
  857. //                      access them.
  858. //
  859. //   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  860. //                                   in which to store an error code
  861. //                                   should an error occur.
  862. //
  863. //   Output:  A Drive_Control_Array structure is returned.  If no
  864. //            errors occur, Drive_Control_Data will be non-NULL,
  865. //            Count will be greater than zero, and *Error_Code will
  866. //            be 0.
  867. //
  868. //   Error Handling:  If an error occurs, the Drive_Control_Array
  869. //                    returned by this function will have NULL for
  870. //                    Drive_Control_Data, and 0 for Count.
  871. //                    *Error_Code will be greater than 0.
  872. //
  873. //   Side Effects:  None.
  874. //
  875. //   Notes:  The caller becomes responsible for the memory allocated
  876. //           for the array of Drive_Control_Records pointed to by
  877. //           Drive_Control_Data pointer in the Drive_Control_Array
  878. //           structure returned by this function.  The caller should
  879. //           free this memory when they are done using it.
  880. //
  881. /*********************************************************************/
  882. Drive_Control_Array _System Get_Drive_Control_Data( CARDINAL32 * Error_Code );
  883.  
  884. /*********************************************************************/
  885. //
  886. //   Function Name:  Get_Drive_Status
  887. //
  888. //   Descriptive Name:  Returns the Drive_Information_Record for the
  889. //                      drive specified by Drive_Handle.
  890. //
  891. //   Input: ADDRESS Drive_Handle - The handle of the drive to use.
  892. /*                             Drive handles are obtained through the*/
  893. //                             Get_Drive_Control_Data function.
  894. //         CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  895. //                                   in which to store an error code
  896. //                                   should an error occur.
  897. //
  898. //   Output: This function returns the Drive_Information_Record for
  899. //           the drive associated with the specified Drive_Handle.
  900. /*           If no errors occur, *Error_Code will be set to 0.  If an*/
  901. //           error does occur, then *Error_Code will be non-zero.
  902. //
  903. //   Error Handling:  If an error occurs, then *Error_Code will be
  904. //                    non-zero.
  905. //
  906. //   Side Effects:  None.
  907. //
  908. //   Notes:  None.
  909. //
  910. /*********************************************************************/
  911. Drive_Information_Record _System Get_Drive_Status( ADDRESS Drive_Handle, CARDINAL32 * Error_Code );
  912.  
  913. /* ************************************************************************** *
  914.  
  915. Functions relating to Partitions
  916.  
  917. ************************************************************************** */
  918.  
  919. /*********************************************************************/
  920. //
  921. //   Function Name: Get_Partitions
  922. //
  923. //   Descriptive Name: Returns an array of partitions associated
  924. //                     with the object specified by Handle.
  925. //
  926. //   Input:ADDRESS Handle - This is the handle of a drive or volume.
  927. //                      Drive handles are obtained through the
  928. //                      Get_Drive_Control_Data function.  Volume
  929. //                      handles are obtained through the
  930. //                      Get_Volume_Control_Data function.
  931. //         CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  932. //                                   in which to store an error code
  933. //                                   should an error occur.
  934. //
  935. //   Output: This function returns a structure.  The structure has
  936. //           two components: an array of partition information
  937. //           records and the number of entries in the array.  If
  938. //           Handle is the handle of a disk drive, then the returned
  939. //           array will contain a partition information record for
  940. //           each partition and block of free space on that drive.
  941. //           If Handle is the handle of a volume, then the returned
  942. //           array will contain a partition information record for
  943. //           each partition which is part of the specified volume.
  944. //           If no errors occur, then *Error_Code will be 0.  If an
  945. //           error does occur, then *Error_Code will be non-zero.
  946. //
  947. //   Error Handling: Any memory allocated for the return value will
  948. //                   be freed.  The Partition_Information_Array
  949. //                   returned by this function will contain a NULL
  950. /*                   pointer for Partition_Array, and have a Count of*/
  951. //                   0.  *Error_Code will be non-zero.
  952. //
  953. //                   If Handle is non-NULL and is invalid, a trap
  954. //                   is likely.
  955. //
  956. //   Side Effects:  Memory will be allocated to hold the array
  957. //                  returned by this function.
  958. //
  959. //   Notes:  The caller becomes responsible for the memory allocated
  960. //           for the array of Partition_Information_Records pointed
  961. //           to by Partition_Array pointer in the
  962. //           Partition_Information_Array structure returned by this
  963. //           function.  The caller should free this memory when they
  964. //           are done using it.
  965. //
  966. /*********************************************************************/
  967. Partition_Information_Array _System Get_Partitions( ADDRESS Handle, CARDINAL32 * Error_Code );
  968.  
  969. /*********************************************************************/
  970. //
  971. //   Function Name: Get_Partition_Handle
  972. //
  973. //   Descriptive Name: Returns the handle of the partition whose
  974. //                     serial number matches the one provided.
  975. //
  976. //   Input: CARDINAL32 Serial_Number - This is the serial number to
  977. /*                                     look for.  If a partition with*/
  978. //                                     a matching serial number is
  979. //                                     found, its handle will be
  980. //                                     returned.
  981. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  982. /*                                    in which to store an error code*/
  983. //                                    should an error occur.
  984. //
  985. //   Output: If a partition with a matching serial number is found,
  986. //              then the function return value will be the handle
  987. //              of the partition found.  If no matching partition is
  988. //              found, then the function return value will be NULL.
  989. //
  990. //   Error Handling:  If no errors occur, *Error_Code will be
  991. //                    LVM_ENGINE_NO_ERROR.  If an error occurs, then
  992. //                    *Error_Code will be a non-zero error code.
  993. //
  994. //   Side Effects:  None.
  995. //
  996. //   Notes:  None.
  997. //
  998. /*********************************************************************/
  999. ADDRESS _System Get_Partition_Handle( CARDINAL32 Serial_Number, CARDINAL32 * Error_Code );
  1000.  
  1001. /*********************************************************************/
  1002. //
  1003. //   Function Name: Get_Partition_Information
  1004. //
  1005. //   Descriptive Name: Returns the Partition_Information_Record for
  1006. //                     the partition specified by Partition_Handle.
  1007. //
  1008. /*   Input: ADDRESS Partition_Handle - The handle associated with the*/
  1009. //                                     partition for which the
  1010. //                                     Partition_Information_Record
  1011. //                                     is desired.
  1012. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1013. /*                                    in which to store an error code*/
  1014. //                                    should an error occur.
  1015. //
  1016. //   Output: A Partition_Information_Record is returned.  If there
  1017. //           is no error, then *Error_Code will be 0.  If an error
  1018. //           occurs, *Error_Code will be non-zero.
  1019. //
  1020. //   Error Handling:  If the Partition_Handle is not a valid handle,
  1021. //                    a trap could result.  If it is a handle for
  1022. /*                    something other than a partition, an error code*/
  1023. //                    will be returned in *Error_Code.
  1024. //
  1025. //   Side Effects:  None.
  1026. //
  1027. //   Notes:  None.
  1028. //
  1029. /*********************************************************************/
  1030. Partition_Information_Record  _System Get_Partition_Information( ADDRESS Partition_Handle, CARDINAL32 * Error_Code );
  1031.  
  1032. /*********************************************************************/
  1033. //
  1034. //   Function Name: Create_Partition
  1035. //
  1036. //   Descriptive Name: Creates a partition on a disk drive.
  1037. //
  1038. //   Input: ADDRESS         Handle - The handle of a disk drive or
  1039. //                                   a block of free space.
  1040. //          CARDINAL32      Size - The size, in sectors, of the
  1041. //                                 partition to create.
  1042. //          char            Name[] - The name to give to the newly
  1043. //                                   created partition.
  1044. //          Allocation_Algorithm algorithm - If Handle is a drive,
  1045. //                                           then the engine will
  1046. //                                           find a block of free
  1047. //                                           space to use to create
  1048. //                                           the partition.  This
  1049. //                                           tells the engine which
  1050. //                                           memory management
  1051. //                                           algorithm to use.
  1052. //          BOOLEAN         Bootable - If TRUE, then the engine will
  1053. //                                     only create the partition if
  1054. //                                     it can be booted from.  If
  1055. //                                     Primary_Partition is FALSE,
  1056. //                                     then it is assumed that OS/2
  1057. //                                     is the operating system that
  1058. //                                     will be booted.
  1059. //          BOOLEAN         Primary_Partition - If TRUE, then the
  1060. //                                              engine will create
  1061. //                                              a primary partition.
  1062. //                                              If FALSE, then the
  1063. //                                              engine will create a
  1064. //                                              logical drive.
  1065. //          BOOLEAN         Allocate_From_Start - If TRUE, then the
  1066. //                                                engine will
  1067. //                                                allocate the new
  1068. //                                                partition from the
  1069. //                                                beginning of the
  1070. //                                                selected block of
  1071. //                                                free space.  If
  1072. //                                                FALSE, then the
  1073. //                                                partition will be
  1074. //                                                allocated from the
  1075. /*                                                end of the selected*/
  1076. //                                                block of free
  1077. //                                                space.
  1078. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1079. /*                                    in which to store an error code*/
  1080. //                                    should an error occur.
  1081. //
  1082. //   Output: The function return value will be the handle of the
  1083. //           partition created.  If the partition could not be
  1084. //           created, then NULL will be returned.
  1085. //           *Error_Code will be 0 if the partition was created.
  1086. //           *Error_Code will be > 0 if the partition could not be
  1087. //           created.
  1088. //
  1089. //   Error Handling:  If the partition can not be created, then any
  1090. //                    memory allocated by this function will be
  1091. //                    freed and the partitioning of the disk in
  1092. //                    question will be unchanged.
  1093. //
  1094. //                    If Handle is not a valid handle, then a trap
  1095. //                    may result.
  1096. //
  1097. //                    If Handle represents a partition or volume,
  1098. //                    then the function will abort and set
  1099. //                    *Error_Code to a non-zero value.
  1100. //
  1101. //   Side Effects:  A partition may be created on a disk drive.
  1102. //
  1103. //   Notes:  None.
  1104. //
  1105. /*********************************************************************/
  1106. ADDRESS _System Create_Partition( ADDRESS               Handle,
  1107. CARDINAL32            Size,
  1108. char                  Name[ PARTITION_NAME_SIZE ],
  1109. Allocation_Algorithm  algorithm,
  1110. BOOLEAN               Bootable,
  1111. BOOLEAN               Primary_Partition,
  1112. BOOLEAN               Allocate_From_Start,
  1113. CARDINAL32 *          Error_Code
  1114. );
  1115.  
  1116. /*********************************************************************/
  1117. //
  1118. //   Function Name: Delete_Partition
  1119. //
  1120. //   Descriptive Name: Deletes the partition specified by
  1121. //                     Partition_Handle.
  1122. //
  1123. /*   Input: ADDRESS Partition_Handle - The handle associated with the*/
  1124. //                                     partition to be deleted.
  1125. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1126. /*                                    in which to store an error code*/
  1127. //                                    should an error occur.
  1128. //
  1129. //   Output: *Error_Code will be 0 if the partition was deleted
  1130. //           successfully.  *Error_Code will be > 0 if the partition
  1131. //           could not be deleted.
  1132. //
  1133. //   Error Handling: If the partition can not be deleted, then
  1134. //                   *Error_Code will be > 0.
  1135. //
  1136. //                   If Partition_Handle is not a valid handle, a
  1137. //                   trap may result.
  1138. //
  1139. /*                   If Partition_Handle is a volume or drive handle,*/
  1140. //                   then this function will abort and set
  1141. //                   *Error_Code to a non-zero value.
  1142. //
  1143. //   Side Effects: A partition on a disk drive may be deleted.
  1144. //
  1145. //   Notes:  A partition can not be deleted if it is part of a
  1146. //           volume!
  1147. //
  1148. /*********************************************************************/
  1149. void _System Delete_Partition( ADDRESS Partition_Handle, CARDINAL32 * Error_Code );
  1150.  
  1151. /*********************************************************************/
  1152. //
  1153. //   Function Name: Set_Active_Flag
  1154. //
  1155. //   Descriptive Name: Sets the Active Flag field for a partition.
  1156. //
  1157. //   Input: ADDRESS Partition_Handle - The handle of the partition
  1158. /*                                     whose Active Flag is to be set*/
  1159. //          BYTE Active_Flag - The new value for the Active Flag.
  1160. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1161. /*                                    in which to store an error code*/
  1162. //                                    should an error occur.
  1163. //
  1164. //   Output: *Error_Code will be 0 if the Active Flag was
  1165. //           successfully set, otherwise *Error_Code will contain a
  1166. //           non-zero error code indicating what went wrong.
  1167. //
  1168. /*   Error Handling: If the Active Flag can not be set, this function*/
  1169. /*                   will abort without changing any disk structures.*/
  1170. //
  1171. //                   If Partition_Handle is not a valid handle, a
  1172. //                   trap may result.
  1173. //
  1174. /*                   If Partition_Handle is a volume or drive handle,*/
  1175. //                   then this function will abort and set
  1176. //                   *Error_Code to a non-zero value.
  1177. //
  1178. //
  1179. //   Side Effects:  The Active Flag for a partition may be modified.
  1180. //
  1181. //   Notes:  None.
  1182. //
  1183. /*********************************************************************/
  1184. void _System Set_Active_Flag ( ADDRESS      Partition_Handle,
  1185. BYTE         Active_Flag,
  1186. CARDINAL32 * Error_Code
  1187. );
  1188.  
  1189. /*********************************************************************/
  1190. //
  1191. //   Function Name: Set_OS_Flag
  1192. //
  1193. //   Descriptive Name: Sets the OS Flag field for a partition.  This
  1194. //                     field is typically used to indicate the
  1195. //                     filesystem used on the partition, which
  1196. //                     generally gives an indication of which OS is
  1197. //                     using that partition.
  1198. //
  1199. //   Input: ADDRESS Partition_Handle - The handle of the partition
  1200. /*                                     whose Active Flag is to be set*/
  1201. //          BYTE OS_Flag - The new value for the OS Flag.
  1202. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1203. /*                                    in which to store an error code*/
  1204. //                                    should an error occur.
  1205. //
  1206. //   Output: *Error_Code will be 0 if the OS Flag was successfully
  1207. /*           set, otherwise *Error_Code will contain a non-zero error*/
  1208. //           code indicating what went wrong.
  1209. //
  1210. //   Error Handling: If the OS Flag can not be set, this function
  1211. /*                   will abort without changing any disk structures.*/
  1212. //
  1213. //                   If Partition_Handle is not a valid handle, a
  1214. //                   trap may result.
  1215. //
  1216. /*                   If Partition_Handle is a volume or drive handle,*/
  1217. //                   then this function will abort and set
  1218. //                   *Error_Code to a non-zero value.
  1219. //
  1220. //
  1221. //   Side Effects:  The OS Flag for a partition may be modified.
  1222. //
  1223. //   Notes:  None.
  1224. //
  1225. /*********************************************************************/
  1226. void _System Set_OS_Flag ( ADDRESS      Partition_Handle,
  1227. BYTE         OS_Flag,
  1228. CARDINAL32 * Error_Code
  1229. );
  1230.  
  1231. /* ************************************************************************** *
  1232.  
  1233. Functions relating to Volumes
  1234.  
  1235. ************************************************************************** */
  1236.  
  1237. /*********************************************************************/
  1238. //
  1239. //   Function Name: Get_Volume_Control_Data
  1240. //
  1241. //   Descriptive Name: This function returns a structure containing
  1242. //                     an array of Volume_Control_Records.  These
  1243. //                     records contain information about volumes
  1244. //                     which is invariant - i.e. will not change for
  1245. //                     as long as the volume exists.  One of the
  1246. //                     items in the Volume_Control_Record is the
  1247. //                     handle for the volume.  This handle must be
  1248. //                     used on all accesses to the volume.
  1249. //
  1250. //   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1251. /*                                    in which to store an error code*/
  1252. //                                    should an error occur.
  1253. //
  1254. //   Output: A Volume_Control_Array structure is returned.
  1255. //
  1256. //           If there are no errors, then the Volume_Control_Data
  1257. //           pointer in the Volume_Control_Array will be non-NULL,
  1258. //           the Count field of the Volume_Control_Array will be
  1259. //           >= 0, and *Error_Code will be 0.
  1260. //
  1261. //           If an error does occur, then the Volume_Control_Data
  1262. //           pointer in the the Volume_Control_Array will be NULL,
  1263. //           the Count field of the Volume_Control_Array will be 0,
  1264. //           and *Error_Code will be > 0.
  1265. //
  1266. /*   Error Handling: If an error occurs, then any memory allocated by*/
  1267. //                   this function will be freed.
  1268. //
  1269. //   Side Effects:  Memory for the returned array is allocated.
  1270. //
  1271. //   Notes:  The caller becomes responsible for the memory allocated
  1272. //           for the array of Volume_Control_Records pointed to by
  1273. //           Volume_Control_Data pointer in the Volume_Control_Array
  1274. //           structure returned by this function.  The caller should
  1275. //           free this memory when they are done using it.
  1276. //
  1277. /*********************************************************************/
  1278. Volume_Control_Array _System Get_Volume_Control_Data( CARDINAL32 * Error_Code );
  1279.  
  1280. /*********************************************************************/
  1281. //
  1282. //   Function Name: Get_Volume_Information
  1283. //
  1284. //   Descriptive Name:  This function returns the
  1285. //                      Volume_Information_Record for the volume
  1286. //                      associated with Volume_Handle.
  1287. //
  1288. //   Input: ADDRESS Volume_Handle - The handle of the volume about
  1289. //                                  which information is desired.
  1290. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1291. /*                                    in which to store an error code*/
  1292. //                                    should an error occur.
  1293. //
  1294. //   Output: This function returns a Volume_Information_Record.
  1295. //
  1296. /*           If this function is successful, then *Error_Code will be*/
  1297. //              0.
  1298. //
  1299. //           If this function fails, then *Error_Code will be > 0.
  1300. //
  1301. //   Error Handling:  If Volume_Handle is not a valid handle, a trap
  1302. /*                    will be likely.  If Volume_Handle is a drive or*/
  1303. //                    partition handle, *Error_Code will be > 0.
  1304. //
  1305. //   Side Effects:  None.
  1306. //
  1307. //   Notes:  None.
  1308. //
  1309. /*********************************************************************/
  1310. Volume_Information_Record _System Get_Volume_Information( ADDRESS Volume_Handle, CARDINAL32 * Error_Code );
  1311.  
  1312. /*********************************************************************/
  1313. //
  1314. //   Function Name: Create_Volume
  1315. //
  1316. /*   Descriptive Name:  This function creates a volume from a list of*/
  1317. //                      partitions.  The partitions are specified by
  1318. //                      their corresponding handles.
  1319. //
  1320. //   Input: char         Name[] - The name to assign to the newly
  1321. //                                created volume.
  1322. //          BOOLEAN      Create_LVM_Volume - If TRUE, then an LVM
  1323. //                                           volume is created,
  1324. //                                           otherwise a
  1325. //                                           compatibility volume is
  1326. //                                           created.
  1327. //          BOOLEAN      Bootable - If TRUE, the volume will not be
  1328. /*                                  created unless OS/2 can be booted*/
  1329. //                                  from it.
  1330. //          char         Drive_Letter_Preference - This is the drive
  1331. //                                                 letter to use for
  1332. //                                                 accessing the
  1333. //                                                 newly created
  1334. //                                                 volume.
  1335. //          CARDINAL32   FeaturesToUse - This is currently reserved
  1336. //                                       for future use and should
  1337. //                                       always be set to 0.
  1338. //          CARDINAL32   Partition_Count - The number of partitions
  1339. //                                         to link together to form
  1340. //                                         the volume being created.
  1341. //          ADDRESS      Partition_Handles[] - An array of partition
  1342. /*                                             handles with one entry*/
  1343. //                                             for each partition
  1344. /*                                             that is to become part*/
  1345. //                                             of the volume being
  1346. //                                             created.
  1347. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1348. /*                                    in which to store an error code*/
  1349. //                                    should an error occur.
  1350. //
  1351. //   Output: *Error_Code will be 0 if the volume was created.
  1352. //           *Error_Code will be > 0 if the volume could not be
  1353. //              created.
  1354. //
  1355. //   Error Handling: If any of the handles in the partition handles
  1356. //                   array is not valid, then a trap is likely.  If
  1357. //                   Partition_Count is greater than the number of
  1358. //                   entries in the partition handles array, then a
  1359. //                   trap is likely.  If any of the handles in the
  1360. //                   partition array are not partition handles, then
  1361. //                   *Error_Code will be > 0.  If the volume can NOT
  1362. /*                   be created, then *Error_Code will be > 0 and any*/
  1363. /*                   memory allocated by this function will be freed.*/
  1364. //                   If the volume can NOT be created, then the
  1365. //                   existing partition/volume structure of the disk
  1366. //                   will be unchanged.
  1367. //
  1368. //   Side Effects:  A volume may be created.
  1369. //
  1370. //   Notes:  This function provides limited compatibility for
  1371. //           programs written to use the LVM Version 1 interface.
  1372. //           Specifically, this function will only allow the
  1373. //           creation of compatibility volumes.  Any attempt to
  1374. //           create an LVM volume will result in an error code being
  1375. //           returned.
  1376. //
  1377. /*********************************************************************/
  1378. void _System Create_Volume( char         Name[VOLUME_NAME_SIZE],
  1379. BOOLEAN      Create_LVM_Volume,
  1380. BOOLEAN      Bootable,
  1381. char         Drive_Letter_Preference,
  1382. CARDINAL32   FeaturesToUse,
  1383. CARDINAL32   Partition_Count,
  1384. ADDRESS      Partition_Handles[],
  1385. CARDINAL32 * Error_Code
  1386. );
  1387.  
  1388. /*********************************************************************/
  1389. //
  1390. //   Function Name: Create_Volume2
  1391. //
  1392. /*   Descriptive Name:  This function creates a volume from a list of*/
  1393. //                      partitions.  The partitions are specified by
  1394. //                      their corresponding handles.
  1395. //
  1396. //   Input: char         Name[] - The name to assign to the newly
  1397. //                                created volume.
  1398. //          BOOLEAN      Create_LVM_Volume - If TRUE, then an LVM
  1399. //                                           volume is created,
  1400. //                                           otherwise a
  1401. //                                           compatibility volume is
  1402. //                                           created.
  1403. //          BOOLEAN      Bootable - If TRUE, the volume will not be
  1404. /*                                  created unless OS/2 can be booted*/
  1405. //                                  from it.
  1406. //          char         Drive_Letter_Preference - This is the drive
  1407. //                                                 letter to use for
  1408. //                                                 accessing the
  1409. //                                                 newly created
  1410. //                                                 volume.
  1411. //          CARDINAL32   Feature_Count - The number of features to
  1412. //                                       install on the volume being
  1413. //                                       created.  This field is
  1414. /*                                       ignored if Create_LVM_Volume*/
  1415. //                                       is FALSE.
  1416. //          LVM_Feature_Specification_Record FeaturesToUse[] - An
  1417. //                                         array of feature IDs and
  1418. //                                         their associated LVM
  1419. //                                         classes used to designate
  1420. //                                         which features to install
  1421. //                                         on the volume being
  1422. //                                         created and the order in
  1423. //                                         which to install them.
  1424. //                                         This field is ignored if
  1425. //                                         Create_LVM_Volume is
  1426. //                                         FALSE.
  1427. //          CARDINAL32   Partition_Count - The number of partitions
  1428. //                                         to link together to form
  1429. //                                         the volume being created.
  1430. //          ADDRESS      Partition_Handles[] - An array of partition
  1431. /*                                             handles with one entry*/
  1432. //                                             for each partition
  1433. /*                                             that is to become part*/
  1434. //                                             of the volume being
  1435. //                                             created.
  1436. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1437. /*                                    in which to store an error code*/
  1438. //                                    should an error occur.
  1439. //
  1440. //   Output: *Error_Code will be 0 if the volume was created.
  1441. //           *Error_Code will be > 0 if the volume could not be
  1442. //              created.
  1443. //
  1444. //   Error Handling: If any of the handles in the partition handles
  1445. //                   array is not valid, then a trap is likely.  If
  1446. //                   Partition_Count is greater than the number of
  1447. //                   entries in the partition handles array, then a
  1448. //                   trap is likely.  If any of the handles in the
  1449. //                   partition array are not partition handles, then
  1450. //                   *Error_Code will be > 0.  If the volume can NOT
  1451. /*                   be created, then *Error_Code will be > 0 and any*/
  1452. /*                   memory allocated by this function will be freed.*/
  1453. //                   If the volume can NOT be created, then the
  1454. //                   existing partition/volume structure of the disk
  1455. //                   will be unchanged.
  1456. //
  1457. //   Side Effects:  A volume may be created.
  1458. //
  1459. //   Notes:  None.
  1460. //
  1461. /*********************************************************************/
  1462. void _System Create_Volume2( char                               Name[VOLUME_NAME_SIZE],
  1463. BOOLEAN                            Create_LVM_Volume,
  1464. BOOLEAN                            Bootable,
  1465. char                               Drive_Letter_Preference,
  1466. CARDINAL32                         Feature_Count,
  1467. LVM_Feature_Specification_Record   FeaturesToUse[],
  1468. CARDINAL32                         Partition_Count,
  1469. ADDRESS                            Partition_Handles[],
  1470. CARDINAL32 *                       Error_Code
  1471. );
  1472.  
  1473. /*********************************************************************/
  1474. //
  1475. //   Function Name: Delete_Volume
  1476. //
  1477. /*   Descriptive Name: Deletes the volume specified by Volume_Handle.*/
  1478. //
  1479. //   Input: ADDRESS Volume_Handle - The handle of the volume to
  1480. /*                                  delete.  All partitions which are*/
  1481. /*                                  part of the specified volume will*/
  1482. //                                  be deleted also.
  1483. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1484. /*                                    in which to store an error code*/
  1485. //                                    should an error occur.
  1486. //
  1487. //   Output: *Error_Code will be 0 if the volume and its partitions
  1488. //           are successfully deleted.  Otherwise, *Error_Code will
  1489. //           be > 0.
  1490. //
  1491. //   Error Handling: *Error_Code will be > 0 if an error occurs.  If
  1492. //                   the volume or any of its partitions can not be
  1493. //                   deleted, then any changes made by this function
  1494. //                   will be undone.
  1495. //
  1496. //                   If Volume_Handle is not a valid handle, a trap
  1497. //                   may result.
  1498. //
  1499. /*                   If Volume_Handle is a partition or drive handle,*/
  1500. //                   then this function will abort and set
  1501. //                   *Error_Code to a non-zero value.
  1502. //
  1503. //   Side Effects:  A volume and its partitions may be deleted.
  1504. //                  System memory may be freed as the internal
  1505. //                  structures used to track the deleted volume
  1506. //                  are no longer required.
  1507. //
  1508. //   Notes:  None.
  1509. //
  1510. /*********************************************************************/
  1511. void _System Delete_Volume( ADDRESS Volume_Handle, CARDINAL32 * Error_Code );
  1512.  
  1513. /*********************************************************************/
  1514. //
  1515. //   Function Name: Hide_Volume
  1516. //
  1517. //   Descriptive Name: Hide volume "hides" a volume from OS/2 by
  1518. /*                     removing its drive letter assignment.  Without*/
  1519. /*                     a drive letter assignment, OS/2 can not access*/
  1520. //                     (or "see") the volume.
  1521. //
  1522. /*   Input: ADDRESS Volume_Handle - The handle of the volume to hide.*/
  1523. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1524. /*                                    in which to store an error code*/
  1525. //                                    should an error occur.
  1526. //
  1527. //   Output: *Error_Code will be 0 if the volume was successfully
  1528. //           hidden.  If the volume could not be hidden, then
  1529. //           *Error_Code will be > 0.
  1530. //
  1531. /*   Error Handling: *Error_Code will be > 0 if the volume can not be*/
  1532. //                   hidden.  If the volume can not be hidden, then
  1533. //                   nothing will be altered.
  1534. //
  1535. //                   If Volume_Handle is not a valid handle, a trap
  1536. //                   may result.
  1537. //
  1538. /*                   If Volume_Handle is a partition or drive handle,*/
  1539. //                   then this function will abort and set
  1540. //                   *Error_Code to a non-zero value.
  1541. //
  1542. //   Side Effects:  None.
  1543. //
  1544. //   Notes:  None.
  1545. //
  1546. /*********************************************************************/
  1547. void _System Hide_Volume( ADDRESS Volume_Handle, CARDINAL32 * Error_Code );
  1548.  
  1549. /*********************************************************************/
  1550. //
  1551. //   Function Name: Expand_Volume
  1552. //
  1553. //   Descriptive Name: This function expands an existing volume by
  1554. //                     linking additional partitions to it.
  1555. //
  1556. //   Input: ADDRESS Volume_Handle - The handle of the volume to be
  1557. //                                  expanded.
  1558. //          CARDINAL32 Partition_Count - The number of partitions or
  1559. //                                       volumes to be added to the
  1560. //                                       volume being expanded.
  1561. //          ADDRESS Partition_Handles[] - An array of handles.  Each
  1562. //                                        handle in the array is the
  1563. //                                        handle of a partition
  1564. //                                        which is to be added to
  1565. //                                        the volume being expanded.
  1566. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1567. /*                                    in which to store an error code*/
  1568. //                                    should an error occur.
  1569. //
  1570. //   Output: *Error_Code will be 0 if the volume is successfully
  1571. //           expanded.  If the volume can not be expanded,
  1572. //           *Error_Code will be > 0.
  1573. //
  1574. //   Error Handling: If the volume can not be expanded, the state of
  1575. /*                   the volume is unchanged and any memory allocated*/
  1576. //                   by this function is freed.
  1577. //
  1578. //                   If Volume_Handle is not a valid handle, a trap
  1579. //                   may result.
  1580. //
  1581. /*                   If Volume_Handle is a partition or drive handle,*/
  1582. //                   then this function will abort and set
  1583. //                   *Error_Code to a non-zero value.
  1584. //
  1585. //                   If any of the partition handles in the
  1586. //                   Partition_handles array are not valid handles,
  1587. //                   then a trap may result.
  1588. //
  1589. //                   If any of the partition handles in the
  1590. //                   Partition_Handles array are actually drive
  1591. //                   handles, then this function will abort and
  1592. //                   set *Error_Code to a non-zero value.
  1593. //
  1594. /*                   If Partition_Count is greater than the number of*/
  1595. //                   entries in the Partition_Handles array, a trap
  1596. //                   may result.
  1597. //
  1598. //   Side Effects:  A volume may be expanded.  If the volume is
  1599. //                  expanded using another volume, the partitions
  1600. //                  on the second volume will be linked to those of
  1601. //                  the first volume and all data on the second
  1602. //                  volume will be lost.
  1603. //
  1604. //   Notes:  None.
  1605. //
  1606. /*********************************************************************/
  1607. void _System Expand_Volume ( ADDRESS         Volume_Handle,
  1608. CARDINAL32      Partition_Count,
  1609. ADDRESS         Partition_Handles[],
  1610. CARDINAL32 *    Error_Code
  1611. );
  1612.  
  1613. /*********************************************************************/
  1614. //
  1615. //   Function Name: Assign_Drive_Letter
  1616. //
  1617. //   Descriptive Name: Assigns a drive letter to a volume.
  1618. //
  1619. //   Input: ADDRESS Volume_Handle - The handle of the volume which
  1620. //                                  is to have its assigned drive
  1621. //                                  letter changed.
  1622. //          char  New_Drive_Preference - The new drive letter to
  1623. //                                       assign to the volume.
  1624. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1625. /*                                    in which to store an error code*/
  1626. //                                    should an error occur.
  1627. //
  1628. //   Output: *Error_Code will be 0 if the drive letter was assigned
  1629. //           successfully; otherwise *Error_Code will be > 0.
  1630. //
  1631. //   Error Handling: If the drive letter assignment can not be made,
  1632. //                   the volume will not be altered.
  1633. //
  1634. //                   If Volume_Handle is not a valid handle, a trap
  1635. //                   may result.
  1636. //
  1637. /*                   If Volume_Handle is a partition or drive handle,*/
  1638. //                   then this function will abort and set
  1639. //                   *Error_Code to a non-zero value.
  1640. //
  1641. //   Side Effects:  A volume may have its drive letter assignment
  1642. //                  changed.
  1643. //
  1644. //   Notes:  If the drive letter being assigned is already in use by
  1645. //           volume which does not lie on removable media, then the
  1646. //           drive assignment will NOT be made.
  1647. //
  1648. /*********************************************************************/
  1649. void _System Assign_Drive_Letter( ADDRESS      Volume_Handle,
  1650. char         New_Drive_Preference,
  1651. CARDINAL32 * Error_Code
  1652. );
  1653.  
  1654. /*********************************************************************/
  1655. //
  1656. //   Function Name: Set_Installable
  1657. //
  1658. //   Descriptive Name: Marks a volume as being the volume to install
  1659. //                     OS/2 on.
  1660. //
  1661. /*   Input: ADDRESS Volume_Handle - The handle of the volume to which*/
  1662. //                                  OS/2 should be installed.
  1663. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1664. /*                                    in which to store an error code*/
  1665. //                                    should an error occur.
  1666. //
  1667. //   Output: If the volume is successfully marked as installable,
  1668. //           *Error_Code will be 0; otherwise *Error_Code will
  1669. //           be > 0.
  1670. //
  1671. //   Error Handling: If Volume_Handle is not a valid handle, a trap
  1672. //                   may result.
  1673. //
  1674. /*                   If Volume_Handle is a partition or drive handle,*/
  1675. //                   then this function will abort and set
  1676. //                   *Error_Code to a non-zero value.
  1677. //
  1678. //   Side Effects:  The specified volume may be marked as
  1679. //                  installable.
  1680. //
  1681. //   Notes:  None.
  1682. //
  1683. /*********************************************************************/
  1684. void _System Set_Installable ( ADDRESS Volume_Handle, CARDINAL32 * Error_Code );
  1685.  
  1686. /*********************************************************************/
  1687. //
  1688. //   Function Name: Get_Installable_Volume
  1689. //
  1690. //   Descriptive Name: Marks a volume as being the volume to install
  1691. //                     OS/2 on.
  1692. //
  1693. //   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1694. /*                                    in which to store an error code*/
  1695. //                                    should an error occur.
  1696. //
  1697. //   Output: If a volume is mared installable, its information will
  1698. /*           be returned and *Error_Code will be LVM_ENGINE_NO_ERROR.*/
  1699. //           If there is no volume marked installable, then
  1700. //           *Error_Code will be > 0.
  1701. //
  1702. //   Error Handling: An error code is returned if there is an error.
  1703. //
  1704. //   Side Effects:  None.
  1705. //
  1706. //   Notes:  None.
  1707. //
  1708. /*********************************************************************/
  1709. Volume_Information_Record _System Get_Installable_Volume ( CARDINAL32 * Error_Code );
  1710.  
  1711. /*********************************************************************/
  1712. //
  1713. //   Function Name: Convert_Volumes_To_V1
  1714. //
  1715. //   Descriptive Name: This function attempts to convert all LVM
  1716. //                     volumes in the system into a format that can
  1717. //                     be used by LVM Version 1, which was shipped
  1718. //                     with Warp Server for e-business.  This
  1719. /*                     function returns a bitmap of the drive letters*/
  1720. //                     corresponding to Volumes that can not be
  1721. //                     converted.
  1722. //
  1723. //   Input: BOOLEAN * Hidden_Volume_Conversion_Failure - The address
  1724. //                                 of a BOOLEAN variable in which
  1725. //                                 to store a flag indicating if
  1726. //                                 there were hidden volumes that
  1727. //                                 could not be converted.  If
  1728. //                                 *Hidden_Volume_Conversion_Failure
  1729. //                                 is TRUE, then there were hidden
  1730. //                                 volumes that could not be
  1731. //                                 converted.  If FALSE, then there
  1732. //                                 were no hidden volumes, or the
  1733. //                                 hidden volumes that existed were
  1734. //                                 converted successfully.
  1735. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1736. /*                                    in which to store an error code*/
  1737. //                                    should an error occur.
  1738. //
  1739. //   Output: This function returns a bitmap of the drive letters
  1740. //           corresponding to volumes that could not be converted to
  1741. //           LVM Version 1 format.  If this function is successful
  1742. /*           and all volumes were converted, then *Error_Code will be*/
  1743. //           set to LVM_ENGINE_NO_ERROR and the bitmap returned will
  1744. //           have no bits set.  If this function failes, *Error_Code
  1745. //           will contain a non-zero error code and the bitmap
  1746. //           returned by this function may be non-zero.
  1747. //
  1748. //   Error Handling: If an error occurs, *Error_Code will be > 0.
  1749. //
  1750. //   Side Effects:  All LVM volumes that can be converted to LVM
  1751. //                  Version 1 format will be.
  1752. //
  1753. /*   Notes:  Bit 0 in the bitmap returned by this function represents*/
  1754. //           drive letter 'A'.
  1755. //
  1756. /*********************************************************************/
  1757. CARDINAL32 _System Convert_Volumes_To_V1 ( BOOLEAN *    Hidden_Volume_Conversion_Failure,
  1758. CARDINAL32 * Error_Code ) ;
  1759.  
  1760. /* ************************************************************************** *
  1761.  
  1762. Functions relating to Partitions, Drives, and Volumes.
  1763.  
  1764. ************************************************************************** */
  1765.  
  1766. /*********************************************************************/
  1767. //
  1768. //   Function Name: Set_Name
  1769. //
  1770. /*   Descriptive Name: Sets the name of a volume, drive, or partition*/
  1771. //
  1772. //   Input: ADDRESS Handle - The handle of the drive, partition, or
  1773. //                           volume which is to have its name set.
  1774. //          char New_Name[] - The new name for the drive/partition/
  1775. //                            volume.
  1776. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1777. /*                                    in which to store an error code*/
  1778. //                                    should an error occur.
  1779. //
  1780. //   Output: *Error_Code will be 0 if the name is set as specified.
  1781. //           If the name can not be set, *Error_Code will be > 0.
  1782. //
  1783. //   Error Handling: If the name can not be set, then drive/volume/
  1784. //                   partition is not modified.
  1785. //
  1786. //                   If Handle is not a valid handle, a trap may
  1787. //                   result.
  1788. //
  1789. //   Side Effects:  A drive/volume/partition may have its name set.
  1790. //
  1791. //   Notes:  None.
  1792. //
  1793. /*********************************************************************/
  1794. void _System Set_Name ( ADDRESS      Handle,
  1795. char         New_Name[],
  1796. CARDINAL32 * Error_Code
  1797. );
  1798.  
  1799. /*********************************************************************/
  1800. //
  1801. //   Function Name: Set_Startable
  1802. //
  1803. //   Descriptive Name: Sets the specified volume or partition
  1804. //                     startable.  If a volume is specified, it must
  1805. //                     be a compatibility volume whose partition is
  1806. //                     a primary partition on the first drive.  If a
  1807. //                     partition is specified, it must be a primary
  1808. //                     partition on the first drive in the system.
  1809. //
  1810. //   Input: ADDRESS Handle - The handle of the partition or volume
  1811. //                           which is to be set startable.
  1812. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1813. /*                                    in which to store an error code*/
  1814. //                                    should an error occur.
  1815. //
  1816. //   Output: *Error_Code will be 0 if the specified volume or
  1817. //           partition was set startable.
  1818. //           If the name can not be set, *Error_Code will be > 0.
  1819. //
  1820. //   Error Handling: If the volume or partition could not be set
  1821. //                   startable, then nothing in the system is
  1822. //                   changed.
  1823. //
  1824. //                   If Handle is not a valid handle, a trap may
  1825. //                   result.
  1826. //
  1827. //   Side Effects:  Any other partition or volume which is marked
  1828. //                  startable will have its startable flag cleared.
  1829. //
  1830. //   Notes:  None.
  1831. //
  1832. /*********************************************************************/
  1833. void _System Set_Startable ( ADDRESS      Handle,
  1834. CARDINAL32 * Error_Code
  1835. );
  1836.  
  1837. /*********************************************************************/
  1838. //
  1839. //   Function Name: Get_Valid_Options
  1840. //
  1841. //   Descriptive Name: Returns a bitmap where each bit in the bitmap
  1842. //                     corresponds to a possible operation that the
  1843. //                     LVM Engine can perform.  Those bits which are
  1844. //                     1 represent operations which can be performed
  1845. //                     on the item specified by Handle.  Those bits
  1846. //                     which are 0 are not allowed on the item
  1847. //                     specified by Handle.
  1848. //
  1849. //   Input: ADDRESS Handle - This is any valid drive, volume, or
  1850. //                           partition handle.
  1851. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1852. /*                                    in which to store an error code*/
  1853. //                                    should an error occur.
  1854. //
  1855. //   Output:  A bitmap indicating which operations are valid on the
  1856. //            item specified by Handle.
  1857. //
  1858. //            If no errors occur, *Error_Code will be 0, otherwise
  1859. //            *Error_Code will be > 0.
  1860. //
  1861. //   Error Handling:  If Handle is not valid, a trap will be likely.
  1862. //
  1863. //   Side Effects:  None.
  1864. //
  1865. //   Notes:  The values of the various bits in the bitmap returned
  1866. //           by this function are defined near the beginning of this
  1867. //           file, immediately after all of the structure
  1868. //           definitions.
  1869. //
  1870. /*********************************************************************/
  1871. CARDINAL32 _System Get_Valid_Options( ADDRESS Handle, CARDINAL32 * Error_Code );
  1872.  
  1873. /*********************************************************************/
  1874. //
  1875. //   Function Name: Get_Child_Handles
  1876. //
  1877. //   Descriptive Name: Given the handle of a volume or aggregate,
  1878. //                     this function will return the handles of the
  1879. //                     children of the volume or aggregate.  This
  1880. //                     allows the entire tree representation of a
  1881. //                     volume to be traversed, a level at a time.
  1882. //
  1883. //   Input: ADDRESS Handle - The handle of the volume or aggregate
  1884. //                           whose children are required.
  1885. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1886. //                                   in which to store an error code
  1887. //                                   should an error occur.
  1888. //
  1889. //   Output:  If successful, an LVM_Handle_Array_Record is returned
  1890. //            with a non-zero Count.  Also, *Error_Code will be set
  1891. //            to LVM_ENGINE_NO_ERROR.  If an error occurs, then
  1892. //            the Count field will be 0 and *Error_Code will contain
  1893. //            a non-zero error code.
  1894. //
  1895. //   Error Handling: If Handle is not a valid handle, then a trap is
  1896. //                   likely.  If Handle is the handle of partition,
  1897. //                   then *Error_Code will be set to
  1898. //                   LVM_ENGINE_NO_CHILDREN.  If Handle is not a
  1899. //                   volume or aggregate handle, then *Error_Code
  1900. //                   will be set to LVM_ENGINE_BAD_HANDLE.
  1901. //
  1902. //   Side Effects:  None.
  1903. //
  1904. //   Notes:  None.
  1905. //
  1906. /*********************************************************************/
  1907. LVM_Handle_Array_Record  _System Get_Child_Handles( ADDRESS Handle, CARDINAL32 * Error_Code);
  1908.  
  1909. /*********************************************************************/
  1910. //
  1911. //   Function Name: Get_Parent_Handle
  1912. //
  1913. //   Descriptive Name: Given the handle of a partition or aggregate,
  1914. //                     this function will return the handle of the
  1915. //                     parent of the partition or aggregate.
  1916. //
  1917. /*   Input: ADDRESS Handle - The handle of the partition or aggregate*/
  1918. //                           whose parent is required.
  1919. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1920. //                                   in which to store an error code
  1921. //                                   should an error occur.
  1922. //
  1923. //   Output:  If successful, the handle of the parent is returned
  1924. //            as the function result and *Error_Code will be set to
  1925. //            LVM_ENGINE_NO_ERROR.
  1926. //            If an error occurs, then NULL will be the function
  1927. //            result and *Error_Code will contain a non-zero error
  1928. //            code.
  1929. //
  1930. //   Error Handling: If Handle is not a valid handle, then a trap is
  1931. //                   likely.  If Handle is the handle of volume,
  1932. //                   then *Error_Code will be set to
  1933. //                   LVM_ENGINE_NO_PARENT.  If Handle is not the
  1934. //                   handle of a volume, partition, or aggregate
  1935. //                   then *Error_Code will be set to
  1936. //                   LVM_ENGINE_BAD_HANDLE.
  1937. //
  1938. //   Side Effects:  None.
  1939. //
  1940. //   Notes:  None.
  1941. //
  1942. /*********************************************************************/
  1943. ADDRESS _System Get_Parent_Handle( ADDRESS Handle, CARDINAL32 * Error_Code);
  1944.  
  1945. /*********************************************************************/
  1946. //
  1947. //   Function Name: Get_Features
  1948. //
  1949. /*   Descriptive Name: Returns the feature ID information for each of*/
  1950. //                     the features that are installed on the
  1951. //                     item specified by Handle.
  1952. //
  1953. //   Input: ADDRESS Handle - The handle of the object to use.
  1954. //
  1955. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1956. //                                   in which to store an error code
  1957. //                                   should an error occur.
  1958. //
  1959. //   Output: If successful, a Feature_Information_Array structure is
  1960. //           returned with a non-zero Count.  Also, *Error_Code will
  1961. //           be set to LVM_ENGINE_NO_ERROR.  If an error occurs,
  1962. //           then the Count field in the structure will be 0 and
  1963. //           (*Error_Code) will contain a non-zero error code.
  1964. //
  1965. //   Error Handling:  If Handle is not a valid handle, a trap
  1966. //                    will be likely.
  1967. //
  1968. /*   Side Effects:  Memory is allocated using the LVM Engine's memory*/
  1969. //                  manager for the array of Feature_ID_Data items
  1970. //                  being returned.
  1971. //
  1972. //   Notes:  None.
  1973. //
  1974. /*********************************************************************/
  1975. Feature_Information_Array _System Get_Features( ADDRESS Handle, CARDINAL32 * Error_Code );
  1976.  
  1977. /* ************************************************************************** *
  1978.  
  1979. Functions relating to Boot Manager
  1980.  
  1981. ************************************************************************** */
  1982.  
  1983. /*********************************************************************/
  1984. //
  1985. //   Function Name: Boot_Manager_Is_Installed
  1986. //
  1987. //   Descriptive Name: Indicates whether or not Boot Manager is
  1988. //                     installed on the first or second hard drives
  1989. //                     in the system.
  1990. //
  1991. /*   Input: BOOLEAN * Active - *Active is set to TRUE if LVM found an*/
  1992. //                             active copy of Boot Manager on the
  1993. //                             system.  If LVM could not find an
  1994. //                             active copy of Boot Manager on the
  1995. //                             system, but did find an inactive copy
  1996. //                             of Boot Manager, then *Active will be
  1997. //                             set to FALSE.
  1998. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  1999. /*                                    in which to store an error code*/
  2000. //                                    should an error occur.
  2001. //
  2002. //   Output: TRUE is returned if Boot Manager is found.  If this
  2003. /*           copy of Boot Manager is Active, then *Active will be set*/
  2004. //           to TRUE.  If the copy of Boot Manager is not currently
  2005. //           active, then *Active will be set to FALSE.
  2006. //
  2007. //           FALSE is returned if Boot Manager is not found or if an
  2008. //           error occurs.  In this case, *Active is undefined.
  2009. //
  2010. //           *Error_Code will be 0 if no errors occur; otherwise it
  2011. //           will be > 0.
  2012. //
  2013. //   Error Handling: If an error occurs, *Error_Code will be > 0.
  2014. //
  2015. //   Side Effects:  None.
  2016. //
  2017. //   Notes:  None.
  2018. //
  2019. /*********************************************************************/
  2020. BOOLEAN _System Boot_Manager_Is_Installed( BOOLEAN * Active, CARDINAL32 * Error_Code);
  2021.  
  2022. /*********************************************************************/
  2023. //
  2024. //   Function Name: Get_Boot_Manager_Handle
  2025. //
  2026. /*   Descriptive Name: Returns the handle of the partition containing*/
  2027. //                     Boot Manager.
  2028. //
  2029. //   Input: 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: If Boot Manager is NOT installed, NULL is returned.
  2034. //           If Boot Manager is installed, whether it is active or
  2035. //           not, the handle of the partition it resides in is
  2036. //           returned.
  2037. //
  2038. //   Error Handling: If an error occurs, *Error_Code will be > 0.
  2039. //
  2040. //   Side Effects:  None.
  2041. //
  2042. //   Notes:
  2043. //
  2044. /*********************************************************************/
  2045. ADDRESS _System Get_Boot_Manager_Handle( CARDINAL32 * Error_Code);
  2046.  
  2047. /*********************************************************************/
  2048. //
  2049. //   Function Name: Add_To_Boot_Manager
  2050. //
  2051. //   Descriptive Name: Adds the volume/partition to the Boot Manager
  2052. //                     menu.
  2053. //
  2054. /*   Input: ADDRESS Handle - The handle of a partition or volume that*/
  2055. /*                           is to be added to the Boot Manager menu.*/
  2056. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  2057. /*                                    in which to store an error code*/
  2058. //                                    should an error occur.
  2059. //
  2060. //   Output: *Error_Code will be 0 if the partition or volume was
  2061. //           successfully added to the Boot Manager menu; otherwise
  2062. //           *Error_Code will be > 0.
  2063. //
  2064. //   Error Handling: If the partition/volume can not be added to the
  2065. //                   Boot Manager menu, no action is taken and
  2066. //                   *Error_Code will contain a non-zero error code.
  2067. //
  2068. //                   If Handle is not a valid handle, a trap may
  2069. //                   result.
  2070. //
  2071. /*                   If Handle represents a drive, then this function*/
  2072. //                   will abort and set *Error_Code to a non-zero
  2073. //                   value.
  2074. //
  2075. //   Side Effects:  The Boot Manager menu may be altered.
  2076. //
  2077. //   Notes:  None.
  2078. //
  2079. /*********************************************************************/
  2080. void _System Add_To_Boot_Manager ( ADDRESS Handle, CARDINAL32 * Error_Code );
  2081.  
  2082. /*********************************************************************/
  2083. //
  2084. //   Function Name: Remove_From_Boot_Manager
  2085. //
  2086. //   Descriptive Name: Removes the specified partition or volume
  2087. //                     from the Boot Manager menu.
  2088. //
  2089. //   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  2090. /*                                    in which to store an error code*/
  2091. //                                    should an error occur.
  2092. //
  2093. //
  2094. //   Output: *Error_Code will be 0 if the partition or volume was
  2095. //           successfully removed to the Boot Manager menu;
  2096. //           otherwise *Error_Code will be > 0.
  2097. //
  2098. //   Error Handling: If Handle is not a valid handle, a trap may
  2099. //                   result.
  2100. //
  2101. //                   If Handle represents a drive, or if Handle
  2102. /*                   represents a volume or partition which is NOT on*/
  2103. //                   the boot manager menu, then this function
  2104. //                   will abort and set *Error_Code to a non-zero
  2105. //                   value.
  2106. //
  2107. //   Side Effects:  The Boot Manager menu may be altered.
  2108. //
  2109. //   Notes:  None.
  2110. //
  2111. /*********************************************************************/
  2112. void _System Remove_From_Boot_Manager ( ADDRESS Handle, CARDINAL32 * Error_Code );
  2113.  
  2114. /*********************************************************************/
  2115. //
  2116. //   Function Name: Get_Boot_Manager_Menu
  2117. //
  2118. /*   Descriptive Name: Returns an array containing the handles of the*/
  2119. //                     partitions and volumes appearing on the
  2120. //                     Boot Manager menu.
  2121. //
  2122. //   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  2123. /*                                    in which to store an error code*/
  2124. //                                    should an error occur.
  2125. //
  2126. //   Output: The function returns a Boot_Manager_Menu structure.
  2127. /*           This structure contains two items: a pointer to an array*/
  2128. /*           of Boot_Manager_Menu_Items and a count of how many items*/
  2129. //           are in the array.  Each Boot_Manager_Menu_Item contains
  2130. //           a handle and a BOOLEAN variable to indicate whether the
  2131. //           handle is for a partition or a volume.
  2132. //
  2133. //           If this function is successful, then *Error_Code will
  2134. //           be 0.
  2135. //
  2136. //           If an error occurs, the Count field in the
  2137. //           Boot_Manager_Menu will be 0 and the corresponding
  2138. //           pointer will be NULL.  *Error_Code will be > 0.
  2139. //
  2140. //   Error Handling: If an error occurs, *Error_Code will be > 0.
  2141. //                   any memory allocated by this function will be
  2142. //                   freed.
  2143. //
  2144. //   Side Effects:  None.
  2145. //
  2146. //   Notes:  None.
  2147. //
  2148. /*********************************************************************/
  2149. Boot_Manager_Menu  _System Get_Boot_Manager_Menu ( CARDINAL32 * Error_Code);
  2150.  
  2151. /*********************************************************************/
  2152. //
  2153. //   Function Name: Install_Boot_Manager
  2154. //
  2155. //   Descriptive Name: This function installs Boot Manager.  It can
  2156. //                     be used to replace an existing Boot Manager
  2157. //                     as well.
  2158. //
  2159. //   Input: CARDINAL32  Drive_Number - The number of the drive to
  2160. /*                                     install Boot Manager on.  Must*/
  2161. //                                     be 1 or 2.
  2162. //          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: If this function is successful, then *Error_Code will be*/
  2167. //           0; otherwise it will be > 0.
  2168. //
  2169. /*   Error Handling: If an error occurs, *Error_Code will be set to a*/
  2170. //                   non-zero value.  Depending upon the error, it
  2171. //                   is possible that the Boot Manager partition can
  2172. //                   be left in an unusuable state (such as for a
  2173. //                   write error).
  2174. //
  2175. //   Side Effects: Boot Manager may be installed on drive 1 or 2.
  2176. //                 The MBR for drive 1 may be altered.
  2177. //
  2178. //   Notes:  None.
  2179. //
  2180. /*********************************************************************/
  2181. void _System Install_Boot_Manager ( CARDINAL32   Drive_Number, CARDINAL32 * Error_Code );           // Only drives 0 and 1 are acceptable.
  2182.  
  2183. /*********************************************************************/
  2184. //
  2185. //   Function Name: Remove_Boot_Manager
  2186. //
  2187. //   Descriptive Name: Removes Boot Manager from the system.
  2188. //
  2189. //   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  2190. /*                                    in which to store an error code*/
  2191. //                                    should an error occur.
  2192. //
  2193. //   Output: *Error_Code will be 0 if Boot Manager was successfully
  2194. //           removed from the system; otherwise *Error_Code will
  2195. //           be 0.
  2196. //
  2197. //   Error Handling: If an error occurs, *Error_Code will be > 0.
  2198. //
  2199. //   Side Effects:  Boot Manager will be removed from the system.
  2200. //
  2201. //   Notes:  None.
  2202. //
  2203. /*********************************************************************/
  2204. void _System Remove_Boot_Manager( CARDINAL32 * Error_Code );
  2205.  
  2206. /*********************************************************************/
  2207. //
  2208. //   Function Name: Set_Boot_Manager_Options
  2209. //
  2210. //   Descriptive Name: Sets the Boot Managers Options.  The options
  2211. //                     that can be set are: whether or not the time-
  2212. //                     out timer is active, how long the timer-out
  2213. //                     is, the partition to boot by default, and
  2214. /*                     whether or not Boot Manager should display its*/
  2215. //                     menu using default mode or advanced mode.
  2216. //
  2217. //   Input: ADDRESS Handle - The handle of the partition or volume
  2218. //                           to boot if the time-out timer is active
  2219. //                           and the time-out value is reached.
  2220. //          BOOLEAN Timer_Active - If TRUE, then the time-out timer
  2221. //                                 is active.
  2222. //          CARDINAL32 Time_Out_Value - If the time-out timer is
  2223. //                                      active, this is the time-out
  2224. //                                      value, in seconds.
  2225. //          BOOLEAN Advanced_Mode - If TRUE, then Boot Manager will
  2226. //                                  operate in advanced mode.  If
  2227. //                                  FALSE, then normal mode will be
  2228. //                                  in effect.
  2229. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  2230. /*                                    in which to store an error code*/
  2231. //                                    should an error occur.
  2232. //
  2233. //   Output: *Error_Code will be 0 if no errors occur.  If an error
  2234. //           does occur, then *Error_Code will be > 0.
  2235. //
  2236. //   Error Handling: If an error occurs, no changes will be made to
  2237. //                   Boot Manager and *Error_Code will be set a
  2238. //                   non-zero error code.
  2239. //
  2240. //   Side Effects:  Boot Manager may be modified.
  2241. //
  2242. //   Notes:  None.
  2243. //
  2244. /*********************************************************************/
  2245. void _System Set_Boot_Manager_Options( ADDRESS      Handle,
  2246. BOOLEAN      Timer_Active,
  2247. CARDINAL32   Time_Out_Value,
  2248. BOOLEAN      Advanced_Mode,
  2249. CARDINAL32 * Error_Code
  2250. );
  2251.  
  2252. /*********************************************************************/
  2253. //
  2254. //   Function Name: Get_Boot_Manager_Options
  2255. //
  2256. /*   Descriptive Name: This function returns the current Boot Manager*/
  2257. /*                     settings for the various Boot Manager options.*/
  2258. //
  2259. /*   Input: ADDRESS * Handle - The handle for the default boot volume*/
  2260. //                             or partition.
  2261. //          BOOLEAN * Handle_Is_Volume - If TRUE, then Handle
  2262. //                                       represents a volume.  If
  2263. //                                       FALSE, then Handle
  2264. //                                       represents a partition.
  2265. /*          BOOLEAN * Timer_Active - If TRUE, then the time-out timer*/
  2266. //                                   is active.  If FALSE, then the
  2267. //                                   time-out timer is not active.
  2268. //          CARDINAL32 * Time_Out_Value - If the time-out timer is
  2269. //                                        active, then this is the
  2270. /*                                        number of seconds that Boot*/
  2271. //                                        Manager will wait for user
  2272. //                                        input before booting the
  2273. //                                        default volume/partition.
  2274. //          BOOLEAN * Advanced_Mode - If TRUE, the Boot Manager is
  2275. /*                                    operating in advanced mode.  If*/
  2276. //                                    FALSE, then Boot Manager is
  2277. //                                    operating in normal mode.
  2278. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  2279. /*                                    in which to store an error code*/
  2280. //                                    should an error occur.
  2281. //
  2282. //   Output: *Handle, *Handle_Is_Volume, *Timer_Active,
  2283. /*           *Time_out_value, *Advanced_Mode, and *Error_Code are all*/
  2284. //           set by this function.  If there are no errors, then
  2285. /*           *Error_Code will be set to 0.  If any errors occur, then*/
  2286. //           *Error_Code will be > 0.
  2287. //
  2288. //   Error Handling: If any of the parameters are invalid, then a
  2289. //                   trap is likely.  If Boot Manager is not
  2290. //                   installed, then *Error_Code will be > 0.
  2291. //
  2292. //   Side Effects:  None.
  2293. //
  2294. //   Notes:  None.
  2295. //
  2296. /*********************************************************************/
  2297. void _System Get_Boot_Manager_Options( ADDRESS    *  Handle,
  2298. BOOLEAN    *  Handle_Is_Volume,
  2299. BOOLEAN    *  Timer_Active,
  2300. CARDINAL32 *  Time_Out_Value,
  2301. BOOLEAN    *  Advanced_Mode,
  2302. CARDINAL32 * Error_Code
  2303. );
  2304.  
  2305. /* ************************************************************************** *
  2306.  
  2307. Other Functions
  2308.  
  2309. ************************************************************************** */
  2310.  
  2311. /*********************************************************************/
  2312. //
  2313. //   Function Name:  Allocate_Engine_Memory
  2314. //
  2315. //   Descriptive Name:  Allocates a block of memory using LVM.DLL's
  2316. //                      memory management functions.
  2317. //
  2318. //   Input: CARDINAL32 Size - The number of bytes of memory to
  2319. //                            allocate.
  2320. //
  2321. //   Output: The address of the block of memory which was allocated,
  2322. //           or NULL if the requested amount of memory could not be
  2323. //           allocated.
  2324. //
  2325. //   Error Handling: None.
  2326. //
  2327. //   Side Effects:  The specified number of bytes is allocated from
  2328. //                  the memory manager imbedded in LVM.DLL.  Memory
  2329. //                  allocated by this function must be freed using
  2330. //                  Free_Engine_Memory function.  The use of any
  2331. /*                  memory manager to free the memory could result in*/
  2332. //                  Bad Things Happening!
  2333. //
  2334. //   Notes:  None.
  2335. //
  2336. /*********************************************************************/
  2337. ADDRESS _System Allocate_Engine_Memory( CARDINAL32 Size );
  2338.  
  2339. /*********************************************************************/
  2340. //
  2341. //   Function Name:  Free_Engine_Memory
  2342. //
  2343. //   Descriptive Name: Frees a memory object created by LVM.DLL and
  2344. //                     returned to a user of LVM.DLL.
  2345. //
  2346. //   Input: ADDRESS Object : The address of the memory object to
  2347. //                           free.  This could be the
  2348. //                           Drive_Control_Data field of a
  2349. //                           Drive_Control_Record, the
  2350. //                           Partition_Array field of a
  2351. //                           Partition_Information_Array structure,
  2352. //                           or any other dynamically allocated
  2353. //                           memory object created by LVM.DLL and
  2354. //                           returned by a function in LVM.DLL.
  2355. //
  2356. //   Output: None.
  2357. //
  2358. //   Error Handling: None.
  2359. //
  2360. //   Side Effects:  None.
  2361. //
  2362. //   Notes:  A trap or exception could occur if a bad address is
  2363. //           passed into this function.
  2364. //
  2365. /*********************************************************************/
  2366. void _System Free_Engine_Memory( ADDRESS Object );
  2367.  
  2368. /*********************************************************************/
  2369. //
  2370. //   Function Name: New_MBR
  2371. //
  2372. //   Descriptive Name: This function lays down a new MBR on the
  2373. //                     specified drive.
  2374. //
  2375. //   Input: ADDRESS Drive_Handle - The handle of the drive on which
  2376. //                                 the new MBR is to be placed.
  2377. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  2378. /*                                    in which to store an error code*/
  2379. //                                    should an error occur.
  2380. //
  2381. //   Output: *Error_Code will be 0 if the new MBR was successfully
  2382. //           placed on the specified drive.  If the operation failed
  2383. /*           for any reason, then *Error_Code will contain a non-zero*/
  2384. //           error code.
  2385. //
  2386. /*   Error Handling: If an error occurs, then the existing MBR is not*/
  2387. //                   altered and *Error_Code will be > 0.
  2388. //
  2389. //   Side Effects:  A new MBR may be placed on the specified drive.
  2390. //
  2391. //   Notes:  None.
  2392. //
  2393. /*********************************************************************/
  2394. void _System New_MBR( ADDRESS Drive_Handle, CARDINAL32 * Error_Code );
  2395.  
  2396. /*********************************************************************/
  2397. //
  2398. //   Function Name: Get_Available_Drive_Letters
  2399. //
  2400. //   Descriptive Name: This function returns a bitmap indicating
  2401. //                     which drive letters are available for use.
  2402. //
  2403. //   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  2404. /*                                    in which to store an error code*/
  2405. //                                    should an error occur.
  2406. //
  2407. //   Output: This function returns a bitmap of the available drive
  2408. //           letters.  If this function is successful, then
  2409. //           *Error_Code will be set to 0.  Otherwise, *Error_Code
  2410. //           will be > 0 and the bitmap returned will have all bits
  2411. //           set to 0.
  2412. //
  2413. //   Error Handling: If an error occurs, *Error_Code will be > 0.
  2414. //
  2415. //   Side Effects:  None.
  2416. //
  2417. //   Notes:  A drive letter is available if it is not associated
  2418. //           with a volume located on a disk drive controlled
  2419. //           by OS2DASD.
  2420. //
  2421. /*********************************************************************/
  2422. CARDINAL32 _System Get_Available_Drive_Letters ( CARDINAL32 * Error_Code ) ;
  2423.  
  2424. /*********************************************************************/
  2425. //
  2426. //   Function Name: Get_Reserved_Drive_Letters
  2427. //
  2428. //   Descriptive Name: This function returns a bitmap indicating
  2429. //                     which drive letters are reserved for use by
  2430. //                     devices NOT under the control of LVM.
  2431. //
  2432. //   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  2433. /*                                    in which to store an error code*/
  2434. //                                    should an error occur.
  2435. //
  2436. //   Output: This function returns a bitmap of the drive letters
  2437. /*           which are being used by devices which are NOT controlled*/
  2438. //           by LVM.  While a Volume CAN be assigned a drive letter
  2439. //           from this list, a reboot will almost always be required
  2440. //           in order for the assignment to take place.
  2441. /*           If this function is successful, then *Error_Code will be*/
  2442. //           set to 0.  Otherwise, *Error_Code will be > 0 and the
  2443. //           bitmap returned will have all bits set to 0.
  2444. //
  2445. //   Error Handling: If an error occurs, *Error_Code will be > 0.
  2446. //
  2447. //   Side Effects:  None.
  2448. //
  2449. //   Notes:  Devices which are assigned drive letters but which are
  2450. //           NOT under LVM control include:  CD-ROM, Network drives,
  2451. //           parallel port attached devices, and any DASD devices
  2452. //           not controlled by OS2DASD.
  2453. //
  2454. /*********************************************************************/
  2455. CARDINAL32 _System Get_Reserved_Drive_Letters ( CARDINAL32 * Error_Code ) ;
  2456.  
  2457. /*********************************************************************/
  2458. //
  2459. //   Function Name: Reboot_Required
  2460. //
  2461. //   Descriptive Name: This function indicates whether or not any
  2462. //                     changes were made to the partitioning of the
  2463. //                     disks in the system which would require a
  2464. //                     reboot to make functional.
  2465. //
  2466. //   Input: None.
  2467. //
  2468. //   Output: The function return value will be TRUE if the system
  2469. //           must be rebooted as a result of disk partitioning
  2470. //           changes.
  2471. //
  2472. //   Error Handling: None required.
  2473. //
  2474. //   Side Effects:  None.
  2475. //
  2476. //   Notes:  None.
  2477. //
  2478. /*********************************************************************/
  2479. BOOLEAN _System Reboot_Required ( void );
  2480.  
  2481. /*********************************************************************/
  2482. //
  2483. //   Function Name: Changes_Pending
  2484. //
  2485. //   Descriptive Name: This function indicates whether or not any
  2486. //                     changes were made to the partitioning of the
  2487. //                     disks in the system which have not yet been
  2488. //                     comitted to disk.
  2489. //
  2490. //   Input: None.
  2491. //
  2492. //   Output: The function return value will be TRUE if there are
  2493. /*           uncomitted changes to the partitioning of one or more of*/
  2494. //           the drives in the system.
  2495. //
  2496. //   Error Handling: None required.
  2497. //
  2498. //   Side Effects:  None.
  2499. //
  2500. //   Notes:  None.
  2501. //
  2502. /*********************************************************************/
  2503. BOOLEAN _System Changes_Pending ( void );
  2504.  
  2505. /*********************************************************************/
  2506. //
  2507. //   Function Name: Set_Reboot_Flag
  2508. //
  2509. //   Descriptive Name: This function sets the Reboot Flag.  The
  2510. //                     Reboot Flag is a special flag on the boot
  2511. //                     disk used by the install program to keep
  2512. //                     track of whether or not the system was just
  2513. //                     rebooted.  It is used by the various phases
  2514. //                     of install.
  2515. //
  2516. //   Input: BOOLEAN Reboot - The new value for the Reboot Flag.  If
  2517. //                           TRUE, then the reboot flag will be set.
  2518. //                           If FALSE, then the reboot flag will be
  2519. //                           cleared.
  2520. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  2521. /*                                    in which to store an error code*/
  2522. //                                    should an error occur.
  2523. //
  2524. //   Output: *Error_Code will be set to 0 if there are no errors.
  2525. //           *Error_Code will be > 0 if an error occurs.
  2526. //
  2527. /*   Error Handling: If an error occurs, then the value of the Reboot*/
  2528. //                   Flag will be unchanged.
  2529. //
  2530. //   Side Effects:  The value of the Reboot Flag may be changed.
  2531. //
  2532. //   Notes:  None.
  2533. //
  2534. /*********************************************************************/
  2535. void _System Set_Reboot_Flag( BOOLEAN Reboot, CARDINAL32 * Error_Code );
  2536.  
  2537. /*********************************************************************/
  2538. //
  2539. //   Function Name: Get_Reboot_Flag
  2540. //
  2541. //   Descriptive Name: This function returns the value of the Reboot
  2542. //                     Flag.  The Reboot Flag is a special flag on
  2543. //                     the boot disk used by the install program to
  2544. //                     keep track of whether or not the system was
  2545. //                     just rebooted.  It is used by the various
  2546. //                     phases of install.
  2547. //
  2548. //   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  2549. /*                                    in which to store an error code*/
  2550. //                                    should an error occur.
  2551. //
  2552. //   Output: The function return value will be TRUE if no errors
  2553. //           occur and the Reboot Flag is set.  *Error_Code will be
  2554. //           0 under these conditions.  If an error occurs, the
  2555. //           function return value will be FALSE and *Error_Code
  2556. //           will be > 0.
  2557. //
  2558. //   Error Handling: If an error occurs, *Error_Code will be > 0.
  2559. //                   The value of the reboot flag will be unchanged.
  2560. //
  2561. //   Side Effects:  None.
  2562. //
  2563. //   Notes:  None.
  2564. //
  2565. /*********************************************************************/
  2566. BOOLEAN _System Get_Reboot_Flag( CARDINAL32 * Error_Code );
  2567.  
  2568. /*********************************************************************/
  2569. //
  2570. //
  2571. //   Function Name: Set_Install_Flags
  2572. //
  2573. //   Descriptive Name: This function sets the value of the Install
  2574. //                     Flags.  The Install Flags reside in a 32 bit
  2575. //                     field in the LVM dataspace.  These flags are
  2576. //                     not used by LVM, thereby leaving Install free
  2577. //                     to use them for whatever it wants.
  2578. //
  2579. //   Input: CARDINAL32 Install_Flags - The new value for the Install
  2580. //                                     Flags.
  2581. //          CARDINAL32 * Error_Code - The address of a CARDINAL32
  2582. /*                                    in which to store an error code*/
  2583. //                                    should an error occur.
  2584. //
  2585. //   Output: *Error_Code will be set to 0 if there are no errors.
  2586. //           *Error_Code will be > 0 if an error occurs.
  2587. //
  2588. //   Error Handling: If an error occurs, then the value of the
  2589. //                   Install Flags will be unchanged.
  2590. //
  2591. //   Side Effects:  The value of the Install Flags may be changed.
  2592. //
  2593. //   Notes:  None.
  2594. //
  2595. /*********************************************************************/
  2596. void _System Set_Install_Flags( CARDINAL32 Install_Flags, CARDINAL32 * Error_Code );
  2597.  
  2598. /*********************************************************************/
  2599. //
  2600. //   Function Name: Get_Install_Flags
  2601. //
  2602. /*   Descriptive Name: This function returns the value of the Install*/
  2603. //                     Flags.  The Install Flags reside in a 32 bit
  2604. //                     field in the LVM dataspace.  These flags are
  2605. //                     not used by LVM, thereby leaving Install free
  2606. //                     to use them for whatever it wants.
  2607. //
  2608. //   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  2609. /*                                    in which to store an error code*/
  2610. //                                    should an error occur.
  2611. //
  2612. //   Output: The function returns the current value of the Install
  2613. //           Flags stored in the LVM Dataspace.
  2614. //           *Error_Code will be LVM_ENGINE_NO_ERROR if the function
  2615. //           is successful.  If an error occurs, the function will
  2616. //           return 0 and *Error_Code will be > 0.
  2617. //
  2618. //   Error Handling: If an error occurs, *Error_Code will be > 0.
  2619. //
  2620. //   Side Effects:  None.
  2621. //
  2622. //   Notes:  None.
  2623. //
  2624. /*********************************************************************/
  2625. CARDINAL32 _System Get_Install_Flags( CARDINAL32 * Error_Code );
  2626.  
  2627. /*********************************************************************/
  2628. //
  2629. //   Function Name: Set_Min_Install_Size
  2630. //
  2631. //   Descriptive Name: This function tells the LVM Engine how big a
  2632. //                     partition/volume must be in order for it to
  2633. //                     marked installable.  If this function is not
  2634. //                     used to set the minimum size for an
  2635. //                     installable partition/volume, the LVM Engine
  2636. //                     will use a default value of 300 MB.
  2637. //
  2638. //   Input: CARDINAL32 Min_Sectors - The minimum size, in sectors,
  2639. //                                   that a partition must be in
  2640. //                                   order for it to be marked as
  2641. //                                   installable.
  2642. //
  2643. //   Output: None.
  2644. //
  2645. //   Error Handling: None required.
  2646. //
  2647. //   Side Effects:  None.
  2648. //
  2649. //   Notes:  None.
  2650. //
  2651. /*********************************************************************/
  2652. void _System Set_Min_Install_Size ( CARDINAL32  Min_Sectors );
  2653.  
  2654. /*********************************************************************/
  2655. //
  2656. //   Function Name: Set_Free_Space_Threshold
  2657. //
  2658. //   Descriptive Name: This function tells the LVM Engine not to
  2659. //                     report blocks of free space which are less
  2660. //                     than the size specified.  The engine defaults
  2661. //                     to not reporting blocks of free space which
  2662. //                     are smaller than 2048 sectors (1 MB).
  2663. //
  2664. //   Input: CARDINAL32 Min_Sectors - The minimum size, in sectors,
  2665. //                                   that a block of free space must
  2666. //                                   be in order for the LVM engine
  2667. //                                   to report it.
  2668. //
  2669. //   Output: None.
  2670. //
  2671. //   Error Handling: None required.
  2672. //
  2673. //   Side Effects:  None.
  2674. //
  2675. //   Notes:  None.
  2676. //
  2677. /*********************************************************************/
  2678. void _System Set_Free_Space_Threshold( CARDINAL32  Min_Sectors );
  2679.  
  2680. /*********************************************************************/
  2681. //
  2682. //   Function Name: Read_Sectors
  2683. //
  2684. //   Descriptive Name: This function reads one or more sectors from
  2685. //                     the specified drive and places the data read
  2686. //                     in Buffer.
  2687. //
  2688. /*   Input: CARDINAL32 Drive_Number : The number of the hard drive to*/
  2689. //                                    read from.  The drives in the
  2690. //                                    system are numbered from 1 to
  2691. //                                    n, where n is the total number
  2692. //                                    of hard drives in the system.
  2693. //          LBA Starting_Sector : The first sector to read from.
  2694. //          CARDINAL32 Sectors_To_Read : The number of sectors to
  2695. //                                       read into memory.
  2696. //          ADDRESS Buffer : The location to put the data read into.
  2697. //          CARDINAL32 * Error : The address of a variable to hold
  2698. //                               the error return code.
  2699. //
  2700. //   Output: If Successful, then the data read will be placed in
  2701. //              memory starting at Buffer, and *Error will be
  2702. //              LVM_ENGINE_NO_ERROR.
  2703. //           If Unsuccessful, then *Error will be > 0 and the
  2704. //              contents of memory starting at Buffer is undefined.
  2705. //
  2706. //   Error Handling: *Error will be > 0 if an error occurs.
  2707. //
  2708. //   Side Effects: Data may be read into memory starting at Buffer.
  2709. //
  2710. //   Notes:  None.
  2711. //
  2712. /*********************************************************************/
  2713. void _System Read_Sectors ( CARDINAL32          Drive_Number,
  2714. LBA                 Starting_Sector,
  2715. CARDINAL32          Sectors_To_Read,
  2716. ADDRESS             Buffer,
  2717. CARDINAL32 *        Error);
  2718.  
  2719. /*********************************************************************/
  2720. //
  2721. //   Function Name: Write_Sectors
  2722. //
  2723. //   Descriptive Name: This function writes data from memory to one
  2724. //                     or more sectors on the specified drive.
  2725. //
  2726. /*   Input: CARDINAL32 Drive_Number : The number of the hard drive to*/
  2727. //                                    write to.  The drives in the
  2728. //                                    system are numbered from 1 to
  2729. //                                    n, where n is the total number
  2730. //                                    of hard drives in the system.
  2731. //          LBA Starting_Sector : The first sector to write to.
  2732. //          CARDINAL32 Sectors_To_Read : The number of sectors to
  2733. //                                       be written.
  2734. //          ADDRESS Buffer : The location of the data to be written
  2735. //                           to disk.
  2736. //          CARDINAL32 * Error : The address of a variable to hold
  2737. //                               the error return code.
  2738. //
  2739. //   Output: If Successful, then the data at Buffer will be placed
  2740. //              on the disk starting at the sector specified, and
  2741. //              *Error will be LVM_ENGINE_NO_ERROR.
  2742. //           If Unsuccessful, then *Error will be > 0 and the
  2743. //              contents of the disk starting at sector
  2744. //              Starting_Sector is undefined.
  2745. //
  2746. //   Error Handling: *Error will be > 0 if an error occurs.
  2747. //
  2748. //   Side Effects: Data may be written to disk.
  2749. //
  2750. //   Notes:  None.
  2751. //
  2752. /*********************************************************************/
  2753. void _System Write_Sectors ( CARDINAL32          Drive_Number,
  2754. LBA                 Starting_Sector,
  2755. CARDINAL32          Sectors_To_Write,
  2756. ADDRESS             Buffer,
  2757. CARDINAL32 *        Error);
  2758.  
  2759. /*********************************************************************/
  2760. //
  2761. //   Function Name: Rediscover_PRMs
  2762. //
  2763. //   Descriptive Name: Causes OS2LVM and OS2DASD to check PRMs for
  2764. //                     new or changed media.
  2765. //
  2766. //   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  2767. /*                                    in which to store an error code*/
  2768. //                                    should an error occur.
  2769. //
  2770. //   Output: If the Rediscover PRM operation was successful, then
  2771. //           *Error_Code will be LVM_ENGINE_NO_ERROR.  If there
  2772. //           was an error, then *Error_Code will be > 0.
  2773. //
  2774. //   Error Handling: None.
  2775. //
  2776. //   Side Effects:  New volumes may be discovered and assigned drive
  2777. //                  letters by OS2LVM and OS2DASD.
  2778. //
  2779. //   Notes: The LVM Engine must be CLOSED when this function is
  2780. //          called as this function is disabled while it is open!
  2781. //
  2782. /*********************************************************************/
  2783. void _System Rediscover_PRMs( CARDINAL32 * Error_Code );
  2784.  
  2785. /*********************************************************************/
  2786. //
  2787. //   Function Name: Get_LVM_View
  2788. //
  2789. //   Descriptive Name:  This function gets the OS2LVM data for the
  2790. //                      specified drive letter.  The intent is to
  2791. //                      allow the determination of what drive letter
  2792. //                      a volume really has given the possibilities
  2793. //                      of conflict or a drive preference of '*'.
  2794. //
  2795. /*   Input:  char  IFSM_Drive_Letter : The drive letter for which the*/
  2796. //                                     OS2LVM data is requested.
  2797. //           CARDINAL32 * Drive_Number : The address of a variable
  2798. //                                       to hold the OS/2 drive
  2799. //                                       number of the drive
  2800. //                                       containing the first
  2801. //                                       partition of the volume
  2802. //                                       currently assigned to the
  2803. //                                       requested drive letter.
  2804. //           CARDINAL32 * Partition_LBA : The address of a variable
  2805. //                                        to hold the LBA of the
  2806. //                                        first partition of the
  2807. //                                        volume currently assigned
  2808. //                                        to the requested drive
  2809. //                                        letter.
  2810. //           char * LVM_Drive_Letter : The address of a variable to
  2811. //                                     hold the drive letter that
  2812. //                                     OS2LVM thinks the volume
  2813. //                                     assigned to the requested
  2814. //                                     drive letter should have.
  2815. //           BYTE * UnitID : The address of a variable to hold the
  2816. /*                           OS2LVM unit ID for the volume associated*/
  2817. //                           with the requested drive letter.
  2818. //
  2819. //   Output:  The function return value will be TRUE if the function
  2820. //            completed successfully.
  2821. //
  2822. //   Error Handling: If this function fails, the specified drive
  2823. //                   letter is either not in use, or is in use by a
  2824. //                   device not controlled by OS2LVM.
  2825. //
  2826. //   Side Effects: None.
  2827. //
  2828. //   Notes: This function can be used with the LVM Engine open or
  2829. //          closed.
  2830. //
  2831. /*********************************************************************/
  2832. BOOLEAN _System Get_LVM_View( char         IFSM_Drive_Letter,
  2833. CARDINAL32 * Drive_Number,
  2834. CARDINAL32 * Partition_LBA,
  2835. char *       LVM_Drive_Letter,
  2836. BYTE *       UnitID);
  2837.  
  2838. /*********************************************************************/
  2839. //
  2840. //   Function Name: Start_Logging
  2841. //
  2842. /*   Descriptive Name: Enables the LVM Engine logging.  Once enabled,*/
  2843. //                     the LVM Engine logging function will log all
  2844. /*                     LVM Engine activity to the specified log file.*/
  2845. //                     The data is logged in a binary format for
  2846. //                     compactness and speed.
  2847. //
  2848. //   Input: char * Filename - The filename of the file to use as the
  2849. //                            log file.
  2850. //          CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  2851. /*                                    in which to store an error code*/
  2852. //                                    should an error occur.
  2853. //
  2854. //   Output: If the logging file was successfully created, then
  2855. //           *Error_Code will be 0.  If the log file could not be
  2856. //           created, then *Error_Code will be > 0.
  2857. //
  2858. //   Error Handling: If the log file can not be created, then
  2859. //                   *Error_Code will be > 0.
  2860. //
  2861. //   Side Effects:  A file may be created/opened for logging of
  2862. //                  LVM Engine actions.
  2863. //
  2864. //   Notes:  None.
  2865. //
  2866. /*********************************************************************/
  2867. void _System Start_Logging( char * Filename, CARDINAL32 * Error_Code );
  2868.  
  2869. /*********************************************************************/
  2870. //
  2871. //   Function Name: Stop_Logging
  2872. //
  2873. //   Descriptive Name: This function ends LVM Engine logging and
  2874. //                     closes the log file.
  2875. //
  2876. //   Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in
  2877. /*                                    in which to store an error code*/
  2878. //                                    should an error occur.
  2879. //
  2880. //   Output: *Error_Code will be 0 if this function completes
  2881. //           successfully; otherwise it will be > 0.
  2882. //
  2883. //   Error Handling: If the log file is not currently opened, or if
  2884. //                   the close operation fails on the log file, then
  2885. //                   *Error_Code will be > 0.
  2886. //
  2887. //   Side Effects:  The log file may be closed.
  2888. //
  2889. //   Notes:  None.
  2890. //
  2891. /*********************************************************************/
  2892. void _System Stop_Logging ( CARDINAL32 * Error_Code );
  2893.  
  2894. #pragma pack()
  2895.  
  2896. #endif
  2897.  
  2898. #endif
  2899.