mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 14:39:36 +01:00 
			
		
		
		
	* diskfree doserror fix (merged)
This commit is contained in:
		
							parent
							
								
									988bcee197
								
							
						
					
					
						commit
						f07f30990e
					
				@ -464,47 +464,51 @@ VAR
 | 
				
			|||||||
BEGIN
 | 
					BEGIN
 | 
				
			||||||
 if (swap(dosversion)>=$070A) AND LFNSupport then
 | 
					 if (swap(dosversion)>=$070A) AND LFNSupport then
 | 
				
			||||||
  begin
 | 
					  begin
 | 
				
			||||||
   S:='C:\'#0;
 | 
					    S:='C:\'#0;
 | 
				
			||||||
   if Drive=0 then
 | 
					    if Drive=0 then
 | 
				
			||||||
    begin
 | 
					     begin
 | 
				
			||||||
     GetDir(Drive,S);
 | 
					      GetDir(Drive,S);
 | 
				
			||||||
     Setlength(S,4);
 | 
					      Setlength(S,4);
 | 
				
			||||||
     S[4]:=#0;
 | 
					      S[4]:=#0;
 | 
				
			||||||
    end
 | 
					     end
 | 
				
			||||||
   else
 | 
					    else
 | 
				
			||||||
    S[1]:=chr(Drive+64);
 | 
					     S[1]:=chr(Drive+64);
 | 
				
			||||||
   Rec.Strucversion:=0;
 | 
					    Rec.Strucversion:=0;
 | 
				
			||||||
   dosmemput(tb_segment,tb_offset,Rec,SIZEOF(ExtendedFat32FreeSpaceRec));
 | 
					    dosmemput(tb_segment,tb_offset,Rec,SIZEOF(ExtendedFat32FreeSpaceRec));
 | 
				
			||||||
   dosmemput(tb_segment,tb_offset+Sizeof(ExtendedFat32FreeSpaceRec)+1,S[1],4);
 | 
					    dosmemput(tb_segment,tb_offset+Sizeof(ExtendedFat32FreeSpaceRec)+1,S[1],4);
 | 
				
			||||||
   dosregs.dx:=tb_offset+Sizeof(ExtendedFat32FreeSpaceRec)+1;
 | 
					    dosregs.dx:=tb_offset+Sizeof(ExtendedFat32FreeSpaceRec)+1;
 | 
				
			||||||
   dosregs.ds:=tb_segment;
 | 
					    dosregs.ds:=tb_segment;
 | 
				
			||||||
   dosregs.di:=tb_offset;
 | 
					    dosregs.di:=tb_offset;
 | 
				
			||||||
   dosregs.es:=tb_segment;
 | 
					    dosregs.es:=tb_segment;
 | 
				
			||||||
   dosregs.cx:=Sizeof(ExtendedFat32FreeSpaceRec);
 | 
					    dosregs.cx:=Sizeof(ExtendedFat32FreeSpaceRec);
 | 
				
			||||||
   dosregs.ax:=$7303;
 | 
					    dosregs.ax:=$7303;
 | 
				
			||||||
   msdos(dosregs);
 | 
					    msdos(dosregs);
 | 
				
			||||||
   copyfromdos(rec,Sizeof(ExtendedFat32FreeSpaceRec));
 | 
					    copyfromdos(rec,Sizeof(ExtendedFat32FreeSpaceRec));
 | 
				
			||||||
   if Free then
 | 
					    if dosregs.eax<>-1 THEN {No error clausule in int except cf}
 | 
				
			||||||
    Do_DiskData:=int64(rec.AvailAllocUnits)*rec.SecPerClus*rec.BytePerSec
 | 
					     begin
 | 
				
			||||||
   else
 | 
					       copyfromdos(rec,Sizeof(ExtendedFat32FreeSpaceRec));
 | 
				
			||||||
    Do_DiskData:=int64(rec.TotalAllocUnits)*rec.SecPerClus*rec.BytePerSec;
 | 
					       if Free then
 | 
				
			||||||
   if doserror<>0 THEN {No error clausule in int except cf}
 | 
					        Do_DiskData:=int64(rec.AvailAllocUnits)*rec.SecPerClus*rec.BytePerSec
 | 
				
			||||||
    Do_DiskData:=-1;
 | 
					       else
 | 
				
			||||||
 | 
					        Do_DiskData:=int64(rec.TotalAllocUnits)*rec.SecPerClus*rec.BytePerSec;
 | 
				
			||||||
 | 
					     end
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					     Do_DiskData:=-1;
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 else
 | 
					 else
 | 
				
			||||||
  begin
 | 
					  begin
 | 
				
			||||||
   dosregs.dl:=drive;
 | 
					    dosregs.dl:=drive;
 | 
				
			||||||
   dosregs.ah:=$36;
 | 
					    dosregs.ah:=$36;
 | 
				
			||||||
   msdos(dosregs);
 | 
					    msdos(dosregs);
 | 
				
			||||||
   if dosregs.ax<>$FFFF then
 | 
					    if dosregs.ax<>$FFFF then
 | 
				
			||||||
    begin
 | 
					     begin
 | 
				
			||||||
     if Free then
 | 
					      if Free then
 | 
				
			||||||
      Do_DiskData:=int64(dosregs.ax)*dosregs.bx*dosregs.cx
 | 
					       Do_DiskData:=int64(dosregs.ax)*dosregs.bx*dosregs.cx
 | 
				
			||||||
     else
 | 
					      else
 | 
				
			||||||
      Do_DiskData:=int64(dosregs.ax)*dosregs.cx*dosregs.dx;
 | 
					       Do_DiskData:=int64(dosregs.ax)*dosregs.cx*dosregs.dx;
 | 
				
			||||||
    end
 | 
					     end
 | 
				
			||||||
   else
 | 
					    else
 | 
				
			||||||
    do_diskdata:=-1;
 | 
					     do_diskdata:=-1;
 | 
				
			||||||
  end;
 | 
					  end;
 | 
				
			||||||
end;
 | 
					end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1135,7 +1139,10 @@ End;
 | 
				
			|||||||
end.
 | 
					end.
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  $Log$
 | 
					  $Log$
 | 
				
			||||||
  Revision 1.9  2000-09-06 20:47:34  peter
 | 
					  Revision 1.10  2000-10-11 15:38:03  peter
 | 
				
			||||||
 | 
					    * diskfree doserror fix (merged)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Revision 1.9  2000/09/06 20:47:34  peter
 | 
				
			||||||
    * removed previous fsplit() patch as it's not the correct behaviour for
 | 
					    * removed previous fsplit() patch as it's not the correct behaviour for
 | 
				
			||||||
      LFNs. The code showing the bug could easily be adapted (merged)
 | 
					      LFNs. The code showing the bug could easily be adapted (merged)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user