Browse Source

Fix compilation, broken by previous commit.

Martijn Laan 3 months ago
parent
commit
8b47a7e217

+ 1 - 0
Projects/Src/Compression.SevenZipDLLDecoder.Interfaces.pas

@@ -84,6 +84,7 @@ const
   { From PropID.h}
   { From PropID.h}
   kpidPath = 3;
   kpidPath = 3;
   kpidIsDir = 6;
   kpidIsDir = 6;
+  kpidSize = 7;
   kpidAttrib = 9;
   kpidAttrib = 9;
   kpidCTime = 10;
   kpidCTime = 10;
   kpidMTime = 12;
   kpidMTime = 12;

+ 10 - 1
Projects/Src/Compression.SevenZipDLLDecoder.pas

@@ -111,6 +111,7 @@ type
     function GetProperty(index: UInt32; propID: PROPID; out value: String): Boolean; overload;
     function GetProperty(index: UInt32; propID: PROPID; out value: String): Boolean; overload;
     function GetProperty(index: UInt32; propID: PROPID; out value: UInt32): Boolean; overload;
     function GetProperty(index: UInt32; propID: PROPID; out value: UInt32): Boolean; overload;
     function GetProperty(index: UInt32; propID: PROPID; out value: Boolean): Boolean; overload;
     function GetProperty(index: UInt32; propID: PROPID; out value: Boolean): Boolean; overload;
+    function GetProperty(index: UInt32; propID: PROPID; out value: Integer64): Boolean; overload;
     function GetProperty(index: UInt32; propID: PROPID; out value: TFileTime): Boolean; overload;
     function GetProperty(index: UInt32; propID: PROPID; out value: TFileTime): Boolean; overload;
   protected
   protected
     { IProgress }
     { IProgress }
@@ -367,6 +368,14 @@ begin
   value := varValue;
   value := varValue;
 end;
 end;
 
 
+function TArchiveExtractCallback.GetProperty(index: UInt32; propID: PROPID;
+  out value: Integer64): Boolean;
+begin
+  var varValue: OleVariant;
+  Result := GetProperty(index, propID, [varUInt64], varValue);
+  value := Integer64(UInt64(varValue));
+end;
+
 function TArchiveExtractCallback.GetProperty(index: UInt32; propID: PROPID;
 function TArchiveExtractCallback.GetProperty(index: UInt32; propID: PROPID;
   out value: TFileTime): Boolean;
   out value: TFileTime): Boolean;
 begin
 begin
@@ -421,7 +430,7 @@ begin
           SetFileAttributesRedir(FDisableFsRedir, NewCurrent.ExpandedPath, ExistingFileAttr and not FILE_ATTRIBUTE_READONLY);
           SetFileAttributesRedir(FDisableFsRedir, NewCurrent.ExpandedPath, ExistingFileAttr and not FILE_ATTRIBUTE_READONLY);
         const DestF = TFileRedir.Create(FDisableFsRedir, NewCurrent.ExpandedPath, fdCreateAlways, faWrite, fsNone);
         const DestF = TFileRedir.Create(FDisableFsRedir, NewCurrent.ExpandedPath, fdCreateAlways, faWrite, fsNone);
         var BytesLeft: Integer64;
         var BytesLeft: Integer64;
-        if GetProperty(FInArchive, index, kpidSize, BytesLeft) then begin
+        if GetProperty(index, kpidSize, BytesLeft) then begin
           { To avoid file system fragmentation, preallocate all of the bytes in the
           { To avoid file system fragmentation, preallocate all of the bytes in the
             destination file }
             destination file }
           DestF.Seek64(BytesLeft);
           DestF.Seek64(BytesLeft);