diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2007-04-17 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:50 +0300 |
commit | a145bfc7cf17f7bbcfae8f0064333c8ea75b455c (patch) | |
tree | 4ea458c9f35956fe080562989a702ea8c9af4b90 /CPP/7zip/UI/GUI/GUI.cpp | |
parent | d9666cf046a8453b33b3e2fbf4d82295a9f87df3 (diff) |
4.45 beta
Diffstat (limited to 'CPP/7zip/UI/GUI/GUI.cpp')
-rwxr-xr-x | CPP/7zip/UI/GUI/GUI.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/CPP/7zip/UI/GUI/GUI.cpp b/CPP/7zip/UI/GUI/GUI.cpp index fe956dbd..ad58a451 100755 --- a/CPP/7zip/UI/GUI/GUI.cpp +++ b/CPP/7zip/UI/GUI/GUI.cpp @@ -4,6 +4,11 @@ #include <initguid.h> +extern "C" +{ + #include "../../../../C/Alloc.h" +} + #include "Common/NewHandler.h" #include "Common/StringConvert.h" #include "Common/CommandLineParser.h" @@ -17,7 +22,6 @@ #include "Windows/FileName.h" #ifdef _WIN32 #include "Windows/MemoryLock.h" -#include "Common/Alloc.h" #endif #include "../../IStream.h" @@ -33,6 +37,7 @@ #include "ExtractGUI.h" #include "UpdateGUI.h" +#include "Resource/BenchmarkDialog/BenchmarkDialog.h" using namespace NWindows; @@ -83,10 +88,26 @@ int Main2() if (options.LargePages) NSecurity::EnableLockMemoryPrivilege(); #endif + + CCodecs *codecs = new CCodecs; + CMyComPtr<IUnknown> compressCodecsInfo = codecs; + HRESULT result = codecs->Load(); + if (result != S_OK) + throw CSystemException(result); bool isExtractGroupCommand = options.Command.IsFromExtractGroup(); - if (isExtractGroupCommand) + if (options.Command.CommandType == NCommandType::kBenchmark) + { + HRESULT res = Benchmark( + #ifdef EXTERNAL_LZMA + codecs, + #endif + options.NumThreads, options.DictionarySize); + if (res != S_OK) + throw CSystemException(res); + } + else if (isExtractGroupCommand) { CExtractCallbackImp *ecs = new CExtractCallbackImp; CMyComPtr<IFolderArchiveExtractCallback> extractCallback = ecs; @@ -109,7 +130,7 @@ int Main2() eo.Properties = options.ExtractProperties; #endif - HRESULT result = ExtractGUI( + HRESULT result = ExtractGUI(codecs, options.ArchivePathsSorted, options.ArchivePathsFullSorted, options.WildcardCensor.Pairs.Front().Head, @@ -138,7 +159,10 @@ int Main2() CUpdateErrorInfo errorInfo; + if (!options.UpdateOptions.Init(codecs, options.ArchiveName, options.ArcType)) + throw "Unsupported archive type"; HRESULT result = UpdateGUI( + codecs, options.WildcardCensor, options.UpdateOptions, options.ShowDialog, errorInfo, &openCallback, &callback); |