lvmtest.pas 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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., 51 Franklin Street, Fifth Floor, Boston,
  15. * MA 02110-1301, USA.
  16. *****************************************************************************)
  17. uses lvm;
  18. // lvmtest.cpp, program to test the LVM library
  19. //
  20. // By John Martin Alfredsson, [email protected]
  21. // Pascal conversion by Yuri Prokushev
  22. var
  23. vca: Volume_Control_Array;
  24. vir: Volume_Information_Record;
  25. iCounter: integer;
  26. const
  27. Error_Code: CARDINAL32 = 99999;
  28. begin
  29. Open_LVM_Engine(True, addr(Error_Code));
  30. if Error_Code<>0 then
  31. begin
  32. writeln('Open_LVM_Engine Error !!');
  33. halt(1);
  34. end;
  35. vca:=Get_Volume_Control_Data(addr(Error_Code));
  36. if Error_Code<>0 then
  37. begin
  38. writeln('Get_Volume_Control_Data Error !!');
  39. halt(1);
  40. end;
  41. for iCounter:=0 to vca.Count-1 do
  42. begin
  43. writeln('--------------------------------------');
  44. vir:=Get_Volume_Information(vca.Volume_Control_Data[iCounter].Volume_Handle, addr(Error_Code));
  45. writeln('Volname : [', vir.Current_Drive_Letter, ':] ', vir.Volume_Name);
  46. writeln('FileSystem : ', vir.File_System_Name);
  47. case vir.Status of
  48. 0: writeln('Status : None');
  49. 1: writeln('Status : Bootable');
  50. 2: writeln('Status : Startable');
  51. 3: writeln('Status : Installable');
  52. end;
  53. if vca.Volume_Control_Data[iCounter].Compatibility_Volume then
  54. writeln('Volume type : Compatibility Volume')
  55. else
  56. writeln('Volume type : LVM Volume');
  57. end;
  58. writeln('--------------------------------------');
  59. Free_Engine_Memory(vca.Volume_Control_Data);
  60. Close_LVM_Engine;
  61. end.