{Compilar com 32 bits ! }

library dosvox32;

uses
  Windows, SysUtils;

function diskSize32 (disk: integer; var low, high: integer): Integer; stdcall;
var size: int64;
begin
  size := diskSize(disk);
  low  := size and $ffffffff;
  high := size shr 32;
  Result := size shr 20;   {valor em mb}
end;

function diskFree32 (disk: integer; var low, high: integer): Integer; stdcall;
var free: int64;
begin
  free := diskFree(disk);
  low  := free and $ffffffff;
  high := free shr 32;
  Result := free shr 20;   {valor em mb}
end;

procedure fileName32 (orig, name32: pchar); stdcall;
var f: TSearchRec;
begin
   if findFirst (strPas(orig), faAnyFile, f) = 0 then
       strcopy (name32, f.FindData.cFileName)
   else
       strcopy (name32, orig);
   findClose (f);
end;

exports
  diskSize32 name 'disksize32' resident,
  diskFree32 name 'diskfree32' resident,
  fileName32 name 'filename32' resident;

end.
