lvmtest.pas 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. (*****************************************************************************
  2. * This program is free software; you can redistribute it and/or modify
  3. * it under the terms of the GNU General Public License as published by
  4. * the Free Software Foundation; either version 2 of the License, or
  5. * (at your option) any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  10. * the GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program; if not, write to the Free Software
  14. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  15. *****************************************************************************)
  16. uses lvm;
  17. // lvmtest.cpp, program to test the LVM library
  18. //
  19. // By John Martin Alfredsson, [email protected]
  20. // Pascal conversion by Yuri Prokushev
  21. var
  22. vca: Volume_Control_Array;
  23. vir: Volume_Information_Record;
  24. iCounter: integer;
  25. const
  26. Error_Code: CARDINAL32 = 99999;
  27. begin
  28. Open_LVM_Engine(True, addr(Error_Code));
  29. if Error_Code<>0 then
  30. begin
  31. writeln('Open_LVM_Engine Error !!');
  32. halt(1);
  33. end;
  34. vca:=Get_Volume_Control_Data(addr(Error_Code));
  35. if Error_Code<>0 then
  36. begin
  37. writeln('Get_Volume_Control_Data Error !!');
  38. halt(1);
  39. end;
  40. for iCounter:=0 to vca.Count-1 do
  41. begin
  42. writeln('--------------------------------------');
  43. vir:=Get_Volume_Information(vca.Volume_Control_Data[iCounter].Volume_Handle, addr(Error_Code));
  44. writeln('Volname : [', vir.Current_Drive_Letter, ':] ', vir.Volume_Name);
  45. writeln('FileSystem : ', vir.File_System_Name);
  46. case vir.Status of
  47. 0: writeln('Status : None');
  48. 1: writeln('Status : Bootable');
  49. 2: writeln('Status : Startable');
  50. 3: writeln('Status : Installable');
  51. end;
  52. if vca.Volume_Control_Data[iCounter].Compatibility_Volume then
  53. writeln('Volume type : Compatibility Volume')
  54. else
  55. writeln('Volume type : LVM Volume');
  56. end;
  57. writeln('--------------------------------------');
  58. Free_Engine_Memory(vca.Volume_Control_Data);
  59. Close_LVM_Engine;
  60. end.