| 1 |
{**************************************************************************************************} |
| 2 |
{ } |
| 3 |
{ Project JEDI Code Library (JCL) } |
| 4 |
{ } |
| 5 |
{ interface of the 'sevenzip' (http://sourceforge.net/projects/sevenzip/) compression library } |
| 6 |
{ version 4.62, December 2th, 2008 } |
| 7 |
{ } |
| 8 |
{ Copyright (C) 1999-2008 Igor Pavlov } |
| 9 |
{ } |
| 10 |
{ GNU LGPL information } |
| 11 |
{ -------------------- } |
| 12 |
{ } |
| 13 |
{ This library is free software; you can redistribute it and/or modify it under the terms of } |
| 14 |
{ the GNU Lesser General Public License as published by the Free Software Foundation; either } |
| 15 |
{ version 2.1 of the License, or (at your option) any later version. } |
| 16 |
{ } |
| 17 |
{ This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; } |
| 18 |
{ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. } |
| 19 |
{ See the GNU Lesser General Public License for more details. } |
| 20 |
{ } |
| 21 |
{ You should have received a copy of the GNU Lesser General Public License along with this } |
| 22 |
{ library; if not, write to } |
| 23 |
{ the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA } |
| 24 |
{ } |
| 25 |
{ unRAR restriction } |
| 26 |
{ ----------------- } |
| 27 |
{ } |
| 28 |
{ The decompression engine for RAR archives was developed using source code of unRAR program. } |
| 29 |
{ All copyrights to original unRAR code are owned by Alexander Roshal. } |
| 30 |
{ } |
| 31 |
{ The license for original unRAR code has the following restriction: } |
| 32 |
{ } |
| 33 |
{ The unRAR sources cannot be used to re-create the RAR compression algorithm, } |
| 34 |
{ which is proprietary. Distribution of modified unRAR sources in separate form } |
| 35 |
{ or as a part of other software is permitted, provided that it is clearly } |
| 36 |
{ stated in the documentation and source comments that the code may } |
| 37 |
{ not be used to develop a RAR (WinRAR) compatible archiver. } |
| 38 |
{ } |
| 39 |
{**************************************************************************************************} |
| 40 |
{ } |
| 41 |
{ Translation 2007-2008 Florent Ouchet for the JEDI Code Library } |
| 42 |
{ Contributors: } |
| 43 |
{ Uwe Schuster (uschuster) } |
| 44 |
{ Jan Goyvaerts (jgsoft) } |
| 45 |
{ } |
| 46 |
{**************************************************************************************************} |
| 47 |
{ } |
| 48 |
{ Last modified: $Date:: $ } |
| 49 |
{ Revision: $Rev:: $ } |
| 50 |
{ Author: $Author:: $ } |
| 51 |
{ } |
| 52 |
{**************************************************************************************************} |
| 53 |
|
| 54 |
unit sevenzip; |
| 55 |
|
| 56 |
{$mode delphi} |
| 57 |
|
| 58 |
interface |
| 59 |
|
| 60 |
{$DEFINE 7ZIP_LINKONREQUEST} |
| 61 |
|
| 62 |
uses |
| 63 |
{$IFDEF HAS_UNITSCOPE} |
| 64 |
Winapi.ActiveX, Winapi.Windows, |
| 65 |
{$ELSE ~HAS_UNITSCOPE} |
| 66 |
ActiveX, Windows, |
| 67 |
{$ENDIF ~HAS_UNITSCOPE} |
| 68 |
{$IFDEF UNITVERSIONING} |
| 69 |
JclUnitVersioning, |
| 70 |
{$ENDIF UNITVERSIONING} |
| 71 |
DCJclAlternative; |
| 72 |
|
| 73 |
//DOM-IGNORE-BEGIN |
| 74 |
|
| 75 |
// Guid.txt |
| 76 |
const |
| 77 |
CLSID_CCodec : TGUID = '{23170F69-40C1-2790-0000-000000000000}'; |
| 78 |
CLSID_CCodecBCJ2 : TGUID = '{23170F69-40C1-2790-1B01-030300000000}'; // BCJ2 0303011B |
| 79 |
CLSID_CCodecBCJ : TGUID = '{23170F69-40C1-2790-0301-030300000000}'; // BCJ 03030103 |
| 80 |
CLSID_CCodecSWAP2 : TGUID = '{23170F69-40C1-2790-0203-030000000000}'; // swap2 020302 |
| 81 |
CLSID_CCodecSWAP4 : TGUID = '{23170F69-40C1-2790-0403-020000000000}'; // swap4 020304 |
| 82 |
CLSID_CCodecBPPC : TGUID = '{23170F69-40C1-2790-0502-030300000000}'; // branch ppc 03030205 |
| 83 |
CLSID_CCodecBIA64 : TGUID = '{23170F69-40C1-2790-0104-030300000000}'; // branch IA64 03030401 |
| 84 |
CLSID_CCodecBARM : TGUID = '{23170F69-40C1-2790-0105-030300000000}'; // branch ARM 03030501 |
| 85 |
CLSID_CCodecBARMT : TGUID = '{23170F69-40C1-2790-0107-030300000000}'; // branch ARM Thumb 03030701 |
| 86 |
CLSID_CCodecBARMS : TGUID = '{23170F69-40C1-2790-0508-030300000000}'; // branch ARM Sparc 03030805 |
| 87 |
CLSID_CCodecBZIP : TGUID = '{23170F69-40C1-2790-0202-040000000000}'; // bzip2 040202 |
| 88 |
CLSID_CCodecCOPY : TGUID = '{23170F69-40C1-2790-0000-000000000000}'; // copy 0 |
| 89 |
CLSID_CCodecDEF64 : TGUID = '{23170F69-40C1-2790-0901-040000000000}'; // deflate64 040109 |
| 90 |
CLSID_CCodecDEFNSIS : TGUID = '{23170F69-40C1-2790-0109-040000000000}'; // deflate nsis 040901 |
| 91 |
CLSID_CCodecDEFREG : TGUID = '{23170F69-40C1-2790-0801-040000000000}'; // deflate register 040108 |
| 92 |
CLSID_CCodecLZMA : TGUID = '{23170F69-40C1-2790-0101-030000000000}'; // lzma 030101 |
| 93 |
CLSID_CCodecPPMD : TGUID = '{23170F69-40C1-2790-0104-030000000000}'; // ppmd 030401 |
| 94 |
CLSID_CCodecRAR1 : TGUID = '{23170F69-40C1-2790-0103-040000000000}'; // rar1 040301 |
| 95 |
CLSID_CCodecRAR2 : TGUID = '{23170F69-40C1-2790-0203-040000000000}'; // rar2 040302 |
| 96 |
CLSID_CCodecRAR3 : TGUID = '{23170F69-40C1-2790-0303-040000000000}'; // rar3 040303 |
| 97 |
CLSID_CAESCodec : TGUID = '{23170F69-40C1-2790-0107-F10600000000}'; // AES 06F10701 |
| 98 |
|
| 99 |
CLSID_CArchiveHandler : TGUID = '{23170F69-40C1-278A-1000-000110000000}'; |
| 100 |
CLSID_CFormatZip : TGUID = '{23170F69-40C1-278A-1000-000110010000}'; |
| 101 |
CLSID_CFormatBZ2 : TGUID = '{23170F69-40C1-278A-1000-000110020000}'; |
| 102 |
CLSID_CFormatRar : TGUID = '{23170F69-40C1-278A-1000-000110030000}'; |
| 103 |
CLSID_CFormatArj : TGUID = '{23170F69-40C1-278A-1000-000110040000}'; |
| 104 |
CLSID_CFormatZ : TGUID = '{23170F69-40C1-278A-1000-000110050000}'; |
| 105 |
CLSID_CFormatLzh : TGUID = '{23170F69-40C1-278A-1000-000110060000}'; |
| 106 |
CLSID_CFormat7z : TGUID = '{23170F69-40C1-278A-1000-000110070000}'; |
| 107 |
CLSID_CFormatCab : TGUID = '{23170F69-40C1-278A-1000-000110080000}'; |
| 108 |
CLSID_CFormatNsis : TGUID = '{23170F69-40C1-278A-1000-000110090000}'; |
| 109 |
CLSID_CFormatLzma : TGUID = '{23170F69-40C1-278A-1000-0001100A0000}'; |
| 110 |
CLSID_CFormatLzma86 : TGUID = '{23170F69-40C1-278A-1000-0001100B0000}'; |
| 111 |
CLSID_CFormatXz : TGUID = '{23170F69-40C1-278A-1000-0001100C0000}'; |
| 112 |
CLSID_CFormatPpmd : TGUID = '{23170F69-40C1-278A-1000-0001100D0000}'; |
| 113 |
CLSID_CFormatTE : TGUID = '{23170F69-40C1-278A-1000-000110CF0000}'; |
| 114 |
CLSID_CFormatUEFIc : TGUID = '{23170F69-40C1-278A-1000-000110D00000}'; |
| 115 |
CLSID_CFormatUEFIs : TGUID = '{23170F69-40C1-278A-1000-000110D10000}'; |
| 116 |
CLSID_CFormatSquashFS : TGUID = '{23170F69-40C1-278A-1000-000110D20000}'; |
| 117 |
CLSID_CFormatCramFS : TGUID = '{23170F69-40C1-278A-1000-000110D30000}'; |
| 118 |
CLSID_CFormatAPM : TGUID = '{23170F69-40C1-278A-1000-000110D40000}'; |
| 119 |
CLSID_CFormatMslz : TGUID = '{23170F69-40C1-278A-1000-000110D50000}'; |
| 120 |
CLSID_CFormatFlv : TGUID = '{23170F69-40C1-278A-1000-000110D60000}'; |
| 121 |
CLSID_CFormatSwf : TGUID = '{23170F69-40C1-278A-1000-000110D70000}'; |
| 122 |
CLSID_CFormatSwfc : TGUID = '{23170F69-40C1-278A-1000-000110D80000}'; |
| 123 |
CLSID_CFormatNtfs : TGUID = '{23170F69-40C1-278A-1000-000110D90000}'; |
| 124 |
CLSID_CFormatFat : TGUID = '{23170F69-40C1-278A-1000-000110DA0000}'; |
| 125 |
CLSID_CFormatMbr : TGUID = '{23170F69-40C1-278A-1000-000110DB0000}'; |
| 126 |
CLSID_CFormatVhd : TGUID = '{23170F69-40C1-278A-1000-000110DC0000}'; |
| 127 |
CLSID_CFormatPe : TGUID = '{23170F69-40C1-278A-1000-000110DD0000}'; |
| 128 |
CLSID_CFormatElf : TGUID = '{23170F69-40C1-278A-1000-000110DE0000}'; |
| 129 |
CLSID_CFormatMacho : TGUID = '{23170F69-40C1-278A-1000-000110DF0000}'; |
| 130 |
CLSID_CFormatUdf : TGUID = '{23170F69-40C1-278A-1000-000110E00000}'; |
| 131 |
CLSID_CFormatXar : TGUID = '{23170F69-40C1-278A-1000-000110E10000}'; |
| 132 |
CLSID_CFormatMub : TGUID = '{23170F69-40C1-278A-1000-000110E20000}'; |
| 133 |
CLSID_CFormatHfs : TGUID = '{23170F69-40C1-278A-1000-000110E30000}'; |
| 134 |
CLSID_CFormatDmg : TGUID = '{23170F69-40C1-278A-1000-000110E40000}'; |
| 135 |
CLSID_CFormatCompound : TGUID = '{23170F69-40C1-278A-1000-000110E50000}'; |
| 136 |
CLSID_CFormatWim : TGUID = '{23170F69-40C1-278A-1000-000110E60000}'; |
| 137 |
CLSID_CFormatIso : TGUID = '{23170F69-40C1-278A-1000-000110E70000}'; |
| 138 |
//CLSID_CFormatBkf : TGUID = '{23170F69-40C1-278A-1000-000110E80000}'; not in 4.57 |
| 139 |
CLSID_CFormatChm : TGUID = '{23170F69-40C1-278A-1000-000110E90000}'; |
| 140 |
CLSID_CFormatSplit : TGUID = '{23170F69-40C1-278A-1000-000110EA0000}'; |
| 141 |
CLSID_CFormatRpm : TGUID = '{23170F69-40C1-278A-1000-000110EB0000}'; |
| 142 |
CLSID_CFormatDeb : TGUID = '{23170F69-40C1-278A-1000-000110EC0000}'; |
| 143 |
CLSID_CFormatCpio : TGUID = '{23170F69-40C1-278A-1000-000110ED0000}'; |
| 144 |
CLSID_CFormatTar : TGUID = '{23170F69-40C1-278A-1000-000110EE0000}'; |
| 145 |
CLSID_CFormatGZip : TGUID = '{23170F69-40C1-278A-1000-000110EF0000}'; |
| 146 |
|
| 147 |
// IStream.h |
| 148 |
type |
| 149 |
// "23170F69-40C1-278A-0000-000300xx0000" |
| 150 |
ISequentialInStream = interface(IUnknown) |
| 151 |
['{23170F69-40C1-278A-0000-000300010000}'] |
| 152 |
function Read(Data: Pointer; Size: Cardinal; ProcessedSize: PCardinal): HRESULT; stdcall; |
| 153 |
{Out: if size != 0, return_value = S_OK and (*processedSize == 0), |
| 154 |
then there are no more bytes in stream. |
| 155 |
if (size > 0) && there are bytes in stream, |
| 156 |
this function must read at least 1 byte. |
| 157 |
This function is allowed to read less than number of remaining bytes in stream. |
| 158 |
You must call Read function in loop, if you need exact amount of data} |
| 159 |
end; |
| 160 |
|
| 161 |
ISequentialOutStream = interface(IUnknown) |
| 162 |
['{23170F69-40C1-278A-0000-000300020000}'] |
| 163 |
function Write(Data: Pointer; Size: Cardinal; ProcessedSize: PCardinal): HRESULT; stdcall; |
| 164 |
{if (size > 0) this function must write at least 1 byte. |
| 165 |
This function is allowed to write less than "size". |
| 166 |
You must call Write function in loop, if you need to write exact amount of data} |
| 167 |
end; |
| 168 |
|
| 169 |
IInStream = interface(ISequentialInStream) |
| 170 |
['{23170F69-40C1-278A-0000-000300030000}'] |
| 171 |
function Seek(Offset: Int64; SeekOrigin: Cardinal; NewPosition: PInt64): HRESULT; stdcall; |
| 172 |
end; |
| 173 |
|
| 174 |
IOutStream = interface(ISequentialOutStream) |
| 175 |
['{23170F69-40C1-278A-0000-000300040000}'] |
| 176 |
function Seek(Offset: Int64; SeekOrigin: Cardinal; NewPosition: PInt64): HRESULT; stdcall; |
| 177 |
function SetSize(NewSize: Int64): HRESULT; stdcall; |
| 178 |
end; |
| 179 |
|
| 180 |
IStreamGetSize = interface(IUnknown) |
| 181 |
['{23170F69-40C1-278A-0000-000300060000}'] |
| 182 |
function GetSize(Size: PInt64): HRESULT; stdcall; |
| 183 |
end; |
| 184 |
|
| 185 |
IOutStreamFlush = interface(IUnknown) |
| 186 |
['{23170F69-40C1-278A-0000-000300070000}'] |
| 187 |
function Flush: HRESULT; stdcall; |
| 188 |
end; |
| 189 |
|
| 190 |
// PropID.h |
| 191 |
const |
| 192 |
kpidNoProperty = 0; |
| 193 |
kpidMainSubfile = 1; |
| 194 |
kpidHandlerItemIndex = 2; |
| 195 |
kpidPath = 3; |
| 196 |
kpidName = 4; |
| 197 |
kpidExtension = 5; |
| 198 |
kpidIsFolder = 6 {$IFDEF SUPPORTS_DEPRECATED} deprecated {$IFDEF SUPPORTS_DEPRECATED_DETAILS} 'Use kpidIsDir' {$ENDIF} {$ENDIF}; |
| 199 |
kpidIsDir = 6; |
| 200 |
kpidSize = 7; |
| 201 |
kpidPackedSize = 8 {$IFDEF SUPPORTS_DEPRECATED} deprecated {$IFDEF SUPPORTS_DEPRECATED_DETAILS} 'Use kpidPackSize' {$ENDIF} {$ENDIF}; |
| 202 |
kpidPackSize = 8; |
| 203 |
kpidAttributes = 9 {$IFDEF SUPPORTS_DEPRECATED} deprecated {$IFDEF SUPPORTS_DEPRECATED_DETAILS} 'Use kpidAttrib' {$ENDIF} {$ENDIF}; |
| 204 |
kpidAttrib = 9; |
| 205 |
kpidCreationTime = 10 {$IFDEF SUPPORTS_DEPRECATED} deprecated {$IFDEF SUPPORTS_DEPRECATED_DETAILS} 'Use kpidCTime' {$ENDIF} {$ENDIF}; |
| 206 |
kpidCTime = 10; |
| 207 |
kpidLastAccessTime = 11 {$IFDEF SUPPORTS_DEPRECATED} deprecated {$IFDEF SUPPORTS_DEPRECATED_DETAILS} 'Use kpidATime' {$ENDIF} {$ENDIF}; |
| 208 |
kpidATime = 11; |
| 209 |
kpidLastWriteTime = 12 {$IFDEF SUPPORTS_DEPRECATED} deprecated {$IFDEF SUPPORTS_DEPRECATED_DETAILS} 'Use kpidMTime' {$ENDIF} {$ENDIF}; |
| 210 |
kpidMTime = 12; |
| 211 |
kpidSolid = 13; |
| 212 |
kpidCommented = 14; |
| 213 |
kpidEncrypted = 15; |
| 214 |
kpidSplitBefore = 16; |
| 215 |
kpidSplitAfter = 17; |
| 216 |
kpidDictionarySize = 18; |
| 217 |
kpidCRC = 19; |
| 218 |
kpidType = 20; |
| 219 |
kpidIsAnti = 21; |
| 220 |
kpidMethod = 22; |
| 221 |
kpidHostOS = 23; |
| 222 |
kpidFileSystem = 24; |
| 223 |
kpidUser = 25; |
| 224 |
kpidGroup = 26; |
| 225 |
kpidBlock = 27; |
| 226 |
kpidComment = 28; |
| 227 |
kpidPosition = 29; |
| 228 |
kpidPrefix = 30; |
| 229 |
kpidNumSubDirs = 31; |
| 230 |
kpidNumSubFiles = 32; |
| 231 |
kpidUnpackVer = 33; |
| 232 |
kpidVolume = 34; |
| 233 |
kpidIsVolume = 35; |
| 234 |
kpidOffset = 36; |
| 235 |
kpidLinks = 37; |
| 236 |
kpidNumBlocks = 38; |
| 237 |
kpidNumVolumes = 39; |
| 238 |
kpidTimeType = 40; |
| 239 |
kpidBit64 = 41; |
| 240 |
kpidBigEndian = 42; |
| 241 |
kpidCpu = 43; |
| 242 |
kpidPhySize = 44; |
| 243 |
kpidHeadersSize = 45; |
| 244 |
kpidChecksum = 46; |
| 245 |
kpidCharacts = 47; |
| 246 |
kpidVa = 48; |
| 247 |
kpidId = 49; |
| 248 |
kpidShortName = 50; |
| 249 |
kpidCreatorApp = 51; |
| 250 |
kpidSectorSize = 52; |
| 251 |
kpidPosixAttrib = 53; |
| 252 |
kpidLink = 54; |
| 253 |
|
| 254 |
kpidIsAltStream = 63; |
| 255 |
|
| 256 |
kpidTotalSize = $1100; |
| 257 |
kpidFreeSpace = $1101; |
| 258 |
kpidClusterSize = $1102; |
| 259 |
kpidVolumeName = $1103; |
| 260 |
|
| 261 |
kpidLocalName = $1200; |
| 262 |
kpidProvider = $1201; |
| 263 |
|
| 264 |
kpidUserDefined = $10000; |
| 265 |
|
| 266 |
// HandlerOut.cpp |
| 267 |
|
| 268 |
kCopyMethodName = WideString('Copy'); |
| 269 |
kLZMAMethodName = WideString('LZMA'); |
| 270 |
kLZMA2MethodName = WideString('LZMA2'); |
| 271 |
kBZip2MethodName = WideString('BZip2'); |
| 272 |
kPpmdMethodName = WideString('PPMd'); |
| 273 |
kDeflateMethodName = WideString('Deflate'); |
| 274 |
kDeflate64MethodName = WideString('Deflate64'); |
| 275 |
|
| 276 |
kAES128MethodName = WideString('AES128'); |
| 277 |
kAES192MethodName = WideString('AES192'); |
| 278 |
kAES256MethodName = WideString('AES256'); |
| 279 |
kZipCryptoMethodName = WideString('ZIPCRYPTO'); |
| 280 |
|
| 281 |
// ICoder.h |
| 282 |
type |
| 283 |
ICompressProgressInfo = interface(IUnknown) |
| 284 |
['{23170F69-40C1-278A-0000-000400040000}'] |
| 285 |
function SetRatioInfo(InSize: PInt64; OutSize: PInt64): HRESULT; stdcall; |
| 286 |
end; |
| 287 |
|
| 288 |
ICompressCoder = interface(IUnknown) |
| 289 |
['{23170F69-40C1-278A-0000-000400050000}'] |
| 290 |
function Code(InStream: ISequentialInStream; OutStream: ISequentialOutStream; |
| 291 |
InSize, OutSize: PInt64; Progress: ICompressProgressInfo): HRESULT; stdcall; |
| 292 |
end; |
| 293 |
|
| 294 |
PISequentialInStream = ^ISequentialInStream; |
| 295 |
PISequentialOutStream = ^ISequentialOutStream; |
| 296 |
|
| 297 |
ICompressCoder2 = interface(IUnknown) |
| 298 |
['{23170F69-40C1-278A-0000-000400180000}'] |
| 299 |
function Code(InStreams: PISequentialInStream; InSizes: JclBase.PPInt64; NumInStreams: Cardinal; |
| 300 |
OutStreams: PISequentialOutStream; OutSizes: JclBase.PPInt64; NumOutStreams: Cardinal; |
| 301 |
Progress: ICompressProgressInfo): HRESULT; stdcall; |
| 302 |
end; |
| 303 |
|
| 304 |
const |
| 305 |
kDictionarySize = $400; |
| 306 |
kUsedMemorySize = $401; |
| 307 |
kOrder = $402; |
| 308 |
kBlockSize = $403; |
| 309 |
kPosStateBits = $440; |
| 310 |
kLitContextBits = $441; |
| 311 |
kLitPosBits = $442; |
| 312 |
kNumFastBytes = $450; |
| 313 |
kMatchFinder = $451; |
| 314 |
kMatchFinderCycles = $452; |
| 315 |
kNumPasses = $460; |
| 316 |
kAlgorithm = $470; |
| 317 |
kMultiThread = $480; |
| 318 |
kNumThreads = $481; |
| 319 |
kEndMarker = $490; |
| 320 |
|
| 321 |
type |
| 322 |
ICompressSetCoderProperties = interface(IUnknown) |
| 323 |
['{23170F69-40C1-278A-0000-000400200000}'] |
| 324 |
function SetCoderProperties(PropIDs: PPropID; Properties: PPropVariant; |
| 325 |
NumProperties: Cardinal): HRESULT; stdcall; |
| 326 |
end; |
| 327 |
|
| 328 |
ICompressSetDecoderProperties2 = interface(IUnknown) |
| 329 |
['{23170F69-40C1-278A-0000-000400220000}'] |
| 330 |
function SetDecoderProperties2(Data: PByte; Size: Cardinal): HRESULT; stdcall; |
| 331 |
end; |
| 332 |
|
| 333 |
ICompressWriteCoderProperties = interface(IUnknown) |
| 334 |
['{23170F69-40C1-278A-0000-000400230000}'] |
| 335 |
function WriteCoderProperties(OutStream: ISequentialOutStream): HRESULT; stdcall; |
| 336 |
end; |
| 337 |
|
| 338 |
ICompressGetInStreamProcessedSize = interface(IUnknown) |
| 339 |
['{23170F69-40C1-278A-0000-000400240000}'] |
| 340 |
function GetInStreamProcessedSize(Value: PInt64): HRESULT; stdcall; |
| 341 |
end; |
| 342 |
|
| 343 |
ICompressSetCoderMt = interface(IUnknown) |
| 344 |
['{23170F69-40C1-278A-0000-000400250000}'] |
| 345 |
function SetNumberOfThreads(NumThreads: Cardinal): HRESULT; stdcall; |
| 346 |
end; |
| 347 |
|
| 348 |
ICompressGetSubStreamSize = interface(IUnknown) |
| 349 |
['{23170F69-40C1-278A-0000-000400300000}'] |
| 350 |
function GetSubStreamSize(SubStream: Int64; out Value: Int64): HRESULT; stdcall; |
| 351 |
end; |
| 352 |
|
| 353 |
ICompressSetInStream = interface(IUnknown) |
| 354 |
['{23170F69-40C1-278A-0000-000400310000}'] |
| 355 |
function SetInStream(InStream: ISequentialInStream): HRESULT; stdcall; |
| 356 |
function ReleaseInStream: HRESULT; stdcall; |
| 357 |
end; |
| 358 |
|
| 359 |
ICompressSetOutStream = interface(IUnknown) |
| 360 |
['{23170F69-40C1-278A-0000-000400320000}'] |
| 361 |
function SetOutStream(OutStream: ISequentialOutStream): HRESULT; stdcall; |
| 362 |
function ReleaseOutStream: HRESULT; stdcall; |
| 363 |
end; |
| 364 |
|
| 365 |
ICompressSetInStreamSize = interface(IUnknown) |
| 366 |
['{23170F69-40C1-278A-0000-000400330000}'] |
| 367 |
function SetInStreamSize(InSize: PInt64): HRESULT; stdcall; |
| 368 |
end; |
| 369 |
|
| 370 |
ICompressSetOutStreamSize = interface(IUnknown) |
| 371 |
['{23170F69-40C1-278A-0000-000400340000}'] |
| 372 |
function SetOutStreamSize(OutSize: PInt64): HRESULT; stdcall; |
| 373 |
end; |
| 374 |
|
| 375 |
ICompressFilter = interface(IUnknown) |
| 376 |
['{23170F69-40C1-278A-0000-000400400000}'] |
| 377 |
function Init: HRESULT; stdcall; |
| 378 |
function Filter(Data: PByte; Size: Cardinal): Cardinal; stdcall; |
| 379 |
// Filter return outSize (UInt32) |
| 380 |
// if (outSize <= size): Filter have converted outSize bytes |
| 381 |
// if (outSize > size): Filter have not converted anything. |
| 382 |
// and it needs at least outSize bytes to convert one block |
| 383 |
// (it's for crypto block algorithms). |
| 384 |
end; |
| 385 |
|
| 386 |
ICompressCodecsInfo = interface(IUnknown) |
| 387 |
['{23170F69-40C1-278A-0000-000400600000}'] |
| 388 |
function GetNumberOfMethods(NumMethods: PCardinal): HRESULT; stdcall; |
| 389 |
function GetProperty(Index: Cardinal; PropID: TPropID; out Value: TPropVariant): HRESULT; stdcall; |
| 390 |
function CreateDecoder(Index: Cardinal; IID: PGUID; out Decoder): HRESULT; stdcall; |
| 391 |
function CreateEncoder(Index: Cardinal; IID: PGUID; out Coder): HRESULT; stdcall; |
| 392 |
end; |
| 393 |
|
| 394 |
ISetCompressCodecsInfo = interface(IUnknown) |
| 395 |
['{23170F69-40C1-278A-0000-000400610000}'] |
| 396 |
function SetCompressCodecsInfo(CompressCodecsInfo: ICompressCodecsInfo): HRESULT; stdcall; |
| 397 |
end; |
| 398 |
|
| 399 |
ICryptoProperties = interface(IUnknown) |
| 400 |
['{23170F69-40C1-278A-0000-000400800000}'] |
| 401 |
function SetKey(Data: PByte; Size: Cardinal): HRESULT; stdcall; |
| 402 |
function SetInitVector(Data: PByte; Size: Cardinal): HRESULT; stdcall; |
| 403 |
end; |
| 404 |
|
| 405 |
ICryptoSetPassword = interface(IUnknown) |
| 406 |
['{23170F69-40C1-278A-0000-000400900000}'] |
| 407 |
function CryptoSetPassword(Data: PByte; Size: Cardinal): HRESULT; stdcall; |
| 408 |
end; |
| 409 |
|
| 410 |
ICryptoSetCRC = interface(IUnknown) |
| 411 |
['{23170F69-40C1-278A-0000-000400A00000}'] |
| 412 |
function CryptoSetCRC(crc: Cardinal): HRESULT; stdcall; |
| 413 |
end; |
| 414 |
|
| 415 |
const |
| 416 |
kID = 0; |
| 417 |
kName = 1; |
| 418 |
kDecoder = 2; |
| 419 |
kEncoder = 3; |
| 420 |
kInStreams = 4; |
| 421 |
kOutStreams = 5; |
| 422 |
kDescription = 6; |
| 423 |
kDecoderIsAssigned = 7; |
| 424 |
kEncoderIsAssigned = 8; |
| 425 |
|
| 426 |
// IProgress.h |
| 427 |
type |
| 428 |
IProgress = interface(IUnknown) |
| 429 |
['{23170F69-40C1-278A-0000-000000050000}'] |
| 430 |
function SetTotal(Total: Int64): HRESULT; stdcall; |
| 431 |
function SetCompleted(CompleteValue: PInt64): HRESULT; stdcall; |
| 432 |
end; |
| 433 |
|
| 434 |
// IArchive.h |
| 435 |
const |
| 436 |
// file time type |
| 437 |
kWindows = 0; |
| 438 |
kUnix = 1; |
| 439 |
kDOS = 2; |
| 440 |
|
| 441 |
// archive |
| 442 |
kArchiveName = 0; |
| 443 |
kClassID = 1; |
| 444 |
kExtension = 2; |
| 445 |
kAddExtension = 3; |
| 446 |
kUpdate = 4; |
| 447 |
kKeepName = 5; |
| 448 |
kStartSignature = 6; |
| 449 |
kFinishSignature = 7; |
| 450 |
kAssociate = 8; |
| 451 |
|
| 452 |
// ask mode |
| 453 |
kExtract = 0; |
| 454 |
kTest = 1; |
| 455 |
kSkip = 2; |
| 456 |
|
| 457 |
// operation result |
| 458 |
kOK = 0; |
| 459 |
kUnSupportedMethod = 1; |
| 460 |
kDataError = 2; |
| 461 |
kCRCError = 3; |
| 462 |
|
| 463 |
kError = 1; |
| 464 |
|
| 465 |
type |
| 466 |
// "23170F69-40C1-278A-0000-000600xx0000" |
| 467 |
IArchiveOpenCallback = interface(IUnknown) |
| 468 |
['{23170F69-40C1-278A-0000-000600100000}'] |
| 469 |
function SetTotal(Files: PInt64; Bytes: PInt64): HRESULT; stdcall; |
| 470 |
function SetCompleted(Files: PInt64; Bytes: PInt64): HRESULT; stdcall; |
| 471 |
end; |
| 472 |
|
| 473 |
IArchiveExtractCallback = interface(IProgress) |
| 474 |
['{23170F69-40C1-278A-0000-000600200000}'] |
| 475 |
function GetStream(Index: Cardinal; out OutStream: ISequentialOutStream; |
| 476 |
askExtractMode: Cardinal): HRESULT; stdcall; |
| 477 |
// GetStream OUT: S_OK - OK, S_FALSE - skeep this file |
| 478 |
function PrepareOperation(askExtractMode: Cardinal): HRESULT; stdcall; |
| 479 |
function SetOperationResult(resultEOperationResult: Integer): HRESULT; stdcall; |
| 480 |
end; |
| 481 |
|
| 482 |
IArchiveOpenVolumeCallback = interface(IUnknown) |
| 483 |
['{23170F69-40C1-278A-0000-000600300000}'] |
| 484 |
function GetProperty(PropID: TPropID; out Value: TPropVariant): HRESULT; stdcall; |
| 485 |
function GetStream(Name: PWideChar; out InStream: IInStream): HRESULT; stdcall; |
| 486 |
end; |
| 487 |
|
| 488 |
IInArchiveGetStream = interface(IUnknown) |
| 489 |
['{23170F69-40C1-278A-0000-000600400000}'] |
| 490 |
function GetStream(Index: Cardinal; out Stream: ISequentialInStream): HRESULT; stdcall; |
| 491 |
end; |
| 492 |
|
| 493 |
IArchiveOpenSetSubArchiveName = interface(IUnknown) |
| 494 |
['{23170F69-40C1-278A-0000-000600500000}'] |
| 495 |
function SetSubArchiveName(Name: PWideChar): HRESULT; stdcall; |
| 496 |
end; |
| 497 |
|
| 498 |
IInArchive = interface(IUnknown) |
| 499 |
['{23170F69-40C1-278A-0000-000600600000}'] |
| 500 |
function Open(Stream: IInStream; MaxCheckStartPosition: PInt64; |
| 501 |
OpenArchiveCallback: IArchiveOpenCallback): HRESULT; stdcall; |
| 502 |
function Close: HRESULT; stdcall; |
| 503 |
function GetNumberOfItems(NumItems: PCardinal): HRESULT; stdcall; |
| 504 |
function GetProperty(Index: Cardinal; PropID: TPropID; |
| 505 |
var Value: TPropVariant): HRESULT; stdcall; |
| 506 |
function Extract(Indices: PCardinal; NumItems: Cardinal; |
| 507 |
TestMode: Integer; ExtractCallback: IArchiveExtractCallback): HRESULT; stdcall; |
| 508 |
// indices must be sorted |
| 509 |
// numItems = 0xFFFFFFFF means all files |
| 510 |
// testMode != 0 means "test files operation" |
| 511 |
function GetArchiveProperty(PropID: TPropID; out Value: TPropVariant): HRESULT; stdcall; |
| 512 |
|
| 513 |
function GetNumberOfProperties(NumProperties: PCardinal): HRESULT; stdcall; |
| 514 |
function GetPropertyInfo(Index: Cardinal; out Name: TBStr; out PropID: TPropID; |
| 515 |
out VarType: TVarType): HRESULT; stdcall; |
| 516 |
|
| 517 |
function GetNumberOfArchiveProperties(NumProperties: PCardinal): HRESULT; stdcall; |
| 518 |
function GetArchivePropertyInfo(Index: Cardinal; out Name: TBStr; out PropID: TPropID; |
| 519 |
out VarType: TVarType): HRESULT; stdcall; |
| 520 |
end; |
| 521 |
|
| 522 |
IArchiveUpdateCallback = interface(IProgress) |
| 523 |
['{23170F69-40C1-278A-0000-000600800000}'] |
| 524 |
function GetUpdateItemInfo(Index: Cardinal; |
| 525 |
NewData: PInteger; // 1 - new data, 0 - old data |
| 526 |
NewProperties: PInteger; // 1 - new properties, 0 - old properties |
| 527 |
IndexInArchive: PCardinal // -1 if there is no in archive, or if doesn't matter |
| 528 |
): HRESULT; stdcall; |
| 529 |
function GetProperty(Index: Cardinal; PropID: TPropID; out Value: TPropVariant): HRESULT; stdcall; |
| 530 |
function GetStream(Index: Cardinal; out InStream: ISequentialInStream): HRESULT; stdcall; |
| 531 |
function SetOperationResult(OperationResult: Integer): HRESULT; stdcall; |
| 532 |
end; |
| 533 |
|
| 534 |
IArchiveUpdateCallback2 = interface(IArchiveUpdateCallback) |
| 535 |
['{23170F69-40C1-278A-0000-000600820000}'] |
| 536 |
function GetVolumeSize(Index: Cardinal; Size: PInt64): HRESULT; stdcall; |
| 537 |
function GetVolumeStream(Index: Cardinal; out VolumeStream: ISequentialOutStream): HRESULT; stdcall; |
| 538 |
end; |
| 539 |
|
| 540 |
IOutArchive = interface(IUnknown) |
| 541 |
['{23170F69-40C1-278A-0000-000600A00000}'] |
| 542 |
function UpdateItems(OutStream: ISequentialOutStream; NumItems: Cardinal; |
| 543 |
UpdateCallback: IArchiveUpdateCallback): HRESULT; stdcall; |
| 544 |
function GetFileTimeType(Type_: PCardinal): HRESULT; stdcall; |
| 545 |
end; |
| 546 |
|
| 547 |
ISetProperties = interface(IUnknown) |
| 548 |
['{23170F69-40C1-278A-0000-000600030000}'] |
| 549 |
function SetProperties(Names: PPWideChar; Values: PPropVariant; NumProperties: Integer): HRESULT; stdcall; |
| 550 |
end; |
| 551 |
|
| 552 |
// IPassword.h |
| 553 |
type |
| 554 |
ICryptoGetTextPassword = interface(IUnknown) |
| 555 |
['{23170F69-40C1-278A-0000-000500100000}'] |
| 556 |
function CryptoGetTextPassword(password: PBStr): HRESULT; stdcall; |
| 557 |
end; |
| 558 |
|
| 559 |
ICryptoGetTextPassword2 = interface(IUnknown) |
| 560 |
['{23170F69-40C1-278A-0000-000500110000}'] |
| 561 |
function CryptoGetTextPassword2(PasswordIsDefined: PInteger; |
| 562 |
Password: PBStr): HRESULT; stdcall; |
| 563 |
end; |
| 564 |
|
| 565 |
// ZipHandlerOut.cpp |
| 566 |
const |
| 567 |
kDeflateAlgoX1 = 0 {$IFDEF SUPPORTS_DEPRECATED} deprecated {$IFDEF SUPPORTS_DEPRECATED_DETAILS} 'Use kLzAlgoX1' {$ENDIF} {$ENDIF}; |
| 568 |
kLzAlgoX1 = 0; |
| 569 |
kDeflateAlgoX5 = 1 {$IFDEF SUPPORTS_DEPRECATED} deprecated {$IFDEF SUPPORTS_DEPRECATED_DETAILS} 'Use kLzAlgoX5' {$ENDIF} {$ENDIF}; |
| 570 |
kLzAlgoX5 = 1; |
| 571 |
|
| 572 |
kDeflateNumPassesX1 = 1; |
| 573 |
kDeflateNumPassesX7 = 3; |
| 574 |
kDeflateNumPassesX9 = 10; |
| 575 |
|
| 576 |
kNumFastBytesX1 = 32 {$IFDEF SUPPORTS_DEPRECATED} deprecated {$IFDEF SUPPORTS_DEPRECATED_DETAILS} 'Use kDeflateNumFastBytesX1' {$ENDIF} {$ENDIF}; |
| 577 |
kDeflateNumFastBytesX1 = 32; |
| 578 |
kNumFastBytesX7 = 64 {$IFDEF SUPPORTS_DEPRECATED} deprecated {$IFDEF SUPPORTS_DEPRECATED_DETAILS} 'Use kDeflateNumFastBytesX7' {$ENDIF} {$ENDIF}; |
| 579 |
kDeflateNumFastBytesX7 = 64; |
| 580 |
kNumFastBytesX9 = 128 {$IFDEF SUPPORTS_DEPRECATED} deprecated {$IFDEF SUPPORTS_DEPRECATED_DETAILS} 'Use kDeflateNumFastBytesX9' {$ENDIF} {$ENDIF}; |
| 581 |
kDeflateNumFastBytesX9 = 128; |
| 582 |
|
| 583 |
kLzmaNumFastBytesX1 = 32; |
| 584 |
kLzmaNumFastBytesX7 = 64; |
| 585 |
|
| 586 |
kBZip2NumPassesX1 = 1; |
| 587 |
kBZip2NumPassesX7 = 2; |
| 588 |
kBZip2NumPassesX9 = 7; |
| 589 |
|
| 590 |
kBZip2DicSizeX1 = 100000; |
| 591 |
kBZip2DicSizeX3 = 500000; |
| 592 |
kBZip2DicSizeX5 = 900000; |
| 593 |
|
| 594 |
// HandlerOut.cpp |
| 595 |
const |
| 596 |
kLzmaAlgoX1 = 0; |
| 597 |
kLzmaAlgoX5 = 1; |
| 598 |
|
| 599 |
kLzmaDicSizeX1 = 1 shl 16; |
| 600 |
kLzmaDicSizeX3 = 1 shl 20; |
| 601 |
kLzmaDicSizeX5 = 1 shl 24; |
| 602 |
kLzmaDicSizeX7 = 1 shl 25; |
| 603 |
kLzmaDicSizeX9 = 1 shl 26; |
| 604 |
|
| 605 |
kLzmaFastBytesX1 = 32; |
| 606 |
kLzmaFastBytesX7 = 64; |
| 607 |
|
| 608 |
kPpmdMemSizeX1 = (1 shl 22); |
| 609 |
kPpmdMemSizeX5 = (1 shl 24); |
| 610 |
kPpmdMemSizeX7 = (1 shl 26); |
| 611 |
kPpmdMemSizeX9 = (192 shl 20); |
| 612 |
|
| 613 |
kPpmdOrderX1 = 4; |
| 614 |
kPpmdOrderX5 = 6; |
| 615 |
kPpmdOrderX7 = 16; |
| 616 |
kPpmdOrderX9 = 32; |
| 617 |
|
| 618 |
kDeflateFastBytesX1 = 32; |
| 619 |
kDeflateFastBytesX7 = 64; |
| 620 |
kDeflateFastBytesX9 = 128; |
| 621 |
|
| 622 |
{$IFDEF 7ZIP_LINKONREQUEST} |
| 623 |
type |
| 624 |
TCreateObjectFunc = function (ClsID: PGUID; IID: PGUID; out Obj): HRESULT; stdcall; |
| 625 |
TGetHandlerProperty2 = function (FormatIndex: Cardinal; PropID: TPropID; out Value: TPropVariant): HRESULT; stdcall; |
| 626 |
TGetHandlerProperty = function (PropID: TPropID; out Value: TPropVariant): HRESULT; stdcall; |
| 627 |
TGetMethodProperty = function (CodecIndex: Cardinal; PropID: TPropID; out Value: TPropVariant): HRESULT; stdcall; |
| 628 |
TGetNumberOfFormatsFunc = function (NumFormats: PCardinal): HRESULT; stdcall; |
| 629 |
TGetNumberOfMethodsFunc = function (NumMethods: PCardinal): HRESULT; stdcall; |
| 630 |
TSetLargePageMode = function: HRESULT; stdcall; |
| 631 |
|
| 632 |
var |
| 633 |
CreateObject: TCreateObjectFunc = nil; |
| 634 |
GetHandlerProperty2: TGetHandlerProperty2 = nil; |
| 635 |
GetHandlerProperty: TGetHandlerProperty = nil; |
| 636 |
GetMethodProperty: TGetMethodProperty = nil; |
| 637 |
GetNumberOfFormats: TGetNumberOfFormatsFunc = nil; |
| 638 |
GetNumberOfMethods: TGetNumberOfMethodsFunc = nil; |
| 639 |
SetLargePageMode: TSetLargePageMode = nil; |
| 640 |
{$ELSE ~7ZIP_LINKONREQUEST} |
| 641 |
function CreateObject(ClsID: PGUID; IID: PGUID; out Obj): HRESULT; stdcall; |
| 642 |
function GetHandlerProperty2(FormatIndex: Cardinal; PropID: TPropID; out Value: TPropVariant): HRESULT; stdcall; |
| 643 |
function GetHandlerProperty(PropID: TPropID; out Value: TPropVariant): HRESULT; stdcall; |
| 644 |
function GetMethodProperty(CodecIndex: Cardinal; PropID: TPropID; out Value: TPropVariant): HRESULT; stdcall; |
| 645 |
function GetNumberOfFormats(NumFormats: PCardinal): HRESULT; stdcall; |
| 646 |
function GetNumberOfMethods(NumMethods: PCardinal): HRESULT; stdcall; |
| 647 |
function SetLargePageMode: HRESULT; stdcall; |
| 648 |
{$ENDIF ~7ZIP_LINKONREQUEST} |
| 649 |
|
| 650 |
//DOM-IGNORE-END |
| 651 |
|
| 652 |
const |
| 653 |
SevenzipDefaultLibraryName = '7z.dll'; |
| 654 |
CreateObjectDefaultExportName = 'CreateObject'; |
| 655 |
GetHandlerProperty2DefaultExportName = 'GetHandlerProperty2'; |
| 656 |
GetHandlerPropertyDefaultExportName = 'GetHandlerProperty'; |
| 657 |
GetMethodPropertyDefaultExportName = 'GetMethodProperty'; |
| 658 |
GetNumberOfFormatsDefaultExportName = 'GetNumberOfFormats'; |
| 659 |
GetNumberOfMethodsDefaultExportName = 'GetNumberOfMethods'; |
| 660 |
SetLargePageModeDefaultExportName = 'SetLargePageMode'; |
| 661 |
|
| 662 |
{$IFDEF 7ZIP_LINKONREQUEST} |
| 663 |
var |
| 664 |
SevenzipLibraryName: string = SevenzipDefaultLibraryName; |
| 665 |
CreateObjectExportName: string = CreateObjectDefaultExportName; |
| 666 |
GetHandlerProperty2ExportName: string = GetHandlerProperty2DefaultExportName; |
| 667 |
GetHandlerPropertyExportName: string = GetHandlerPropertyDefaultExportName; |
| 668 |
GetMethodPropertyExportName: string = GetMethodPropertyDefaultExportName; |
| 669 |
GetNumberOfFormatsExportName: string = GetNumberOfFormatsDefaultExportName; |
| 670 |
GetNumberOfMethodsExportName: string = GetNumberOfMethodsDefaultExportName; |
| 671 |
SetLargePageModeExportName: string = SetLargePageModeDefaultExportName; |
| 672 |
SevenzipLibraryHandle: TModuleHandle = INVALID_MODULEHANDLE_VALUE; |
| 673 |
{$ENDIF 7ZIP_LINKONREQUEST} |
| 674 |
|
| 675 |
function Load7Zip: Boolean; |
| 676 |
function Is7ZipLoaded: Boolean; |
| 677 |
procedure Unload7Zip; |
| 678 |
|
| 679 |
{$IFDEF UNITVERSIONING} |
| 680 |
const |
| 681 |
UnitVersioning: TUnitVersionInfo = ( |
| 682 |
RCSfile: '$URL$'; |
| 683 |
Revision: '$Revision$'; |
| 684 |
Date: '$Date$'; |
| 685 |
LogPath: 'JCL\source\windows'; |
| 686 |
Extra: ''; |
| 687 |
Data: nil |
| 688 |
); |
| 689 |
{$ENDIF UNITVERSIONING} |
| 690 |
|
| 691 |
implementation |
| 692 |
|
| 693 |
{$IFDEF 7ZIP_LINKDLL} |
| 694 |
function CreateObject; external SevenzipDefaultLibraryName name CreateObjectDefaultExportName; |
| 695 |
function GetHandlerProperty2; external SevenzipDefaultLibraryName name GetHandlerProperty2DefaultExportName; |
| 696 |
function GetHandlerProperty; external SevenzipDefaultLibraryName name GetHandlerPropertyDefaultExportName; |
| 697 |
function GetMethodProperty; external SevenzipDefaultLibraryName name GetMethodPropertyDefaultExportName; |
| 698 |
function GetNumberOfFormats; external SevenzipDefaultLibraryName name GetNumberOfFormatsDefaultExportName; |
| 699 |
function GetNumberOfMethods; external SevenzipDefaultLibraryName name GetNumberOfMethodsDefaultExportName; |
| 700 |
function SetLargePageMode; external SevenzipDefaultLibraryName name SetLargePageModeDefaultExportName; |
| 701 |
{$ENDIF 7ZIP_LINKDLL} |
| 702 |
|
| 703 |
function Load7Zip: Boolean; |
| 704 |
{$IFDEF 7ZIP_LINKONREQUEST} |
| 705 |
begin |
| 706 |
Result := SevenzipLibraryHandle <> INVALID_MODULEHANDLE_VALUE; |
| 707 |
if Result then |
| 708 |
Exit; |
| 709 |
|
| 710 |
Result := JclSysUtils.LoadModule(SevenzipLibraryHandle, SevenzipLibraryName); |
| 711 |
if Result then |
| 712 |
begin |
| 713 |
@CreateObject := GetModuleSymbol(SevenzipLibraryHandle, CreateObjectExportName); |
| 714 |
@GetHandlerProperty2 := GetModuleSymbol(SevenzipLibraryHandle, GetHandlerProperty2ExportName); |
| 715 |
@GetHandlerProperty := GetModuleSymbol(SevenzipLibraryHandle, GetHandlerPropertyExportName); |
| 716 |
@GetMethodProperty := GetModuleSymbol(SevenzipLibraryHandle, GetMethodPropertyExportName); |
| 717 |
@GetNumberOfFormats := GetModuleSymbol(SevenzipLibraryHandle, GetNumberOfFormatsExportName); |
| 718 |
@GetNumberOfMethods := GetModuleSymbol(SevenzipLibraryHandle, GetNumberOfMethodsExportName); |
| 719 |
@SetLargePageMode := GetModuleSymbol(SevenzipLibraryHandle, SetLargePageModeExportName); |
| 720 |
Result := Assigned(@CreateObject) and Assigned(@GetHandlerProperty2) and |
| 721 |
Assigned(@GetHandlerProperty) and Assigned(@GetMethodProperty) and |
| 722 |
Assigned(@GetNumberOfFormats) and Assigned(@GetNumberOfMethods) and |
| 723 |
Assigned(@SetLargePageMode); |
| 724 |
end; |
| 725 |
end; |
| 726 |
{$ELSE ~7ZIP_LINKONREQUEST} |
| 727 |
begin |
| 728 |
Result := True; |
| 729 |
end; |
| 730 |
{$ENDIF ~7ZIP_LINKONREQUEST} |
| 731 |
|
| 732 |
function Is7ZipLoaded: Boolean; |
| 733 |
begin |
| 734 |
{$IFDEF 7ZIP_LINKONREQUEST} |
| 735 |
Result := SevenzipLibraryHandle <> INVALID_MODULEHANDLE_VALUE; |
| 736 |
{$ELSE ~7ZIP_LINKONREQUEST} |
| 737 |
Result := True; |
| 738 |
{$ENDIF ~7ZIP_LINKONREQUEST} |
| 739 |
end; |
| 740 |
|
| 741 |
procedure Unload7Zip; |
| 742 |
begin |
| 743 |
{$IFDEF 7ZIP_LINKONREQUEST} |
| 744 |
@CreateObject := nil; |
| 745 |
@GetHandlerProperty2 := nil; |
| 746 |
@GetHandlerProperty := nil; |
| 747 |
@GetMethodProperty := nil; |
| 748 |
@GetNumberOfFormats := nil; |
| 749 |
@GetNumberOfMethods := nil; |
| 750 |
@SetLargePageMode := nil; |
| 751 |
JclSysUtils.UnloadModule(SevenzipLibraryHandle); |
| 752 |
{$ENDIF 7ZIP_LINKONREQUEST} |
| 753 |
end; |
| 754 |
|
| 755 |
{$IFDEF UNITVERSIONING} |
| 756 |
initialization |
| 757 |
RegisterUnitVersion(HInstance, UnitVersioning); |
| 758 |
|
| 759 |
finalization |
| 760 |
UnregisterUnitVersion(HInstance); |
| 761 |
{$ENDIF UNITVERSIONING} |
| 762 |
|
| 763 |
end. |