Changeset 30 for trunk


Ignore:
Timestamp:
Apr 9, 2016, 7:49:58 PM (9 years ago)
Author:
chronos
Message:
  • Fixed: Wrong drive size detection for larger drives (Int64 overflow).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UPhysDrive.pas

    r28 r30  
    7272procedure TDriveInfo.SetSize(AValue: Int64);
    7373begin
    74   if FSize=AValue then Exit;
    75   FSize:=AValue;
     74  if FSize = AValue then Exit;
     75  FSize := AValue;
    7676end;
    7777
     
    145145      NewDriveInfo.Model := Trim(LoadFileToStr(List[I] + '/device/model'));
    146146      NewDriveInfo.SectorSize := StrToInt(Trim(LoadFileToStr(List[I] + '/queue/physical_block_size')));
    147       NewDriveInfo.Size := StrToInt(Trim(LoadFileToStr(List[I] + '/size'))) * 512;
     147      NewDriveInfo.Size := StrToInt64(Trim(LoadFileToStr(List[I] + '/size'))) * 512;
    148148      NewDriveInfo.Path := '/dev/' + ExtractFileName(List[I]);
    149149      Add(NewDriveInfo);
Note: See TracChangeset for help on using the changeset viewer.