diff options
Diffstat (limited to 'CPP/7zip')
-rwxr-xr-x | CPP/7zip/Archive/7z/7zEncode.cpp | 20 | ||||
-rwxr-xr-x | CPP/7zip/Archive/7z/7zExtract.cpp | 28 | ||||
-rwxr-xr-x | CPP/7zip/Archive/7z/7zHandler.cpp | 123 | ||||
-rwxr-xr-x | CPP/7zip/Archive/7z/7zItem.h | 7 | ||||
-rwxr-xr-x | CPP/7zip/Archive/7z/7zProperties.cpp | 8 | ||||
-rwxr-xr-x | CPP/7zip/Archive/7z/7zUpdate.cpp | 98 | ||||
-rwxr-xr-x | CPP/7zip/Archive/ArchiveExports.cpp | 14 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Arj/ArjHandler.cpp | 341 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Arj/ArjHandler.h | 1 | ||||
-rwxr-xr-x | CPP/7zip/Archive/BZip2/BZip2Handler.cpp | 110 | ||||
-rwxr-xr-x | CPP/7zip/Archive/BZip2/BZip2HandlerOut.cpp | 21 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Cab/CabHandler.cpp | 151 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Chm/ChmHandler.cpp | 172 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Com/ComHandler.cpp | 65 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Com/ComIn.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Com/ComRegister.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Common/CoderMixer2MT.cpp | 24 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Common/CoderMixer2MT.h | 1 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Common/CoderMixerMT.cpp | 24 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Common/CoderMixerMT.h | 1 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Common/DummyOutStream.cpp | 24 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Common/DummyOutStream.h | 10 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Cpio/CpioHandler.cpp | 182 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Cpio/CpioHandler.h | 4 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Deb/DebHandler.cpp | 151 | ||||
-rwxr-xr-x | CPP/7zip/Archive/GZip/GZipHandler.cpp | 153 | ||||
-rwxr-xr-x | CPP/7zip/Archive/GZip/GZipHandlerOut.cpp | 46 | ||||
-rwxr-xr-x | CPP/7zip/Archive/GZip/GZipUpdate.cpp | 18 | ||||
-rwxr-xr-x | CPP/7zip/Archive/IArchive.h | 44 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Iso/IsoHandler.cpp | 122 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Lzh/LzhHandler.cpp | 215 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Nsis/NsisHandler.cpp | 121 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Nsis/NsisHandler.h | 1 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Nsis/NsisIn.cpp | 4 | ||||
-rwxr-xr-x | CPP/7zip/Archive/RPM/RpmHandler.cpp | 82 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Rar/RarHandler.cpp | 276 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Rar/RarIn.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Rar/RarIn.h | 4 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Rar/RarRegister.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Split/SplitHandler.cpp | 115 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Split/SplitHandlerOut.cpp | 28 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Tar/TarHandler.cpp | 155 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Tar/TarHandlerOut.cpp | 46 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Tar/TarUpdate.cpp | 79 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Wim/WimHandler.cpp | 197 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Wim/WimIn.h | 17 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Z/DllExports.cpp | 91 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Z/ZHandler.cpp | 91 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Zip/ZipHandler.cpp | 108 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Zip/ZipIn.cpp | 4 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Zip/ZipItem.h | 2 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Zip/ZipUpdate.cpp | 139 | ||||
-rwxr-xr-x | CPP/7zip/Bundles/Format7zF/Format7z.dsp | 8 | ||||
-rwxr-xr-x | CPP/7zip/Bundles/SFXCon/Main.cpp | 3 | ||||
-rwxr-xr-x | CPP/7zip/Bundles/SFXSetup/ExtractCallback.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/Bundles/SFXSetup/ExtractCallback.h | 2 | ||||
-rwxr-xr-x | CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp | 8 | ||||
-rwxr-xr-x | CPP/7zip/Bundles/SFXSetup/makefile | 6 | ||||
-rwxr-xr-x | CPP/7zip/Bundles/SFXSetup/resource.rc | 2 | ||||
-rwxr-xr-x | CPP/7zip/Bundles/SFXWin/SFXWin.dsp | 24 | ||||
-rwxr-xr-x | CPP/7zip/Bundles/SFXWin/makefile | 18 | ||||
-rwxr-xr-x | CPP/7zip/Bundles/SFXWin/resource.rc | 10 | ||||
-rwxr-xr-x | CPP/7zip/Common/FileStreams.cpp | 27 | ||||
-rwxr-xr-x | CPP/7zip/Common/FileStreams.h | 38 | ||||
-rwxr-xr-x | CPP/7zip/Common/OutBuffer.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/Common/ProgressUtils.cpp | 61 | ||||
-rwxr-xr-x | CPP/7zip/Common/ProgressUtils.h | 26 | ||||
-rwxr-xr-x | CPP/7zip/Common/StreamUtils.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/Compress/Branch/x86_2.cpp | 16 | ||||
-rwxr-xr-x | CPP/7zip/Compress/Copy/CopyCoder.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/Compress/Rar/Rar1Decoder.cpp | 12 | ||||
-rwxr-xr-x | CPP/7zip/Compress/Rar/Rar2Decoder.cpp | 1 | ||||
-rwxr-xr-x | CPP/7zip/Compress/Rar/Rar3Decoder.cpp | 5 | ||||
-rwxr-xr-x | CPP/7zip/Compress/Rar/Rar3Decoder.h | 7 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/IFolder.h | 195 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/PhysDriveFolder.h | 86 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/AboutDialog/7zipLogo.ico | bin | 9150 -> 0 bytes | |||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/AboutDialog/StdAfx.h | 16 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/ComboDialog/StdAfx.h | 16 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/CopyDialog/StdAfx.h | 16 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/EditPage/StdAfx.h | 16 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/LangPage/StdAfx.h | 16 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/ListBoxDialog/StdAfx.h | 16 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/ListBoxDialog/resource.h | 3 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/ListBoxDialog/resource.rc | 22 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/ListViewDialog/StdAfx.h | 16 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/MessagesDialog/StdAfx.h | 16 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/OverwriteDialog/StdAfx.h | 16 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/PasswordDialog/StdAfx.h | 16 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/PluginsPage/StdAfx.h | 16 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/ProgressDialog/StdAfx.h | 16 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/ProgressDialog2/StdAfx.h | 16 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/ProgressDialog2/resource.rc | 56 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/SettingsPage/StdAfx.h | 16 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/SplitDialog/StdAfx.h | 18 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/Resource/SystemPage/StdAfx.h | 16 | ||||
-rwxr-xr-x | CPP/7zip/FileManager/RootFolder.h | 49 | ||||
-rwxr-xr-x | CPP/7zip/Guid.txt | 190 | ||||
-rwxr-xr-x | CPP/7zip/ICoder.h | 6 | ||||
-rwxr-xr-x | CPP/7zip/IDecl.h | 15 | ||||
-rwxr-xr-x | CPP/7zip/IPassword.h | 8 | ||||
-rwxr-xr-x | CPP/7zip/IProgress.h | 8 | ||||
-rwxr-xr-x | CPP/7zip/IStream.h | 8 | ||||
-rwxr-xr-x | CPP/7zip/MyVersion.h | 10 | ||||
-rwxr-xr-x | CPP/7zip/PropID.h | 9 | ||||
-rwxr-xr-x | CPP/7zip/UI/Agent/Agent.cpp | 206 | ||||
-rwxr-xr-x | CPP/7zip/UI/Agent/Agent.h | 110 | ||||
-rwxr-xr-x | CPP/7zip/UI/Agent/AgentOut.cpp | 24 | ||||
-rwxr-xr-x | CPP/7zip/UI/Agent/AgentProxy.cpp | 90 | ||||
-rwxr-xr-x | CPP/7zip/UI/Agent/AgentProxy.h | 27 | ||||
-rwxr-xr-x | CPP/7zip/UI/Agent/ArchiveFolder.cpp | 7 | ||||
-rwxr-xr-x | CPP/7zip/UI/Agent/ArchiveFolderOut.cpp | 14 | ||||
-rwxr-xr-x | CPP/7zip/UI/Agent/IFolderArchive.h | 122 | ||||
-rwxr-xr-x | CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp | 28 | ||||
-rwxr-xr-x | CPP/7zip/UI/Agent/UpdateCallbackAgent.h | 13 | ||||
-rwxr-xr-x | CPP/7zip/UI/Client7z/Client7z.cpp | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/Common/ArchiveExtractCallback.cpp | 113 | ||||
-rwxr-xr-x | CPP/7zip/UI/Common/ArchiveExtractCallback.h | 35 | ||||
-rwxr-xr-x | CPP/7zip/UI/Common/CompressCall.cpp | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/Common/Extract.cpp | 52 | ||||
-rwxr-xr-x | CPP/7zip/UI/Common/Extract.h | 13 | ||||
-rwxr-xr-x | CPP/7zip/UI/Common/IFileExtractCallback.h | 9 | ||||
-rwxr-xr-x | CPP/7zip/UI/Common/OpenArchive.cpp | 27 | ||||
-rwxr-xr-x | CPP/7zip/UI/Common/Update.cpp | 10 | ||||
-rwxr-xr-x | CPP/7zip/UI/Common/Update.h | 18 | ||||
-rwxr-xr-x | CPP/7zip/UI/Common/UpdateCallback.cpp | 8 | ||||
-rwxr-xr-x | CPP/7zip/UI/Common/UpdateCallback.h | 33 | ||||
-rwxr-xr-x | CPP/7zip/UI/Console/Console.dsp | 8 | ||||
-rwxr-xr-x | CPP/7zip/UI/Console/ExtractCallbackConsole.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/Console/ExtractCallbackConsole.h | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/Console/List.cpp | 67 | ||||
-rwxr-xr-x | CPP/7zip/UI/Console/Main.cpp | 14 | ||||
-rwxr-xr-x | CPP/7zip/UI/Console/UpdateCallbackConsole.cpp | 14 | ||||
-rwxr-xr-x | CPP/7zip/UI/Console/UpdateCallbackConsole.h | 19 | ||||
-rwxr-xr-x | CPP/7zip/UI/Console/makefile | 1 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/ContextMenu.cpp | 10 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/ContextMenu.h | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/DllExports.cpp | 28 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/Explorer.dsp | 288 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/FoldersPage.cpp (renamed from CPP/7zip/UI/Explorer/FoldersPage/FoldersPage.cpp) | 8 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/FoldersPage.h (renamed from CPP/7zip/UI/Explorer/FoldersPage/FoldersPage.h) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/FoldersPage.rc (renamed from CPP/7zip/UI/Explorer/FoldersPage/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/FoldersPageRes.h (renamed from CPP/7zip/UI/Explorer/FoldersPage/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/MyMessages.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/OptionsDialog.cpp | 10 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/OptionsDialog.h | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/SystemPage.cpp (renamed from CPP/7zip/UI/Explorer/SystemPage/SystemPage.cpp) | 33 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/SystemPage.h (renamed from CPP/7zip/UI/Explorer/SystemPage/SystemPage.h) | 6 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/SystemPage.rc (renamed from CPP/7zip/UI/Explorer/SystemPage/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/SystemPageRes.h (renamed from CPP/7zip/UI/Explorer/SystemPage/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/makefile | 56 | ||||
-rwxr-xr-x | CPP/7zip/UI/Explorer/resource.rc | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/ExtractEngine.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/ExtractEngine.h | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/Far.dsp | 8 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/FarPlugin.h | 5 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/Messages.h | 9 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/Plugin.cpp | 196 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/Plugin.h | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/UpdateCallback100.cpp | 5 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/UpdateCallback100.h | 1 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/makefile | 1 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/7zFM.exe.manifest (renamed from CPP/7zip/FileManager/7zFM.exe.manifest) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/7zipLogo.ico (renamed from CPP/7zip/FileManager/7zipLogo.ico) | bin | 9150 -> 9150 bytes | |||
-rwxr-xr-x | CPP/7zip/UI/FileManager/AboutDialog.cpp (renamed from CPP/7zip/FileManager/Resource/AboutDialog/AboutDialog.cpp) | 6 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/AboutDialog.h (renamed from CPP/7zip/FileManager/Resource/AboutDialog/AboutDialog.h) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/AboutDialog.rc (renamed from CPP/7zip/FileManager/Resource/AboutDialog/resource.rc) | 6 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/AboutDialogRes.h (renamed from CPP/7zip/FileManager/Resource/AboutDialog/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Add.bmp (renamed from CPP/7zip/FileManager/Add.bmp) | bin | 982 -> 982 bytes | |||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Add2.bmp (renamed from CPP/7zip/FileManager/Add2.bmp) | bin | 406 -> 406 bytes | |||
-rwxr-xr-x | CPP/7zip/UI/FileManager/App.cpp (renamed from CPP/7zip/FileManager/App.cpp) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/App.h (renamed from CPP/7zip/FileManager/App.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/AppState.h (renamed from CPP/7zip/FileManager/AppState.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ClassDefs.cpp (renamed from CPP/7zip/FileManager/ClassDefs.cpp) | 6 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ComboDialog.cpp (renamed from CPP/7zip/FileManager/Resource/ComboDialog/ComboDialog.cpp) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ComboDialog.h (renamed from CPP/7zip/FileManager/Resource/ComboDialog/ComboDialog.h) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ComboDialog.rc (renamed from CPP/7zip/FileManager/Resource/ComboDialog/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ComboDialogRes.h (renamed from CPP/7zip/FileManager/Resource/ComboDialog/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Copy.bmp (renamed from CPP/7zip/FileManager/Copy.bmp) | bin | 982 -> 982 bytes | |||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Copy2.bmp (renamed from CPP/7zip/FileManager/Copy2.bmp) | bin | 406 -> 406 bytes | |||
-rwxr-xr-x | CPP/7zip/UI/FileManager/CopyDialog.cpp (renamed from CPP/7zip/FileManager/Resource/CopyDialog/CopyDialog.cpp) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/CopyDialog.h (renamed from CPP/7zip/FileManager/Resource/CopyDialog/CopyDialog.h) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/CopyDialog.rc (renamed from CPP/7zip/FileManager/Resource/CopyDialog/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/CopyDialogRes.h (renamed from CPP/7zip/FileManager/Resource/CopyDialog/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Delete.bmp (renamed from CPP/7zip/FileManager/Delete.bmp) | bin | 982 -> 982 bytes | |||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Delete2.bmp (renamed from CPP/7zip/FileManager/Delete2.bmp) | bin | 406 -> 406 bytes | |||
-rwxr-xr-x | CPP/7zip/UI/FileManager/EditPage.cpp (renamed from CPP/7zip/FileManager/Resource/EditPage/EditPage.cpp) | 10 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/EditPage.h (renamed from CPP/7zip/FileManager/Resource/EditPage/EditPage.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/EditPage.rc (renamed from CPP/7zip/FileManager/Resource/EditPage/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/EditPageRes.h (renamed from CPP/7zip/FileManager/Resource/EditPage/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/EnumFormatEtc.cpp (renamed from CPP/7zip/FileManager/EnumFormatEtc.cpp) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/EnumFormatEtc.h (renamed from CPP/7zip/FileManager/EnumFormatEtc.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Extract.bmp (renamed from CPP/7zip/FileManager/Extract.bmp) | bin | 982 -> 982 bytes | |||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Extract2.bmp (renamed from CPP/7zip/FileManager/Extract2.bmp) | bin | 406 -> 406 bytes | |||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ExtractCallback.cpp (renamed from CPP/7zip/FileManager/ExtractCallback.cpp) | 82 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ExtractCallback.h (renamed from CPP/7zip/FileManager/ExtractCallback.h) | 45 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FM.cpp (renamed from CPP/7zip/FileManager/FM.cpp) | 8 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FM.dsp (renamed from CPP/7zip/FileManager/FM.dsp) | 586 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FM.dsw (renamed from CPP/7zip/FileManager/FM.dsw) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FM.ico (renamed from CPP/7zip/FileManager/FM.ico) | bin | 4846 -> 4846 bytes | |||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FSDrives.cpp (renamed from CPP/7zip/FileManager/FSDrives.cpp) | 30 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FSDrives.h (renamed from CPP/7zip/FileManager/FSDrives.h) | 21 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FSFolder.cpp (renamed from CPP/7zip/FileManager/FSFolder.cpp) | 85 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FSFolder.h (renamed from CPP/7zip/FileManager/FSFolder.h) | 39 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FSFolderCopy.cpp (renamed from CPP/7zip/FileManager/FSFolderCopy.cpp) | 69 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp (renamed from CPP/7zip/FileManager/FileFolderPluginOpen.cpp) | 11 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FileFolderPluginOpen.h (renamed from CPP/7zip/FileManager/FileFolderPluginOpen.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FilePlugins.cpp (renamed from CPP/7zip/FileManager/FilePlugins.cpp) | 9 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FilePlugins.h (renamed from CPP/7zip/FileManager/FilePlugins.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FormatUtils.cpp (renamed from CPP/7zip/FileManager/FormatUtils.cpp) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FormatUtils.h (renamed from CPP/7zip/FileManager/FormatUtils.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/HelpUtils.cpp (renamed from CPP/7zip/FileManager/HelpUtils.cpp) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/HelpUtils.h (renamed from CPP/7zip/FileManager/HelpUtils.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/IFolder.h | 145 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Info.bmp (renamed from CPP/7zip/FileManager/Info.bmp) | bin | 982 -> 982 bytes | |||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Info2.bmp (renamed from CPP/7zip/FileManager/Info2.bmp) | bin | 406 -> 406 bytes | |||
-rwxr-xr-x | CPP/7zip/UI/FileManager/LangPage.cpp (renamed from CPP/7zip/FileManager/Resource/LangPage/LangPage.cpp) | 8 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/LangPage.h (renamed from CPP/7zip/FileManager/Resource/LangPage/LangPage.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/LangPage.rc (renamed from CPP/7zip/FileManager/Resource/LangPage/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/LangPageRes.h (renamed from CPP/7zip/FileManager/Resource/LangPage/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/LangUtils.cpp (renamed from CPP/7zip/FileManager/LangUtils.cpp) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/LangUtils.h (renamed from CPP/7zip/FileManager/LangUtils.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ListViewDialog.cpp (renamed from CPP/7zip/FileManager/Resource/ListViewDialog/ListViewDialog.cpp) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ListViewDialog.h (renamed from CPP/7zip/FileManager/Resource/ListViewDialog/ListViewDialog.h) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ListViewDialog.rc (renamed from CPP/7zip/FileManager/Resource/ListViewDialog/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ListViewDialogRes.h (renamed from CPP/7zip/FileManager/Resource/ListViewDialog/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/MessagesDialog.cpp (renamed from CPP/7zip/FileManager/Resource/MessagesDialog/MessagesDialog.cpp) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/MessagesDialog.h (renamed from CPP/7zip/FileManager/Resource/MessagesDialog/MessagesDialog.h) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/MessagesDialog.rc (renamed from CPP/7zip/FileManager/Resource/MessagesDialog/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/MessagesDialogRes.h (renamed from CPP/7zip/FileManager/Resource/MessagesDialog/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Move.bmp (renamed from CPP/7zip/FileManager/Move.bmp) | bin | 982 -> 982 bytes | |||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Move2.bmp (renamed from CPP/7zip/FileManager/Move2.bmp) | bin | 406 -> 406 bytes | |||
-rwxr-xr-x | CPP/7zip/UI/FileManager/MyCom2.h (renamed from CPP/7zip/FileManager/MyCom2.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/MyLoadMenu.cpp (renamed from CPP/7zip/FileManager/MyLoadMenu.cpp) | 6 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/MyLoadMenu.h (renamed from CPP/7zip/FileManager/MyLoadMenu.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/NetFolder.cpp (renamed from CPP/7zip/FileManager/NetFolder.cpp) | 33 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/NetFolder.h (renamed from CPP/7zip/FileManager/NetFolder.h) | 21 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/OpenCallback.cpp (renamed from CPP/7zip/FileManager/OpenCallback.cpp) | 6 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/OpenCallback.h (renamed from CPP/7zip/FileManager/OpenCallback.h) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/OptionsDialog.cpp (renamed from CPP/7zip/FileManager/OptionsDialog.cpp) | 20 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/OverwriteDialog.cpp (renamed from CPP/7zip/FileManager/Resource/OverwriteDialog/OverwriteDialog.cpp) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/OverwriteDialog.h (renamed from CPP/7zip/FileManager/Resource/OverwriteDialog/OverwriteDialog.h) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/OverwriteDialog.rc (renamed from CPP/7zip/FileManager/Resource/OverwriteDialog/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/OverwriteDialogRes.h (renamed from CPP/7zip/FileManager/Resource/OverwriteDialog/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Panel.cpp (renamed from CPP/7zip/FileManager/Panel.cpp) | 139 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Panel.h (renamed from CPP/7zip/FileManager/Panel.h) | 1 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelCopy.cpp (renamed from CPP/7zip/FileManager/PanelCopy.cpp) | 5 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelCrc.cpp (renamed from CPP/7zip/FileManager/PanelCrc.cpp) | 8 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelDrag.cpp (renamed from CPP/7zip/FileManager/PanelDrag.cpp) | 6 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelFolderChange.cpp (renamed from CPP/7zip/FileManager/PanelFolderChange.cpp) | 17 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelItemOpen.cpp (renamed from CPP/7zip/FileManager/PanelItemOpen.cpp) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelItems.cpp (renamed from CPP/7zip/FileManager/PanelItems.cpp) | 64 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelKey.cpp (renamed from CPP/7zip/FileManager/PanelKey.cpp) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelListNotify.cpp (renamed from CPP/7zip/FileManager/PanelListNotify.cpp) | 6 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelMenu.cpp (renamed from CPP/7zip/FileManager/PanelMenu.cpp) | 154 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelOperations.cpp (renamed from CPP/7zip/FileManager/PanelOperations.cpp) | 53 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelSelect.cpp (renamed from CPP/7zip/FileManager/PanelSelect.cpp) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelSort.cpp (renamed from CPP/7zip/FileManager/PanelSort.cpp) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelSplitFile.cpp (renamed from CPP/7zip/FileManager/PanelSplitFile.cpp) | 12 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PasswordDialog.cpp (renamed from CPP/7zip/FileManager/Resource/PasswordDialog/PasswordDialog.cpp) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PasswordDialog.h (renamed from CPP/7zip/FileManager/Resource/PasswordDialog/PasswordDialog.h) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PasswordDialog.rc (renamed from CPP/7zip/FileManager/Resource/PasswordDialog/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PasswordDialogRes.h (renamed from CPP/7zip/FileManager/Resource/PasswordDialog/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PhysDriveFolder.cpp (renamed from CPP/7zip/FileManager/PhysDriveFolder.cpp) | 26 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PhysDriveFolder.h | 58 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PluginInterface.h (renamed from CPP/7zip/FileManager/PluginInterface.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PluginLoader.h (renamed from CPP/7zip/FileManager/PluginLoader.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PluginsPage.cpp (renamed from CPP/7zip/FileManager/Resource/PluginsPage/PluginsPage.cpp) | 17 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PluginsPage.h (renamed from CPP/7zip/FileManager/Resource/PluginsPage/PluginsPage.h) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PluginsPage.rc (renamed from CPP/7zip/FileManager/Resource/PluginsPage/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PluginsPageRes.h (renamed from CPP/7zip/FileManager/Resource/PluginsPage/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ProgramLocation.cpp (renamed from CPP/7zip/FileManager/ProgramLocation.cpp) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ProgramLocation.h (renamed from CPP/7zip/FileManager/ProgramLocation.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ProgressDialog.cpp (renamed from CPP/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.cpp) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ProgressDialog.h (renamed from CPP/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.h) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ProgressDialog.rc (renamed from CPP/7zip/FileManager/Resource/ProgressDialog/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ProgressDialog2.cpp (renamed from CPP/7zip/FileManager/Resource/ProgressDialog2/ProgressDialog.cpp) | 95 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ProgressDialog2.h (renamed from CPP/7zip/FileManager/Resource/ProgressDialog2/ProgressDialog.h) | 55 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ProgressDialog2.rc | 77 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ProgressDialog2Res.h (renamed from CPP/7zip/FileManager/Resource/ProgressDialog2/resource.h) | 11 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ProgressDialogRes.h (renamed from CPP/7zip/FileManager/Resource/ProgressDialog/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PropertyName.cpp (renamed from CPP/7zip/FileManager/PropertyName.cpp) | 13 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PropertyName.h (renamed from CPP/7zip/FileManager/PropertyName.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PropertyName.rc (renamed from CPP/7zip/FileManager/Resource/PropertyName/resource.rc) | 12 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PropertyNameRes.h (renamed from CPP/7zip/FileManager/Resource/PropertyName/resource.h) | 9 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/RegistryAssociations.cpp (renamed from CPP/7zip/FileManager/RegistryAssociations.cpp) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/RegistryAssociations.h (renamed from CPP/7zip/FileManager/RegistryAssociations.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/RegistryPlugins.cpp (renamed from CPP/7zip/FileManager/RegistryPlugins.cpp) | 22 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/RegistryPlugins.h (renamed from CPP/7zip/FileManager/RegistryPlugins.h) | 1 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/RegistryUtils.cpp (renamed from CPP/7zip/FileManager/RegistryUtils.cpp) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/RegistryUtils.h (renamed from CPP/7zip/FileManager/RegistryUtils.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/RootFolder.cpp (renamed from CPP/7zip/FileManager/RootFolder.cpp) | 27 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/RootFolder.h | 32 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SettingsPage.cpp (renamed from CPP/7zip/FileManager/Resource/SettingsPage/SettingsPage.cpp) | 10 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SettingsPage.h (renamed from CPP/7zip/FileManager/Resource/SettingsPage/SettingsPage.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SettingsPage.rc (renamed from CPP/7zip/FileManager/Resource/SettingsPage/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SettingsPageRes.h (renamed from CPP/7zip/FileManager/Resource/SettingsPage/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SplitDialog.cpp (renamed from CPP/7zip/FileManager/Resource/SplitDialog/SplitDialog.cpp) | 6 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SplitDialog.h (renamed from CPP/7zip/FileManager/Resource/SplitDialog/SplitDialog.h) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SplitDialog.rc (renamed from CPP/7zip/FileManager/Resource/SplitDialog/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SplitDialogRes.h (renamed from CPP/7zip/FileManager/Resource/SplitDialog/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SplitUtils.cpp (renamed from CPP/7zip/FileManager/SplitUtils.cpp) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SplitUtils.h (renamed from CPP/7zip/FileManager/SplitUtils.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/StdAfx.cpp (renamed from CPP/7zip/FileManager/StdAfx.cpp) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/StdAfx.h (renamed from CPP/7zip/FileManager/StdAfx.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/StringUtils.cpp (renamed from CPP/7zip/FileManager/StringUtils.cpp) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/StringUtils.h (renamed from CPP/7zip/FileManager/StringUtils.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SysIconUtils.cpp (renamed from CPP/7zip/FileManager/SysIconUtils.cpp) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SysIconUtils.h (renamed from CPP/7zip/FileManager/SysIconUtils.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SystemPage.cpp (renamed from CPP/7zip/FileManager/Resource/SystemPage/SystemPage.cpp) | 23 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SystemPage.h (renamed from CPP/7zip/FileManager/Resource/SystemPage/SystemPage.h) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SystemPage.rc (renamed from CPP/7zip/FileManager/Resource/SystemPage/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/SystemPageRes.h (renamed from CPP/7zip/FileManager/Resource/SystemPage/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Test.bmp (renamed from CPP/7zip/FileManager/Test.bmp) | bin | 982 -> 982 bytes | |||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Test2.bmp (renamed from CPP/7zip/FileManager/Test2.bmp) | bin | 406 -> 406 bytes | |||
-rwxr-xr-x | CPP/7zip/UI/FileManager/TextPairs.cpp (renamed from CPP/7zip/FileManager/TextPairs.cpp) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/TextPairs.h (renamed from CPP/7zip/FileManager/TextPairs.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/UpdateCallback100.cpp (renamed from CPP/7zip/FileManager/UpdateCallback100.cpp) | 24 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/UpdateCallback100.h (renamed from CPP/7zip/FileManager/UpdateCallback100.h) | 25 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ViewSettings.cpp (renamed from CPP/7zip/FileManager/ViewSettings.cpp) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/ViewSettings.h (renamed from CPP/7zip/FileManager/ViewSettings.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/makefile (renamed from CPP/7zip/FileManager/makefile) | 123 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/resource.h (renamed from CPP/7zip/FileManager/resource.h) | 5 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/resource.rc (renamed from CPP/7zip/FileManager/resource.rc) | 42 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/BenchmarkDialog.cpp (renamed from CPP/7zip/UI/GUI/Resource/BenchmarkDialog/BenchmarkDialog.cpp) | 6 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/BenchmarkDialog.h (renamed from CPP/7zip/UI/GUI/Resource/BenchmarkDialog/BenchmarkDialog.h) | 6 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/BenchmarkDialog.rc (renamed from CPP/7zip/UI/GUI/Resource/BenchmarkDialog/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/BenchmarkDialogRes.h (renamed from CPP/7zip/UI/GUI/Resource/BenchmarkDialog/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/CompressDialog.cpp | 16 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/CompressDialog.h | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/CompressDialog.rc (renamed from CPP/7zip/UI/Resource/CompressDialog/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/CompressDialogRes.h (renamed from CPP/7zip/UI/Resource/CompressDialog/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/Extract.rc (renamed from CPP/7zip/UI/Resource/Extract/resource.rc) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/ExtractDialog.cpp | 8 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/ExtractDialog.h | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/ExtractDialog.rc (renamed from CPP/7zip/UI/Resource/ExtractDialog/resource.rc) | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/ExtractDialogRes.h (renamed from CPP/7zip/UI/Resource/ExtractDialog/resource.h) | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/ExtractGUI.cpp | 54 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/ExtractGUI.h | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/ExtractRes.h (renamed from CPP/7zip/UI/Resource/Extract/resource.h) | 0 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/GUI.cpp | 7 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/GUI.dsp | 74 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/OpenCallbackGUI.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/Resource/BenchmarkDialog/StdAfx.h | 16 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp | 20 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/UpdateCallbackGUI.h | 22 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/UpdateGUI.cpp | 8 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/UpdateGUI.h | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/makefile | 24 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/resource.h | 7 | ||||
-rwxr-xr-x | CPP/7zip/UI/GUI/resource.rc | 25 | ||||
-rwxr-xr-x | CPP/7zip/UI/makefile | 1 | ||||
-rwxr-xr-x | CPP/7zip/makefile | 4 |
354 files changed, 4552 insertions, 5049 deletions
diff --git a/CPP/7zip/Archive/7z/7zEncode.cpp b/CPP/7zip/Archive/7z/7zEncode.cpp index 8c229362..3a5cfcd5 100755 --- a/CPP/7zip/Archive/7z/7zEncode.cpp +++ b/CPP/7zip/Archive/7z/7zEncode.cpp @@ -13,7 +13,9 @@ #include "../../Common/CreateCoder.h" #include "../../Common/FilterCoder.h" -static UInt64 k_AES = 0x06F10701; +static const UInt64 k_AES = 0x06F10701; +static const UInt64 k_BCJ = 0x03030103; +static const UInt64 k_BCJ2 = 0x0303011B; namespace NArchive { namespace N7z { @@ -59,7 +61,8 @@ HRESULT CEncoder::CreateMixerCoder( { const CMethodFull &methodFull = _options.Methods[i]; _codersInfo.Add(CCoderInfo()); - // CCoderInfo &encodingInfo = _codersInfo.Back(); + CCoderInfo &encodingInfo = _codersInfo.Back(); + encodingInfo.MethodID = methodFull.Id; CMyComPtr<ICompressCoder> encoder; CMyComPtr<ICompressCoder2> encoder2; @@ -176,7 +179,7 @@ HRESULT CEncoder::Encode( return E_FAIL; UInt32 mainCoderIndex, mainStreamIndex; _bindInfo.FindInStream(_bindInfo.InStreams[0], mainCoderIndex, mainStreamIndex); - _mixerCoderSpec->SetProgressCoderIndex(mainCoderIndex); + if (inStreamSize != NULL) { CRecordVector<const UInt64 *> sizePointers; @@ -234,6 +237,17 @@ HRESULT CEncoder::Encode( memmove(encodingInfo.Properties, outStreamSpec->GetBuffer(), size); } } + + UInt32 progressIndex = mainCoderIndex; + + for (i = 0; i < _codersInfo.Size(); i++) + { + const CCoderInfo &e = _codersInfo[i]; + if ((e.MethodID == k_BCJ || e.MethodID == k_BCJ2) && i + 1 < _codersInfo.Size()) + progressIndex = i + 1; + } + + _mixerCoderSpec->SetProgressCoderIndex(progressIndex); RINOK(_mixerCoder->Code(&inStreamPointers.Front(), NULL, 1, &outStreamPointers.Front(), NULL, outStreamPointers.Size(), compressProgress)); diff --git a/CPP/7zip/Archive/7z/7zExtract.cpp b/CPP/7zip/Archive/7z/7zExtract.cpp index 2f2423ee..65f9c9eb 100755 --- a/CPP/7zip/Archive/7z/7zExtract.cpp +++ b/CPP/7zip/Archive/7z/7zExtract.cpp @@ -149,16 +149,27 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, ); // CDecoder1 decoder; - UInt64 currentImportantTotalUnPacked = 0; + UInt64 currentTotalPacked = 0; + UInt64 currentTotalUnPacked = 0; UInt64 totalFolderUnPacked; + UInt64 totalFolderPacked; + + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, false); for(int i = 0; i < extractFolderInfoVector.Size(); i++, - currentImportantTotalUnPacked += totalFolderUnPacked) + currentTotalUnPacked += totalFolderUnPacked, + currentTotalPacked += totalFolderPacked) { + lps->OutSize = currentTotalUnPacked; + lps->InSize = currentTotalPacked; + RINOK(lps->SetCur()); + const CExtractFolderInfo &efi = extractFolderInfoVector[i]; totalFolderUnPacked = efi.UnPackSize; - RINOK(extractCallback->SetCompleted(¤tImportantTotalUnPacked)); + totalFolderPacked = 0; CFolderOutStream *folderOutStream = new CFolderOutStream; CMyComPtr<ISequentialOutStream> outStream(folderOutStream); @@ -194,14 +205,7 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, CNum folderIndex = efi.FolderIndex; const CFolder &folderInfo = database.Folders[folderIndex]; - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - localProgressSpec->Init(extractCallback, false); - - CLocalCompressProgressInfo *localCompressProgressSpec = - new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; - localCompressProgressSpec->Init(progress, NULL, ¤tImportantTotalUnPacked); + totalFolderPacked = _database.GetFolderFullPackSize(folderIndex); CNum packStreamIndex = database.FolderStartPackStreamIndex[folderIndex]; UInt64 folderStartPackPos = database.GetFolderStreamPos(folderIndex, 0); @@ -225,7 +229,7 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, &database.PackSizes[packStreamIndex], folderInfo, outStream, - compressProgress + progress #ifndef _NO_CRYPTO , getTextPassword #endif diff --git a/CPP/7zip/Archive/7z/7zHandler.cpp b/CPP/7zip/Archive/7z/7zHandler.cpp index 9fc45848..d5dc8720 100755 --- a/CPP/7zip/Archive/7z/7zHandler.cpp +++ b/CPP/7zip/Archive/7z/7zHandler.cpp @@ -53,14 +53,10 @@ STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) return S_OK; } -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) -{ - value->vt = VT_EMPTY; - return S_OK; -} - #ifdef _SFX +IMP_IInArchive_ArcProps_NO + STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 * /* numProperties */) { return E_NOTIMPL; @@ -72,27 +68,64 @@ STDMETHODIMP CHandler::GetPropertyInfo(UInt32 /* index */, return E_NOTIMPL; } -#endif +#else -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) +STATPROPSTG kArcProps[] = { - *numProperties = 0; - return S_OK; -} + { NULL, kpidMethod, VT_BSTR}, + { NULL, kpidSolid, VT_BOOL}, + { NULL, kpidNumBlocks, VT_UI4} +}; -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) +STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value) { - return E_NOTIMPL; + COM_TRY_BEGIN + NWindows::NCOM::CPropVariant prop; + switch(propID) + { + case kpidMethod: + { + UString resString; + CRecordVector<UInt64> ids; + int i; + for (i = 0; i < _database.Folders.Size(); i++) + { + const CFolder &f = _database.Folders[i]; + for (int j = f.Coders.Size() - 1; j >= 0; j--) + ids.AddToUniqueSorted(f.Coders[j].MethodID); + } + + for (i = 0; i < ids.Size(); i++) + { + UInt64 id = ids[i]; + UString methodName; + /* bool methodIsKnown = */ FindMethod(EXTERNAL_CODECS_VARS id, methodName); + if (methodName.IsEmpty()) + methodName = ConvertMethodIdToString(id); + if (!resString.IsEmpty()) + resString += L' '; + resString += methodName; + } + prop = resString; + break; + } + case kpidSolid: prop = _database.IsSolid(); break; + case kpidNumBlocks: prop = (UInt32)_database.Folders.Size(); break; + } + prop.Detach(value); + return S_OK; + COM_TRY_END } +IMP_IInArchive_ArcProps + +#endif -static void MySetFileTime(bool timeDefined, FILETIME unixTime, - NWindows::NCOM::CPropVariant &propVariant) +static void MySetFileTime(bool timeDefined, FILETIME unixTime, NWindows::NCOM::CPropVariant &prop) { if (timeDefined) - propVariant = unixTime; + prop = unixTime; } #ifndef _SFX @@ -171,7 +204,7 @@ bool CHandler::IsEncrypted(UInt32 index2) const STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; + NWindows::NCOM::CPropVariant prop; /* const CRef2 &ref2 = _refs[index]; @@ -196,68 +229,68 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va case kpidPath: { if (!item.Name.IsEmpty()) - propVariant = NItemName::GetOSName(item.Name); + prop = NItemName::GetOSName(item.Name); break; } case kpidIsFolder: - propVariant = item.IsDirectory; + prop = item.IsDirectory; break; case kpidSize: { - propVariant = item.UnPackSize; - // propVariant = ref2.UnPackSize; + prop = item.UnPackSize; + // prop = ref2.UnPackSize; break; } case kpidPosition: { /* if (ref2.Refs.Size() > 1) - propVariant = ref2.StartPos; + prop = ref2.StartPos; else */ if (item.IsStartPosDefined) - propVariant = item.StartPos; + prop = item.StartPos; break; } case kpidPackedSize: { - // propVariant = ref2.PackSize; + // prop = ref2.PackSize; { CNum folderIndex = _database.FileIndexToFolderIndexMap[index2]; if (folderIndex != kNumNoIndex) { if (_database.FolderStartFileIndex[folderIndex] == (CNum)index2) - propVariant = _database.GetFolderFullPackSize(folderIndex); + prop = _database.GetFolderFullPackSize(folderIndex); /* else - propVariant = UInt64(0); + prop = (UInt64)0; */ } else - propVariant = UInt64(0); + prop = (UInt64)0; } break; } case kpidLastAccessTime: - MySetFileTime(item.IsLastAccessTimeDefined, item.LastAccessTime, propVariant); + MySetFileTime(item.IsLastAccessTimeDefined, item.LastAccessTime, prop); break; case kpidCreationTime: - MySetFileTime(item.IsCreationTimeDefined, item.CreationTime, propVariant); + MySetFileTime(item.IsCreationTimeDefined, item.CreationTime, prop); break; case kpidLastWriteTime: - MySetFileTime(item.IsLastWriteTimeDefined, item.LastWriteTime, propVariant); + MySetFileTime(item.IsLastWriteTimeDefined, item.LastWriteTime, prop); break; case kpidAttributes: if (item.AreAttributesDefined) - propVariant = item.Attributes; + prop = item.Attributes; break; case kpidCRC: if (item.IsFileCRCDefined) - propVariant = item.FileCRC; + prop = item.FileCRC; break; case kpidEncrypted: { - propVariant = IsEncrypted(index2); + prop = IsEncrypted(index2); break; } #ifndef _SFX @@ -357,7 +390,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va } } } - propVariant = methodsString; + prop = methodsString; } } break; @@ -365,7 +398,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va { CNum folderIndex = _database.FileIndexToFolderIndexMap[index2]; if (folderIndex != kNumNoIndex) - propVariant = (UInt32)folderIndex; + prop = (UInt32)folderIndex; } break; case kpidPackedSize0: @@ -381,21 +414,21 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va if (_database.FolderStartFileIndex[folderIndex] == (CNum)index2 && folderInfo.PackStreams.Size() > (int)(propID - kpidPackedSize0)) { - propVariant = _database.GetFolderPackStreamSize(folderIndex, propID - kpidPackedSize0); + prop = _database.GetFolderPackStreamSize(folderIndex, propID - kpidPackedSize0); } else - propVariant = UInt64(0); + prop = (UInt64)0; } else - propVariant = UInt64(0); + prop = (UInt64)0; } break; #endif case kpidIsAnti: - propVariant = item.IsAnti; + prop = item.IsAnti; break; } - propVariant.Detach(value); + prop.Detach(value); return S_OK; COM_TRY_END } @@ -522,11 +555,11 @@ STDMETHODIMP CHandler::Open(IInStream *stream, { UString baseName; { - NCOM::CPropVariant propVariant; - RINOK(openVolumeCallback->GetProperty(kpidName, &propVariant)); - if (propVariant.vt != VT_BSTR) + NCOM::CPropVariant prop; + RINOK(openVolumeCallback->GetProperty(kpidName, &prop)); + if (prop.vt != VT_BSTR) break; - baseName = propVariant.bstrVal; + baseName = prop.bstrVal; } seqName.InitName(baseName); } diff --git a/CPP/7zip/Archive/7z/7zItem.h b/CPP/7zip/Archive/7z/7zItem.h index 388f19d3..31c5ce2d 100755 --- a/CPP/7zip/Archive/7z/7zItem.h +++ b/CPP/7zip/Archive/7z/7zItem.h @@ -170,6 +170,13 @@ struct CArchiveDatabase NumUnPackStreamsVector.IsEmpty() && Files.IsEmpty()); } + bool IsSolid() const + { + for (int i = 0; i < NumUnPackStreamsVector.Size(); i++) + if (NumUnPackStreamsVector[i] > 1) + return true; + return false; + } }; }} diff --git a/CPP/7zip/Archive/7z/7zProperties.cpp b/CPP/7zip/Archive/7z/7zProperties.cpp index 316f4f09..3452a030 100755 --- a/CPP/7zip/Archive/7z/7zProperties.cpp +++ b/CPP/7zip/Archive/7z/7zProperties.cpp @@ -37,18 +37,14 @@ CPropMap kPropMap[] = { NID::kWinAttributes, NULL, kpidAttributes, VT_UI4}, { NID::kStartPos, NULL, kpidPosition, VT_UI4}, - { NID::kCRC, NULL, kpidCRC, VT_UI4}, - { NID::kAnti, L"Anti", kpidIsAnti, VT_BOOL}, + { NID::kAnti, NULL, kpidIsAnti, VT_BOOL}, // { 97, NULL, kpidSolid, VT_BOOL}, #ifndef _SFX { 98, NULL, kpidMethod, VT_BSTR}, - { 99, L"Block", kpidBlock, VT_UI4} + { 99, NULL, kpidBlock, VT_UI4} #endif - // { L"ID", kpidID, VT_BSTR}, - // { L"UnPack Version", kpidUnPackVersion, VT_UI1}, - // { L"Host OS", kpidHostOS, VT_BSTR} }; static const int kPropMapSize = sizeof(kPropMap) / sizeof(kPropMap[0]); diff --git a/CPP/7zip/Archive/7z/7zUpdate.cpp b/CPP/7zip/Archive/7z/7zUpdate.cpp index 59e7c4fc..68f4604d 100755 --- a/CPP/7zip/Archive/7z/7zUpdate.cpp +++ b/CPP/7zip/Archive/7z/7zUpdate.cpp @@ -22,52 +22,19 @@ static const UInt32 kDictionaryForBCJ2_LZMA = 1 << 20; static const UInt32 kAlgorithmForBCJ2_LZMA = 1; static const UInt32 kNumFastBytesForBCJ2_LZMA = 64; -static HRESULT CopyBlock(ISequentialInStream *inStream, - ISequentialOutStream *outStream, ICompressProgressInfo *progress) +static HRESULT WriteRange(IInStream *inStream, ISequentialOutStream *outStream, + UInt64 position, UInt64 size, ICompressProgressInfo *progress) { - CMyComPtr<ICompressCoder> copyCoder = new NCompress::CCopyCoder; - return copyCoder->Code(inStream, outStream, NULL, NULL, progress); -} - -static HRESULT WriteRange( - ISequentialInStream *inStream, - ISequentialOutStream *outStream, - UInt64 size, - IProgress *progress, - UInt64 ¤tComplexity) -{ - CLimitedSequentialInStream *streamSpec = new - CLimitedSequentialInStream; + RINOK(inStream->Seek(position, STREAM_SEEK_SET, 0)); + CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; CMyComPtr<CLimitedSequentialInStream> inStreamLimited(streamSpec); streamSpec->SetStream(inStream); streamSpec->Init(size); - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> localProgress = localProgressSpec; - localProgressSpec->Init(progress, true); - - CLocalCompressProgressInfo *localCompressProgressSpec = - new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; - - localCompressProgressSpec->Init(localProgress, ¤tComplexity, ¤tComplexity); - - HRESULT result = CopyBlock(inStreamLimited, outStream, compressProgress); - currentComplexity += size; - return result; -} - - -static HRESULT WriteRange(IInStream *inStream, - ISequentialOutStream *outStream, - UInt64 position, - UInt64 size, - IProgress *progress, - UInt64 ¤tComplexity) -{ - inStream->Seek(position, STREAM_SEEK_SET, 0); - return WriteRange(inStream, outStream, - size, progress, currentComplexity); + NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder; + CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec; + RINOK(copyCoder->Code(inStreamLimited, outStream, NULL, NULL, progress)); + return (copyCoderSpec->TotalSize == size ? S_OK : E_FAIL); } static int GetReverseSlashPos(const UString &name) @@ -94,14 +61,6 @@ UString CUpdateItem::GetExtension() const return Name.Mid(GetExtensionPos()); } -/* -struct CFolderRef -{ - const CArchiveDatabaseEx *Database; - int FolderIndex; -}; -*/ - #define RINOZ(x) { int __tt = (x); if (__tt != 0) return __tt; } static int CompareBuffers(const CByteBuffer &a1, const CByteBuffer &a2) @@ -522,16 +481,10 @@ static HRESULT Update2( return E_NOTIMPL; */ - UInt64 startBlockSize = database != 0 ? - database->ArchiveInfo.StartPosition: 0; + UInt64 startBlockSize = database != 0 ? database->ArchiveInfo.StartPosition: 0; if (startBlockSize > 0 && !options.RemoveSfxBlock) { - CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; - CMyComPtr<ISequentialInStream> limitedStream(streamSpec); - RINOK(inStream->Seek(0, STREAM_SEEK_SET, NULL)); - streamSpec->SetStream(inStream); - streamSpec->Init(startBlockSize); - RINOK(CopyBlock(limitedStream, seqOutStream, NULL)); + RINOK(WriteRange(inStream, seqOutStream, 0, startBlockSize, NULL)); } CRecordVector<int> fileIndexToUpdateIndexMap; @@ -607,6 +560,11 @@ static HRESULT Update2( complexity = 0; RINOK(updateCallback->SetCompleted(&complexity)); + + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(updateCallback, true); + ///////////////////////////////////////// // Write Copy Items @@ -614,10 +572,11 @@ static HRESULT Update2( { int folderIndex = folderRefs[i]; + lps->ProgressOffset = complexity; + UInt64 packSize = database->GetFolderFullPackSize(folderIndex); RINOK(WriteRange(inStream, archive.SeqStream, - database->GetFolderStreamPos(folderIndex, 0), - database->GetFolderFullPackSize(folderIndex), - updateCallback, complexity)); + database->GetFolderStreamPos(folderIndex, 0), packSize, progress)); + complexity += packSize; const CFolder &folder = database->Folders[folderIndex]; CNum startIndex = database->FolderStartPackStreamIndex[folderIndex]; @@ -736,18 +695,17 @@ static HRESULT Update2( inStreamSpec->Init(updateCallback, &indices[i], numSubFiles); CFolder folderItem; - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> localProgress = localProgressSpec; - localProgressSpec->Init(updateCallback, true); - CLocalCompressProgressInfo *localCompressProgressSpec = new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; - localCompressProgressSpec->Init(localProgress, &complexity, NULL); - + + int startPackIndex = newDatabase.PackSizes.Size(); RINOK(encoder.Encode( EXTERNAL_CODECS_LOC_VARS solidInStream, NULL, &inSizeForReduce, folderItem, - archive.SeqStream, newDatabase.PackSizes, compressProgress)); + archive.SeqStream, newDatabase.PackSizes, progress)); + + for (; startPackIndex < newDatabase.PackSizes.Size(); startPackIndex++) + lps->OutSize += newDatabase.PackSizes[startPackIndex]; + lps->InSize += folderItem.GetUnPackSize(); // for() // newDatabase.PackCRCsDefined.Add(false); // newDatabase.PackCRCs.Add(0); @@ -783,7 +741,6 @@ static HRESULT Update2( file.IsFileCRCDefined = true; file.HasStream = true; numUnPackStreams++; - complexity += file.UnPackSize; } else { @@ -935,8 +892,7 @@ HRESULT UpdateVolume( CMyComPtr<ISequentialInStream> inCrcStream = inCrcStreamSpec; inCrcStreamSpec->Init(fileStream); - RINOK(WriteRange(inCrcStream, volumeStream, pureSize, - updateCallback, complexity)); + RINOK(WriteRange(inCrcStream, volumeStream, pureSize, updateCallback, complexity)); file.UnPackSize = inCrcStreamSpec->GetSize(); if (file.UnPackSize == 0) break; diff --git a/CPP/7zip/Archive/ArchiveExports.cpp b/CPP/7zip/Archive/ArchiveExports.cpp index 294b14d1..a60303a5 100755 --- a/CPP/7zip/Archive/ArchiveExports.cpp +++ b/CPP/7zip/Archive/ArchiveExports.cpp @@ -85,11 +85,11 @@ STDAPI GetHandlerProperty2(UInt32 formatIndex, PROPID propID, PROPVARIANT *value if (formatIndex >= g_NumArcs) return E_INVALIDARG; const CArcInfo &arc = *g_Arcs[formatIndex]; - NWindows::NCOM::CPropVariant propVariant; + NWindows::NCOM::CPropVariant prop; switch(propID) { case NArchive::kName: - propVariant = arc.Name; + prop = arc.Name; break; case NArchive::kClassID: { @@ -99,22 +99,22 @@ STDAPI GetHandlerProperty2(UInt32 formatIndex, PROPID propID, PROPVARIANT *value } case NArchive::kExtension: if (arc.Ext != 0) - propVariant = arc.Ext; + prop = arc.Ext; break; case NArchive::kAddExtension: if (arc.AddExt != 0) - propVariant = arc.AddExt; + prop = arc.AddExt; break; case NArchive::kUpdate: - propVariant = (bool)(arc.CreateOutArchive != 0); + prop = (bool)(arc.CreateOutArchive != 0); break; case NArchive::kKeepName: - propVariant = arc.KeepName; + prop = arc.KeepName; break; case NArchive::kStartSignature: return SetPropString((const char *)arc.Signature, arc.SignatureSize, value); } - propVariant.Detach(value); + prop.Detach(value); return S_OK; } diff --git a/CPP/7zip/Archive/Arj/ArjHandler.cpp b/CPP/7zip/Archive/Arj/ArjHandler.cpp index b5227e54..d154fd76 100755 --- a/CPP/7zip/Archive/Arj/ArjHandler.cpp +++ b/CPP/7zip/Archive/Arj/ArjHandler.cpp @@ -51,16 +51,7 @@ const int kNumHostOSes = sizeof(kHostOS) / sizeof(kHostOS[0]); const wchar_t *kUnknownOS = L"Unknown"; -/* -enum // PropID -{ - kpidHostOS = kpidUserDefined, - kpidUnPackVersion, - kpidMethod, -}; -*/ - -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, { NULL, kpidIsFolder, VT_BOOL}, @@ -68,59 +59,15 @@ STATPROPSTG kProperties[] = { NULL, kpidPackedSize, VT_UI8}, { NULL, kpidLastWriteTime, VT_FILETIME}, { NULL, kpidAttributes, VT_UI4}, - { NULL, kpidEncrypted, VT_BOOL}, - // { NULL, kpidCommented, VT_BOOL}, - { NULL, kpidCRC, VT_UI4}, - { NULL, kpidMethod, VT_UI1}, + // { NULL, kpidUnpackVer, VT_UI1}, { NULL, kpidHostOS, VT_BSTR} - - // { L"UnPack Version", kpidUnPackVersion, VT_UI1}, - // { L"Method", kpidMethod, VT_UI1}, - // { L"Host OS", kpidHostOS, VT_BSTR} }; - -CHandler::CHandler() -{} - -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) -{ - value->vt = VT_EMPTY; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} - -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - *name = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) -{ - *numProperties = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_NOTIMPL; -} +IMP_IInArchive_Props +IMP_IInArchive_ArcProps_NO STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) { @@ -131,27 +78,19 @@ STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; + NWindows::NCOM::CPropVariant prop; const CItemEx &item = _items[index]; switch(propID) { - case kpidPath: - propVariant = - NItemName::GetOSName(MultiByteToUnicodeString(item.Name, CP_OEMCP)); - /* - NItemName::GetOSName2( - MultiByteToUnicodeString(item.Name, item.GetCodePage())); - */ - break; - case kpidIsFolder: - propVariant = item.IsDirectory(); - break; - case kpidSize: - propVariant = item.Size; - break; - case kpidPackedSize: - propVariant = item.PackSize; - break; + case kpidPath: prop = NItemName::GetOSName(MultiByteToUnicodeString(item.Name, CP_OEMCP)); break; + case kpidIsFolder: prop = item.IsDirectory(); break; + case kpidSize: prop = item.Size; break; + case kpidPackedSize: prop = item.PackSize; break; + case kpidAttributes: prop = item.GetWinAttributes(); break; + case kpidEncrypted: prop = item.IsEncrypted(); break; + case kpidCRC: prop = item.FileCRC; break; + case kpidMethod: prop = item.Method; break; + case kpidHostOS: prop = (item.HostOS < kNumHostOSes) ? (kHostOS[item.HostOS]) : kUnknownOS; break; case kpidLastWriteTime: { FILETIME localFileTime, utcFileTime; @@ -162,52 +101,15 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va } else utcFileTime.dwHighDateTime = utcFileTime.dwLowDateTime = 0; - propVariant = utcFileTime; + prop = utcFileTime; break; } - case kpidAttributes: - propVariant = item.GetWinAttributes(); - break; - case kpidEncrypted: - propVariant = item.IsEncrypted(); - break; - /* - case kpidCommented: - propVariant = item.IsCommented(); - break; - */ - case kpidCRC: - propVariant = item.FileCRC; - break; - case kpidMethod: - propVariant = item.Method; - break; - case kpidHostOS: - propVariant = (item.HostOS < kNumHostOSes) ? - (kHostOS[item.HostOS]) : kUnknownOS; - break; } - propVariant.Detach(value); + prop.Detach(value); return S_OK; COM_TRY_END } -/* -class CPropgressImp: public CProgressVirt -{ -public: - CMyComPtr<IArchiveOpenCallback> Callback; - STDMETHOD(SetCompleted)(const UInt64 *numFiles); -}; - -STDMETHODIMP CPropgressImp::SetCompleted(const UInt64 *numFiles) -{ - if (Callback) - return Callback->SetCompleted(numFiles, NULL); - return S_OK; -} -*/ - STDMETHODIMP CHandler::Open(IInStream *inStream, const UInt64 *maxCheckStartPosition, IArchiveOpenCallback *callback) { @@ -226,17 +128,17 @@ STDMETHODIMP CHandler::Open(IInStream *inStream, } for (;;) { - CItemEx itemInfo; + CItemEx item; bool filled; - HRESULT result = archive.GetNextItem(filled, itemInfo); + HRESULT result = archive.GetNextItem(filled, item); if (result == S_FALSE) return S_FALSE; if (result != S_OK) return S_FALSE; if (!filled) break; - _items.Add(itemInfo); - archive.IncreaseRealPosition(itemInfo.PackSize); + _items.Add(item); + archive.IncreaseRealPosition(item.PackSize); if (callback != NULL) { UInt64 numFiles = _items.Size(); @@ -279,9 +181,9 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, UInt32 i; for(i = 0; i < numItems; i++) { - const CItemEx &itemInfo = _items[allFilesMode ? i : indices[i]]; - totalUnPacked += itemInfo.Size; - totalPacked += itemInfo.PackSize; + const CItemEx &item = _items[allFilesMode ? i : indices[i]]; + totalUnPacked += item.Size; + totalPacked += item.PackSize; } extractCallback->SetTotal(totalUnPacked); @@ -290,29 +192,40 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, CMyComPtr<ICompressCoder> arj1Decoder; CMyComPtr<ICompressCoder> arj2Decoder; - CMyComPtr<ICompressCoder> copyCoder; + NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder(); + CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec; + + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, false); + + CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; + CMyComPtr<ISequentialInStream> inStream(streamSpec); + streamSpec->SetStream(_stream); for(i = 0; i < numItems; i++, currentTotalUnPacked += currentItemUnPacked, currentTotalPacked += currentItemPacked) { - currentItemUnPacked = 0; - currentItemPacked = 0; + lps->InSize = currentTotalPacked; + lps->OutSize = currentTotalUnPacked; + RINOK(lps->SetCur()); + + currentItemUnPacked = currentItemPacked = 0; - RINOK(extractCallback->SetCompleted(¤tTotalUnPacked)); CMyComPtr<ISequentialOutStream> realOutStream; - Int32 askMode; - askMode = testMode ? NArchive::NExtract::NAskMode::kTest : - NArchive::NExtract::NAskMode::kExtract; + Int32 askMode = testMode ? + NExtract::NAskMode::kTest : + NExtract::NAskMode::kExtract; Int32 index = allFilesMode ? i : indices[i]; - const CItemEx &itemInfo = _items[index]; + const CItemEx &item = _items[index]; RINOK(extractCallback->GetStream(index, &realOutStream, askMode)); - if(itemInfo.IsDirectory()) + if(item.IsDirectory()) { // if (!testMode) { RINOK(extractCallback->PrepareOperation(askMode)); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); + RINOK(extractCallback->SetOperationResult(NExtract::NOperationResult::kOK)); } continue; } @@ -321,8 +234,8 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, continue; RINOK(extractCallback->PrepareOperation(askMode)); - currentItemUnPacked = itemInfo.Size; - currentItemPacked = itemInfo.PackSize; + currentItemUnPacked = item.Size; + currentItemPacked = item.PackSize; { COutStreamWithCRC *outStreamSpec = new COutStreamWithCRC; @@ -330,150 +243,64 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, outStreamSpec->SetStream(realOutStream); outStreamSpec->Init(); realOutStream.Release(); - - CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; - CMyComPtr<ISequentialInStream> inStream(streamSpec); + + streamSpec->Init(item.PackSize); UInt64 pos; - _stream->Seek(itemInfo.DataPosition, STREAM_SEEK_SET, &pos); - - streamSpec->SetStream(_stream); - streamSpec->Init(itemInfo.PackSize); - - - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - localProgressSpec->Init(extractCallback, false); + _stream->Seek(item.DataPosition, STREAM_SEEK_SET, &pos); + HRESULT result = S_OK; + Int32 opRes = NExtract::NOperationResult::kOK; - CLocalCompressProgressInfo *localCompressProgressSpec = - new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; - localCompressProgressSpec->Init(progress, - ¤tTotalPacked, - ¤tTotalUnPacked); - - if (itemInfo.IsEncrypted()) + if (item.IsEncrypted()) { - RINOK(extractCallback->SetOperationResult( - NArchive::NExtract::NOperationResult::kUnSupportedMethod)); - continue; + opRes = NExtract::NOperationResult::kUnSupportedMethod; } - - HRESULT result; - - switch(itemInfo.Method) + else { - case NFileHeader::NCompressionMethod::kStored: + switch(item.Method) + { + case NFileHeader::NCompressionMethod::kStored: { - if(!copyCoder) - copyCoder = new NCompress::CCopyCoder; - try - { - if (itemInfo.IsEncrypted()) - { - RINOK(extractCallback->SetOperationResult( - NArchive::NExtract::NOperationResult::kUnSupportedMethod)); - continue; - } - else - { - result = copyCoder->Code(inStream, outStream, - NULL, NULL, compressProgress); - } - if (result == S_FALSE) - throw "data error"; - if (result != S_OK) - return result; - } - catch(...) - { - outStream.Release(); - RINOK(extractCallback->SetOperationResult( - NArchive::NExtract::NOperationResult::kDataError)); - continue; - } + result = copyCoder->Code(inStream, outStream, NULL, NULL, progress); + if (result == S_OK && copyCoderSpec->TotalSize != item.PackSize) + result = S_FALSE; break; } - case NFileHeader::NCompressionMethod::kCompressed1a: - case NFileHeader::NCompressionMethod::kCompressed1b: - case NFileHeader::NCompressionMethod::kCompressed1c: + case NFileHeader::NCompressionMethod::kCompressed1a: + case NFileHeader::NCompressionMethod::kCompressed1b: + case NFileHeader::NCompressionMethod::kCompressed1c: { - if(!arj1Decoder) - { + if (!arj1Decoder) arj1Decoder = new NCompress::NArj::NDecoder1::CCoder; - } - try - { - if (itemInfo.IsEncrypted()) - { - RINOK(extractCallback->SetOperationResult( - NArchive::NExtract::NOperationResult::kUnSupportedMethod)); - continue; - } - else - { - result = arj1Decoder->Code(inStream, outStream, - NULL, ¤tItemUnPacked, compressProgress); - } - if (result == S_FALSE) - throw "data error"; - if (result != S_OK) - return result; - } - catch(...) - { - outStream.Release(); - RINOK(extractCallback->SetOperationResult( - NArchive::NExtract::NOperationResult::kDataError)); - continue; - } + result = arj1Decoder->Code(inStream, outStream, NULL, ¤tItemUnPacked, progress); break; } - case NFileHeader::NCompressionMethod::kCompressed2: + case NFileHeader::NCompressionMethod::kCompressed2: { - if(!arj2Decoder) - { + if (!arj2Decoder) arj2Decoder = new NCompress::NArj::NDecoder2::CCoder; - } - try - { - if (itemInfo.IsEncrypted()) - { - RINOK(extractCallback->SetOperationResult( - NArchive::NExtract::NOperationResult::kUnSupportedMethod)); - continue; - } - else - { - result = arj2Decoder->Code(inStream, outStream, - NULL, ¤tItemUnPacked, compressProgress); - } - if (result == S_FALSE) - throw "data error"; - if (result != S_OK) - return result; - } - catch(...) - { - outStream.Release(); - RINOK(extractCallback->SetOperationResult( - NArchive::NExtract::NOperationResult::kDataError)); - continue; - } + result = arj2Decoder->Code(inStream, outStream, NULL, ¤tItemUnPacked, progress); break; } - default: - RINOK(extractCallback->SetOperationResult( - NArchive::NExtract::NOperationResult::kUnSupportedMethod)); - continue; + default: + opRes = NExtract::NOperationResult::kUnSupportedMethod; + } + } + if (opRes == NExtract::NOperationResult::kOK) + { + if (result == S_FALSE) + opRes = NExtract::NOperationResult::kDataError; + else + { + RINOK(result); + opRes = (outStreamSpec->GetCRC() == item.FileCRC) ? + NExtract::NOperationResult::kOK: + NExtract::NOperationResult::kCRCError; + } } - bool crcOK = outStreamSpec->GetCRC() == itemInfo.FileCRC; outStream.Release(); - if(crcOK) - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)) - else - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kCRCError)) + RINOK(extractCallback->SetOperationResult(opRes)); } } return S_OK; diff --git a/CPP/7zip/Archive/Arj/ArjHandler.h b/CPP/7zip/Archive/Arj/ArjHandler.h index 1f43808a..4351b26f 100755 --- a/CPP/7zip/Archive/Arj/ArjHandler.h +++ b/CPP/7zip/Archive/Arj/ArjHandler.h @@ -19,7 +19,6 @@ public: INTERFACE_IInArchive(;) - CHandler(); private: CObjectVector<CItemEx> _items; CMyComPtr<IInStream> _stream; diff --git a/CPP/7zip/Archive/BZip2/BZip2Handler.cpp b/CPP/7zip/Archive/BZip2/BZip2Handler.cpp index c60045fa..0b790c68 100755 --- a/CPP/7zip/Archive/BZip2/BZip2Handler.cpp +++ b/CPP/7zip/Archive/BZip2/BZip2Handler.cpp @@ -21,49 +21,13 @@ namespace NBZip2 { static const CMethodId kMethodId_BZip2 = 0x040202; -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { - { NULL, kpidPath, VT_BSTR}, - // { NULL, kpidIsFolder, VT_BOOL}, - // { NULL, kpidSize, VT_UI8}, - { NULL, kpidPackedSize, VT_UI8}, + { NULL, kpidPackedSize, VT_UI8} }; -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) -{ - value->vt = VT_EMPTY; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} - -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - *name = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) -{ - *numProperties = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_INVALIDARG; -} +IMP_IInArchive_Props +IMP_IInArchive_ArcProps_NO STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) { @@ -71,24 +35,15 @@ STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) return S_OK; } -STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) +STDMETHODIMP CHandler::GetProperty(UInt32 /* index */, PROPID propID, PROPVARIANT *value) { - COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; - if (index != 0) - return E_INVALIDARG; + NWindows::NCOM::CPropVariant prop; switch(propID) { - case kpidIsFolder: - propVariant = false; - break; - case kpidPackedSize: - propVariant = _item.PackSize; - break; + case kpidPackedSize: prop = _item.PackSize; break; } - propVariant.Detach(value); + prop.Detach(value); return S_OK; - COM_TRY_END } STDMETHODIMP CHandler::Open(IInStream *stream, @@ -148,14 +103,14 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, extractCallback->SetTotal(_item.PackSize); - UInt64 currentTotalPacked = 0, currentTotalUnPacked = 0; + UInt64 currentTotalPacked = 0; RINOK(extractCallback->SetCompleted(¤tTotalPacked)); CMyComPtr<ISequentialOutStream> realOutStream; Int32 askMode; - askMode = testMode ? NArchive::NExtract::NAskMode::kTest : - NArchive::NExtract::NAskMode::kExtract; + askMode = testMode ? NExtract::NAskMode::kTest : + NExtract::NAskMode::kExtract; RINOK(extractCallback->GetStream(0, &realOutStream, askMode)); @@ -171,7 +126,7 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, kMethodId_BZip2, decoder, false); if (loadResult != S_OK || !decoder) { - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kUnSupportedMethod)); + RINOK(extractCallback->SetOperationResult(NExtract::NOperationResult::kUnSupportedMethod)); return S_OK; } @@ -188,29 +143,26 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, CDummyOutStream *outStreamSpec = new CDummyOutStream; CMyComPtr<ISequentialOutStream> outStream(outStreamSpec); - outStreamSpec->Init(realOutStream); + outStreamSpec->SetStream(realOutStream); + outStreamSpec->Init(); realOutStream.Release(); - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - localProgressSpec->Init(extractCallback, true); - - CLocalCompressProgressInfo *localCompressProgressSpec = - new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, true); RINOK(_stream->Seek(_streamStartPosition, STREAM_SEEK_SET, NULL)); - HRESULT result = S_OK; bool firstItem = true; for (;;) { - localCompressProgressSpec->Init(progress, - ¤tTotalPacked, - ¤tTotalUnPacked); + lps->InSize = currentTotalPacked; + lps->OutSize = outStreamSpec->GetSize(); + + RINOK(lps->SetCur()); const int kSignatureSize = 3; Byte buffer[kSignatureSize]; @@ -226,26 +178,22 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, { if (firstItem) return E_FAIL; - outStream.Release(); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)) - return S_OK; + break; } firstItem = false; UInt64 dataStartPos; RINOK(_stream->Seek((UInt64)(Int64)(-3), STREAM_SEEK_CUR, &dataStartPos)); - result = decoder->Code(_stream, outStream, NULL, NULL, compressProgress); + result = decoder->Code(_stream, outStream, NULL, NULL, progress); if (result != S_OK) break; CMyComPtr<ICompressGetInStreamProcessedSize> getInStreamProcessedSize; - decoder.QueryInterface(IID_ICompressGetInStreamProcessedSize, - &getInStreamProcessedSize); + decoder.QueryInterface(IID_ICompressGetInStreamProcessedSize, &getInStreamProcessedSize); if (!getInStreamProcessedSize) break; - UInt64 packSize; RINOK(getInStreamProcessedSize->GetInStreamProcessedSize(&packSize)); UInt64 pos; @@ -254,17 +202,15 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, } outStream.Release(); - int retResult; + Int32 retResult; if (result == S_OK) - retResult = NArchive::NExtract::NOperationResult::kOK; + retResult = NExtract::NOperationResult::kOK; else if (result == S_FALSE) - retResult = NArchive::NExtract::NOperationResult::kDataError; + retResult = NExtract::NOperationResult::kDataError; else return result; + return extractCallback->SetOperationResult(retResult); - RINOK(extractCallback->SetOperationResult(retResult)); - - return S_OK; COM_TRY_END } diff --git a/CPP/7zip/Archive/BZip2/BZip2HandlerOut.cpp b/CPP/7zip/Archive/BZip2/BZip2HandlerOut.cpp index 134d4124..33c9d0bf 100755 --- a/CPP/7zip/Archive/BZip2/BZip2HandlerOut.cpp +++ b/CPP/7zip/Archive/BZip2/BZip2HandlerOut.cpp @@ -49,20 +49,19 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt UInt32 indexInArchive; if (!updateCallback) return E_FAIL; - RINOK(updateCallback->GetUpdateItemInfo(0, - &newData, &newProperties, &indexInArchive)); + RINOK(updateCallback->GetUpdateItemInfo(0,&newData, &newProperties, &indexInArchive)); if (IntToBool(newProperties)) { { - NCOM::CPropVariant propVariant; - RINOK(updateCallback->GetProperty(0, kpidIsFolder, &propVariant)); - if (propVariant.vt == VT_BOOL) + NCOM::CPropVariant prop; + RINOK(updateCallback->GetProperty(0, kpidIsFolder, &prop)); + if (prop.vt == VT_BOOL) { - if (propVariant.boolVal != VARIANT_FALSE) + if (prop.boolVal != VARIANT_FALSE) return E_INVALIDARG; } - else if (propVariant.vt != VT_EMPTY) + else if (prop.vt != VT_EMPTY) return E_INVALIDARG; } } @@ -71,11 +70,11 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt { UInt64 size; { - NCOM::CPropVariant propVariant; - RINOK(updateCallback->GetProperty(0, kpidSize, &propVariant)); - if (propVariant.vt != VT_UI8) + NCOM::CPropVariant prop; + RINOK(updateCallback->GetProperty(0, kpidSize, &prop)); + if (prop.vt != VT_UI8) return E_INVALIDARG; - size = propVariant.uhVal.QuadPart; + size = prop.uhVal.QuadPart; } UInt32 dicSize = _dicSize; diff --git a/CPP/7zip/Archive/Cab/CabHandler.cpp b/CPP/7zip/Archive/Cab/CabHandler.cpp index 2ce9d9ce..b3e65d90 100755 --- a/CPP/7zip/Archive/Cab/CabHandler.cpp +++ b/CPP/7zip/Archive/Cab/CabHandler.cpp @@ -14,6 +14,8 @@ #include "CabHandler.h" #include "CabBlockInStream.h" +#include "../../Common/ProgressUtils.h" + #include "../../Compress/Copy/CopyCoder.h" #include "../../Compress/Deflate/DeflateDecoder.h" #include "../../Compress/Lzx/LzxDecoder.h" @@ -31,13 +33,11 @@ namespace NCab { #ifdef _CAB_DETAILS enum { - kpidBlockReal = kpidUserDefined, - kpidOffset, - kpidVolume, + kpidBlockReal = kpidUserDefined }; #endif -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, // { NULL, kpidIsFolder, VT_BOOL}, @@ -49,8 +49,8 @@ STATPROPSTG kProperties[] = #ifdef _CAB_DETAILS , { L"BlockReal", kpidBlockReal, VT_UI4}, - { L"Offset", kpidOffset, VT_UI4}, - { L"Volume", kpidVolume, VT_UI4} + { NULL, kpidOffset, VT_UI4}, + { NULL, kpidVolume, VT_UI4} #endif }; @@ -65,49 +65,69 @@ static const wchar_t *kMethods[] = static const int kNumMethods = sizeof(kMethods) / sizeof(kMethods[0]); static const wchar_t *kUnknownMethod = L"Unknown"; -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) -{ - value->vt = VT_EMPTY; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) +STATPROPSTG kArcProps[] = { - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} + { NULL, kpidMethod, VT_BSTR}, + // { NULL, kpidSolid, VT_BOOL}, + { NULL, kpidNumBlocks, VT_UI4}, + { NULL, kpidNumVolumes, VT_UI4} +}; -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - if (srcItem.lpwstrName == 0) - *name = 0; - else - *name = ::SysAllocString(srcItem.lpwstrName); - return S_OK; -} +IMP_IInArchive_Props +IMP_IInArchive_ArcProps -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) +STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value) { - *numProperties = 0; + COM_TRY_BEGIN + NWindows::NCOM::CPropVariant prop; + switch(propID) + { + case kpidMethod: + { + UString resString; + CRecordVector<Byte> ids; + int i; + for (int v = 0; v < m_Database.Volumes.Size(); v++) + { + const CDatabaseEx &de = m_Database.Volumes[v]; + for (i = 0; i < de.Folders.Size(); i++) + ids.AddToUniqueSorted(de.Folders[i].GetCompressionMethod()); + } + for (i = 0; i < ids.Size(); i++) + { + Byte id = ids[i]; + UString method = (id < kNumMethods) ? kMethods[id] : kUnknownMethod; + if (!resString.IsEmpty()) + resString += L' '; + resString += method; + } + prop = resString; + break; + } + // case kpidSolid: prop = _database.IsSolid(); break; + case kpidNumBlocks: + { + UInt32 numFolders = 0; + for (int v = 0; v < m_Database.Volumes.Size(); v++) + numFolders += m_Database.Volumes[v].Folders.Size(); + prop = numFolders; + break; + } + case kpidNumVolumes: + { + prop = (UInt32)m_Database.Volumes.Size(); + break; + } + } + prop.Detach(value); return S_OK; -} - -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_INVALIDARG; + COM_TRY_END } STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; + NWindows::NCOM::CPropVariant prop; const CMvItem &mvItem = m_Database.Items[index]; const CDatabaseEx &db = m_Database.Volumes[mvItem.VolumeIndex]; @@ -122,14 +142,14 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va ConvertUTF8ToUnicode(item.Name, unicodeName); else unicodeName = MultiByteToUnicodeString(item.Name, CP_ACP); - propVariant = (const wchar_t *)NItemName::WinNameToOSName(unicodeName); + prop = (const wchar_t *)NItemName::WinNameToOSName(unicodeName); break; } case kpidIsFolder: - propVariant = item.IsDirectory(); + prop = item.IsDirectory(); break; case kpidSize: - propVariant = item.Size; + prop = item.Size; break; case kpidLastWriteTime: { @@ -141,11 +161,11 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va } else utcFileTime.dwHighDateTime = utcFileTime.dwLowDateTime = 0; - propVariant = utcFileTime; + prop = utcFileTime; break; } case kpidAttributes: - propVariant = item.GetWinAttributes(); + prop = item.GetWinAttributes(); break; case kpidMethod: @@ -162,28 +182,28 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va ConvertUInt64ToString(folder.CompressionTypeMinor, temp); method += temp; } - propVariant = method; + prop = method; break; } case kpidBlock: - propVariant = (Int32)m_Database.GetFolderIndex(&mvItem); + prop = (Int32)m_Database.GetFolderIndex(&mvItem); break; #ifdef _CAB_DETAILS case kpidBlockReal: - propVariant = UInt32(item.FolderIndex); + prop = UInt32(item.FolderIndex); break; case kpidOffset: - propVariant = (UInt32)item.Offset; + prop = (UInt32)item.Offset; break; case kpidVolume: - propVariant = (UInt32)mvItem.VolumeIndex; + prop = (UInt32)mvItem.VolumeIndex; break; - + #endif } - propVariant.Detach(value); + prop.Detach(value); return S_OK; COM_TRY_END } @@ -568,8 +588,14 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, totalUnPacked = 0; - NCompress::CCopyCoder *copyCoderSpec = NULL; - CMyComPtr<ICompressCoder> copyCoder; + UInt64 totalPacked = 0; + + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, false); + + NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder; + CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec; NCompress::NDeflate::NDecoder::CCOMCoder *deflateDecoderSpec = NULL; CMyComPtr<ICompressCoder> deflateDecoder; @@ -648,8 +674,10 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, curUnpack = item.GetEndOffset(); } - RINOK(extractCallback->SetCompleted(&totalUnPacked)); - + lps->OutSize = totalUnPacked; + lps->InSize = totalPacked; + RINOK(lps->SetCur()); + CCabFolderOutStream *cabFolderOutStream = new CCabFolderOutStream; CMyComPtr<ISequentialOutStream> outStream(cabFolderOutStream); @@ -662,11 +690,6 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, switch(folder.GetCompressionMethod()) { case NHeader::NCompressionMethodMajor::kNone: - if(copyCoderSpec == NULL) - { - copyCoderSpec = new NCompress::CCopyCoder; - copyCoder = copyCoderSpec; - } break; case NHeader::NCompressionMethodMajor::kMSZip: if(deflateDecoderSpec == NULL) @@ -748,9 +771,13 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, if (keepInputBuffer) continue; - UInt64 totalUnPacked2 = totalUnPacked + cabFolderOutStream->GetPosInFolder(); - RINOK(extractCallback->SetCompleted(&totalUnPacked2)); + totalPacked += packSize; + + lps->OutSize = totalUnPacked2; + lps->InSize = totalPacked; + RINOK(lps->SetCur()); + UInt64 unpackRemain = cabFolderOutStream->GetRemain(); const UInt32 kBlockSizeMax = (1 << 15); diff --git a/CPP/7zip/Archive/Chm/ChmHandler.cpp b/CPP/7zip/Archive/Chm/ChmHandler.cpp index a3c3b6a0..d1499328 100755 --- a/CPP/7zip/Archive/Chm/ChmHandler.cpp +++ b/CPP/7zip/Archive/Chm/ChmHandler.cpp @@ -34,13 +34,12 @@ namespace NChm { enum { - kpidSection = kpidUserDefined, - kpidOffset + kpidSection = kpidUserDefined }; #endif -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, // { NULL, kpidIsFolder, VT_BOOL}, @@ -51,62 +50,63 @@ STATPROPSTG kProperties[] = #ifdef _CHM_DETAILS , { L"Section", kpidSection, VT_UI4}, - { L"Offset", kpidOffset, VT_UI4} + { NULL, kpidOffset, VT_UI4} #endif }; -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) +STATPROPSTG kArcProps[] = { - value->vt = VT_EMPTY; - return S_OK; -} + { NULL, kpidNumBlocks, VT_UI8} +}; -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} +IMP_IInArchive_Props -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - if (srcItem.lpwstrName == 0) - *name = 0; - else - *name = ::SysAllocString(srcItem.lpwstrName); - return S_OK; -} +IMP_IInArchive_ArcProps_NO +/* +IMP_IInArchive_ArcProps -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) +STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value) { - *numProperties = 0; + COM_TRY_BEGIN + NWindows::NCOM::CPropVariant prop; + switch(propID) + { + case kpidNumBlocks: + { + UInt64 numBlocks = 0; + for (int i = 0; i < m_Database.Sections.Size(); i++) + { + const CSectionInfo &s = m_Database.Sections[i]; + for (int j = 0; j < s.Methods.Size(); j++) + { + const CMethodInfo &m = s.Methods[j]; + if (m.IsLzx()) + numBlocks += m.LzxInfo.ResetTable.GetNumBlocks(); + } + } + prop = numBlocks; + break; + } + } + prop.Detach(value); return S_OK; + COM_TRY_END } - -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_INVALIDARG; -} +*/ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; + NWindows::NCOM::CPropVariant prop; if (m_Database.NewFormat) { switch(propID) { case kpidSize: - propVariant = (UInt64)m_Database.NewFormatString.Length(); + prop = (UInt64)m_Database.NewFormatString.Length(); break; } - propVariant.Detach(value); + prop.Detach(value); return S_OK; } int entryIndex; @@ -128,44 +128,44 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va if (us[0] == L'/') us.Delete(0); } - propVariant = NItemName::GetOSName2(us); + prop = NItemName::GetOSName2(us); } break; } case kpidIsFolder: - propVariant = item.IsDirectory(); + prop = item.IsDirectory(); break; case kpidSize: - propVariant = item.Size; + prop = item.Size; break; case kpidMethod: { if (!item.IsDirectory()) if (item.Section == 0) - propVariant = L"Copy"; + prop = L"Copy"; else if (item.Section < m_Database.Sections.Size()) - propVariant = m_Database.Sections[(int)item.Section].GetMethodName(); + prop = m_Database.Sections[(int)item.Section].GetMethodName(); break; } case kpidBlock: if (m_Database.LowLevel) - propVariant = item.Section; + prop = item.Section; else if (item.Section != 0) - propVariant = m_Database.GetFolder(index); + prop = m_Database.GetFolder(index); break; #ifdef _CHM_DETAILS case kpidSection: - propVariant = (UInt32)item.Section; + prop = (UInt32)item.Section; break; case kpidOffset: - propVariant = (UInt32)item.Offset; + prop = (UInt32)item.Offset; break; #endif } - propVariant.Detach(value); + prop.Detach(value); return S_OK; COM_TRY_END } @@ -295,7 +295,7 @@ HRESULT CChmFolderOutStream::WriteEmptyFiles() { if (m_FileIsOpen) return S_OK; - for(;m_CurrentIndex < m_NumFiles; m_CurrentIndex++) + for (;m_CurrentIndex < m_NumFiles; m_CurrentIndex++) { UInt64 fileSize = m_Database->GetFileSize(m_StartIndex + m_CurrentIndex); if (fileSize != 0) @@ -421,17 +421,23 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, (m_Database.LowLevel ? m_Database.Items.Size(): m_Database.Indices.Size()); - if(numItems == 0) + if (numItems == 0) return S_OK; bool testMode = (_aTestMode != 0); UInt64 currentTotalSize = 0; - CMyComPtr<ICompressCoder> copyCoder; + NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder(); + CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec; UInt32 i; + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, false); + CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; CMyComPtr<ISequentialInStream> inStream(streamSpec); + streamSpec->SetStream(m_Stream); if (m_Database.LowLevel) { @@ -440,17 +446,21 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, if (m_Database.NewFormat) totalSize = m_Database.NewFormatString.Length(); else - for(i = 0; i < numItems; i++) + for (i = 0; i < numItems; i++) totalSize += m_Database.Items[allFilesMode ? i : indices[i]].Size; extractCallback->SetTotal(totalSize); - for(i = 0; i < numItems; i++, currentTotalSize += currentItemSize) + for (i = 0; i < numItems; i++, currentTotalSize += currentItemSize) { - RINOK(extractCallback->SetCompleted(¤tTotalSize)); + currentItemSize = 0; + lps->InSize = currentTotalSize; // Change it + lps->OutSize = currentTotalSize; + + RINOK(lps->SetCur()); CMyComPtr<ISequentialOutStream> realOutStream; - Int32 askMode; - askMode = testMode ? NArchive::NExtract::NAskMode::kTest : - NArchive::NExtract::NAskMode::kExtract; + Int32 askMode= testMode ? + NArchive::NExtract::NAskMode::kTest : + NArchive::NExtract::NAskMode::kExtract; Int32 index = allFilesMode ? i : indices[i]; RINOK(extractCallback->GetStream(index, &realOutStream, askMode)); @@ -458,7 +468,7 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, { if (index != 0) return E_FAIL; - if(!testMode && (!realOutStream)) + if (!testMode && (!realOutStream)) continue; if (!testMode) { @@ -472,7 +482,7 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, currentItemSize = item.Size; - if(!testMode && (!realOutStream)) + if (!testMode && (!realOutStream)) continue; RINOK(extractCallback->PrepareOperation(askMode)); if (item.Section != 0) @@ -488,28 +498,19 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, } RINOK(m_Stream->Seek(m_Database.ContentOffset + item.Offset, STREAM_SEEK_SET, NULL)); - streamSpec->SetStream(m_Stream); streamSpec->Init(item.Size); - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - localProgressSpec->Init(extractCallback, false); - - CLocalCompressProgressInfo *localCompressProgressSpec = new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; - localCompressProgressSpec->Init(progress, ¤tTotalSize, ¤tTotalSize); - - if(!copyCoder) - copyCoder = new NCompress::CCopyCoder; - RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, compressProgress)); + RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, progress)); realOutStream.Release(); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); + RINOK(extractCallback->SetOperationResult((copyCoderSpec->TotalSize == item.Size) ? + NArchive::NExtract::NOperationResult::kOK: + NArchive::NExtract::NOperationResult::kDataError)); } return S_OK; } UInt64 lastFolderIndex = ((UInt64)0 - 1); - for(i = 0; i < numItems; i++) + for (i = 0; i < numItems; i++) { UInt32 index = allFilesMode ? i : indices[i]; int entryIndex = m_Database.Indices[index]; @@ -545,7 +546,7 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, currentTotalSize = 0; CRecordVector<bool> extractStatuses; - for(i = 0; i < numItems;) + for (i = 0; i < numItems;) { RINOK(extractCallback->SetCompleted(¤tTotalSize)); UInt32 index = allFilesMode ? i : indices[i]; @@ -566,32 +567,27 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, continue; } - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - localProgressSpec->Init(extractCallback, false); - - CLocalCompressProgressInfo *localCompressProgressSpec = new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; - localCompressProgressSpec->Init(progress, NULL, ¤tTotalSize); + lps->InSize = currentTotalSize; // Change it + lps->OutSize = currentTotalSize; if (item.Size == 0 || sectionIndex == 0) { CMyComPtr<ISequentialOutStream> realOutStream; RINOK(extractCallback->GetStream(index, &realOutStream, askMode)); - if(!testMode && (!realOutStream)) + if (!testMode && (!realOutStream)) continue; RINOK(extractCallback->PrepareOperation(askMode)); + Int32 opRes = NArchive::NExtract::NOperationResult::kOK; if (!testMode && item.Size != 0) { RINOK(m_Stream->Seek(m_Database.ContentOffset + item.Offset, STREAM_SEEK_SET, NULL)); - streamSpec->SetStream(m_Stream); streamSpec->Init(item.Size); - if(!copyCoder) - copyCoder = new NCompress::CCopyCoder; - RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, compressProgress)); + RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, progress)); + if (copyCoderSpec->TotalSize != item.Size) + opRes = NArchive::NExtract::NOperationResult::kDataError; } realOutStream.Release(); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); + RINOK(extractCallback->SetOperationResult(opRes)); currentTotalSize += item.Size; continue; } @@ -652,7 +648,7 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, chmFolderOutStream->m_StartIndex = index; if (limitFolderIndex == folderIndex) { - for(; i < numItems; i++) + for (; i < numItems; i++) { UInt32 nextIndex = allFilesMode ? i : indices[i]; int entryIndex = m_Database.Indices[nextIndex]; diff --git a/CPP/7zip/Archive/Com/ComHandler.cpp b/CPP/7zip/Archive/Com/ComHandler.cpp index 6d548256..aa9bf859 100755 --- a/CPP/7zip/Archive/Com/ComHandler.cpp +++ b/CPP/7zip/Archive/Com/ComHandler.cpp @@ -10,7 +10,7 @@ namespace NArchive { namespace NCom { -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, { NULL, kpidIsFolder, VT_BOOL}, @@ -21,49 +21,32 @@ STATPROPSTG kProperties[] = { NULL, kpidLastWriteTime, VT_FILETIME} }; -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) -{ - value->vt = VT_EMPTY; - return S_OK; -} -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) +STATPROPSTG kArcProps[] = { - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} + { NULL, kpidClusterSize, VT_UI4} +}; -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - if (srcItem.lpwstrName == 0) - *name = 0; - else - *name = ::SysAllocString(srcItem.lpwstrName); - return S_OK; -} +IMP_IInArchive_Props +IMP_IInArchive_ArcProps -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) +STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value) { - *numProperties = 0; + COM_TRY_BEGIN + NWindows::NCOM::CPropVariant prop; + switch(propID) + { + case kpidClusterSize: prop = (UInt32)1 << _db.SectorSizeBits; break; + } + prop.Detach(value); return S_OK; -} - -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_INVALIDARG; + COM_TRY_END } STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; + NWindows::NCOM::CPropVariant prop; const CRef &ref = _db.Refs[index]; const CItem &item = _db.Items[ref.Did]; @@ -72,21 +55,21 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val case kpidPath: { UString name = _db.GetItemPath(index); - propVariant = name; + prop = name; break; } case kpidIsFolder: - propVariant = item.IsDir(); + prop = item.IsDir(); break; case kpidCreationTime: - propVariant = item.CreationTime; + prop = item.CreationTime; break; case kpidLastWriteTime: - propVariant = item.LastWriteTime; + prop = item.LastWriteTime; break; /* case kpidAttributes: - propVariant = item.Falgs; + prop = item.Falgs; break; */ case kpidPackedSize: @@ -95,15 +78,15 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val int numBits = _db.IsLargeStream(item.Size) ? _db.SectorSizeBits : _db.MiniSectorSizeBits; - propVariant = (item.Size + ((UInt32)1 << numBits) - 1) >> numBits << numBits; + prop = (item.Size + ((UInt64)1 << numBits) - 1) >> numBits << numBits; break; } case kpidSize: if (!item.IsDir()) - propVariant = (UInt64)item.Size; + prop = (UInt64)item.Size; break; } - propVariant.Detach(value); + prop.Detach(value); return S_OK; COM_TRY_END } diff --git a/CPP/7zip/Archive/Com/ComIn.cpp b/CPP/7zip/Archive/Com/ComIn.cpp index 0db3f1c6..c3549609 100755 --- a/CPP/7zip/Archive/Com/ComIn.cpp +++ b/CPP/7zip/Archive/Com/ComIn.cpp @@ -338,7 +338,7 @@ HRESULT OpenArchive(IInStream *inStream, CDatabase &db) if (!db.MiniSids.Allocate(numSectorsInMiniStream)) return S_FALSE; { - UInt64 matSize64 = (root.Size + (1 << miniSectorSizeBits) - 1) >> miniSectorSizeBits; + UInt64 matSize64 = (root.Size + ((UInt64)1 << miniSectorSizeBits) - 1) >> miniSectorSizeBits; if (matSize64 > NFatID::kMaxValue) return S_FALSE; db.MatSize = (UInt32)matSize64; diff --git a/CPP/7zip/Archive/Com/ComRegister.cpp b/CPP/7zip/Archive/Com/ComRegister.cpp index 688c9803..c744b04f 100755 --- a/CPP/7zip/Archive/Com/ComRegister.cpp +++ b/CPP/7zip/Archive/Com/ComRegister.cpp @@ -8,6 +8,6 @@ static IInArchive *CreateArc() { return new NArchive::NCom::CHandler; } static CArcInfo g_ArcInfo = - { L"Com", L"msi doc xls ppt", 0, 0xE5, { 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1 }, 8, false, CreateArc, 0 }; + { L"Compound", L"msi doc xls ppt", 0, 0xE5, { 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1 }, 8, false, CreateArc, 0 }; REGISTER_ARC(Com) diff --git a/CPP/7zip/Archive/Common/CoderMixer2MT.cpp b/CPP/7zip/Archive/Common/CoderMixer2MT.cpp index a297eb7f..2ef1fa95 100755 --- a/CPP/7zip/Archive/Common/CoderMixer2MT.cpp +++ b/CPP/7zip/Archive/Common/CoderMixer2MT.cpp @@ -167,6 +167,14 @@ HRESULT CCoderMixer2MT::Init(ISequentialInStream **inStreams, ISequentialOutStre return S_OK; } +HRESULT CCoderMixer2MT::ReturnIfError(HRESULT code) +{ + for (int i = 0; i < _coders.Size(); i++) + if (_coders[i].Result == code) + return code; + return S_OK; +} + STDMETHODIMP CCoderMixer2MT::Code(ISequentialInStream **inStreams, const UInt64 ** /* inSizes */, UInt32 numInStreams, @@ -198,18 +206,10 @@ STDMETHODIMP CCoderMixer2MT::Code(ISequentialInStream **inStreams, if (i != _progressCoderIndex) _coders[i].WaitFinish(); - for (i = 0; i < _coders.Size(); i++) - { - HRESULT result = _coders[i].Result; - if (result == E_ABORT) - return result; - } - for (i = 0; i < _coders.Size(); i++) - { - HRESULT result = _coders[i].Result; - if (result == S_FALSE) - return result; - } + RINOK(ReturnIfError(E_ABORT)); + RINOK(ReturnIfError(E_OUTOFMEMORY)); + RINOK(ReturnIfError(S_FALSE)); + for (i = 0; i < _coders.Size(); i++) { HRESULT result = _coders[i].Result; diff --git a/CPP/7zip/Archive/Common/CoderMixer2MT.h b/CPP/7zip/Archive/Common/CoderMixer2MT.h index 3cd3282b..505f1a88 100755 --- a/CPP/7zip/Archive/Common/CoderMixer2MT.h +++ b/CPP/7zip/Archive/Common/CoderMixer2MT.h @@ -51,6 +51,7 @@ class CCoderMixer2MT: void AddCoderCommon(); HRESULT Init(ISequentialInStream **inStreams, ISequentialOutStream **outStreams); + HRESULT ReturnIfError(HRESULT code); public: CObjectVector<CCoder2> _coders; MY_UNKNOWN_IMP diff --git a/CPP/7zip/Archive/Common/CoderMixerMT.cpp b/CPP/7zip/Archive/Common/CoderMixerMT.cpp index ad32896c..6319c5da 100755 --- a/CPP/7zip/Archive/Common/CoderMixerMT.cpp +++ b/CPP/7zip/Archive/Common/CoderMixerMT.cpp @@ -30,6 +30,14 @@ void CCoderMixerMT::ReInit() _coders[i].ReInit(); } +HRESULT CCoderMixerMT::ReturnIfError(HRESULT code) +{ + for (int i = 0; i < _coders.Size(); i++) + if (_coders[i].Result == code) + return code; + return S_OK; +} + STDMETHODIMP CCoderMixerMT::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream, const UInt64 * /* inSize */, const UInt64 * /* outSize */, @@ -67,18 +75,10 @@ STDMETHODIMP CCoderMixerMT::Code(ISequentialInStream *inStream, if (i != _progressCoderIndex) _coders[i].WaitFinish(); - for (i = 0; i < _coders.Size(); i++) - { - HRESULT result = _coders[i].Result; - if (result == E_ABORT) - return result; - } - for (i = 0; i < _coders.Size(); i++) - { - HRESULT result = _coders[i].Result; - if (result == S_FALSE) - return result; - } + RINOK(ReturnIfError(E_ABORT)); + RINOK(ReturnIfError(E_OUTOFMEMORY)); + RINOK(ReturnIfError(S_FALSE)); + for (i = 0; i < _coders.Size(); i++) { HRESULT result = _coders[i].Result; diff --git a/CPP/7zip/Archive/Common/CoderMixerMT.h b/CPP/7zip/Archive/Common/CoderMixerMT.h index 88b6e3e6..6fd1ba44 100755 --- a/CPP/7zip/Archive/Common/CoderMixerMT.h +++ b/CPP/7zip/Archive/Common/CoderMixerMT.h @@ -42,6 +42,7 @@ class CCoderMixerMT: CObjectVector<CStreamBinder> _streamBinders; int _progressCoderIndex; + HRESULT ReturnIfError(HRESULT code); public: CObjectVector<CCoder> _coders; MY_UNKNOWN_IMP diff --git a/CPP/7zip/Archive/Common/DummyOutStream.cpp b/CPP/7zip/Archive/Common/DummyOutStream.cpp index b1d49913..54bcfec1 100755 --- a/CPP/7zip/Archive/Common/DummyOutStream.cpp +++ b/CPP/7zip/Archive/Common/DummyOutStream.cpp @@ -4,17 +4,19 @@ #include "DummyOutStream.h" -void CDummyOutStream::Init(ISequentialOutStream *outStream) +STDMETHODIMP CDummyOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize) { - m_Stream = outStream; -} - -STDMETHODIMP CDummyOutStream::Write(const void *data, - UInt32 size, UInt32 *processedSize) -{ - if(m_Stream) - return m_Stream->Write(data, size, processedSize); + UInt32 realProcessedSize; + HRESULT result; + if(!_stream) + { + realProcessedSize = size; + result = S_OK; + } + else + result = _stream->Write(data, size, &realProcessedSize); + _size += realProcessedSize; if(processedSize != NULL) - *processedSize = size; - return S_OK; + *processedSize = realProcessedSize; + return result; } diff --git a/CPP/7zip/Archive/Common/DummyOutStream.h b/CPP/7zip/Archive/Common/DummyOutStream.h index 51690787..d19b3111 100755 --- a/CPP/7zip/Archive/Common/DummyOutStream.h +++ b/CPP/7zip/Archive/Common/DummyOutStream.h @@ -10,14 +10,14 @@ class CDummyOutStream: public ISequentialOutStream, public CMyUnknownImp { + CMyComPtr<ISequentialOutStream> _stream; + UInt64 _size; public: + void SetStream(ISequentialOutStream *outStream) { _stream = outStream; } + void Init() { _size = 0; } MY_UNKNOWN_IMP - STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize); -private: - CMyComPtr<ISequentialOutStream> m_Stream; -public: - void Init(ISequentialOutStream *outStream); + UInt64 GetSize() const { return _size; } }; #endif diff --git a/CPP/7zip/Archive/Cpio/CpioHandler.cpp b/CPP/7zip/Archive/Cpio/CpioHandler.cpp index 601afbd6..e2392b86 100755 --- a/CPP/7zip/Archive/Cpio/CpioHandler.cpp +++ b/CPP/7zip/Archive/Cpio/CpioHandler.cpp @@ -3,6 +3,7 @@ #include "StdAfx.h" #include "CpioHandler.h" +#include "CpioIn.h" #include "Common/Defs.h" #include "Common/StringConvert.h" @@ -16,8 +17,8 @@ #include "../../Common//LimitedStreams.h" #include "../../Compress/Copy/CopyCoder.h" + #include "../Common/ItemNameUtils.h" -#include "CpioIn.h" using namespace NWindows; using namespace NTime; @@ -25,13 +26,15 @@ using namespace NTime; namespace NArchive { namespace NCpio { +/* enum // PropID { kpidinode = kpidUserDefined, kpidiChkSum }; +*/ -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, { NULL, kpidIsFolder, VT_BOOL}, @@ -44,43 +47,10 @@ STATPROPSTG kProperties[] = // { L"CheckSum", kpidiChkSum, VT_UI4} }; -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) -{ - value->vt = VT_EMPTY; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} - -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - *name = 0; - return S_OK; -} +IMP_IInArchive_Props +IMP_IInArchive_ArcProps_NO -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) -{ - *numProperties = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_INVALIDARG; -} - -STDMETHODIMP CHandler::Open(IInStream *inStream, +STDMETHODIMP CHandler::Open(IInStream *stream, const UInt64 * /* maxCheckStartPosition */, IArchiveOpenCallback *openArchiveCallback) { @@ -89,41 +59,41 @@ STDMETHODIMP CHandler::Open(IInStream *inStream, { CInArchive archive; - if(archive.Open(inStream) != S_OK) + if (archive.Open(stream) != S_OK) return S_FALSE; - m_Items.Clear(); + _items.Clear(); if (openArchiveCallback != NULL) { RINOK(openArchiveCallback->SetTotal(NULL, NULL)); - UInt64 numFiles = m_Items.Size(); + UInt64 numFiles = _items.Size(); RINOK(openArchiveCallback->SetCompleted(&numFiles, NULL)); } for (;;) { - CItemEx itemInfo; + CItemEx item; bool filled; - HRESULT result = archive.GetNextItem(filled, itemInfo); + HRESULT result = archive.GetNextItem(filled, item); if (result == S_FALSE) return S_FALSE; if (result != S_OK) return S_FALSE; if (!filled) break; - m_Items.Add(itemInfo); - archive.SkeepDataRecords(itemInfo.Size, itemInfo.Align); + _items.Add(item); + archive.SkeepDataRecords(item.Size, item.Align); if (openArchiveCallback != NULL) { - UInt64 numFiles = m_Items.Size(); + UInt64 numFiles = _items.Size(); RINOK(openArchiveCallback->SetCompleted(&numFiles, NULL)); } } - if (m_Items.Size() == 0) + if (_items.Size() == 0) return S_FALSE; - m_InStream = inStream; + _inStream = stream; } /* catch(...) @@ -137,35 +107,35 @@ STDMETHODIMP CHandler::Open(IInStream *inStream, STDMETHODIMP CHandler::Close() { - m_Items.Clear(); - m_InStream.Release(); + _items.Clear(); + _inStream.Release(); return S_OK; } STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) { - *numItems = m_Items.Size(); + *numItems = _items.Size(); return S_OK; } STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; - const CItemEx &item = m_Items[index]; + NWindows::NCOM::CPropVariant prop; + const CItemEx &item = _items[index]; switch(propID) { case kpidPath: - propVariant = (const wchar_t *)NItemName::GetOSName( + prop = (const wchar_t *)NItemName::GetOSName( MultiByteToUnicodeString(item.Name, CP_OEMCP)); break; case kpidIsFolder: - propVariant = item.IsDirectory(); + prop = item.IsDirectory(); break; case kpidSize: case kpidPackedSize: - propVariant = item.Size; + prop = (UInt64)item.Size; break; case kpidLastWriteTime: { @@ -177,19 +147,19 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val utcFileTime.dwLowDateTime = 0; utcFileTime.dwHighDateTime = 0; } - propVariant = utcFileTime; + prop = utcFileTime; break; } + /* case kpidinode: - propVariant = item.inode; + prop = item.inode; break; - /* case kpidiChkSum: - propVariant = item.ChkSum; + prop = item.ChkSum; break; */ } - propVariant.Detach(value); + prop.Detach(value); return S_OK; COM_TRY_END } @@ -198,89 +168,65 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, Int32 _aTestMode, IArchiveExtractCallback *extractCallback) { COM_TRY_BEGIN + bool testMode = (_aTestMode != 0); bool allFilesMode = (numItems == UInt32(-1)); if (allFilesMode) - numItems = m_Items.Size(); - if(numItems == 0) + numItems = _items.Size(); + if (numItems == 0) return S_OK; - bool testMode = (_aTestMode != 0); UInt64 totalSize = 0; UInt32 i; - for(i = 0; i < numItems; i++) - totalSize += m_Items[allFilesMode ? i : indices[i]].Size; + for (i = 0; i < numItems; i++) + totalSize += _items[allFilesMode ? i : indices[i]].Size; extractCallback->SetTotal(totalSize); UInt64 currentTotalSize = 0; UInt64 currentItemSize; - CMyComPtr<ICompressCoder> copyCoder; + NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder(); + CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec; - for(i = 0; i < numItems; i++, currentTotalSize += currentItemSize) + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, false); + + CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; + CMyComPtr<ISequentialInStream> inStream(streamSpec); + streamSpec->SetStream(_inStream); + + for (i = 0; i < numItems; i++, currentTotalSize += currentItemSize) { - RINOK(extractCallback->SetCompleted(¤tTotalSize)); + lps->InSize = lps->OutSize = currentTotalSize; + RINOK(lps->SetCur()); CMyComPtr<ISequentialOutStream> realOutStream; - Int32 askMode; - askMode = testMode ? NArchive::NExtract::NAskMode::kTest : + Int32 askMode = testMode ? + NArchive::NExtract::NAskMode::kTest : NArchive::NExtract::NAskMode::kExtract; Int32 index = allFilesMode ? i : indices[i]; - const CItemEx &itemInfo = m_Items[index]; - + const CItemEx &item = _items[index]; RINOK(extractCallback->GetStream(index, &realOutStream, askMode)); - - currentItemSize = itemInfo.Size; - - if(itemInfo.IsDirectory()) + currentItemSize = item.Size; + if (item.IsDirectory()) { RINOK(extractCallback->PrepareOperation(askMode)); RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); continue; } - if(!testMode && (!realOutStream)) - { + if (!testMode && (!realOutStream)) continue; - } RINOK(extractCallback->PrepareOperation(askMode)); + if (testMode) { - if (testMode) - { - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); - continue; - } - - RINOK(m_InStream->Seek(itemInfo.GetDataPosition(), STREAM_SEEK_SET, NULL)); - CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; - CMyComPtr<ISequentialInStream> inStream(streamSpec); - streamSpec->SetStream(m_InStream); - streamSpec->Init(itemInfo.Size); - - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - localProgressSpec->Init(extractCallback, false); - - CLocalCompressProgressInfo *localCompressProgressSpec = - new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; - localCompressProgressSpec->Init(progress, - ¤tTotalSize, ¤tTotalSize); - - if(copyCoder == NULL) - { - copyCoder = new NCompress::CCopyCoder; - } - try - { - RINOK(copyCoder->Code(inStream, realOutStream, - NULL, NULL, compressProgress)); - } - catch(...) - { - realOutStream.Release(); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kDataError)); - continue; - } - realOutStream.Release(); RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); + continue; } + RINOK(_inStream->Seek(item.GetDataPosition(), STREAM_SEEK_SET, NULL)); + streamSpec->Init(item.Size); + RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, progress)); + realOutStream.Release(); + RINOK(extractCallback->SetOperationResult((copyCoderSpec->TotalSize == item.Size) ? + NArchive::NExtract::NOperationResult::kOK: + NArchive::NExtract::NOperationResult::kDataError)); } return S_OK; COM_TRY_END diff --git a/CPP/7zip/Archive/Cpio/CpioHandler.h b/CPP/7zip/Archive/Cpio/CpioHandler.h index e9320e61..3b4e7036 100755 --- a/CPP/7zip/Archive/Cpio/CpioHandler.h +++ b/CPP/7zip/Archive/Cpio/CpioHandler.h @@ -21,8 +21,8 @@ public: INTERFACE_IInArchive(;) private: - CObjectVector<CItemEx> m_Items; - CMyComPtr<IInStream> m_InStream; + CObjectVector<CItemEx> _items; + CMyComPtr<IInStream> _inStream; }; }} diff --git a/CPP/7zip/Archive/Deb/DebHandler.cpp b/CPP/7zip/Archive/Deb/DebHandler.cpp index 8728cec8..19cf310b 100755 --- a/CPP/7zip/Archive/Deb/DebHandler.cpp +++ b/CPP/7zip/Archive/Deb/DebHandler.cpp @@ -26,51 +26,16 @@ using namespace NTime; namespace NArchive { namespace NDeb { -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, - // { NULL, kpidIsFolder, VT_BOOL}, { NULL, kpidSize, VT_UI8}, { NULL, kpidPackedSize, VT_UI8}, { NULL, kpidLastWriteTime, VT_FILETIME} }; -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) -{ - value->vt = VT_EMPTY; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} - -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - *name = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) -{ - *numProperties = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_INVALIDARG; -} - +IMP_IInArchive_Props +IMP_IInArchive_ArcProps_NO STDMETHODIMP CHandler::Open(IInStream *stream, const UInt64 * /* maxCheckStartPosition */, @@ -92,17 +57,17 @@ STDMETHODIMP CHandler::Open(IInStream *stream, for (;;) { - CItemEx itemInfo; + CItemEx item; bool filled; - HRESULT result = archive.GetNextItem(filled, itemInfo); + HRESULT result = archive.GetNextItem(filled, item); if (result == S_FALSE) return S_FALSE; if (result != S_OK) return S_FALSE; if (!filled) break; - _items.Add(itemInfo); - archive.SkeepData(itemInfo.Size); + _items.Add(item); + archive.SkeepData(item.Size); if (openArchiveCallback != NULL) { UInt64 numFiles = _items.Size(); @@ -131,21 +96,21 @@ STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; + NWindows::NCOM::CPropVariant prop; const CItemEx &item = _items[index]; switch(propID) { case kpidPath: - propVariant = (const wchar_t *)NItemName::GetOSName2( + prop = (const wchar_t *)NItemName::GetOSName2( MultiByteToUnicodeString(item.Name, CP_OEMCP)); break; case kpidIsFolder: - propVariant = false; + prop = false; break; case kpidSize: case kpidPackedSize: - propVariant = item.Size; + prop = item.Size; break; case kpidLastWriteTime: { @@ -157,11 +122,11 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val utcFileTime.dwLowDateTime = 0; utcFileTime.dwHighDateTime = 0; } - propVariant = utcFileTime; + prop = utcFileTime; break; } } - propVariant.Detach(value); + prop.Detach(value); return S_OK; COM_TRY_END } @@ -170,83 +135,65 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, Int32 _aTestMode, IArchiveExtractCallback *extractCallback) { COM_TRY_BEGIN + bool testMode = (_aTestMode != 0); bool allFilesMode = (numItems == UInt32(-1)); if (allFilesMode) numItems = _items.Size(); - if(numItems == 0) + if (numItems == 0) return S_OK; - bool testMode = (_aTestMode != 0); UInt64 totalSize = 0; UInt32 i; - for(i = 0; i < numItems; i++) + for (i = 0; i < numItems; i++) totalSize += _items[allFilesMode ? i : indices[i]].Size; extractCallback->SetTotal(totalSize); UInt64 currentTotalSize = 0; UInt64 currentItemSize; - CMyComPtr<ICompressCoder> copyCoder; + NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder(); + CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec; - for(i = 0; i < numItems; i++, currentTotalSize += currentItemSize) + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, false); + + CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; + CMyComPtr<ISequentialInStream> inStream(streamSpec); + streamSpec->SetStream(_inStream); + + for (i = 0; i < numItems; i++, currentTotalSize += currentItemSize) { - RINOK(extractCallback->SetCompleted(¤tTotalSize)); + lps->InSize = lps->OutSize = currentTotalSize; + RINOK(lps->SetCur()); CMyComPtr<ISequentialOutStream> realOutStream; - Int32 askMode; - askMode = testMode ? NArchive::NExtract::NAskMode::kTest : + Int32 askMode = testMode ? + NArchive::NExtract::NAskMode::kTest : NArchive::NExtract::NAskMode::kExtract; Int32 index = allFilesMode ? i : indices[i]; - const CItemEx &itemInfo = _items[index]; - + const CItemEx &item = _items[index]; RINOK(extractCallback->GetStream(index, &realOutStream, askMode)); - - currentItemSize = itemInfo.Size; - - if(!testMode && (!realOutStream)) - { + currentItemSize = item.Size; + + + + + + + if (!testMode && (!realOutStream)) continue; - } RINOK(extractCallback->PrepareOperation(askMode)); + if (testMode) { - if (testMode) - { - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); - continue; - } - - RINOK(_inStream->Seek(itemInfo.GetDataPosition(), STREAM_SEEK_SET, NULL)); - CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; - CMyComPtr<ISequentialInStream> inStream(streamSpec); - streamSpec->SetStream(_inStream); - streamSpec->Init(itemInfo.Size); - - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - localProgressSpec->Init(extractCallback, false); - - CLocalCompressProgressInfo *localCompressProgressSpec = - new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; - localCompressProgressSpec->Init(progress, - ¤tTotalSize, ¤tTotalSize); - - if(copyCoder == NULL) - { - copyCoder = new NCompress::CCopyCoder; - } - try - { - RINOK(copyCoder->Code(inStream, realOutStream, - NULL, NULL, compressProgress)); - } - catch(...) - { - realOutStream.Release(); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kDataError)); - continue; - } - realOutStream.Release(); RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); + continue; } + RINOK(_inStream->Seek(item.GetDataPosition(), STREAM_SEEK_SET, NULL)); + streamSpec->Init(item.Size); + RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, progress)); + realOutStream.Release(); + RINOK(extractCallback->SetOperationResult((copyCoderSpec->TotalSize == item.Size) ? + NArchive::NExtract::NOperationResult::kOK: + NArchive::NExtract::NOperationResult::kDataError)); } return S_OK; COM_TRY_END diff --git a/CPP/7zip/Archive/GZip/GZipHandler.cpp b/CPP/7zip/Archive/GZip/GZipHandler.cpp index 427098ce..48d85fa4 100755 --- a/CPP/7zip/Archive/GZip/GZipHandler.cpp +++ b/CPP/7zip/Archive/GZip/GZipHandler.cpp @@ -59,15 +59,13 @@ enum // PropID }; */ -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, - // { NULL, kpidIsFolder, VT_BOOL}, { NULL, kpidSize, VT_UI8}, { NULL, kpidPackedSize, VT_UI8}, { NULL, kpidLastWriteTime, VT_FILETIME}, - // { NULL, kpidCommented, VT_BOOL}, // { NULL, kpidMethod, VT_UI1}, { NULL, kpidHostOS, VT_BSTR}, @@ -77,39 +75,8 @@ STATPROPSTG kProperties[] = // { L"Is Text", kpidIsText, VT_BOOL}, }; -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) -{ - value->vt = VT_EMPTY; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} - -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - const STATPROPSTG &prop = kProperties[index]; - *propID = prop.propid; - *varType = prop.vt; - *name = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) -{ - *numProperties = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_NOTIMPL; -} +IMP_IInArchive_Props +IMP_IInArchive_ArcProps_NO STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) { @@ -120,15 +87,12 @@ STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) STDMETHODIMP CHandler::GetProperty(UInt32 /* index */, PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; + NWindows::NCOM::CPropVariant prop; switch(propID) { case kpidPath: if (m_Item.NameIsPresent()) - propVariant = MultiByteToUnicodeString(m_Item.Name, CP_ACP); - break; - case kpidIsFolder: - propVariant = false; + prop = MultiByteToUnicodeString(m_Item.Name, CP_ACP); break; case kpidLastWriteTime: { @@ -136,47 +100,47 @@ STDMETHODIMP CHandler::GetProperty(UInt32 /* index */, PROPID propID, PROPVARIA if (m_Item.Time != 0) { NTime::UnixTimeToFileTime((UInt32)m_Item.Time, utcTime); - propVariant = utcTime; + prop = utcTime; } else { // utcTime.dwLowDateTime = utcTime.dwHighDateTime = 0; - // propVariant = utcTime; + // prop = utcTime; } break; } case kpidSize: - propVariant = UInt64(m_Item.UnPackSize32); + prop = UInt64(m_Item.UnPackSize32); break; case kpidPackedSize: - propVariant = m_PackSize; + prop = m_PackSize; break; case kpidCommented: - propVariant = m_Item.CommentIsPresent(); + prop = m_Item.CommentIsPresent(); break; case kpidHostOS: - propVariant = (m_Item.HostOS < kNumHostOSes) ? + prop = (m_Item.HostOS < kNumHostOSes) ? kHostOS[m_Item.HostOS] : kUnknownOS; break; case kpidMethod: - propVariant = m_Item.CompressionMethod; + prop = m_Item.CompressionMethod; break; case kpidCRC: - propVariant = m_Item.FileCRC; + prop = m_Item.FileCRC; break; /* case kpidExtraFlags: - propVariant = m_Item.ExtraFlags; + prop = m_Item.ExtraFlags; break; case kpidIsText: - propVariant = m_Item.IsText(); + prop = m_Item.IsText(); break; case kpidExtraIsPresent: - propVariant = m_Item.ExtraFieldIsPresent(); + prop = m_Item.ExtraFieldIsPresent(); break; */ } - propVariant.Detach(value); + prop.Detach(value); return S_OK; COM_TRY_END } @@ -232,7 +196,7 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, extractCallback->SetTotal(m_PackSize); - UInt64 currentTotalUnPacked = 0, currentTotalPacked = 0; + UInt64 currentTotalPacked = 0; RINOK(extractCallback->SetCompleted(¤tTotalPacked)); CMyComPtr<ISequentialOutStream> realOutStream; @@ -253,22 +217,18 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, outStreamSpec->Init(); realOutStream.Release(); - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - localProgressSpec->Init(extractCallback, true); - - CLocalCompressProgressInfo *localCompressProgressSpec = - new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, true); CMyComPtr<ICompressCoder> deflateDecoder; bool firstItem = true; RINOK(m_Stream->Seek(m_StreamStartPosition, STREAM_SEEK_SET, NULL)); + Int32 opRes; for (;;) { - localCompressProgressSpec->Init(progress, - ¤tTotalPacked, - ¤tTotalUnPacked); + lps->InSize = currentTotalPacked; + lps->OutSize = outStreamSpec->GetSize(); CInArchive archive; CItem item; @@ -277,9 +237,8 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, { if (firstItem) return E_FAIL; - outStream.Release(); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)) - return S_OK; + opRes = NArchive::NExtract::NOperationResult::kOK; + break; } firstItem = false; @@ -288,45 +247,32 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, outStreamSpec->InitCRC(); - switch(item.CompressionMethod) + if (item.CompressionMethod != NFileHeader::NCompressionMethod::kDeflate) + { + opRes = NArchive::NExtract::NOperationResult::kUnSupportedMethod; + break; + } + + if (!deflateDecoder) { - case NFileHeader::NCompressionMethod::kDeflate: + RINOK(CreateCoder( + EXTERNAL_CODECS_VARS + kMethodId_Deflate, deflateDecoder, false)); + if (!deflateDecoder) { - if(!deflateDecoder) - { - RINOK(CreateCoder( - EXTERNAL_CODECS_VARS - kMethodId_Deflate, deflateDecoder, false)); - if (!deflateDecoder) - { - outStream.Release(); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kUnSupportedMethod)); - return S_OK; - } - } - try - { - HRESULT result = deflateDecoder->Code(m_Stream, outStream, NULL, NULL, compressProgress); - if (result == S_FALSE) - throw "data error"; - if (result != S_OK) - return result; - } - catch(...) - { - outStream.Release(); - RINOK(extractCallback->SetOperationResult( - NArchive::NExtract::NOperationResult::kDataError)); - return S_OK; - } + opRes = NArchive::NExtract::NOperationResult::kUnSupportedMethod; break; } - default: - outStream.Release(); - RINOK(extractCallback->SetOperationResult( - NArchive::NExtract::NOperationResult::kUnSupportedMethod)); - return S_OK; } + result = deflateDecoder->Code(m_Stream, outStream, NULL, NULL, progress); + if (result != S_OK) + { + if (result != S_FALSE) + return result; + opRes = NArchive::NExtract::NOperationResult::kDataError; + break; + } + CMyComPtr<ICompressGetInStreamProcessedSize> getInStreamProcessedSize; RINOK(deflateDecoder.QueryInterface(IID_ICompressGetInStreamProcessedSize, &getInStreamProcessedSize)); @@ -342,12 +288,13 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, return E_FAIL; if((outStreamSpec->GetCRC() != postItem.FileCRC)) { - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kCRCError)) + opRes = NArchive::NExtract::NOperationResult::kCRCError; break; } } + outStream.Release(); + return extractCallback->SetOperationResult(opRes); COM_TRY_END - return S_OK; } IMPL_ISetCompressCodecsInfo diff --git a/CPP/7zip/Archive/GZip/GZipHandlerOut.cpp b/CPP/7zip/Archive/GZip/GZipHandlerOut.cpp index 76cfd642..f2776adb 100755 --- a/CPP/7zip/Archive/GZip/GZipHandlerOut.cpp +++ b/CPP/7zip/Archive/GZip/GZipHandlerOut.cpp @@ -70,41 +70,41 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt UString name; bool isDirectory; { - NCOM::CPropVariant propVariant; - RINOK(updateCallback->GetProperty(itemIndex, kpidAttributes, &propVariant)); - if (propVariant.vt == VT_EMPTY) + NCOM::CPropVariant prop; + RINOK(updateCallback->GetProperty(itemIndex, kpidAttributes, &prop)); + if (prop.vt == VT_EMPTY) attributes = 0; - else if (propVariant.vt != VT_UI4) + else if (prop.vt != VT_UI4) return E_INVALIDARG; else - attributes = propVariant.ulVal; + attributes = prop.ulVal; } { - NCOM::CPropVariant propVariant; - RINOK(updateCallback->GetProperty(itemIndex, kpidLastWriteTime, &propVariant)); - if (propVariant.vt != VT_FILETIME) + NCOM::CPropVariant prop; + RINOK(updateCallback->GetProperty(itemIndex, kpidLastWriteTime, &prop)); + if (prop.vt != VT_FILETIME) return E_INVALIDARG; - utcTime = propVariant.filetime; + utcTime = prop.filetime; } { - NCOM::CPropVariant propVariant; - RINOK(updateCallback->GetProperty(itemIndex, kpidPath, &propVariant)); - if (propVariant.vt == VT_EMPTY) + NCOM::CPropVariant prop; + RINOK(updateCallback->GetProperty(itemIndex, kpidPath, &prop)); + if (prop.vt == VT_EMPTY) name.Empty(); - else if (propVariant.vt != VT_BSTR) + else if (prop.vt != VT_BSTR) return E_INVALIDARG; else - name = propVariant.bstrVal; + name = prop.bstrVal; } { - NCOM::CPropVariant propVariant; - RINOK(updateCallback->GetProperty(itemIndex, kpidIsFolder, &propVariant)); - if (propVariant.vt == VT_EMPTY) + NCOM::CPropVariant prop; + RINOK(updateCallback->GetProperty(itemIndex, kpidIsFolder, &prop)); + if (prop.vt == VT_EMPTY) isDirectory = false; - else if (propVariant.vt != VT_BOOL) + else if (prop.vt != VT_BOOL) return E_INVALIDARG; else - isDirectory = (propVariant.boolVal != VARIANT_FALSE); + isDirectory = (prop.boolVal != VARIANT_FALSE); } if (isDirectory || NFile::NFind::NAttributes::IsDirectory(attributes)) return E_INVALIDARG; @@ -121,11 +121,11 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt if (IntToBool(newData)) { { - NCOM::CPropVariant propVariant; - RINOK(updateCallback->GetProperty(itemIndex, kpidSize, &propVariant)); - if (propVariant.vt != VT_UI8) + NCOM::CPropVariant prop; + RINOK(updateCallback->GetProperty(itemIndex, kpidSize, &prop)); + if (prop.vt != VT_UI8) return E_INVALIDARG; - size = propVariant.uhVal.QuadPart; + size = prop.uhVal.QuadPart; } newItem.UnPackSize32 = (UInt32)size; diff --git a/CPP/7zip/Archive/GZip/GZipUpdate.cpp b/CPP/7zip/Archive/GZip/GZipUpdate.cpp index 17e27c9f..1f5ebd0e 100755 --- a/CPP/7zip/Archive/GZip/GZipUpdate.cpp +++ b/CPP/7zip/Archive/GZip/GZipUpdate.cpp @@ -34,9 +34,7 @@ HRESULT UpdateArchive( int indexInClient, IArchiveUpdateCallback *updateCallback) { - UInt64 complexity = 0; - - complexity += unpackSize; + UInt64 complexity = unpackSize; RINOK(updateCallback->SetTotal(complexity)); @@ -54,13 +52,9 @@ HRESULT UpdateArchive( inStreamSpec->SetStream(fileInStream); inStreamSpec->Init(); - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> localProgress = localProgressSpec; - localProgressSpec->Init(updateCallback, true); - - CLocalCompressProgressInfo *localCompressProgressSpec = - new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(updateCallback, true); COutArchive outArchive; outArchive.Create(outStream); @@ -72,8 +66,6 @@ HRESULT UpdateArchive( RINOK(outArchive.WriteHeader(item)); - localCompressProgressSpec->Init(localProgress, &complexity, NULL); - { RINOK(CreateCoder( EXTERNAL_CODECS_LOC_VARS @@ -102,7 +94,7 @@ HRESULT UpdateArchive( RINOK(deflateEncoder.QueryInterface(IID_ICompressSetCoderProperties, &setCoderProperties)); RINOK(setCoderProperties->SetCoderProperties(propIDs, properties, numProps)); } - RINOK(deflateEncoder->Code(crcStream, outStream, NULL, NULL, compressProgress)); + RINOK(deflateEncoder->Code(crcStream, outStream, NULL, NULL, progress)); item.FileCRC = inStreamSpec->GetCRC(); item.UnPackSize32 = (UInt32)inStreamSpec->GetSize(); diff --git a/CPP/7zip/Archive/IArchive.h b/CPP/7zip/Archive/IArchive.h index 5fe20a72..e0ae7aa1 100755 --- a/CPP/7zip/Archive/IArchive.h +++ b/CPP/7zip/Archive/IArchive.h @@ -7,12 +7,7 @@ #include "../IProgress.h" #include "../PropID.h" -// MIDL_INTERFACE("23170F69-40C1-278A-0000-000600xx0000") -#define ARCHIVE_INTERFACE_SUB(i, base, x) \ -DEFINE_GUID(IID_ ## i, \ -0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x06, 0x00, x, 0x00, 0x00); \ -struct i: public base - +#define ARCHIVE_INTERFACE_SUB(i, base, x) DECL_INTERFACE_SUB(i, base, 6, x) #define ARCHIVE_INTERFACE(i, x) ARCHIVE_INTERFACE_SUB(i, IUnknown, x) namespace NFileTimeType @@ -172,4 +167,41 @@ ARCHIVE_INTERFACE(ISetProperties, 0x03) }; +#define IMP_IInArchive_GetProp(k) \ + (UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) \ + { if(index >= sizeof(k) / sizeof(k[0])) return E_INVALIDARG; \ + const STATPROPSTG &srcItem = k[index]; \ + *propID = srcItem.propid; *varType = srcItem.vt; *name = 0; return S_OK; } \ + +#define IMP_IInArchive_GetProp_WITH_NAME(k) \ + (UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) \ + { if(index >= sizeof(k) / sizeof(k[0])) return E_INVALIDARG; \ + const STATPROPSTG &srcItem = k[index]; \ + *propID = srcItem.propid; *varType = srcItem.vt; \ + if (srcItem.lpwstrName == 0) *name = 0; else *name = ::SysAllocString(srcItem.lpwstrName); return S_OK; } \ + +#define IMP_IInArchive_Props \ + STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) \ + { *numProperties = sizeof(kProps) / sizeof(kProps[0]); return S_OK; } \ + STDMETHODIMP CHandler::GetPropertyInfo IMP_IInArchive_GetProp(kProps) + +#define IMP_IInArchive_Props_WITH_NAME \ + STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) \ + { *numProperties = sizeof(kProps) / sizeof(kProps[0]); return S_OK; } \ + STDMETHODIMP CHandler::GetPropertyInfo IMP_IInArchive_GetProp_WITH_NAME(kProps) + + +#define IMP_IInArchive_ArcProps \ + STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) \ + { *numProperties = sizeof(kArcProps) / sizeof(kArcProps[0]); return S_OK; } \ + STDMETHODIMP CHandler::GetArchivePropertyInfo IMP_IInArchive_GetProp(kArcProps) + +#define IMP_IInArchive_ArcProps_NO \ + STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) \ + { *numProperties = 0; return S_OK; } \ + STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32, BSTR *, PROPID *, VARTYPE *) \ + { return E_NOTIMPL; } \ + STDMETHODIMP CHandler::GetArchiveProperty(PROPID, PROPVARIANT *value) \ + { value->vt = VT_EMPTY; return S_OK; } + #endif diff --git a/CPP/7zip/Archive/Iso/IsoHandler.cpp b/CPP/7zip/Archive/Iso/IsoHandler.cpp index 1b20f257..0ab39c4f 100755 --- a/CPP/7zip/Archive/Iso/IsoHandler.cpp +++ b/CPP/7zip/Archive/Iso/IsoHandler.cpp @@ -15,6 +15,7 @@ #include "../../Common/ProgressUtils.h" #include "../../Common/LimitedStreams.h" + #include "../../Compress/Copy/CopyCoder.h" #include "../Common/ItemNameUtils.h" @@ -25,7 +26,7 @@ using namespace NTime; namespace NArchive { namespace NIso { -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, { NULL, kpidIsFolder, VT_BOOL}, @@ -34,41 +35,8 @@ STATPROPSTG kProperties[] = { NULL, kpidLastWriteTime, VT_FILETIME} }; -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) -{ - value->vt = VT_EMPTY; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} - -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - *name = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) -{ - *numProperties = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_INVALIDARG; -} +IMP_IInArchive_Props +IMP_IInArchive_ArcProps_NO STDMETHODIMP CHandler::Open(IInStream *stream, const UInt64 * /* maxCheckStartPosition */, @@ -103,7 +71,7 @@ STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; + NWindows::NCOM::CPropVariant prop; if (index >= (UInt32)_archive.Refs.Size()) { index -= _archive.Refs.Size(); @@ -118,16 +86,16 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val // s += name; // s += L"-"; s += be.GetName(); - propVariant = (const wchar_t *)s; + prop = (const wchar_t *)s; break; } case kpidIsFolder: - propVariant = false; + prop = false; break; case kpidSize: case kpidPackedSize: { - propVariant = (UInt64)_archive.GetBootItemSize(index); + prop = (UInt64)_archive.GetBootItemSize(index); break; } } @@ -154,22 +122,22 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val if (!s.IsEmpty()) if (s[s.Length() - 1] == L'.') s = s.Left(s.Length() - 1); - propVariant = (const wchar_t *)NItemName::GetOSName2(s); + prop = (const wchar_t *)NItemName::GetOSName2(s); } break; case kpidIsFolder: - propVariant = item.IsDir(); + prop = item.IsDir(); break; case kpidSize: case kpidPackedSize: if (!item.IsDir()) - propVariant = (UInt64)item.DataLength; + prop = (UInt64)item.DataLength; break; case kpidLastWriteTime: { FILETIME utcFileTime; if (item.DateTime.GetFileTime(utcFileTime)) - propVariant = utcFileTime; + prop = utcFileTime; /* else { @@ -181,7 +149,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val } } } - propVariant.Detach(value); + prop.Detach(value); return S_OK; COM_TRY_END } @@ -194,9 +162,9 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, bool allFilesMode = (numItems == UInt32(-1)); if (allFilesMode) numItems = _archive.Refs.Size(); - UInt64 totalSize = 0; if(numItems == 0) return S_OK; + UInt64 totalSize = 0; UInt32 i; for(i = 0; i < numItems; i++) { @@ -217,12 +185,22 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, UInt64 currentTotalSize = 0; UInt64 currentItemSize; - CMyComPtr<ICompressCoder> copyCoder; + NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder(); + CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec; + + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, false); + + CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; + CMyComPtr<ISequentialInStream> inStream(streamSpec); + streamSpec->SetStream(_inStream); for (i = 0; i < numItems; i++, currentTotalSize += currentItemSize) { + lps->InSize = lps->OutSize = currentTotalSize; + RINOK(lps->SetCur()); currentItemSize = 0; - RINOK(extractCallback->SetCompleted(¤tTotalSize)); CMyComPtr<ISequentialOutStream> realOutStream; Int32 askMode; askMode = testMode ? NArchive::NExtract::NAskMode::kTest : NArchive::NExtract::NAskMode::kExtract; @@ -252,47 +230,21 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, blockIndex = be.LoadRBA; } - if(!testMode && (!realOutStream)) + if (!testMode && (!realOutStream)) continue; - RINOK(extractCallback->PrepareOperation(askMode)); + if (testMode) { - if (testMode) - { - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); - continue; - } - - RINOK(_inStream->Seek(blockIndex * _archive.BlockSize, STREAM_SEEK_SET, NULL)); - CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; - CMyComPtr<ISequentialInStream> inStream(streamSpec); - streamSpec->SetStream(_inStream); - streamSpec->Init(currentItemSize); - - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - localProgressSpec->Init(extractCallback, false); - - CLocalCompressProgressInfo *localCompressProgressSpec = new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; - localCompressProgressSpec->Init(progress, ¤tTotalSize, ¤tTotalSize); - - Int32 res = NArchive::NExtract::NOperationResult::kOK; - if(!copyCoder) - { - copyCoder = new NCompress::CCopyCoder; - } - try - { - RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, compressProgress)); - } - catch(...) - { - res = NArchive::NExtract::NOperationResult::kDataError; - } - realOutStream.Release(); - RINOK(extractCallback->SetOperationResult(res)); + RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); + continue; } + RINOK(_inStream->Seek(blockIndex * _archive.BlockSize, STREAM_SEEK_SET, NULL)); + streamSpec->Init(currentItemSize); + RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, progress)); + realOutStream.Release(); + RINOK(extractCallback->SetOperationResult((copyCoderSpec->TotalSize == currentItemSize) ? + NArchive::NExtract::NOperationResult::kOK: + NArchive::NExtract::NOperationResult::kDataError)); } return S_OK; COM_TRY_END diff --git a/CPP/7zip/Archive/Lzh/LzhHandler.cpp b/CPP/7zip/Archive/Lzh/LzhHandler.cpp index 03af11d1..c5123f56 100755 --- a/CPP/7zip/Archive/Lzh/LzhHandler.cpp +++ b/CPP/7zip/Archive/Lzh/LzhHandler.cpp @@ -67,7 +67,7 @@ static const wchar_t *GetOS(Byte osId) return kUnknownOS; }; -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, { NULL, kpidIsFolder, VT_BOOL}, @@ -85,45 +85,10 @@ STATPROPSTG kProperties[] = }; +IMP_IInArchive_Props +IMP_IInArchive_ArcProps_NO -CHandler::CHandler() -{} - -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) -{ - value->vt = VT_EMPTY; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} - -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - *name = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) -{ - *numProperties = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_NOTIMPL; -} +CHandler::CHandler() {} STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) { @@ -134,7 +99,7 @@ STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; + NWindows::NCOM::CPropVariant prop; const CItemEx &item = _items[index]; switch(propID) { @@ -145,18 +110,18 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va { if (s[s.Length() - 1] == WCHAR_PATH_SEPARATOR) s.Delete(s.Length() - 1); - propVariant = s; + prop = s; } break; } case kpidIsFolder: - propVariant = item.IsDirectory(); + prop = item.IsDirectory(); break; case kpidSize: - propVariant = item.Size; + prop = item.Size; break; case kpidPackedSize: - propVariant = item.PackSize; + prop = item.PackSize; break; case kpidLastWriteTime: { @@ -177,19 +142,19 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va else utcFileTime.dwHighDateTime = utcFileTime.dwLowDateTime = 0; } - propVariant = utcFileTime; + prop = utcFileTime; break; } /* case kpidAttributes: - propVariant = (UInt32)item.Attributes; + prop = (UInt32)item.Attributes; break; case kpidCommented: - propVariant = item.IsCommented(); + prop = item.IsCommented(); break; */ case kpidCRC: - propVariant = (UInt32)item.CRC; + prop = (UInt32)item.CRC; break; case kpidMethod: { @@ -197,14 +162,14 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va method2[kMethodIdSize] = 0; for (int i = 0; i < kMethodIdSize; i++) method2[i] = item.Method[i]; - propVariant = method2; + prop = method2; break; } case kpidHostOS: - propVariant = GetOS(item.OsId); + prop = GetOS(item.OsId); break; } - propVariant.Detach(value); + prop.Detach(value); return S_OK; COM_TRY_END } @@ -242,17 +207,17 @@ STDMETHODIMP CHandler::Open(IInStream *inStream, } for (;;) { - CItemEx itemInfo; + CItemEx item; bool filled; - HRESULT result = archive.GetNextItem(filled, itemInfo); + HRESULT result = archive.GetNextItem(filled, item); if (result == S_FALSE) return S_FALSE; if (result != S_OK) return S_FALSE; if (!filled) break; - _items.Add(itemInfo); - archive.Skeep(itemInfo.PackSize); + _items.Add(item); + archive.Skeep(item.PackSize); if (callback != NULL) { UInt64 numFiles = _items.Size(); @@ -298,9 +263,9 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, UInt32 i; for(i = 0; i < numItems; i++) { - const CItemEx &itemInfo = _items[allFilesMode ? i : indices[i]]; - totalUnPacked += itemInfo.Size; - totalPacked += itemInfo.PackSize; + const CItemEx &item = _items[allFilesMode ? i : indices[i]]; + totalUnPacked += item.Size; + totalPacked += item.PackSize; } extractCallback->SetTotal(totalUnPacked); @@ -311,7 +276,17 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, CMyComPtr<ICompressCoder> lzhDecoder; CMyComPtr<ICompressCoder> lzh1Decoder; CMyComPtr<ICompressCoder> arj2Decoder; - CMyComPtr<ICompressCoder> copyCoder; + + NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder(); + CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec; + + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, false); + + CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; + CMyComPtr<ISequentialInStream> inStream(streamSpec); + streamSpec->SetStream(_stream); for(i = 0; i < numItems; i++, currentTotalUnPacked += currentItemUnPacked, currentTotalPacked += currentItemPacked) @@ -319,21 +294,24 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, currentItemUnPacked = 0; currentItemPacked = 0; - RINOK(extractCallback->SetCompleted(¤tTotalUnPacked)); + lps->InSize = currentTotalPacked; + lps->OutSize = currentTotalUnPacked; + RINOK(lps->SetCur()); + CMyComPtr<ISequentialOutStream> realOutStream; Int32 askMode; - askMode = testMode ? NArchive::NExtract::NAskMode::kTest : - NArchive::NExtract::NAskMode::kExtract; + askMode = testMode ? NExtract::NAskMode::kTest : + NExtract::NAskMode::kExtract; Int32 index = allFilesMode ? i : indices[i]; - const CItemEx &itemInfo = _items[index]; + const CItemEx &item = _items[index]; RINOK(extractCallback->GetStream(index, &realOutStream, askMode)); - if(itemInfo.IsDirectory()) + if(item.IsDirectory()) { // if (!testMode) { RINOK(extractCallback->PrepareOperation(askMode)); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); + RINOK(extractCallback->SetOperationResult(NExtract::NOperationResult::kOK)); } continue; } @@ -342,8 +320,8 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, continue; RINOK(extractCallback->PrepareOperation(askMode)); - currentItemUnPacked = itemInfo.Size; - currentItemPacked = itemInfo.PackSize; + currentItemUnPacked = item.Size; + currentItemPacked = item.PackSize; { COutStreamWithCRC *outStreamSpec = new COutStreamWithCRC; @@ -351,109 +329,58 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, outStreamSpec->Init(realOutStream); realOutStream.Release(); - CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; - CMyComPtr<ISequentialInStream> inStream(streamSpec); - UInt64 pos; - _stream->Seek(itemInfo.DataPosition, STREAM_SEEK_SET, &pos); - - streamSpec->SetStream(_stream); - streamSpec->Init(itemInfo.PackSize); - + _stream->Seek(item.DataPosition, STREAM_SEEK_SET, &pos); - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - localProgressSpec->Init(extractCallback, false); + streamSpec->Init(item.PackSize); + HRESULT result = S_OK; + Int32 opRes = NExtract::NOperationResult::kOK; - CLocalCompressProgressInfo *localCompressProgressSpec = - new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; - localCompressProgressSpec->Init(progress, - ¤tTotalPacked, - ¤tTotalUnPacked); - - HRESULT result; - - if (itemInfo.IsCopyMethod()) + if (item.IsCopyMethod()) { - if(!copyCoder) - copyCoder = new NCompress::CCopyCoder; - try - { - result = copyCoder->Code(inStream, outStream, NULL, NULL, compressProgress); - if (result == S_FALSE) - throw "data error"; - if (result != S_OK) - return result; - } - catch(...) - { - outStream.Release(); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kDataError)); - continue; - } + result = copyCoder->Code(inStream, outStream, NULL, NULL, progress); + if (result == S_OK && copyCoderSpec->TotalSize != item.PackSize) + result = S_FALSE; } - else if (itemInfo.IsLh4GroupMethod()) + else if (item.IsLh4GroupMethod()) { if(!lzhDecoder) { lzhDecoderSpec = new NCompress::NLzh::NDecoder::CCoder; lzhDecoder = lzhDecoderSpec; } - try - { - lzhDecoderSpec->SetDictionary(itemInfo.GetNumDictBits()); - result = lzhDecoder->Code(inStream, outStream, NULL, ¤tItemUnPacked, compressProgress); - if (result == S_FALSE) - throw "data error"; - if (result != S_OK) - return result; - } - catch(...) - { - outStream.Release(); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kDataError)); - continue; - } + lzhDecoderSpec->SetDictionary(item.GetNumDictBits()); + result = lzhDecoder->Code(inStream, outStream, NULL, ¤tItemUnPacked, progress); } /* - else if (itemInfo.IsLh1GroupMethod()) + else if (item.IsLh1GroupMethod()) { if(!lzh1Decoder) { lzh1DecoderSpec = new NCompress::NLzh1::NDecoder::CCoder; lzh1Decoder = lzh1DecoderSpec; } - try - { - lzh1DecoderSpec->SetDictionary(itemInfo.GetNumDictBits()); - result = lzh1Decoder->Code(inStream, outStream, NULL, ¤tItemUnPacked, compressProgress); - if (result == S_FALSE) - throw "data error"; - if (result != S_OK) - return result; - } - catch(...) - { - outStream.Release(); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kDataError)); - continue; - } + lzh1DecoderSpec->SetDictionary(item.GetNumDictBits()); + result = lzh1Decoder->Code(inStream, outStream, NULL, ¤tItemUnPacked, progress); } */ else + opRes = NExtract::NOperationResult::kUnSupportedMethod; + + if (opRes == NExtract::NOperationResult::kOK) { - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kUnSupportedMethod)); - continue; + if (result == S_FALSE) + opRes = NExtract::NOperationResult::kDataError; + else + { + RINOK(result); + if (outStreamSpec->GetCRC() != item.CRC) + opRes = NExtract::NOperationResult::kCRCError; + } } - - bool crcOK = (outStreamSpec->GetCRC() == itemInfo.CRC); outStream.Release(); - if(crcOK) - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)) - else - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kCRCError)) + RINOK(extractCallback->SetOperationResult(opRes)); } } return S_OK; diff --git a/CPP/7zip/Archive/Nsis/NsisHandler.cpp b/CPP/7zip/Archive/Nsis/NsisHandler.cpp index 07fd2c4e..62c7ab38 100755 --- a/CPP/7zip/Archive/Nsis/NsisHandler.cpp +++ b/CPP/7zip/Archive/Nsis/NsisHandler.cpp @@ -31,7 +31,7 @@ static const wchar_t *kMethods[] = static const int kNumMethods = sizeof(kMethods) / sizeof(kMethods[0]); -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, { NULL, kpidIsFolder, VT_BOOL}, @@ -42,43 +42,44 @@ STATPROPSTG kProperties[] = { NULL, kpidSolid, VT_BOOL} }; -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) +STATPROPSTG kArcProps[] = { - value->vt = VT_EMPTY; - return S_OK; -} + { NULL, kpidMethod, VT_BSTR}, + { NULL, kpidSolid, VT_BOOL} +}; -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} +IMP_IInArchive_Props +IMP_IInArchive_ArcProps -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) +STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value) { - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - *name = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) -{ - *numProperties = 0; + COM_TRY_BEGIN + NWindows::NCOM::CPropVariant prop; + switch(propID) + { + case kpidMethod: + { + UInt32 dict = 1; + bool filter = false; + for (int i = 0; i < _archive.Items.Size(); i++) + { + const CItem &item = _archive.Items[i]; + filter |= item.UseFilter; + if (item.DictionarySize > dict) + dict = item.DictionarySize; + } + prop = GetMethod(filter, dict); + break; + } + case kpidSolid: prop = _archive.IsSolid; break; + } + prop.Detach(value); return S_OK; + COM_TRY_END } -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_INVALIDARG; -} -STDMETHODIMP CHandler::Open( - IInStream *stream, const UInt64 * maxCheckStartPosition, IArchiveOpenCallback * /* openArchiveCallback */) +STDMETHODIMP CHandler::Open(IInStream *stream, const UInt64 * maxCheckStartPosition, IArchiveOpenCallback * /* openArchiveCallback */) { COM_TRY_BEGIN Close(); @@ -142,6 +143,24 @@ static UString GetStringForSizeValue(UInt32 value) return result; } +UString CHandler::GetMethod(bool useItemFilter, UInt32 dictionary) const +{ + NMethodType::EEnum methodIndex = _archive.Method; + UString method; + if (_archive.IsSolid && _archive.UseFilter || !_archive.IsSolid && useItemFilter) + { + method += kBcjMethod; + method += L" "; + } + method += (methodIndex < kNumMethods) ? kMethods[methodIndex] : kUnknownMethod; + if (methodIndex == NMethodType::kLZMA) + { + method += L":"; + method += GetStringForSizeValue(_archive.IsSolid ? _archive.DictionarySize: dictionary); + } + return method; +} + bool CHandler::GetUncompressedSize(int index, UInt32 &size) { size = 0; @@ -185,24 +204,24 @@ bool CHandler::GetCompressedSize(int index, UInt32 &size) STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; + NWindows::NCOM::CPropVariant prop; #ifdef NSIS_SCRIPT if (index >= (UInt32)_archive.Items.Size()) { switch(propID) { case kpidPath: - propVariant = L"[NSIS].nsi"; + prop = L"[NSIS].nsi"; break; case kpidIsFolder: - propVariant = false; + prop = false; break; case kpidSize: case kpidPackedSize: - propVariant = (UInt64)_archive.Script.Length(); + prop = (UInt64)_archive.Script.Length(); break; case kpidSolid: - propVariant = false; + prop = false; break; } } @@ -215,57 +234,44 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val case kpidPath: { const UString s = NItemName::WinNameToOSName(MultiByteToUnicodeString(item.GetReducedName(), CP_ACP)); - propVariant = (const wchar_t *)s; + prop = (const wchar_t *)s; break; } case kpidIsFolder: - propVariant = false; + prop = false; break; case kpidSize: { UInt32 size; if (GetUncompressedSize(index, size)) - propVariant = (UInt64)size; + prop = (UInt64)size; break; } case kpidPackedSize: { UInt32 size; if (GetCompressedSize(index, size)) - propVariant = (UInt64)size; + prop = (UInt64)size; break; } case kpidLastWriteTime: { if (item.DateTime.dwHighDateTime > 0x01000000 && item.DateTime.dwHighDateTime < 0xFF000000) - propVariant = item.DateTime; + prop = item.DateTime; break; } case kpidMethod: { - NMethodType::EEnum methodIndex = _archive.Method; - UString method; - if (_archive.IsSolid && _archive.UseFilter || !_archive.IsSolid && item.UseFilter) - { - method += kBcjMethod; - method += L" "; - } - method += (methodIndex < kNumMethods) ? kMethods[methodIndex] : kUnknownMethod; - if (methodIndex == NMethodType::kLZMA) - { - method += L":"; - method += GetStringForSizeValue(_archive.IsSolid ? _archive.DictionarySize: item.DictionarySize); - } - propVariant = method; + prop = GetMethod(item.UseFilter, item.DictionarySize); break; } case kpidSolid: - propVariant = _archive.IsSolid; + prop = _archive.IsSolid; break; } } - propVariant.Detach(value); + prop.Detach(value); return S_OK; COM_TRY_END } @@ -478,8 +484,7 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, } } } - if (!testMode) - realOutStream.Release(); + realOutStream.Release(); RINOK(extractCallback->SetOperationResult(dataError ? NArchive::NExtract::NOperationResult::kDataError : NArchive::NExtract::NOperationResult::kOK)); diff --git a/CPP/7zip/Archive/Nsis/NsisHandler.h b/CPP/7zip/Archive/Nsis/NsisHandler.h index 82e76139..5dc30107 100755 --- a/CPP/7zip/Archive/Nsis/NsisHandler.h +++ b/CPP/7zip/Archive/Nsis/NsisHandler.h @@ -26,6 +26,7 @@ class CHandler: bool GetUncompressedSize(int index, UInt32 &size); bool GetCompressedSize(int index, UInt32 &size); + UString GetMethod(bool useItemFilter, UInt32 dictionary) const; public: MY_QUERYINTERFACE_BEGIN2(IInArchive) QUERY_ENTRY_ISetCompressCodecsInfo diff --git a/CPP/7zip/Archive/Nsis/NsisIn.cpp b/CPP/7zip/Archive/Nsis/NsisIn.cpp index aa1e456f..83080448 100755 --- a/CPP/7zip/Archive/Nsis/NsisIn.cpp +++ b/CPP/7zip/Archive/Nsis/NsisIn.cpp @@ -905,10 +905,10 @@ HRESULT CInArchive::ReadEntries(const CBlockHeader &bh) { Items.Sort(CompareItems, 0); int i; - if (IsSolid) + // if (IsSolid) for (i = 0; i + 1 < Items.Size();) { - if (Items[i].Pos == Items[i + 1].Pos) + if (Items[i].Pos == Items[i + 1].Pos && (IsSolid || Items[i].Name == Items[i + 1].Name)) Items.Delete(i + 1); else i++; diff --git a/CPP/7zip/Archive/RPM/RpmHandler.cpp b/CPP/7zip/Archive/RPM/RpmHandler.cpp index b1a5bf7d..7cd881a1 100755 --- a/CPP/7zip/Archive/RPM/RpmHandler.cpp +++ b/CPP/7zip/Archive/RPM/RpmHandler.cpp @@ -25,49 +25,14 @@ using namespace NWindows; namespace NArchive { namespace NRpm { -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { -// { NULL, kpidPath, VT_BSTR}, -// { NULL, kpidIsFolder, VT_BOOL}, { NULL, kpidSize, VT_UI8}, { NULL, kpidPackedSize, VT_UI8} }; -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) -{ - value->vt = VT_EMPTY; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} - -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - *name = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) -{ - *numProperties = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_INVALIDARG; -} +IMP_IInArchive_Props +IMP_IInArchive_ArcProps_NO STDMETHODIMP CHandler::Open(IInStream *inStream, const UInt64 * /* maxCheckStartPosition */, @@ -106,27 +71,16 @@ STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) STDMETHODIMP CHandler::GetProperty(UInt32 /* index */, PROPID propID, PROPVARIANT *value) { - COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; - + NWindows::NCOM::CPropVariant prop; switch(propID) { - /* - case kpidPath: - propVariant = (const wchar_t *)L"a.cpio.gz"; - break; - */ - case kpidIsFolder: - propVariant = false; - break; case kpidSize: case kpidPackedSize: - propVariant = m_Size; + prop = m_Size; break; } - propVariant.Detach(value); + prop.Detach(value); return S_OK; - COM_TRY_END } STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, @@ -149,8 +103,8 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, RINOK(extractCallback->SetTotal(m_Size)); RINOK(extractCallback->SetCompleted(¤tTotalSize)); CMyComPtr<ISequentialOutStream> realOutStream; - Int32 askMode; - askMode = testMode ? NArchive::NExtract::NAskMode::kTest : + Int32 askMode = testMode ? + NArchive::NExtract::NAskMode::kTest : NArchive::NExtract::NAskMode::kExtract; Int32 index = 0; @@ -171,23 +125,13 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, CMyComPtr<ICompressCoder> copyCoder = new NCompress::CCopyCoder; - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - localProgressSpec->Init(extractCallback, false); + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, false); - try - { - RINOK(copyCoder->Code(m_InStream, realOutStream, NULL, NULL, progress)); - } - catch(...) - { - realOutStream.Release(); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kDataError)); - return S_OK; - } + RINOK(copyCoder->Code(m_InStream, realOutStream, NULL, NULL, progress)); realOutStream.Release(); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); - return S_OK; + return extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK); COM_TRY_END } diff --git a/CPP/7zip/Archive/Rar/RarHandler.cpp b/CPP/7zip/Archive/Rar/RarHandler.cpp index 7dbcee3d..6664cb07 100755 --- a/CPP/7zip/Archive/Rar/RarHandler.cpp +++ b/CPP/7zip/Archive/Rar/RarHandler.cpp @@ -42,12 +42,7 @@ static const int kNumHostOSes = sizeof(kHostOS) / sizeof(kHostOS[0]); static const wchar_t *kUnknownOS = L"Unknown"; -enum // PropID -{ - kpidUnPackVersion = kpidUserDefined -}; - -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, { NULL, kpidIsFolder, VT_BOOL}, @@ -58,7 +53,6 @@ STATPROPSTG kProperties[] = { NULL, kpidLastAccessTime, VT_FILETIME}, { NULL, kpidAttributes, VT_UI4}, - { NULL, kpidEncrypted, VT_BOOL}, { NULL, kpidSolid, VT_BOOL}, { NULL, kpidCommented, VT_BOOL}, @@ -66,17 +60,23 @@ STATPROPSTG kProperties[] = { NULL, kpidSplitAfter, VT_BOOL}, { NULL, kpidCRC, VT_UI4}, { NULL, kpidHostOS, VT_BSTR}, - { NULL, kpidMethod, VT_BSTR} - // { NULL, kpidDictionarySize, VT_UI4}, - // { L"UnPack Version", kpidUnPackVersion, VT_UI1} + { NULL, kpidMethod, VT_BSTR}, + { NULL, kpidUnpackVer, VT_UI1} }; -STATPROPSTG kArchiveProperties[] = +STATPROPSTG kArcProps[] = { { NULL, kpidSolid, VT_BOOL}, - { NULL, kpidCommented, VT_BOOL}, + { NULL, kpidNumBlocks, VT_UI4}, + { NULL, kpidEncrypted, VT_BOOL}, + { NULL, kpidIsVolume, VT_BOOL}, + { NULL, kpidNumVolumes, VT_UI4}, + // { NULL, kpidCommented, VT_BOOL} }; +IMP_IInArchive_Props +IMP_IInArchive_ArcProps + UInt64 CHandler::GetPackSize(int refIndex) const { const CRefItem &refItem = _refItems[refIndex]; @@ -88,56 +88,29 @@ UInt64 CHandler::GetPackSize(int refIndex) const STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value) { - COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; + // COM_TRY_BEGIN + NWindows::NCOM::CPropVariant prop; switch(propID) { - case kpidSolid: - propVariant = _archiveInfo.IsSolid(); - break; - case kpidCommented: - propVariant = _archiveInfo.IsCommented(); + case kpidSolid: prop = _archiveInfo.IsSolid(); break; + case kpidEncrypted: prop = _archiveInfo.IsEncrypted(); break; + case kpidIsVolume: prop = _archiveInfo.IsVolume(); break; + case kpidNumBlocks: + { + UInt32 numBlocks = 0; + for (int i = 0; i < _refItems.Size(); i++) + if (!IsSolid(i)) + numBlocks++; + prop = (UInt32)numBlocks; break; - } - propVariant.Detach(value); - return S_OK; - COM_TRY_END -} - -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} - -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - *name = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kArchiveProperties) / sizeof(kArchiveProperties[0]); - return S_OK; -} + } + case kpidNumVolumes: prop = (UInt32)(_archives.Size() - 1); -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kArchiveProperties) / sizeof(kArchiveProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kArchiveProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - *name = 0; + // case kpidCommented: prop = _archiveInfo.IsCommented(); break; + } + prop.Detach(value); return S_OK; + // COM_TRY_END } STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) @@ -160,10 +133,23 @@ static bool RarTimeToFileTime(const CRarTime &rarTime, FILETIME &result) return true; } +static void RarTimeToProp(const CRarTime &rarTime, NWindows::NCOM::CPropVariant &prop) +{ + FILETIME localFileTime, utcFileTime; + if (RarTimeToFileTime(rarTime, localFileTime)) + { + if (!LocalFileTimeToFileTime(&localFileTime, &utcFileTime)) + utcFileTime.dwHighDateTime = utcFileTime.dwLowDateTime = 0; + } + else + utcFileTime.dwHighDateTime = utcFileTime.dwLowDateTime = 0; + prop = utcFileTime; +} + STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; + NWindows::NCOM::CPropVariant prop; const CRefItem &refItem = _refItems[index]; const CItemEx &item = _items[refItem.ItemIndex]; switch(propID) @@ -175,102 +161,28 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va u = item.UnicodeName; else u = MultiByteToUnicodeString(item.Name, CP_OEMCP); - propVariant = (const wchar_t *)NItemName::WinNameToOSName(u); - break; - } - case kpidIsFolder: - propVariant = item.IsDirectory(); - break; - case kpidSize: - propVariant = item.UnPackSize; - break; - case kpidPackedSize: - { - propVariant = GetPackSize(index); - break; - } - case kpidLastWriteTime: - { - FILETIME localFileTime, utcFileTime; - if (RarTimeToFileTime(item.LastWriteTime, localFileTime)) - { - if (!LocalFileTimeToFileTime(&localFileTime, &utcFileTime)) - utcFileTime.dwHighDateTime = utcFileTime.dwLowDateTime = 0; - } - else - utcFileTime.dwHighDateTime = utcFileTime.dwLowDateTime = 0; - propVariant = utcFileTime; - break; - } - case kpidCreationTime: - { - if (item.IsCreationTimeDefined) - { - FILETIME localFileTime, utcFileTime; - if (RarTimeToFileTime(item.CreationTime, localFileTime)) - { - if (!LocalFileTimeToFileTime(&localFileTime, &utcFileTime)) - utcFileTime.dwHighDateTime = utcFileTime.dwLowDateTime = 0; - } - else - utcFileTime.dwHighDateTime = utcFileTime.dwLowDateTime = 0; - propVariant = utcFileTime; - } + prop = (const wchar_t *)NItemName::WinNameToOSName(u); break; } - case kpidLastAccessTime: - { - if (item.IsLastAccessTimeDefined) - { - FILETIME localFileTime, utcFileTime; - if (RarTimeToFileTime(item.LastAccessTime, localFileTime)) - { - if (!LocalFileTimeToFileTime(&localFileTime, &utcFileTime)) - utcFileTime.dwHighDateTime = utcFileTime.dwLowDateTime = 0; - } - else - utcFileTime.dwHighDateTime = utcFileTime.dwLowDateTime = 0; - propVariant = utcFileTime; - } - break; - } - case kpidAttributes: - propVariant = item.GetWinAttributes(); - break; - case kpidEncrypted: - propVariant = item.IsEncrypted(); - break; - case kpidSolid: - propVariant = IsSolid(index); - break; - case kpidCommented: - propVariant = item.IsCommented(); - break; - case kpidSplitBefore: - propVariant = item.IsSplitBefore(); - break; - case kpidSplitAfter: - propVariant = _items[refItem.ItemIndex + refItem.NumItems - 1].IsSplitAfter(); - break; - /* - case kpidDictionarySize: - if (!item.IsDirectory()) - propVariant = UInt32(0x10000 << item.GetDictSize()); - break; - */ + case kpidIsFolder: prop = item.IsDirectory(); break; + case kpidSize: prop = item.UnPackSize; break; + case kpidPackedSize: prop = GetPackSize(index); break; + case kpidLastWriteTime: RarTimeToProp(item.LastWriteTime, prop); + case kpidCreationTime: if (item.IsCreationTimeDefined) RarTimeToProp(item.CreationTime, prop); break; + case kpidLastAccessTime: if (item.IsLastAccessTimeDefined) RarTimeToProp(item.LastAccessTime, prop); break; + case kpidAttributes: prop = item.GetWinAttributes(); break; + case kpidEncrypted: prop = item.IsEncrypted(); break; + case kpidSolid: prop = IsSolid(index); break; + case kpidCommented: prop = item.IsCommented(); break; + case kpidSplitBefore: prop = item.IsSplitBefore(); break; + case kpidSplitAfter: prop = _items[refItem.ItemIndex + refItem.NumItems - 1].IsSplitAfter(); break; case kpidCRC: { - const CItemEx &lastItem = - _items[refItem.ItemIndex + refItem.NumItems - 1]; - if (lastItem.IsSplitAfter()) - propVariant = item.FileCRC; - else - propVariant = lastItem.FileCRC; + const CItemEx &lastItem = _items[refItem.ItemIndex + refItem.NumItems - 1]; + prop = ((lastItem.IsSplitAfter()) ? item.FileCRC : lastItem.FileCRC); break; } - case kpidUnPackVersion: - propVariant = item.UnPackVersion; - break; + case kpidUnpackVer: prop = item.UnPackVersion; break; case kpidMethod: { UString method; @@ -293,15 +205,12 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va ConvertUInt64ToString(item.Method, temp); method += temp; } - propVariant = method; + prop = method; break; } - case kpidHostOS: - propVariant = (item.HostOS < kNumHostOSes) ? - (kHostOS[item.HostOS]) : kUnknownOS; - break; + case kpidHostOS: prop = (item.HostOS < kNumHostOSes) ? (kHostOS[item.HostOS]) : kUnknownOS; break; } - propVariant.Detach(value); + prop.Detach(value); return S_OK; COM_TRY_END } @@ -325,8 +234,12 @@ public: if (dotPos >= 0) { UString ext = name.Mid(dotPos + 1); - if (ext.CompareNoCase(L"RAR")==0 || - ext.CompareNoCase(L"EXE") == 0) + if (ext.CompareNoCase(L"rar") == 0) + { + _afterPart = name.Mid(dotPos); + basePart = name.Left(dotPos); + } + else if (ext.CompareNoCase(L"exe") == 0) { _afterPart = L".rar"; basePart = name.Left(dotPos); @@ -338,11 +251,11 @@ public: _afterPart.Empty(); _unchangedPart = basePart + UString(L"."); _changedPart = L"r00"; - return true;; + return true; } int numLetters = 1; - if (basePart.Right(numLetters) == L"1") + if (basePart.Right(numLetters) == L"1" || basePart.Right(numLetters) == L"0") { while (numLetters < basePart.Length()) { @@ -427,11 +340,11 @@ STDMETHODIMP CHandler::Open(IInStream *stream, break; UString baseName; { - NCOM::CPropVariant propVariant; - RINOK(openVolumeCallback->GetProperty(kpidName, &propVariant)); - if (propVariant.vt != VT_BSTR) + NCOM::CPropVariant prop; + RINOK(openVolumeCallback->GetProperty(kpidName, &prop)); + if (prop.vt != VT_BSTR) break; - baseName = propVariant.bstrVal; + baseName = prop.bstrVal; } seqName.InitName(baseName, _archiveInfo.HaveNewVolumeName()); } @@ -572,8 +485,8 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, CObjectVector<CMethodItem> methodItems; - NCompress::CCopyCoder *copyCoderSpec = NULL; - CMyComPtr<ICompressCoder> copyCoder; + NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder; + CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec; CFilterCoder *filterStreamSpec = new CFilterCoder; CMyComPtr<ISequentialInStream> filterStream = filterStreamSpec; @@ -586,18 +499,24 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, CFolderInStream *folderInStreamSpec = NULL; CMyComPtr<ISequentialInStream> folderInStream; + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, false); + bool solidStart = true; for(int i = 0; i < importantIndexes.Size(); i++, currentImportantTotalUnPacked += currentUnPackSize, currentImportantTotalPacked += currentPackSize) { - RINOK(extractCallback->SetCompleted( - ¤tImportantTotalUnPacked)); + lps->InSize = currentImportantTotalPacked; + lps->OutSize = currentImportantTotalUnPacked; + RINOK(lps->SetCur()); CMyComPtr<ISequentialOutStream> realOutStream; Int32 askMode; if(extractStatuses[i]) - askMode = testMode ? NArchive::NExtract::NAskMode::kTest : + askMode = testMode ? + NArchive::NExtract::NAskMode::kTest : NArchive::NExtract::NAskMode::kExtract; else askMode = NArchive::NExtract::NAskMode::kSkip; @@ -648,9 +567,6 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, outStreamSpec->Init(); realOutStream.Release(); - UInt64 packedPos = currentImportantTotalPacked; - UInt64 unpackedPos = currentImportantTotalUnPacked; - /* for (int partIndex = 0; partIndex < 1; partIndex++) { @@ -672,18 +588,6 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, folderInStreamSpec->Init(&_archives, &_items, refItem); - - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - localProgressSpec->Init(extractCallback, false); - - CLocalCompressProgressInfo *localCompressProgressSpec = - new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; - localCompressProgressSpec->Init(progress, - &packedPos, - &unpackedPos); - UInt64 packSize = currentPackSize; // packedPos += item.PackSize; @@ -773,11 +677,6 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, { case '0': { - if(copyCoderSpec == NULL) - { - copyCoderSpec = new NCompress::CCopyCoder; - copyCoder = copyCoderSpec; - } commonCoder = copyCoder; break; } @@ -850,8 +749,7 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kUnSupportedMethod)); continue; } - HRESULT result = commonCoder->Code(inStream, outStream, - &packSize, &item.UnPackSize, compressProgress); + HRESULT result = commonCoder->Code(inStream, outStream, &packSize, &item.UnPackSize, progress); if (item.IsEncrypted()) filterStreamSpec->ReleaseInStream(); if (result == S_FALSE) diff --git a/CPP/7zip/Archive/Rar/RarIn.cpp b/CPP/7zip/Archive/Rar/RarIn.cpp index 7340cc1f..0af72a48 100755 --- a/CPP/7zip/Archive/Rar/RarIn.cpp +++ b/CPP/7zip/Archive/Rar/RarIn.cpp @@ -439,7 +439,7 @@ HRESULT CInArchive::GetNextItem(CItemEx &item, ICryptoGetTextPassword *getTextPa const UInt32 kSaltSize = 8; Byte salt[kSaltSize]; if(!ReadBytesAndTestSize(salt, kSaltSize)) - return false; + return S_FALSE; m_Position += kSaltSize; RINOK(m_RarAESSpec->SetDecoderProperties2(salt, kSaltSize)) // Password diff --git a/CPP/7zip/Archive/Rar/RarIn.h b/CPP/7zip/Archive/Rar/RarIn.h index 9cb66512..f1dee321 100755 --- a/CPP/7zip/Archive/Rar/RarIn.h +++ b/CPP/7zip/Archive/Rar/RarIn.h @@ -33,9 +33,9 @@ class CInArchiveInfo { public: UInt64 StartPosition; - WORD Flags; + UInt16 Flags; UInt64 CommentPosition; - WORD CommentSize; + UInt16 CommentSize; bool IsSolid() const { return (Flags & NHeader::NArchive::kSolid) != 0; } bool IsCommented() const { return (Flags & NHeader::NArchive::kComment) != 0; } bool IsVolume() const { return (Flags & NHeader::NArchive::kVolume) != 0; } diff --git a/CPP/7zip/Archive/Rar/RarRegister.cpp b/CPP/7zip/Archive/Rar/RarRegister.cpp index def6e480..a79fd026 100755 --- a/CPP/7zip/Archive/Rar/RarRegister.cpp +++ b/CPP/7zip/Archive/Rar/RarRegister.cpp @@ -8,6 +8,6 @@ static IInArchive *CreateArc() { return new NArchive::NRar::CHandler; } static CArcInfo g_ArcInfo = - { L"Rar", L"rar", 0, 3, {0x52 , 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00}, 7, false, CreateArc, 0, }; + { L"Rar", L"rar r00", 0, 3, {0x52 , 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00}, 7, false, CreateArc, 0, }; REGISTER_ARC(Rar) diff --git a/CPP/7zip/Archive/Split/SplitHandler.cpp b/CPP/7zip/Archive/Split/SplitHandler.cpp index e919154f..0cd31639 100755 --- a/CPP/7zip/Archive/Split/SplitHandler.cpp +++ b/CPP/7zip/Archive/Split/SplitHandler.cpp @@ -23,7 +23,7 @@ using namespace NTime; namespace NArchive { namespace NSplit { -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, // { NULL, kpidIsFolder, VT_BOOL}, @@ -31,41 +31,8 @@ STATPROPSTG kProperties[] = { NULL, kpidPackedSize, VT_UI8}, }; -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) -{ - value->vt = VT_EMPTY; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} - -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - *name = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) -{ - *numProperties = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_INVALIDARG; -} +IMP_IInArchive_Props +IMP_IInArchive_ArcProps_NO class CSeqName { @@ -158,11 +125,11 @@ STDMETHODIMP CHandler::Open(IInStream *stream, return S_FALSE; { - NCOM::CPropVariant propVariant; - RINOK(openVolumeCallback->GetProperty(kpidName, &propVariant)); - if (propVariant.vt != VT_BSTR) + NCOM::CPropVariant prop; + RINOK(openVolumeCallback->GetProperty(kpidName, &prop)); + if (prop.vt != VT_BSTR) return S_FALSE; - _name = propVariant.bstrVal; + _name = prop.bstrVal; } int dotPos = _name.ReverseFind('.'); @@ -219,11 +186,11 @@ STDMETHODIMP CHandler::Open(IInStream *stream, _totalSize = 0; UInt64 size; { - NCOM::CPropVariant propVariant; - RINOK(openVolumeCallback->GetProperty(kpidSize, &propVariant)); - if (propVariant.vt != VT_UI8) + NCOM::CPropVariant prop; + RINOK(openVolumeCallback->GetProperty(kpidSize, &prop)); + if (prop.vt != VT_UI8) return E_INVALIDARG; - size = propVariant.uhVal.QuadPart; + size = prop.uhVal.QuadPart; } _totalSize += size; _sizes.Add(size); @@ -247,11 +214,11 @@ STDMETHODIMP CHandler::Open(IInStream *stream, if (!stream) break; { - NCOM::CPropVariant propVariant; - RINOK(openVolumeCallback->GetProperty(kpidSize, &propVariant)); - if (propVariant.vt != VT_UI8) + NCOM::CPropVariant prop; + RINOK(openVolumeCallback->GetProperty(kpidSize, &prop)); + if (prop.vt != VT_UI8) return E_INVALIDARG; - size = propVariant.uhVal.QuadPart; + size = prop.uhVal.QuadPart; } _totalSize += size; _sizes.Add(size); @@ -288,25 +255,22 @@ STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) STDMETHODIMP CHandler::GetProperty(UInt32 /* index */, PROPID propID, PROPVARIANT *value) { - COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; - + NWindows::NCOM::CPropVariant prop; switch(propID) { case kpidPath: - propVariant = _subName; + prop = _subName; break; case kpidIsFolder: - propVariant = false; + prop = false; break; case kpidSize: case kpidPackedSize: - propVariant = _totalSize; + prop = _totalSize; break; } - propVariant.Detach(value); + prop.Detach(value); return S_OK; - COM_TRY_END } STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, @@ -348,47 +312,28 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); return S_OK; } - // currentItemSize = itemInfo.Size; - if(!testMode && (!realOutStream)) - { + if (!testMode && (!realOutStream)) return S_OK; - } NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder; CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec; - for(int i = 0; i < _streams.Size(); i++, currentTotalSize += currentItemSize) - { - // CMyComPtr<ISequentialInStream> inStream; - // RINOK(volumeExtractCallback->GetInStream(_names[i], &inStream)); + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, false); - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - localProgressSpec->Init(extractCallback, false); - CLocalCompressProgressInfo *localCompressProgressSpec = - new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; - localCompressProgressSpec->Init(progress, - ¤tTotalSize, ¤tTotalSize); + for (int i = 0; i < _streams.Size(); i++, currentTotalSize += currentItemSize) + { + lps->InSize = lps->OutSize = currentTotalSize; + RINOK(lps->SetCur()); IInStream *inStream = _streams[i]; RINOK(inStream->Seek(0, STREAM_SEEK_SET, NULL)); - try - { - RINOK(copyCoder->Code(inStream, realOutStream, - NULL, NULL, compressProgress)); - } - catch(...) - { - realOutStream.Release(); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kDataError)); - return S_OK;; - } + RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, progress)); currentItemSize = copyCoderSpec->TotalSize; } realOutStream.Release(); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); - return S_OK; + return extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK); COM_TRY_END } diff --git a/CPP/7zip/Archive/Split/SplitHandlerOut.cpp b/CPP/7zip/Archive/Split/SplitHandlerOut.cpp index ea86c281..26e19669 100755 --- a/CPP/7zip/Archive/Split/SplitHandlerOut.cpp +++ b/CPP/7zip/Archive/Split/SplitHandlerOut.cpp @@ -48,30 +48,30 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt if (newProperties != 0) { { - NCOM::CPropVariant propVariant; - RINOK(updateCallback->GetProperty(fileIndex, kpidIsFolder, &propVariant)); - if (propVariant.vt == VT_EMPTY) + NCOM::CPropVariant prop; + RINOK(updateCallback->GetProperty(fileIndex, kpidIsFolder, &prop)); + if (prop.vt == VT_EMPTY) { } - else if (propVariant.vt != VT_BOOL) + else if (prop.vt != VT_BOOL) return E_INVALIDARG; else { - if (propVariant.boolVal != VARIANT_FALSE) + if (prop.boolVal != VARIANT_FALSE) return E_INVALIDARG; } } { - NCOM::CPropVariant propVariant; - RINOK(updateCallback->GetProperty(fileIndex, kpidIsAnti, &propVariant)); - if (propVariant.vt == VT_EMPTY) + NCOM::CPropVariant prop; + RINOK(updateCallback->GetProperty(fileIndex, kpidIsAnti, &prop)); + if (prop.vt == VT_EMPTY) { } - else if (propVariant.vt != VT_BOOL) + else if (prop.vt != VT_BOOL) return E_INVALIDARG; else { - if (propVariant.boolVal != VARIANT_FALSE) + if (prop.boolVal != VARIANT_FALSE) return E_INVALIDARG; } } @@ -80,11 +80,11 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt bool thereIsCopyData = false; if (newData != 0) { - NCOM::CPropVariant propVariant; - RINOK(updateCallback->GetProperty(fileIndex, kpidSize, &propVariant)); - if (propVariant.vt != VT_UI8) + NCOM::CPropVariant prop; + RINOK(updateCallback->GetProperty(fileIndex, kpidSize, &prop)); + if (prop.vt != VT_UI8) return E_INVALIDARG; - newSize = propVariant.uhVal.QuadPart; + newSize = prop.uhVal.QuadPart; } else thereIsCopyData = true; diff --git a/CPP/7zip/Archive/Tar/TarHandler.cpp b/CPP/7zip/Archive/Tar/TarHandler.cpp index f2c83caf..d16307ca 100755 --- a/CPP/7zip/Archive/Tar/TarHandler.cpp +++ b/CPP/7zip/Archive/Tar/TarHandler.cpp @@ -1,4 +1,4 @@ -// Tar/Handler.cpp +/ Tar/Handler.cpp #include "StdAfx.h" @@ -15,6 +15,7 @@ #include "../../Common/ProgressUtils.h" #include "../../Common/LimitedStreams.h" + #include "../../Compress/Copy/CopyCoder.h" #include "../Common/ItemNameUtils.h" @@ -25,7 +26,7 @@ using namespace NTime; namespace NArchive { namespace NTar { -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, { NULL, kpidIsFolder, VT_BOOL}, @@ -36,41 +37,16 @@ STATPROPSTG kProperties[] = { NULL, kpidGroup, VT_BSTR}, }; -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) -{ - value->vt = VT_EMPTY; - return S_OK; -} -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - *name = 0; - return S_OK; -} -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) -{ - *numProperties = 0; - return S_OK; -} -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_INVALIDARG; -} + + + + +IMP_IInArchive_Props +IMP_IInArchive_ArcProps_NO STDMETHODIMP CHandler::Open(IInStream *stream, const UInt64 * /* maxCheckStartPosition */, @@ -81,7 +57,7 @@ STDMETHODIMP CHandler::Open(IInStream *stream, { CInArchive archive; - if(archive.Open(stream) != S_OK) + if (archive.Open(stream) != S_OK) return S_FALSE; _items.Clear(); @@ -120,11 +96,11 @@ STDMETHODIMP CHandler::Open(IInStream *stream, openArchiveCallback->QueryInterface(IID_IArchiveOpenVolumeCallback, (void **)&openVolumeCallback); if (!openVolumeCallback) return S_FALSE; - NCOM::CPropVariant propVariant; - RINOK(openVolumeCallback->GetProperty(kpidName, &propVariant)); - if (propVariant.vt != VT_BSTR) + NCOM::CPropVariant prop; + RINOK(openVolumeCallback->GetProperty(kpidName, &prop)); + if (prop.vt != VT_BSTR) return S_FALSE; - UString baseName = propVariant.bstrVal; + UString baseName = prop.bstrVal; baseName = baseName.Right(4); if (baseName.CompareNoCase(L".tar") != 0) return S_FALSE; @@ -157,45 +133,45 @@ STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; - const NArchive::NTar::CItemEx &item = _items[index]; + NWindows::NCOM::CPropVariant prop; + const CItemEx &item = _items[index]; switch(propID) { case kpidPath: - propVariant = (const wchar_t *)NItemName::GetOSName2( + prop = (const wchar_t *)NItemName::GetOSName2( MultiByteToUnicodeString(item.Name, CP_OEMCP)); break; case kpidIsFolder: - propVariant = item.IsDirectory(); + prop = item.IsDirectory(); break; case kpidSize: case kpidPackedSize: - propVariant = (UInt64)item.Size; + prop = (UInt64)item.Size; break; case kpidLastWriteTime: { FILETIME utcFileTime; if (item.ModificationTime != 0) - NTime::UnixTimeToFileTime((UInt32)item.ModificationTime, utcFileTime); + NTime::UnixTimeToFileTime(item.ModificationTime, utcFileTime); else { utcFileTime.dwLowDateTime = 0; utcFileTime.dwHighDateTime = 0; } - propVariant = utcFileTime; + prop = utcFileTime; break; } case kpidUser: - propVariant = (const wchar_t *) + prop = (const wchar_t *) MultiByteToUnicodeString(item.UserName, CP_OEMCP); break; case kpidGroup: - propVariant = (const wchar_t *) + prop = (const wchar_t *) MultiByteToUnicodeString(item.GroupName, CP_OEMCP); break; } - propVariant.Detach(value); + prop.Detach(value); return S_OK; COM_TRY_END } @@ -208,86 +184,61 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, bool allFilesMode = (numItems == UInt32(-1)); if (allFilesMode) numItems = _items.Size(); - UInt64 totalSize = 0; - if(numItems == 0) + if (numItems == 0) return S_OK; + UInt64 totalSize = 0; UInt32 i; - for(i = 0; i < numItems; i++) + for (i = 0; i < numItems; i++) totalSize += _items[allFilesMode ? i : indices[i]].Size; extractCallback->SetTotal(totalSize); UInt64 currentTotalSize = 0; UInt64 currentItemSize; - CMyComPtr<ICompressCoder> copyCoder; + NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder(); + CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec; - for(i = 0; i < numItems; i++, currentTotalSize += currentItemSize) + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, false); + + CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; + CMyComPtr<ISequentialInStream> inStream(streamSpec); + streamSpec->SetStream(_inStream); + + for (i = 0; i < numItems; i++, currentTotalSize += currentItemSize) { - RINOK(extractCallback->SetCompleted(¤tTotalSize)); + lps->InSize = lps->OutSize = currentTotalSize; + RINOK(lps->SetCur()); CMyComPtr<ISequentialOutStream> realOutStream; - Int32 askMode; - askMode = testMode ? NArchive::NExtract::NAskMode::kTest : + Int32 askMode = testMode ? + NArchive::NExtract::NAskMode::kTest : NArchive::NExtract::NAskMode::kExtract; Int32 index = allFilesMode ? i : indices[i]; const CItemEx &item = _items[index]; - RINOK(extractCallback->GetStream(index, &realOutStream, askMode)); - currentItemSize = item.Size; - - if(item.IsDirectory()) + if (item.IsDirectory()) { RINOK(extractCallback->PrepareOperation(askMode)); RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); continue; } - if(!testMode && (!realOutStream)) - { + if (!testMode && (!realOutStream)) continue; - } RINOK(extractCallback->PrepareOperation(askMode)); + if (testMode) { - if (testMode) - { - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); - continue; - } - - RINOK(_inStream->Seek(item.GetDataPosition(), STREAM_SEEK_SET, NULL)); - CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; - CMyComPtr<ISequentialInStream> inStream(streamSpec); - streamSpec->SetStream(_inStream); - streamSpec->Init(item.Size); - - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - localProgressSpec->Init(extractCallback, false); - - - CLocalCompressProgressInfo *localCompressProgressSpec = - new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; - localCompressProgressSpec->Init(progress, - ¤tTotalSize, ¤tTotalSize); - - if(!copyCoder) - { - copyCoder = new NCompress::CCopyCoder; - } - try - { - RINOK(copyCoder->Code(inStream, realOutStream, - NULL, NULL, compressProgress)); - } - catch(...) - { - realOutStream.Release(); - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kDataError)); - continue; - } - realOutStream.Release(); RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); + continue; } + RINOK(_inStream->Seek(item.GetDataPosition(), STREAM_SEEK_SET, NULL)); + streamSpec->Init(item.Size); + RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, progress)); + realOutStream.Release(); + RINOK(extractCallback->SetOperationResult((copyCoderSpec->TotalSize == item.Size) ? + NArchive::NExtract::NOperationResult::kOK: + NArchive::NExtract::NOperationResult::kDataError)); } return S_OK; COM_TRY_END diff --git a/CPP/7zip/Archive/Tar/TarHandlerOut.cpp b/CPP/7zip/Archive/Tar/TarHandlerOut.cpp index 110833fb..ea39d7e2 100755 --- a/CPP/7zip/Archive/Tar/TarHandlerOut.cpp +++ b/CPP/7zip/Archive/Tar/TarHandlerOut.cpp @@ -53,42 +53,42 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt bool isDirectoryStatusDefined; UInt32 attributes; { - NCOM::CPropVariant propVariant; - RINOK(updateCallback->GetProperty(i, kpidAttributes, &propVariant)); - if (propVariant.vt == VT_EMPTY) + NCOM::CPropVariant prop; + RINOK(updateCallback->GetProperty(i, kpidAttributes, &prop)); + if (prop.vt == VT_EMPTY) attributes = 0; - else if (propVariant.vt != VT_UI4) + else if (prop.vt != VT_UI4) return E_INVALIDARG; else - attributes = propVariant.ulVal; + attributes = prop.ulVal; } { - NCOM::CPropVariant propVariant; - RINOK(updateCallback->GetProperty(i, kpidLastWriteTime, &propVariant)); - if (propVariant.vt != VT_FILETIME) + NCOM::CPropVariant prop; + RINOK(updateCallback->GetProperty(i, kpidLastWriteTime, &prop)); + if (prop.vt != VT_FILETIME) return E_INVALIDARG; - utcTime = propVariant.filetime; + utcTime = prop.filetime; } { - NCOM::CPropVariant propVariant; - RINOK(updateCallback->GetProperty(i, kpidPath, &propVariant)); - if (propVariant.vt == VT_EMPTY) + NCOM::CPropVariant prop; + RINOK(updateCallback->GetProperty(i, kpidPath, &prop)); + if (prop.vt == VT_EMPTY) name.Empty(); - else if (propVariant.vt != VT_BSTR) + else if (prop.vt != VT_BSTR) return E_INVALIDARG; else - name = propVariant.bstrVal; + name = prop.bstrVal; } { - NCOM::CPropVariant propVariant; - RINOK(updateCallback->GetProperty(i, kpidIsFolder, &propVariant)); - if (propVariant.vt == VT_EMPTY) + NCOM::CPropVariant prop; + RINOK(updateCallback->GetProperty(i, kpidIsFolder, &prop)); + if (prop.vt == VT_EMPTY) isDirectoryStatusDefined = false; - else if (propVariant.vt != VT_BOOL) + else if (prop.vt != VT_BOOL) return E_INVALIDARG; else { - updateItem.IsDirectory = (propVariant.boolVal != VARIANT_FALSE); + updateItem.IsDirectory = (prop.boolVal != VARIANT_FALSE); isDirectoryStatusDefined = true; } } @@ -109,11 +109,11 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt { UInt64 size; { - NCOM::CPropVariant propVariant; - RINOK(updateCallback->GetProperty(i, kpidSize, &propVariant)); - if (propVariant.vt != VT_UI8) + NCOM::CPropVariant prop; + RINOK(updateCallback->GetProperty(i, kpidSize, &prop)); + if (prop.vt != VT_UI8) return E_INVALIDARG; - size = propVariant.uhVal.QuadPart; + size = prop.uhVal.QuadPart; } updateItem.Size = size; } diff --git a/CPP/7zip/Archive/Tar/TarUpdate.cpp b/CPP/7zip/Archive/Tar/TarUpdate.cpp index 9a6f64e2..b4241e0d 100755 --- a/CPP/7zip/Archive/Tar/TarUpdate.cpp +++ b/CPP/7zip/Archive/Tar/TarUpdate.cpp @@ -13,23 +13,9 @@ #include "TarOut.h" #include "TarUpdate.h" -static const UInt64 kOneItemComplexity = 512; - namespace NArchive { namespace NTar { -static HRESULT CopyBlock(ISequentialInStream *inStream, - ISequentialOutStream *outStream, ICompressProgressInfo *progress, - UInt64 *totalSize = NULL) -{ - NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder; - CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec; - HRESULT result = copyCoder->Code(inStream, outStream, NULL, NULL, progress); - if (totalSize != NULL) - *totalSize = copyCoderSpec->TotalSize; - return result; -} - HRESULT UpdateArchive(IInStream *inStream, ISequentialOutStream *outStream, const CObjectVector<NArchive::NTar::CItemEx> &inputItems, const CObjectVector<CUpdateItemInfo> &updateItems, @@ -48,25 +34,27 @@ HRESULT UpdateArchive(IInStream *inStream, ISequentialOutStream *outStream, complexity += updateItem.Size; else complexity += inputItems[updateItem.IndexInArchive].GetFullSize(); - complexity += kOneItemComplexity; } RINOK(updateCallback->SetTotal(complexity)); + NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder; + CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec; + + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(updateCallback, true); + + CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; + CMyComPtr<CLimitedSequentialInStream> inStreamLimited(streamSpec); + streamSpec->SetStream(inStream); + complexity = 0; for(i = 0; i < updateItems.Size(); i++) { - RINOK(updateCallback->SetCompleted(&complexity)); - - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> localProgress = localProgressSpec; - localProgressSpec->Init(updateCallback, true); - - CLocalCompressProgressInfo *localCompressProgressSpec = new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; - - localCompressProgressSpec->Init(localProgress, &complexity, NULL); + lps->InSize = lps->OutSize = complexity; + RINOK(lps->SetCur()); const CUpdateItemInfo &updateItem = updateItems[i]; CItem item; @@ -76,13 +64,13 @@ HRESULT UpdateArchive(IInStream *inStream, ISequentialOutStream *outStream, item.Name = (updateItem.Name); if (updateItem.IsDirectory) { - item.LinkFlag = NFileHeader::NLinkFlag::kDirectory; - item.Size = 0; + item.LinkFlag = NFileHeader::NLinkFlag::kDirectory; + item.Size = 0; } else { - item.LinkFlag = NFileHeader::NLinkFlag::kNormal; - item.Size = updateItem.Size; + item.LinkFlag = NFileHeader::NLinkFlag::kNormal; + item.Size = updateItem.Size; } item.ModificationTime = updateItem.Time; item.DeviceMajorDefined = false; @@ -118,45 +106,40 @@ HRESULT UpdateArchive(IInStream *inStream, ISequentialOutStream *outStream, RINOK(outArchive.WriteHeader(item)); if (!updateItem.IsDirectory) { - UInt64 totalSize; - RINOK(CopyBlock(fileInStream, outStream, compressProgress, &totalSize)); - if (totalSize != item.Size) + RINOK(copyCoder->Code(fileInStream, outStream, NULL, NULL, progress)); + if (copyCoderSpec->TotalSize != item.Size) return E_FAIL; RINOK(outArchive.FillDataResidual(item.Size)); } } complexity += updateItem.Size; - RINOK(updateCallback->SetOperationResult( - NArchive::NUpdate::NOperationResult::kOK)); + RINOK(updateCallback->SetOperationResult(NArchive::NUpdate::NOperationResult::kOK)); } else { - CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream; - CMyComPtr<CLimitedSequentialInStream> inStreamLimited(streamSpec); const CItemEx &existItemInfo = inputItems[updateItem.IndexInArchive]; + UInt64 size; if (updateItem.NewProperties) { RINOK(outArchive.WriteHeader(item)); - RINOK(inStream->Seek(existItemInfo.GetDataPosition(), - STREAM_SEEK_SET, NULL)); - streamSpec->SetStream(inStream); - streamSpec->Init(existItemInfo.Size); + RINOK(inStream->Seek(existItemInfo.GetDataPosition(), STREAM_SEEK_SET, NULL)); + size = existItemInfo.Size; } else { - RINOK(inStream->Seek(existItemInfo.HeaderPosition, - STREAM_SEEK_SET, NULL)); - streamSpec->SetStream(inStream); - streamSpec->Init(existItemInfo.GetFullSize()); + RINOK(inStream->Seek(existItemInfo.HeaderPosition, STREAM_SEEK_SET, NULL)); + size = existItemInfo.GetFullSize(); } - RINOK(CopyBlock(inStreamLimited, outStream, compressProgress)); + streamSpec->Init(size); + + RINOK(copyCoder->Code(inStreamLimited, outStream, NULL, NULL, progress)); + if (copyCoderSpec->TotalSize != size) + return E_FAIL; RINOK(outArchive.FillDataResidual(existItemInfo.Size)); - complexity += existItemInfo.GetFullSize(); + complexity += size; } - complexity += kOneItemComplexity; } return outArchive.WriteFinishHeader(); } }} - diff --git a/CPP/7zip/Archive/Wim/WimHandler.cpp b/CPP/7zip/Archive/Wim/WimHandler.cpp index aa9300a2..38c1c6ae 100755 --- a/CPP/7zip/Archive/Wim/WimHandler.cpp +++ b/CPP/7zip/Archive/Wim/WimHandler.cpp @@ -20,18 +20,7 @@ namespace NWim { #define WIM_DETAILS -#ifdef WIM_DETAILS - -enum -{ - kpidVolume = kpidUserDefined, - kpidOffset, - kpidLinks -}; - -#endif - -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, { NULL, kpidIsFolder, VT_BOOL}, @@ -44,59 +33,63 @@ STATPROPSTG kProperties[] = { NULL, kpidLastWriteTime, VT_FILETIME} #ifdef WIM_DETAILS - , { L"Volume", kpidVolume, VT_UI4} - , { L"Offset", kpidOffset, VT_UI8} - , { L"Links", kpidLinks, VT_UI4} + , { NULL, kpidVolume, VT_UI4} + , { NULL, kpidOffset, VT_UI8} + , { NULL, kpidLinks, VT_UI4} #endif }; +STATPROPSTG kArcProps[] = +{ + { NULL, kpidSize, VT_UI8}, + { NULL, kpidPackedSize, VT_UI8}, + { NULL, kpidIsVolume, VT_BOOL}, + { NULL, kpidVolume, VT_UI4}, + { NULL, kpidNumVolumes, VT_UI4} +}; + static const wchar_t *kStreamsNamePrefix = L"Files" WSTRING_PATH_SEPARATOR; static const wchar_t *kMethodLZX = L"LZX"; static const wchar_t *kMethodCopy = L"Copy"; -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) -{ - value->vt = VT_EMPTY; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} - -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - if (srcItem.lpwstrName == 0) - *name = 0; - else - *name = ::SysAllocString(srcItem.lpwstrName); - return S_OK; -} +IMP_IInArchive_Props +IMP_IInArchive_ArcProps -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) +STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value) { - *numProperties = 0; + COM_TRY_BEGIN + NWindows::NCOM::CPropVariant prop; + switch(propID) + { + case kpidSize: prop = m_Database.GetUnpackSize(); break; + case kpidPackedSize: prop = m_Database.GetPackSize(); break; + case kpidIsVolume: + if (m_Xmls.Size() > 0) + { + UInt16 volIndex = m_Xmls[0].VolIndex; + if (volIndex < m_Volumes.Size()) + prop = (m_Volumes[volIndex].Header.NumParts > 1); + } + break; + case kpidVolume: + if (m_Xmls.Size() > 0) + { + UInt16 volIndex = m_Xmls[0].VolIndex; + if (volIndex < m_Volumes.Size()) + prop = m_Volumes[volIndex].Header.PartNumber; + } + break; + case kpidNumVolumes: if (m_Volumes.Size() > 0) prop = (UInt32)(m_Volumes.Size() - 1); + } + prop.Detach(value); return S_OK; -} - -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_INVALIDARG; + COM_TRY_END } STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; + NWindows::NCOM::CPropVariant prop; if (index < (UInt32)m_Database.Items.Size()) { const CItem &item = m_Database.Items[index]; @@ -108,7 +101,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val { case kpidPath: if (item.HasMetadata) - propVariant = item.Name; + prop = item.Name; else { wchar_t sz[32]; @@ -117,62 +110,62 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val while (s.Length() < m_NameLenForStreams) s = L'0' + s; s = UString(kStreamsNamePrefix) + s; - propVariant = s; + prop = s; break; } break; case kpidIsFolder: - propVariant = item.IsDirectory(); + prop = item.IsDirectory(); break; case kpidAttributes: if (item.HasMetadata) - propVariant = item.Attributes; + prop = item.Attributes; break; case kpidCreationTime: if (item.HasMetadata) - propVariant = item.CreationTime; + prop = item.CreationTime; break; case kpidLastAccessTime: if (item.HasMetadata) - propVariant = item.LastAccessTime; + prop = item.LastAccessTime; break; case kpidLastWriteTime: if (item.HasMetadata) - propVariant = item.LastWriteTime; + prop = item.LastWriteTime; break; case kpidPackedSize: if (si) - propVariant = si->Resource.PackSize; + prop = si->Resource.PackSize; else - propVariant = (UInt64)0; + prop = (UInt64)0; break; case kpidSize: if (si) - propVariant = si->Resource.UnpackSize; + prop = si->Resource.UnpackSize; else - propVariant = (UInt64)0; + prop = (UInt64)0; break; case kpidMethod: if (si) if (si->Resource.IsCompressed()) - propVariant = kMethodLZX; + prop = kMethodLZX; else - propVariant = kMethodCopy; + prop = kMethodCopy; break; #ifdef WIM_DETAILS case kpidVolume: if (si) - propVariant = (UInt32)si->PartNumber; + prop = (UInt32)si->PartNumber; break; case kpidOffset: if (si) - propVariant = (UInt64)si->Resource.Offset; + prop = (UInt64)si->Resource.Offset; break; case kpidLinks: if (si) - propVariant = (UInt32)si->RefCount; + prop = (UInt32)si->RefCount; else - propVariant = (UInt64)0; + prop = (UInt64)0; break; #endif } @@ -188,23 +181,23 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val wchar_t sz[32]; ConvertUInt64ToString(m_Xmls[index].VolIndex, sz); UString s = (UString)sz + L".xml"; - propVariant = s; + prop = s; break; } case kpidIsFolder: - propVariant = false; + prop = false; break; case kpidPackedSize: case kpidSize: - propVariant = (UInt64)m_Xmls[index].Data.GetCapacity(); + prop = (UInt64)m_Xmls[index].Data.GetCapacity(); break; case kpidMethod: - propVariant = L"Copy"; + prop = L"Copy"; break; } } } - propVariant.Detach(value); + prop.Detach(value); return S_OK; COM_TRY_END } @@ -317,11 +310,11 @@ STDMETHODIMP CHandler::Open(IInStream *inStream, break; numVolumes = header.NumParts; { - NCOM::CPropVariant propVariant; - RINOK(openVolumeCallback->GetProperty(kpidName, &propVariant)); - if (propVariant.vt != VT_BSTR) + NCOM::CPropVariant prop; + RINOK(openVolumeCallback->GetProperty(kpidName, &prop)); + if (prop.vt != VT_BSTR) break; - seqName.InitName(propVariant.bstrVal); + seqName.InitName(prop.bstrVal); } } } @@ -381,29 +374,33 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, RINOK(extractCallback->SetTotal(totalSize)); - UInt64 currentTotalSize = 0; - UInt64 currentItemSize = 0; - + UInt64 currentTotalPacked = 0; + UInt64 currentTotalUnPacked = 0; + UInt64 currentItemUnPacked, currentItemPacked; + int prevSuccessStreamIndex = -1; CUnpacker unpacker; - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - localProgressSpec->Init(extractCallback, false); - - CLocalCompressProgressInfo *localCompressProgressSpec = new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, false); - for (i = 0; i < numItems; currentTotalSize += currentItemSize) + for (i = 0; i < numItems; currentTotalUnPacked += currentItemUnPacked, + currentTotalPacked += currentItemPacked) { - currentItemSize = 0; - RINOK(extractCallback->SetCompleted(¤tTotalSize)); + currentItemUnPacked = 0; + currentItemPacked = 0; + + lps->InSize = currentTotalPacked; + lps->OutSize = currentTotalUnPacked; + + RINOK(lps->SetCur()); UInt32 index = allFilesMode ? i : indices[i]; i++; Int32 askMode = testMode ? - NArchive::NExtract::NAskMode::kTest : - NArchive::NExtract::NAskMode::kExtract; + NExtract::NAskMode::kTest : + NExtract::NAskMode::kExtract; CMyComPtr<ISequentialOutStream> realOutStream; RINOK(extractCallback->GetStream(index, &realOutStream, askMode)); @@ -413,13 +410,13 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, continue; RINOK(extractCallback->PrepareOperation(askMode)); const CByteBuffer &data = m_Xmls[index - (UInt32)m_Database.Items.Size()].Data; - currentItemSize = data.GetCapacity(); + currentItemUnPacked = data.GetCapacity(); if (realOutStream) { RINOK(WriteStream(realOutStream, (const Byte *)data, (UInt32)data.GetCapacity(), NULL)); realOutStream.Release(); } - RINOK(extractCallback->SetOperationResult(NArchive::NExtract::NOperationResult::kOK)); + RINOK(extractCallback->SetOperationResult(NExtract::NOperationResult::kOK)); continue; } @@ -432,32 +429,32 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, RINOK(extractCallback->PrepareOperation(askMode)); realOutStream.Release(); RINOK(extractCallback->SetOperationResult(item.HasStream() ? - NArchive::NExtract::NOperationResult::kDataError : - NArchive::NExtract::NOperationResult::kOK)); + NExtract::NOperationResult::kDataError : + NExtract::NOperationResult::kOK)); continue; } const CStreamInfo &si = m_Database.Streams[streamIndex]; - currentItemSize = si.Resource.UnpackSize; + currentItemUnPacked = si.Resource.UnpackSize; + currentItemPacked = si.Resource.PackSize; if(!testMode && (!realOutStream)) continue; RINOK(extractCallback->PrepareOperation(askMode)); - Int32 opRes = NArchive::NExtract::NOperationResult::kOK; + Int32 opRes = NExtract::NOperationResult::kOK; if (streamIndex != prevSuccessStreamIndex || realOutStream) { Byte digest[20]; - localCompressProgressSpec->Init(progress, ¤tTotalSize, ¤tTotalSize); - HRESULT res = unpacker.Unpack(m_Volumes[si.PartNumber].Stream, si.Resource, realOutStream, compressProgress, digest); + HRESULT res = unpacker.Unpack(m_Volumes[si.PartNumber].Stream, si.Resource, realOutStream, progress, digest); if (res == S_OK) { if (memcmp(digest, si.Hash, kHashSize) == 0) prevSuccessStreamIndex = streamIndex; else - opRes = NArchive::NExtract::NOperationResult::kCRCError; + opRes = NExtract::NOperationResult::kCRCError; } else if (res == S_FALSE) - opRes = NArchive::NExtract::NOperationResult::kDataError; + opRes = NExtract::NOperationResult::kDataError; else return res; } diff --git a/CPP/7zip/Archive/Wim/WimIn.h b/CPP/7zip/Archive/Wim/WimIn.h index bc74f61b..467b99ae 100755 --- a/CPP/7zip/Archive/Wim/WimIn.h +++ b/CPP/7zip/Archive/Wim/WimIn.h @@ -107,6 +107,23 @@ struct CDatabase { CRecordVector<CStreamInfo> Streams; CObjectVector<CItem> Items; + + UInt64 GetUnpackSize() const + { + UInt64 res = 0; + for (int i = 0; i < Streams.Size(); i++) + res += Streams[i].Resource.UnpackSize; + return res; + } + + UInt64 GetPackSize() const + { + UInt64 res = 0; + for (int i = 0; i < Streams.Size(); i++) + res += Streams[i].Resource.PackSize; + return res; + } + void Clear() { Streams.Clear(); diff --git a/CPP/7zip/Archive/Z/DllExports.cpp b/CPP/7zip/Archive/Z/DllExports.cpp deleted file mode 100755 index b8df85f4..00000000 --- a/CPP/7zip/Archive/Z/DllExports.cpp +++ /dev/null @@ -1,91 +0,0 @@ -// DLLExports.cpp - -#include "StdAfx.h" - -#include "Common/MyInitGuid.h" -#include "Common/ComTry.h" -#include "Windows/PropVariant.h" -#include "ZHandler.h" -#include "../../ICoder.h" - -// {23170F69-40C1-278A-1000-000110050000} -DEFINE_GUID(CLSID_CZHandler, -0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x10, 0x05, 0x00, 0x00); - -extern "C" -BOOL WINAPI DllMain(HINSTANCE /* hInstance */, DWORD /* dwReason */, LPVOID /* lpReserved */) -{ - return TRUE; -} - -STDAPI CreateObject( - const GUID *classID, - const GUID *interfaceID, - void **outObject) -{ - COM_TRY_BEGIN - *outObject = 0; - if (*classID != CLSID_CZHandler) - return CLASS_E_CLASSNOTAVAILABLE; - int needIn = *interfaceID == IID_IInArchive; - int needOut = *interfaceID == IID_IOutArchive; - if (needIn || needOut) - { - NArchive::NZ::CHandler *temp = new NArchive::NZ::CHandler; - if (needIn) - { - CMyComPtr<IInArchive> inArchive = (IInArchive *)temp; - *outObject = inArchive.Detach(); - } - else - { - CMyComPtr<IOutArchive> outArchive = (IOutArchive *)temp; - *outObject = outArchive.Detach(); - } - } - else - return E_NOINTERFACE; - COM_TRY_END - return S_OK; -} - - -STDAPI GetHandlerProperty(PROPID propID, PROPVARIANT *value) -{ - NWindows::NCOM::CPropVariant propVariant; - switch(propID) - { - case NArchive::kName: - propVariant = L"Z"; - break; - case NArchive::kClassID: - { - if ((value->bstrVal = ::SysAllocStringByteLen( - (const char *)&CLSID_CZHandler, sizeof(GUID))) != 0) - value->vt = VT_BSTR; - return S_OK; - } - case NArchive::kExtension: - propVariant = L"z taz"; - break; - case NArchive::kAddExtension: - propVariant = L"* .tar"; - break; - case NArchive::kUpdate: - propVariant = false; - break; - case NArchive::kKeepName: - propVariant = true; - break; - case NArchive::kStartSignature: - { - const unsigned char sig[] = { 0x1F, 0x9D }; - if ((value->bstrVal = ::SysAllocStringByteLen((const char *)sig, 2)) != 0) - value->vt = VT_BSTR; - return S_OK; - } - - } - propVariant.Detach(value); - return S_OK; -} diff --git a/CPP/7zip/Archive/Z/ZHandler.cpp b/CPP/7zip/Archive/Z/ZHandler.cpp index 33887690..73f391f7 100755 --- a/CPP/7zip/Archive/Z/ZHandler.cpp +++ b/CPP/7zip/Archive/Z/ZHandler.cpp @@ -19,47 +19,13 @@ namespace NArchive { namespace NZ { -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { - { NULL, kpidPath, VT_BSTR}, { NULL, kpidPackedSize, VT_UI8}, }; -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) -{ - value->vt = VT_EMPTY; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} - -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - *name = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) -{ - *numProperties = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_INVALIDARG; -} +IMP_IInArchive_Props +IMP_IInArchive_ArcProps_NO STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) { @@ -67,24 +33,15 @@ STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) return S_OK; } -STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) +STDMETHODIMP CHandler::GetProperty(UInt32 /* index */, PROPID propID, PROPVARIANT *value) { - COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; - if (index != 0) - return E_INVALIDARG; + NWindows::NCOM::CPropVariant prop; switch(propID) { - case kpidIsFolder: - propVariant = false; - break; - case kpidPackedSize: - propVariant = _packSize; - break; + case kpidPackedSize: prop = _packSize; break; } - propVariant.Detach(value); + prop.Detach(value); return S_OK; - COM_TRY_END } static const int kSignatureSize = 3; @@ -151,26 +108,26 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, RINOK(extractCallback->SetCompleted(¤tTotalPacked)); CMyComPtr<ISequentialOutStream> realOutStream; - Int32 askMode; - askMode = testMode ? NArchive::NExtract::NAskMode::kTest : - NArchive::NExtract::NAskMode::kExtract; + Int32 askMode = testMode ? + NExtract::NAskMode::kTest : + NExtract::NAskMode::kExtract; RINOK(extractCallback->GetStream(0, &realOutStream, askMode)); - if(!testMode && !realOutStream) + if (!testMode && !realOutStream) return S_OK; extractCallback->PrepareOperation(askMode); CDummyOutStream *outStreamSpec = new CDummyOutStream; CMyComPtr<ISequentialOutStream> outStream(outStreamSpec); - outStreamSpec->Init(realOutStream); - + outStreamSpec->SetStream(realOutStream); + outStreamSpec->Init(); realOutStream.Release(); - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - localProgressSpec->Init(extractCallback, true); + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, false); RINOK(_stream->Seek(_streamStartPosition + kSignatureSize, STREAM_SEEK_SET, NULL)); @@ -182,20 +139,20 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, int opResult; if (result != S_OK) - opResult = NArchive::NExtract::NOperationResult::kUnSupportedMethod; + opResult = NExtract::NOperationResult::kUnSupportedMethod; else { result = decoder->Code(_stream, outStream, NULL, NULL, progress); - outStream.Release(); if (result == S_FALSE) - opResult = NArchive::NExtract::NOperationResult::kDataError; - else if (result == S_OK) - opResult = NArchive::NExtract::NOperationResult::kOK; + opResult = NExtract::NOperationResult::kDataError; else - return result; + { + RINOK(result); + opResult = NExtract::NOperationResult::kOK; + } } - RINOK(extractCallback->SetOperationResult(opResult)); - return S_OK; + outStream.Release(); + return extractCallback->SetOperationResult(opResult); COM_TRY_END } diff --git a/CPP/7zip/Archive/Zip/ZipHandler.cpp b/CPP/7zip/Archive/Zip/ZipHandler.cpp index 84269599..c3576eeb 100755 --- a/CPP/7zip/Archive/Zip/ZipHandler.cpp +++ b/CPP/7zip/Archive/Zip/ZipHandler.cpp @@ -74,15 +74,7 @@ static const int kNumHostOSes = sizeof(kHostOS) / sizeof(kHostOS[0]); static const wchar_t *kUnknownOS = L"Unknown"; - -/* -enum // PropID -{ - kpidUnPackVersion, -}; -*/ - -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, { NULL, kpidIsFolder, VT_BOOL}, @@ -99,7 +91,7 @@ STATPROPSTG kProperties[] = { NULL, kpidMethod, VT_BSTR}, { NULL, kpidHostOS, VT_BSTR} - // { L"UnPack Version", kpidUnPackVersion, VT_UI1}, + // { NULL, kpidUnpackVer, VT_UI1}, }; const wchar_t *kMethods[] = @@ -147,7 +139,7 @@ CStrongCryptoPair g_StrongCryptoPairs[] = { NStrongCryptoFlags::kRC4, L"RC4" } }; -STATPROPSTG kArcProperties[] = +STATPROPSTG kArcProps[] = { { NULL, kpidComment, VT_BSTR} }; @@ -158,7 +150,7 @@ CHandler::CHandler(): InitMethodProperties(); } -static void StringToProp(const CByteBuffer &data, UINT codePage, NWindows::NCOM::CPropVariant &propVariant) +static void StringToProp(const CByteBuffer &data, UINT codePage, NWindows::NCOM::CPropVariant &prop) { int size = (int)data.GetCapacity(); if (size <= 0) @@ -168,62 +160,29 @@ static void StringToProp(const CByteBuffer &data, UINT codePage, NWindows::NCOM: memcpy(p, (const Byte *)data, size); p[size] = '\0'; s.ReleaseBuffer(); - propVariant = MultiByteToUnicodeString(s, codePage); + prop = MultiByteToUnicodeString(s, codePage); } +IMP_IInArchive_Props +IMP_IInArchive_ArcProps + STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; + NWindows::NCOM::CPropVariant prop; switch(propID) { case kpidComment: { - StringToProp(m_Archive.m_ArchiveInfo.Comment, CP_ACP, propVariant); + StringToProp(m_Archive.m_ArchiveInfo.Comment, CP_ACP, prop); break; } } - propVariant.Detach(value); + prop.Detach(value); COM_TRY_END return S_OK; } -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} - -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if (index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - *name = 0; - return S_OK; -} - -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) -{ - *numProperties = sizeof(kArcProperties) / sizeof(kArcProperties[0]); - return S_OK; -} - -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 index, - BSTR * name, PROPID * propID, VARTYPE *varType) -{ - if (index >= sizeof(kArcProperties) / sizeof(kArcProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kArcProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - *name = 0; - return S_OK; -} - STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) { *numItems = m_Items.Size(); @@ -233,22 +192,22 @@ STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems) STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; + NWindows::NCOM::CPropVariant prop; const CItemEx &item = m_Items[index]; switch(propID) { case kpidPath: - propVariant = NItemName::GetOSName2( + prop = NItemName::GetOSName2( MultiByteToUnicodeString(item.Name, item.GetCodePage())); break; case kpidIsFolder: - propVariant = item.IsDirectory(); + prop = item.IsDirectory(); break; case kpidSize: - propVariant = item.UnPackSize; + prop = item.UnPackSize; break; case kpidPackedSize: - propVariant = item.PackSize; + prop = item.PackSize; break; case kpidLastWriteTime: { @@ -260,23 +219,23 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val } else utcFileTime.dwHighDateTime = utcFileTime.dwLowDateTime = 0; - propVariant = utcFileTime; + prop = utcFileTime; break; } case kpidAttributes: - propVariant = item.GetWinAttributes(); + prop = item.GetWinAttributes(); break; case kpidEncrypted: - propVariant = item.IsEncrypted(); + prop = item.IsEncrypted(); break; case kpidComment: { - StringToProp(item.Comment, item.GetCodePage(), propVariant); + StringToProp(item.Comment, item.GetCodePage(), prop); break; } case kpidCRC: if (item.IsThereCrc()) - propVariant = item.FileCRC; + prop = item.FileCRC; break; case kpidMethod: { @@ -335,15 +294,15 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val ConvertUInt64ToString(methodId, s); method += s; } - propVariant = method; + prop = method; break; } case kpidHostOS: - propVariant = (item.MadeByVersion.HostOS < kNumHostOSes) ? + prop = (item.MadeByVersion.HostOS < kNumHostOSes) ? (kHostOS[item.MadeByVersion.HostOS]) : kUnknownOS; break; } - propVariant.Detach(value); + prop.Detach(value); return S_OK; COM_TRY_END } @@ -731,15 +690,14 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, totalUnPacked += item.UnPackSize; totalPacked += item.PackSize; } - extractCallback->SetTotal(totalUnPacked); + RINOK(extractCallback->SetTotal(totalUnPacked)); UInt64 currentTotalUnPacked = 0, currentTotalPacked = 0; UInt64 currentItemUnPacked, currentItemPacked; - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> progress = localProgressSpec; - CLocalCompressProgressInfo *localCompressProgressSpec = new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(extractCallback, false); for (i = 0; i < numItems; i++, currentTotalUnPacked += currentItemUnPacked, currentTotalPacked += currentItemPacked) @@ -747,7 +705,10 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, currentItemUnPacked = 0; currentItemPacked = 0; - RINOK(extractCallback->SetCompleted(¤tTotalUnPacked)); + lps->InSize = currentTotalPacked; + lps->OutSize = currentTotalUnPacked; + RINOK(lps->SetCur()); + CMyComPtr<ISequentialOutStream> realOutStream; Int32 askMode = testMode ? NArchive::NExtract::NAskMode::kTest : @@ -792,14 +753,11 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, RINOK(extractCallback->PrepareOperation(askMode)); - localProgressSpec->Init(extractCallback, false); - localCompressProgressSpec->Init(progress, ¤tTotalPacked, ¤tTotalUnPacked); - Int32 res; RINOK(myDecoder.Decode( EXTERNAL_CODECS_VARS m_Archive, item, realOutStream, extractCallback, - compressProgress, _numThreads, res)); + progress, _numThreads, res)); realOutStream.Release(); RINOK(extractCallback->SetOperationResult(res)) diff --git a/CPP/7zip/Archive/Zip/ZipIn.cpp b/CPP/7zip/Archive/Zip/ZipIn.cpp index bb45d1d1..bf3764f7 100755 --- a/CPP/7zip/Archive/Zip/ZipIn.cpp +++ b/CPP/7zip/Archive/Zip/ZipIn.cpp @@ -542,6 +542,10 @@ HRESULT CInArchive::FindCd(CCdInfo &cdInfo) // cdInfo.NumEntries = GetUInt16(buf + i + 10); cdInfo.Size = GetUInt32(buf + i + 12); cdInfo.Offset = GetUInt32(buf + i + 16); + UInt64 curPos = endPosition - bufSize + i; + UInt64 cdEnd = cdInfo.Size + cdInfo.Offset; + if (curPos > cdEnd) + m_ArchiveInfo.Base = curPos - cdEnd; return S_OK; } } diff --git a/CPP/7zip/Archive/Zip/ZipItem.h b/CPP/7zip/Archive/Zip/ZipItem.h index 2395a37a..350e81b6 100755 --- a/CPP/7zip/Archive/Zip/ZipItem.h +++ b/CPP/7zip/Archive/Zip/ZipItem.h @@ -226,7 +226,7 @@ public: if (CentralExtra.GetWzAesField(aesField)) return aesField.NeedCrc(); } - return true; + return (FileCRC != 0 || !IsDirectory()); } WORD GetCodePage() const diff --git a/CPP/7zip/Archive/Zip/ZipUpdate.cpp b/CPP/7zip/Archive/Zip/ZipUpdate.cpp index 27284953..b08545c6 100755 --- a/CPP/7zip/Archive/Zip/ZipUpdate.cpp +++ b/CPP/7zip/Archive/Zip/ZipUpdate.cpp @@ -237,12 +237,93 @@ public: } }; +class CMtProgressMixer2: + public ICompressProgressInfo, + public CMyUnknownImp +{ + UInt64 ProgressOffset; + UInt64 InSizes[2]; + UInt64 OutSizes[2]; + CMyComPtr<IProgress> Progress; + CMyComPtr<ICompressProgressInfo> RatioProgress; + bool _inSizeIsMain; +public: + NWindows::NSynchronization::CCriticalSection CriticalSection; + MY_UNKNOWN_IMP + void Create(IProgress *progress, bool inSizeIsMain); + void SetProgressOffset(UInt64 progressOffset); + HRESULT SetRatioInfo(int index, const UInt64 *inSize, const UInt64 *outSize); + STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize); +}; + +void CMtProgressMixer2::Create(IProgress *progress, bool inSizeIsMain) +{ + Progress = progress; + Progress.QueryInterface(IID_ICompressProgressInfo, &RatioProgress); + _inSizeIsMain = inSizeIsMain; + ProgressOffset = InSizes[0] = InSizes[1] = OutSizes[0] = OutSizes[1] = 0; +} + +void CMtProgressMixer2::SetProgressOffset(UInt64 progressOffset) +{ + CriticalSection.Enter(); + ProgressOffset = progressOffset; + CriticalSection.Leave(); +} + +HRESULT CMtProgressMixer2::SetRatioInfo(int index, const UInt64 *inSize, const UInt64 *outSize) +{ + NWindows::NSynchronization::CCriticalSectionLock lock(CriticalSection); + if (index == 0 && RatioProgress) + { + RINOK(RatioProgress->SetRatioInfo(inSize, outSize)); + } + if (inSize != 0) + InSizes[index] = *inSize; + if (outSize != 0) + OutSizes[index] = *outSize; + UInt64 v = ProgressOffset + (_inSizeIsMain ? + (InSizes[0] + InSizes[1]) : + (OutSizes[0] + OutSizes[1])); + return Progress->SetCompleted(&v); +} + +STDMETHODIMP CMtProgressMixer2::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize) +{ + return SetRatioInfo(0, inSize, outSize); +} + +class CMtProgressMixer: + public ICompressProgressInfo, + public CMyUnknownImp +{ +public: + CMtProgressMixer2 *Mixer2; + CMyComPtr<ICompressProgressInfo> RatioProgress; + void Create(IProgress *progress, bool inSizeIsMain); + MY_UNKNOWN_IMP + STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize); +}; + +void CMtProgressMixer::Create(IProgress *progress, bool inSizeIsMain) +{ + Mixer2 = new CMtProgressMixer2; + RatioProgress = Mixer2; + Mixer2->Create(progress, inSizeIsMain); +} + +STDMETHODIMP CMtProgressMixer::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize) +{ + return Mixer2->SetRatioInfo(1, inSize, outSize); +} + + #endif static HRESULT UpdateItemOldData(COutArchive &archive, IInStream *inStream, - const CUpdateItem &updateItem, CItemEx &item, ICompressProgressInfo *progress, + const CUpdateItem &updateItem, CItemEx &item, ICompressProgressInfo *progress, UInt64 &complexity) { if (updateItem.NewProperties) @@ -301,21 +382,20 @@ static HRESULT Update2St( const CByteBuffer &comment, IArchiveUpdateCallback *updateCallback) { - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> localProgress = localProgressSpec; - localProgressSpec->Init(updateCallback, true); - - CLocalCompressProgressInfo *localCompressProgressSpec = new CLocalCompressProgressInfo; - CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec; + CLocalProgress *lps = new CLocalProgress; + CMyComPtr<ICompressProgressInfo> progress = lps; + lps->Init(updateCallback, true); CAddCommon compressor(*options); CObjectVector<CItem> items; - UInt64 complexity = 0; + UInt64 unpackSizeTotal = 0, packSizeTotal = 0; for (int itemIndex = 0; itemIndex < updateItems.Size(); itemIndex++) { - RINOK(updateCallback->SetCompleted(&complexity)); + lps->InSize = unpackSizeTotal; + lps->OutSize = packSizeTotal; + RINOK(lps->SetCur()); const CUpdateItem &updateItem = updateItems[itemIndex]; CItemEx item; if (!updateItem.NewProperties || !updateItem.NewData) @@ -338,7 +418,7 @@ static HRESULT Update2St( HRESULT res = updateCallback->GetStream(updateItem.IndexInClient, &fileInStream); if (res == S_FALSE) { - complexity += updateItem.Size + NFileHeader::kLocalBlockSize; + lps->ProgressOffset += updateItem.Size; RINOK(updateCallback->SetOperationResult(NArchive::NUpdate::NOperationResult::kOK)); continue; } @@ -350,23 +430,26 @@ static HRESULT Update2St( CCompressingResult compressingResult; CMyComPtr<IOutStream> outStream; archive.CreateStreamForCompressing(&outStream); - localCompressProgressSpec->Init(localProgress, &complexity, NULL); RINOK(compressor.Compress( EXTERNAL_CODECS_LOC_VARS - fileInStream, outStream, compressProgress, compressingResult)); + fileInStream, outStream, progress, compressingResult)); SetItemInfoFromCompressingResult(compressingResult, options->IsAesMode, options->AesKeyMode, item); archive.WriteLocalHeader(item); RINOK(updateCallback->SetOperationResult(NArchive::NUpdate::NOperationResult::kOK)); - complexity += item.UnPackSize; + unpackSizeTotal += item.UnPackSize; + packSizeTotal += item.PackSize; } } else { - localCompressProgressSpec->Init(localProgress, &complexity, NULL); - RINOK(UpdateItemOldData(archive, inStream, updateItem, item, compressProgress, complexity)); + UInt64 complexity = 0; + lps->SendRatio = false; + RINOK(UpdateItemOldData(archive, inStream, updateItem, item, progress, complexity)); + lps->SendRatio = true; + lps->ProgressOffset += complexity; } items.Add(item); - complexity += NFileHeader::kLocalBlockSize; + lps->ProgressOffset += NFileHeader::kLocalBlockSize; } archive.WriteCentralDir(items, comment); return S_OK; @@ -477,17 +560,12 @@ static HRESULT Update2( CObjectVector<CItem> items; - CLocalProgress *localProgressSpec = new CLocalProgress; - CMyComPtr<ICompressProgressInfo> localProgress = localProgressSpec; - localProgressSpec->Init(updateCallback, true); + CMtProgressMixer *mtProgressMixerSpec = new CMtProgressMixer; + CMyComPtr<ICompressProgressInfo> progress = mtProgressMixerSpec; + mtProgressMixerSpec->Create(updateCallback, true); CMtCompressProgressMixer mtCompressProgressMixer; - mtCompressProgressMixer.Init(numThreads + 1, localProgress); - - // we need one item for main stream - CMtCompressProgress *progressMainSpec = new CMtCompressProgress(); - CMyComPtr<ICompressProgressInfo> progressMain = progressMainSpec; - progressMainSpec->Init(&mtCompressProgressMixer, (int)numThreads); + mtCompressProgressMixer.Init(numThreads, mtProgressMixerSpec->RatioProgress); CMemBlockManagerMt memManager(kBlockSize); CMemRefs refs(&memManager); @@ -551,12 +629,13 @@ static HRESULT Update2( } CMyComPtr<ISequentialInStream> fileInStream; { - NWindows::NSynchronization::CCriticalSectionLock lock(mtCompressProgressMixer.CriticalSection); + NWindows::NSynchronization::CCriticalSectionLock lock(mtProgressMixerSpec->Mixer2->CriticalSection); HRESULT res = updateCallback->GetStream(updateItem.IndexInClient, &fileInStream); if (res == S_FALSE) { complexity += updateItem.Size; - complexity++; + complexity += NFileHeader::kLocalBlockSize; + mtProgressMixerSpec->Mixer2->SetProgressOffset(complexity); RINOK(updateCallback->SetOperationResult(NArchive::NUpdate::NOperationResult::kOK)); refs.Refs[mtItemIndex - 1].Skip = true; continue; @@ -633,7 +712,6 @@ static HRESULT Update2( options->IsAesMode, options->AesKeyMode, item); SetFileHeader(archive, *options, updateItem, item); archive.WriteLocalHeader(item); - complexity += item.UnPackSize; // RINOK(updateCallback->SetOperationResult(NArchive::NUpdate::NOperationResult::kOK)); memRef.FreeOpt(&memManager); } @@ -667,7 +745,6 @@ static HRESULT Update2( options->IsAesMode, options->AesKeyMode, item); SetFileHeader(archive, *options, updateItem, item); archive.WriteLocalHeader(item); - complexity += item.UnPackSize; } else { @@ -682,11 +759,11 @@ static HRESULT Update2( } else { - progressMainSpec->Reinit(); - RINOK(UpdateItemOldData(archive, inStream, updateItem, item, progressMain, complexity)); + RINOK(UpdateItemOldData(archive, inStream, updateItem, item, progress, complexity)); } items.Add(item); complexity += NFileHeader::kLocalBlockSize; + mtProgressMixerSpec->Mixer2->SetProgressOffset(complexity); itemIndex++; } archive.WriteCentralDir(items, comment); diff --git a/CPP/7zip/Bundles/Format7zF/Format7z.dsp b/CPP/7zip/Bundles/Format7zF/Format7z.dsp index eddccf5e..5b2f0098 100755 --- a/CPP/7zip/Bundles/Format7zF/Format7z.dsp +++ b/CPP/7zip/Bundles/Format7zF/Format7z.dsp @@ -2411,12 +2411,20 @@ SOURCE=..\..\ICoder.h # End Source File # Begin Source File +SOURCE=..\..\IDecl.h +# End Source File +# Begin Source File + SOURCE=..\..\IPassword.h # End Source File # Begin Source File SOURCE=..\..\IProgress.h # End Source File +# Begin Source File + +SOURCE=..\..\IStream.h +# End Source File # End Group # Begin Source File diff --git a/CPP/7zip/Bundles/SFXCon/Main.cpp b/CPP/7zip/Bundles/SFXCon/Main.cpp index 9084d9d7..79dabdec 100755 --- a/CPP/7zip/Bundles/SFXCon/Main.cpp +++ b/CPP/7zip/Bundles/SFXCon/Main.cpp @@ -389,11 +389,12 @@ int Main2( eo.YesToAll = yesToAll; UString errorMessage; + CDecompressStat stat; HRESULT result = DecompressArchives( codecs, v1, v2, wildcardCensorHead, - eo, &openCallback, ecs, errorMessage); + eo, &openCallback, ecs, errorMessage, stat); if (!errorMessage.IsEmpty()) { (*g_StdStream) << endl << "Error: " << errorMessage;; diff --git a/CPP/7zip/Bundles/SFXSetup/ExtractCallback.cpp b/CPP/7zip/Bundles/SFXSetup/ExtractCallback.cpp index 7051b9cd..aaeae468 100755 --- a/CPP/7zip/Bundles/SFXSetup/ExtractCallback.cpp +++ b/CPP/7zip/Bundles/SFXSetup/ExtractCallback.cpp @@ -240,7 +240,7 @@ STDMETHODIMP CExtractCallbackImp::SetOperationResult(Int32 resultEOperationResul } } if(_outFileStream != NULL) - _outFileStreamSpec->File.SetLastWriteTime(&_processedFileInfo.UTCLastWriteTime); + _outFileStreamSpec->SetLastWriteTime(&_processedFileInfo.UTCLastWriteTime); _outFileStream.Release(); if (_extractMode) NDirectory::MySetFileAttributes(_diskFilePath, _processedFileInfo.Attributes); diff --git a/CPP/7zip/Bundles/SFXSetup/ExtractCallback.h b/CPP/7zip/Bundles/SFXSetup/ExtractCallback.h index b85dce42..01427394 100755 --- a/CPP/7zip/Bundles/SFXSetup/ExtractCallback.h +++ b/CPP/7zip/Bundles/SFXSetup/ExtractCallback.h @@ -13,7 +13,7 @@ #include "../../ICoder.h" #ifndef _NO_PROGRESS -#include "../../FileManager/Resource/ProgressDialog/ProgressDialog.h" +#include "../../UI/FileManager/ProgressDialog.h" #endif class CExtractCallbackImp: diff --git a/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp b/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp index 210e52ae..04c9af18 100755 --- a/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp +++ b/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp @@ -13,7 +13,7 @@ #include "../../UI/Common/OpenArchive.h" #include "../../UI/Explorer/MyMessages.h" -#include "../../FileManager/FormatUtils.h" +#include "../../UI/FileManager/FormatUtils.h" #include "ExtractCallback.h" diff --git a/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp b/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp index 528275fd..1fd348bc 100755 --- a/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp +++ b/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp @@ -668,20 +668,20 @@ SOURCE=..\..\UI\GUI\OpenCallbackGUI.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\FileManager\Resource\ProgressDialog\ProgressDialog.cpp +SOURCE=..\..\UI\FileManager\ProgressDialog.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\Resource\ProgressDialog\ProgressDialog.h +SOURCE=..\..\UI\FileManager\ProgressDialog.h # End Source File # End Group # Begin Source File -SOURCE=..\..\FileManager\FormatUtils.cpp +SOURCE=..\..\UI\FileManager\FormatUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\FormatUtils.h +SOURCE=..\..\UI\FileManager\FormatUtils.h # End Source File # End Group # Begin Group "C" diff --git a/CPP/7zip/Bundles/SFXSetup/makefile b/CPP/7zip/Bundles/SFXSetup/makefile index 99104f67..10731a93 100755 --- a/CPP/7zip/Bundles/SFXSetup/makefile +++ b/CPP/7zip/Bundles/SFXSetup/makefile @@ -64,6 +64,7 @@ UI_COMMON_OBJS = \ FM_OBJS = \ $O\FormatUtils.obj \ + $O\ProgressDialog.obj \ AR_COMMON_OBJS = \ $O\CoderMixer2.obj \ @@ -125,7 +126,6 @@ OBJS = \ $(LZ_OBJS) \ $(LZMA_OPT_OBJS) \ $O\MyMessages.obj \ - $O\ProgressDialog.obj \ $(C_OBJS) \ $(C_BRANCH_OBJS) \ $(CRC_OBJS) \ @@ -149,7 +149,7 @@ $(7ZIP_COMMON_OBJS): ../../Common/$(*B).cpp $(COMPL) $(UI_COMMON_OBJS): ../../UI/Common/$(*B).cpp $(COMPL) -$(FM_OBJS): ../../FileManager/$(*B).cpp +$(FM_OBJS): ../../UI/FileManager//$(*B).cpp $(COMPL) $(AR_COMMON_OBJS): ../../Archive/Common/$(*B).cpp $(COMPL) @@ -167,8 +167,6 @@ $(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp $O\MyMessages.obj: ../../UI/Explorer/MyMessages.cpp $(COMPL) -$O\ProgressDialog.obj: ../../FileManager/Resource/ProgressDialog/$(*B).cpp - $(COMPL) $(C_OBJS): ../../../../C/$(*B).c $(COMPL_O1) diff --git a/CPP/7zip/Bundles/SFXSetup/resource.rc b/CPP/7zip/Bundles/SFXSetup/resource.rc index 4bf6a585..85c24f0b 100755 --- a/CPP/7zip/Bundles/SFXSetup/resource.rc +++ b/CPP/7zip/Bundles/SFXSetup/resource.rc @@ -13,4 +13,4 @@ BEGIN IDS_PROGRESS_EXTRACTING "Extracting" END -#include "../../FileManager/Resource/ProgressDialog/resource.rc" +#include "../../UI/FileManager/ProgressDialog.rc" diff --git a/CPP/7zip/Bundles/SFXWin/SFXWin.dsp b/CPP/7zip/Bundles/SFXWin/SFXWin.dsp index 8ce4146d..70de7602 100755 --- a/CPP/7zip/Bundles/SFXWin/SFXWin.dsp +++ b/CPP/7zip/Bundles/SFXWin/SFXWin.dsp @@ -389,35 +389,35 @@ SOURCE=..\..\Crypto\Hash\Sha256.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\FileManager\Resource\MessagesDialog\MessagesDialog.cpp +SOURCE=..\..\UI\FileManager\MessagesDialog.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\Resource\MessagesDialog\MessagesDialog.h +SOURCE=..\..\UI\FileManager\MessagesDialog.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\Resource\OverwriteDialog\OverwriteDialog.cpp +SOURCE=..\..\UI\FileManager\OverwriteDialog.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\Resource\OverwriteDialog\OverwriteDialog.h +SOURCE=..\..\UI\FileManager\OverwriteDialog.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\Resource\PasswordDialog\PasswordDialog.cpp +SOURCE=..\..\UI\FileManager\PasswordDialog.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\Resource\PasswordDialog\PasswordDialog.h +SOURCE=..\..\UI\FileManager\PasswordDialog.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\Resource\ProgressDialog\ProgressDialog.cpp +SOURCE=..\..\UI\FileManager\ProgressDialog.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\Resource\ProgressDialog\ProgressDialog.h +SOURCE=..\..\UI\FileManager\ProgressDialog.h # End Source File # End Group # Begin Group "7zip Common" @@ -533,19 +533,19 @@ SOURCE=..\..\Common\VirtThread.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\FileManager\ExtractCallback.cpp +SOURCE=..\..\UI\FileManager\ExtractCallback.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\ExtractCallback.h +SOURCE=..\..\UI\FileManager\ExtractCallback.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\FormatUtils.cpp +SOURCE=..\..\UI\FileManager\FormatUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\FormatUtils.h +SOURCE=..\..\UI\FileManager\FormatUtils.h # End Source File # End Group # Begin Group "Windows" diff --git a/CPP/7zip/Bundles/SFXWin/makefile b/CPP/7zip/Bundles/SFXWin/makefile index 733d804f..55ebd8c6 100755 --- a/CPP/7zip/Bundles/SFXWin/makefile +++ b/CPP/7zip/Bundles/SFXWin/makefile @@ -68,6 +68,10 @@ UI_COMMON_OBJS = \ FM_OBJS = \ $O\ExtractCallback.obj \ $O\FormatUtils.obj \ + $O\MessagesDialog.obj \ + $O\OverwriteDialog.obj \ + $O\PasswordDialog.obj \ + $O\ProgressDialog.obj \ AR_COMMON_OBJS = \ $O\CoderMixer2.obj \ @@ -150,10 +154,6 @@ OBJS = \ $(7ZAES_OPT_OBJS) \ $(AES_OPT_OBJS) \ $O\MyMessages.obj \ - $O\MessagesDialog.obj \ - $O\OverwriteDialog.obj \ - $O\PasswordDialog.obj \ - $O\ProgressDialog.obj \ $(C_OBJS) \ $(C_BRANCH_OBJS) \ $(CRC_OBJS) \ @@ -178,7 +178,7 @@ $(7ZIP_COMMON_OBJS): ../../Common/$(*B).cpp $(COMPL) $(UI_COMMON_OBJS): ../../UI/Common/$(*B).cpp $(COMPL) -$(FM_OBJS): ../../FileManager/$(*B).cpp +$(FM_OBJS): ../../UI/FileManager/$(*B).cpp $(COMPL) $(AR_COMMON_OBJS): ../../Archive/Common/$(*B).cpp $(COMPL) @@ -205,14 +205,6 @@ $(AES_OPT_OBJS): ../../Crypto/AES/$(*B).cpp $O\MyMessages.obj: ../../UI/Explorer/MyMessages.cpp $(COMPL) -$O\MessagesDialog.obj: ../../FileManager/Resource/MessagesDialog/$(*B).cpp - $(COMPL) -$O\OverwriteDialog.obj: ../../FileManager/Resource/OverwriteDialog./$(*B).cpp - $(COMPL) -$O\PasswordDialog.obj: ../../FileManager/Resource/PasswordDialog/$(*B).cpp - $(COMPL) -$O\ProgressDialog.obj: ../../FileManager/Resource/ProgressDialog/$(*B).cpp - $(COMPL) $(C_OBJS): ../../../../C/$(*B).c $(COMPL_O1) $(C_BRANCH_OBJS): ../../../../C/Compress/Branch/$(*B).c diff --git a/CPP/7zip/Bundles/SFXWin/resource.rc b/CPP/7zip/Bundles/SFXWin/resource.rc index 60304803..8dd95bf0 100755 --- a/CPP/7zip/Bundles/SFXWin/resource.rc +++ b/CPP/7zip/Bundles/SFXWin/resource.rc @@ -27,8 +27,8 @@ BEGIN PUSHBUTTON "Cancel", IDCANCEL, bXPos1, bYPos, bXSize, bYSize END -#include "../../FileManager/Resource/MessagesDialog/resource.rc" -#include "../../FileManager/Resource/OverwriteDialog/resource.rc" -#include "../../FileManager/Resource/PasswordDialog/resource.rc" -#include "../../FileManager/Resource/ProgressDialog/resource.rc" -#include "../../UI/Resource/Extract/resource.rc" +#include "../../UI/FileManager/MessagesDialog.rc" +#include "../../UI/FileManager/OverwriteDialog.rc" +#include "../../UI/FileManager/PasswordDialog.rc" +#include "../../UI/FileManager/ProgressDialog.rc" +#include "../../UI/GUI/Extract.rc" diff --git a/CPP/7zip/Common/FileStreams.cpp b/CPP/7zip/Common/FileStreams.cpp index bd90ce79..27fb0e81 100755 --- a/CPP/7zip/Common/FileStreams.cpp +++ b/CPP/7zip/Common/FileStreams.cpp @@ -12,9 +12,13 @@ static inline HRESULT ConvertBoolToHRESULT(bool result) { - // return result ? S_OK: E_FAIL; #ifdef _WIN32 - return result ? S_OK: (::GetLastError()); + if (result) + return S_OK; + DWORD lastError = ::GetLastError(); + if (lastError == 0) + return E_FAIL; + return lastError; #else return result ? S_OK: E_FAIL; #endif @@ -141,26 +145,13 @@ STDMETHODIMP CInFileStream::GetSize(UInt64 *size) ////////////////////////// // COutFileStream -bool COutFileStream::Create(LPCTSTR fileName, bool createAlways) -{ - return File.Create(fileName, createAlways); -} - -#ifdef USE_WIN_FILE -#ifndef _UNICODE -bool COutFileStream::Create(LPCWSTR fileName, bool createAlways) -{ - return File.Create(fileName, createAlways); -} -#endif -#endif - STDMETHODIMP COutFileStream::Write(const void *data, UInt32 size, UInt32 *processedSize) { #ifdef USE_WIN_FILE UInt32 realProcessedSize; bool result = File.WritePart(data, size, realProcessedSize); + ProcessedSize += realProcessedSize; if(processedSize != NULL) *processedSize = realProcessedSize; return ConvertBoolToHRESULT(result); @@ -174,13 +165,13 @@ STDMETHODIMP COutFileStream::Write(const void *data, UInt32 size, UInt32 *proces return E_FAIL; if(processedSize != NULL) *processedSize = (UInt32)res; + ProcessedSize += res; return S_OK; #endif } -STDMETHODIMP COutFileStream::Seek(Int64 offset, UInt32 seekOrigin, - UInt64 *newPosition) +STDMETHODIMP COutFileStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition) { if(seekOrigin >= 3) return STG_E_INVALIDFUNCTION; diff --git a/CPP/7zip/Common/FileStreams.h b/CPP/7zip/Common/FileStreams.h index a65c96e1..94cd1daf 100755 --- a/CPP/7zip/Common/FileStreams.h +++ b/CPP/7zip/Common/FileStreams.h @@ -72,20 +72,52 @@ class COutFileStream: public IOutStream, public CMyUnknownImp { -public: #ifdef USE_WIN_FILE NWindows::NFile::NIO::COutFile File; #else NC::NFile::NIO::COutFile File; #endif +public: virtual ~COutFileStream() {} - bool Create(LPCTSTR fileName, bool createAlways); + bool Create(LPCTSTR fileName, bool createAlways) + { + ProcessedSize = 0; + return File.Create(fileName, createAlways); + } + bool Open(LPCTSTR fileName, DWORD creationDisposition) + { + ProcessedSize = 0; + return File.Open(fileName, creationDisposition); + } #ifdef USE_WIN_FILE #ifndef _UNICODE - bool Create(LPCWSTR fileName, bool createAlways); + bool Create(LPCWSTR fileName, bool createAlways) + { + ProcessedSize = 0; + return File.Create(fileName, createAlways); + } + bool Open(LPCWSTR fileName, DWORD creationDisposition) + { + ProcessedSize = 0; + return File.Open(fileName, creationDisposition); + } #endif #endif + UInt64 ProcessedSize; + + #ifdef USE_WIN_FILE + bool SetTime(const FILETIME *creationTime, const FILETIME *lastAccessTime, const FILETIME *lastWriteTime) + { + return File.SetTime(creationTime, lastAccessTime, lastWriteTime); + } + bool SetLastWriteTime(const FILETIME *lastWriteTime) + { + return File.SetLastWriteTime(lastWriteTime); + } + #endif + + MY_UNKNOWN_IMP1(IOutStream) STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize); diff --git a/CPP/7zip/Common/OutBuffer.cpp b/CPP/7zip/Common/OutBuffer.cpp index a63862b9..31d17c5a 100755 --- a/CPP/7zip/Common/OutBuffer.cpp +++ b/CPP/7zip/Common/OutBuffer.cpp @@ -109,7 +109,7 @@ HRESULT COutBuffer::Flush() void COutBuffer::FlushWithCheck() { - HRESULT result = FlushPart(); + HRESULT result = Flush(); #ifdef _NO_EXCEPTIONS ErrorCode = result; #else diff --git a/CPP/7zip/Common/ProgressUtils.cpp b/CPP/7zip/Common/ProgressUtils.cpp index 40e13877..22dc60d1 100755 --- a/CPP/7zip/Common/ProgressUtils.cpp +++ b/CPP/7zip/Common/ProgressUtils.cpp @@ -4,52 +4,37 @@ #include "ProgressUtils.h" -void CLocalCompressProgressInfo::Init(ICompressProgressInfo *progress, - const UInt64 *inStartValue, const UInt64 *outStartValue) +CLocalProgress::CLocalProgress() { - _progress = progress; - _inStartValueIsAssigned = (inStartValue != NULL); - if (_inStartValueIsAssigned) - _inStartValue = *inStartValue; - _outStartValueIsAssigned = (outStartValue != NULL); - if (_outStartValueIsAssigned) - _outStartValue = *outStartValue; + ProgressOffset = InSize = OutSize = 0; + SendRatio = true; } -STDMETHODIMP CLocalCompressProgressInfo::SetRatioInfo( - const UInt64 *inSize, const UInt64 *outSize) -{ - UInt64 inSizeNew, outSizeNew; - const UInt64 *inSizeNewPointer; - const UInt64 *outSizeNewPointer; - if (_inStartValueIsAssigned && inSize != NULL) - { - inSizeNew = _inStartValue + (*inSize); - inSizeNewPointer = &inSizeNew; - } - else - inSizeNewPointer = NULL; - - if (_outStartValueIsAssigned && outSize != NULL) - { - outSizeNew = _outStartValue + (*outSize); - outSizeNewPointer = &outSizeNew; - } - else - outSizeNewPointer = NULL; - return _progress->SetRatioInfo(inSizeNewPointer, outSizeNewPointer); -} - -/////////////////////////////////// - void CLocalProgress::Init(IProgress *progress, bool inSizeIsMain) { + _ratioProgress.Release(); _progress = progress; + _progress.QueryInterface(IID_ICompressProgressInfo, &_ratioProgress); _inSizeIsMain = inSizeIsMain; } -STDMETHODIMP CLocalProgress::SetRatioInfo( - const UInt64 *inSize, const UInt64 *outSize) +STDMETHODIMP CLocalProgress::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize) +{ + UInt64 inSizeNew = InSize, outSizeNew = OutSize; + if (inSize) + inSizeNew += (*inSize); + if (outSize) + outSizeNew += (*outSize); + if (SendRatio && _ratioProgress) + { + RINOK(_ratioProgress->SetRatioInfo(&inSizeNew, &outSizeNew)); + } + inSizeNew += ProgressOffset; + outSizeNew += ProgressOffset; + return _progress->SetCompleted(_inSizeIsMain ? &inSizeNew : &outSizeNew); +} + +HRESULT CLocalProgress::SetCur() { - return _progress->SetCompleted(_inSizeIsMain ? inSize : outSize); + return SetRatioInfo(NULL, NULL); } diff --git a/CPP/7zip/Common/ProgressUtils.h b/CPP/7zip/Common/ProgressUtils.h index f89839fa..4d0eb20d 100755 --- a/CPP/7zip/Common/ProgressUtils.h +++ b/CPP/7zip/Common/ProgressUtils.h @@ -8,32 +8,22 @@ #include "../ICoder.h" #include "../IProgress.h" -class CLocalCompressProgressInfo: - public ICompressProgressInfo, - public CMyUnknownImp -{ - CMyComPtr<ICompressProgressInfo> _progress; - bool _inStartValueIsAssigned; - bool _outStartValueIsAssigned; - UInt64 _inStartValue; - UInt64 _outStartValue; -public: - void Init(ICompressProgressInfo *progress, - const UInt64 *inStartValue, const UInt64 *outStartValue); - - MY_UNKNOWN_IMP - - STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize); -}; - class CLocalProgress: public ICompressProgressInfo, public CMyUnknownImp { CMyComPtr<IProgress> _progress; + CMyComPtr<ICompressProgressInfo> _ratioProgress; bool _inSizeIsMain; public: + UInt64 ProgressOffset; + UInt64 InSize; + UInt64 OutSize; + bool SendRatio; + + CLocalProgress(); void Init(IProgress *progress, bool inSizeIsMain); + HRESULT SetCur(); MY_UNKNOWN_IMP diff --git a/CPP/7zip/Common/StreamUtils.cpp b/CPP/7zip/Common/StreamUtils.cpp index a5d9ac0e..1d951271 100755 --- a/CPP/7zip/Common/StreamUtils.cpp +++ b/CPP/7zip/Common/StreamUtils.cpp @@ -38,7 +38,7 @@ HRESULT WriteStream(ISequentialOutStream *stream, const void *data, UInt32 size, size -= processedSizeLoc; RINOK(res); if (processedSizeLoc == 0) - break; + return E_FAIL; } return S_OK; } diff --git a/CPP/7zip/Compress/Branch/x86_2.cpp b/CPP/7zip/Compress/Branch/x86_2.cpp index 61f0c55a..51176c98 100755 --- a/CPP/7zip/Compress/Branch/x86_2.cpp +++ b/CPP/7zip/Compress/Branch/x86_2.cpp @@ -238,6 +238,13 @@ HRESULT CEncoder::CodeReal(ISequentialInStream **inStreams, if (progress != NULL) { + /* + const UInt64 compressedSize = + _mainStream.GetProcessedSize() + + _callStream.GetProcessedSize() + + _jumpStream.GetProcessedSize() + + _rangeEncoder.GetProcessedSize(); + */ RINOK(progress->SetRatioInfo(&nowPos64, NULL)); } @@ -312,7 +319,14 @@ HRESULT CDecoder::CodeReal(ISequentialInStream **inStreams, { if (processedBytes >= (1 << 20) && progress != NULL) { - UInt64 nowPos64 = _outStream.GetProcessedSize(); + /* + const UInt64 compressedSize = + _mainInStream.GetProcessedSize() + + _callStream.GetProcessedSize() + + _jumpStream.GetProcessedSize() + + _rangeDecoder.GetProcessedSize(); + */ + const UInt64 nowPos64 = _outStream.GetProcessedSize(); RINOK(progress->SetRatioInfo(NULL, &nowPos64)); processedBytes = 0; } diff --git a/CPP/7zip/Compress/Copy/CopyCoder.cpp b/CPP/7zip/Compress/Copy/CopyCoder.cpp index b9af74db..8e18db2b 100755 --- a/CPP/7zip/Compress/Copy/CopyCoder.cpp +++ b/CPP/7zip/Compress/Copy/CopyCoder.cpp @@ -40,7 +40,7 @@ STDMETHODIMP CCopyCoder::Code(ISequentialInStream *inStream, if (size > *outSize - TotalSize) size = (UInt32)(*outSize - TotalSize); RINOK(inStream->Read(_buffer, size, &realProcessedSize)); - if(realProcessedSize == 0) + if (realProcessedSize == 0) break; RINOK(WriteStream(outStream, _buffer, realProcessedSize, NULL)); TotalSize += realProcessedSize; diff --git a/CPP/7zip/Compress/Rar/Rar1Decoder.cpp b/CPP/7zip/Compress/Rar/Rar1Decoder.cpp index f19b14f4..0998a3f2 100755 --- a/CPP/7zip/Compress/Rar/Rar1Decoder.cpp +++ b/CPP/7zip/Compress/Rar/Rar1Decoder.cpp @@ -463,14 +463,10 @@ STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress) { - try - { - HRESULT res = CodeReal(inStream, outStream, inSize, outSize, progress); - m_OutWindowStream.Flush(); - return res; - } - catch(const CLZOutWindowException &e) { m_OutWindowStream.Flush(); return e.ErrorCode; } - catch(...) { m_OutWindowStream.Flush(); return S_FALSE; } + try { return CodeReal(inStream, outStream, inSize, outSize, progress); } + catch(const CInBufferException &e) { return e.ErrorCode; } + catch(const CLZOutWindowException &e) { return e.ErrorCode; } + catch(...) { return S_FALSE; } } STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *data, UInt32 size) diff --git a/CPP/7zip/Compress/Rar/Rar2Decoder.cpp b/CPP/7zip/Compress/Rar/Rar2Decoder.cpp index 152c388b..057a1a60 100755 --- a/CPP/7zip/Compress/Rar/Rar2Decoder.cpp +++ b/CPP/7zip/Compress/Rar/Rar2Decoder.cpp @@ -385,6 +385,7 @@ STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ICompressProgressInfo *progress) { try { return CodeReal(inStream, outStream, inSize, outSize, progress); } + catch(const CInBufferException &e) { return e.ErrorCode; } catch(const CLZOutWindowException &e) { return e.ErrorCode; } catch(...) { return S_FALSE; } } diff --git a/CPP/7zip/Compress/Rar/Rar3Decoder.cpp b/CPP/7zip/Compress/Rar/Rar3Decoder.cpp index 7f71d1d8..e629f4df 100755 --- a/CPP/7zip/Compress/Rar/Rar3Decoder.cpp +++ b/CPP/7zip/Compress/Rar/Rar3Decoder.cpp @@ -52,8 +52,8 @@ CDecoder::CDecoder(): CDecoder::~CDecoder() { InitFilters(); - if (_vmData) - ::MidFree(_vmData); + ::MidFree(_vmData); + ::MidFree(_window); } HRESULT CDecoder::WriteDataToStream(const Byte *data, UInt32 size) @@ -821,6 +821,7 @@ STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, _unpackSize = *outSize; return CodeReal(progress); } + catch(const CInBufferException &e) { return e.ErrorCode; } catch(...) { return S_FALSE; } // CNewException is possible here. But probably CNewException is caused // by error in data stream. diff --git a/CPP/7zip/Compress/Rar/Rar3Decoder.h b/CPP/7zip/Compress/Rar/Rar3Decoder.h index 178bf5db..6eefb28f 100755 --- a/CPP/7zip/Compress/Rar/Rar3Decoder.h +++ b/CPP/7zip/Compress/Rar/Rar3Decoder.h @@ -35,13 +35,12 @@ const UInt32 kLevelTableSize = 20; const UInt32 kTablesSizesSum = kMainTableSize + kDistTableSize + kAlignTableSize + kLenTableSize; -template<class TInByte> -class CBitDecoder2 +class CBitDecoder { UInt32 m_Value; public: UInt32 m_BitPos; - TInByte m_Stream; + CInBuffer m_Stream; bool Create(UInt32 bufferSize) { return m_Stream.Create(bufferSize); } void SetStream(ISequentialInStream *inStream) { m_Stream.SetStream(inStream);} void ReleaseStream() { m_Stream.ReleaseStream();} @@ -98,8 +97,6 @@ public: } }; -typedef CBitDecoder2<CInBuffer> CBitDecoder; - const int kNumTopBits = 24; const UInt32 kTopValue = (1 << kNumTopBits); const UInt32 kBot = (1 << 15); diff --git a/CPP/7zip/FileManager/IFolder.h b/CPP/7zip/FileManager/IFolder.h deleted file mode 100755 index 4758ea5b..00000000 --- a/CPP/7zip/FileManager/IFolder.h +++ /dev/null @@ -1,195 +0,0 @@ -// FolderInterface.h - -#ifndef __FOLDERINTERFACE_H -#define __FOLDERINTERFACE_H - -#include "../IProgress.h" - -#define FOLDER_INTERFACE_SUB(i, b, x, y) \ -DEFINE_GUID(IID_ ## i, \ -0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x08, 0x00, x, y, 0x00); \ -struct i: public b - -#define FOLDER_INTERFACE2(i, x, y) FOLDER_INTERFACE_SUB(i, IUnknown, x, y) - -#define FOLDER_INTERFACE(i, x) FOLDER_INTERFACE2(i, x, 0x00) - -namespace NPlugin -{ - enum - { - kName = 0, - kType, - kClassID, - kOptionsClassID - }; -} - -FOLDER_INTERFACE(IFolderFolder, 0x00) -{ - STDMETHOD(LoadItems)() PURE; - STDMETHOD(GetNumberOfItems)(UInt32 *numItems) PURE; - // STDMETHOD(GetNumberOfSubFolders)(UInt32 *numSubFolders) PURE; - STDMETHOD(GetProperty)(UInt32 itemIndex, PROPID propID, PROPVARIANT *value) PURE; - STDMETHOD(BindToFolder)(UInt32 index, IFolderFolder **resultFolder) PURE; - STDMETHOD(BindToFolder)(const wchar_t *name, IFolderFolder **resultFolder) PURE; - STDMETHOD(BindToParentFolder)(IFolderFolder **resultFolder) PURE; - STDMETHOD(GetName)(BSTR *name) PURE; -}; - -FOLDER_INTERFACE(IEnumProperties, 0x01) -{ - // STDMETHOD(EnumProperties)(IEnumSTATPROPSTG **enumerator) PURE; - STDMETHOD(GetNumberOfProperties)(UInt32 *numProperties) PURE; - STDMETHOD(GetPropertyInfo)(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) PURE; -}; - -FOLDER_INTERFACE(IFolderGetTypeID, 0x02) -{ - STDMETHOD(GetTypeID)(BSTR *name) PURE; -}; - -FOLDER_INTERFACE(IFolderGetPath, 0x03) -{ - STDMETHOD(GetPath)(BSTR *path) PURE; -}; - -FOLDER_INTERFACE(IFolderWasChanged, 0x04) -{ - STDMETHOD(WasChanged)(Int32 *wasChanged) PURE; -}; - -/* -FOLDER_INTERFACE(IFolderReload, 0x05) -{ - STDMETHOD(Reload)() PURE; -}; -*/ - -FOLDER_INTERFACE_SUB(IFolderOperationsExtractCallback, IProgress, 0x06, 0x01) -{ - STDMETHOD(AskWrite)( - const wchar_t *srcPath, - Int32 srcIsFolder, - const FILETIME *srcTime, - const UInt64 *srcSize, - const wchar_t *destPathRequest, - BSTR *destPathResult, - Int32 *writeAnswer) PURE; - STDMETHOD(ShowMessage)(const wchar_t *message) PURE; - STDMETHOD(SetCurrentFilePath)(const wchar_t *filePath) PURE; -}; - -/* -FOLDER_INTERFACE_SUB(IFolderOperationsUpdateCallback, IProgress, 0x06, 0x02) -{ - STDMETHOD(AskOverwrite)( - const wchar_t *srcPath, - Int32 destIsFolder, - const FILETIME *destTime, - const UInt64 *destSize, - const wchar_t *aDestPathRequest, - const wchar_t *aDestName, - BSTR *aDestPathResult, - Int32 *aResult); -}; -*/ - -FOLDER_INTERFACE(IFolderOperations, 0x06) -{ - STDMETHOD(CreateFolder)(const wchar_t *name, IProgress *progress) PURE; - STDMETHOD(CreateFile)(const wchar_t *name, IProgress *progress) PURE; - STDMETHOD(Rename)(UInt32 index, const wchar_t *newName, IProgress *progress) PURE; - STDMETHOD(Delete)(const UInt32 *indices, UInt32 numItems, IProgress *progress) PURE; - STDMETHOD(CopyTo)(const UInt32 *indices, UInt32 numItems, - const wchar_t *path, IFolderOperationsExtractCallback *callback) PURE; - STDMETHOD(MoveTo)(const UInt32 *indices, UInt32 numItems, - const wchar_t *path, IFolderOperationsExtractCallback *callback) PURE; - STDMETHOD(CopyFrom)(const wchar_t *fromFolderPath, - const wchar_t **itemsPaths, UInt32 numItems, IProgress *progress) PURE; - STDMETHOD(SetProperty)(UInt32 index, PROPID propID, const PROPVARIANT *value, IProgress *progress) PURE; -}; - -/* -FOLDER_INTERFACE2(IFolderOperationsDeleteToRecycleBin, 0x06, 0x03) -{ - STDMETHOD(DeleteToRecycleBin)(const UInt32 *indices, UInt32 numItems, IProgress *progress) PURE; -}; -*/ - -FOLDER_INTERFACE(IFolderGetSystemIconIndex, 0x07) -{ - STDMETHOD(GetSystemIconIndex)(UInt32 index, Int32 *iconIndex) PURE; -}; - -FOLDER_INTERFACE(IFolderGetItemFullSize, 0x08) -{ - STDMETHOD(GetItemFullSize)(UInt32 index, PROPVARIANT *value, IProgress *progress) PURE; -}; - -FOLDER_INTERFACE(IFolderClone, 0x09) -{ - STDMETHOD(Clone)(IFolderFolder **resultFolder) PURE; -}; - -FOLDER_INTERFACE(IFolderSetFlatMode, 0x0A) -{ - STDMETHOD(SetFlatMode)(Int32 flatMode) PURE; -}; - -/* -FOLDER_INTERFACE(IFolderOpen, 0x10) -{ - STDMETHOD(FolderOpen)( - const wchar_t *aFileName, - // IArchiveHandler100 **anArchiveHandler, - // NZipRootRegistry::CArchiverInfo &anArchiverInfoResult, - // UString &aDefaultName, - IOpenArchive2CallBack *anOpenArchive2CallBack) PURE; -}; -*/ - -#define FOLDER_MANAGER_INTERFACE(i, x) \ -DEFINE_GUID(IID_ ## i, \ -0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x09, 0x00, x, 0x00, 0x00); \ -struct i: public IUnknown - -// old interfaces 00, 01 - -FOLDER_MANAGER_INTERFACE(IFolderManager, 0x02) -{ - STDMETHOD(OpenFolderFile)(const wchar_t *filePath, IFolderFolder **resultFolder, IProgress *progress) PURE; - STDMETHOD(GetExtensions)(BSTR *extensions) PURE; - STDMETHOD(GetIconPath)(const wchar_t *ext, BSTR *iconPath, Int32 *iconIndex) PURE; - // STDMETHOD(GetTypes)(BSTR *types) PURE; - // STDMETHOD(GetExtensions)(const wchar_t *type, BSTR *extensions) PURE; - // STDMETHOD(CreateFolderFile)(const wchar_t *type, const wchar_t *filePath, IProgress *progress) PURE; -}; - -/* -FOLDER_MANAGER_INTERFACE(IFolderManagerGetIconPath, 0x03) -{ -}; -*;/ - -/* -FOLDER_INTERFACE(IFolderExtract, 0x05, 0x0A); -{ - STDMETHOD(Clone)(IFolderFolder **aFolder) PURE; -}; - -FOLDER_INTERFACE(IFolderChangeNotify,0x05, 0x04, 0x00); -IFolderChangeNotify: public IUnknown -{ - STDMETHOD(OnChanged)() PURE; -}; - -FOLDER_INTERFACE(IFolderSetChangeNotify, 0x05, 0x05); -{ - STDMETHOD(SetChangeNotify)(IFolderChangeNotify *aChangeNotify) PURE; -}; -*/ - - -#endif diff --git a/CPP/7zip/FileManager/PhysDriveFolder.h b/CPP/7zip/FileManager/PhysDriveFolder.h deleted file mode 100755 index 550b76b4..00000000 --- a/CPP/7zip/FileManager/PhysDriveFolder.h +++ /dev/null @@ -1,86 +0,0 @@ -// PhysDriveFolder.h - -#ifndef __PHYSDRIVEFOLDER_H -#define __PHYSDRIVEFOLDER_H - -#include "Common/MyString.h" -#include "Common/MyCom.h" - -#include "IFolder.h" - -class CPhysDriveFolder: - public IFolderFolder, - public IEnumProperties, - public IFolderGetTypeID, - public IFolderGetPath, - public IFolderWasChanged, - public IFolderOperations, - public IFolderGetItemFullSize, - public IFolderClone, - // public IFolderGetSystemIconIndex, - public CMyUnknownImp -{ - UInt64 GetSizeOfItem(int anIndex) const; -public: - MY_QUERYINTERFACE_BEGIN - MY_QUERYINTERFACE_ENTRY(IEnumProperties) - MY_QUERYINTERFACE_ENTRY(IFolderGetTypeID) - MY_QUERYINTERFACE_ENTRY(IFolderGetPath) - MY_QUERYINTERFACE_ENTRY(IFolderWasChanged) - MY_QUERYINTERFACE_ENTRY(IFolderOperations) - MY_QUERYINTERFACE_ENTRY(IFolderGetItemFullSize) - MY_QUERYINTERFACE_ENTRY(IFolderClone) - // MY_QUERYINTERFACE_ENTRY(IFolderGetSystemIconIndex) - MY_QUERYINTERFACE_END - MY_ADDREF_RELEASE - - - STDMETHOD(LoadItems)(); - STDMETHOD(GetNumberOfItems)(UInt32 *numItems); - STDMETHOD(GetProperty)(UInt32 itemIndex, PROPID propID, PROPVARIANT *value); - STDMETHOD(BindToFolder)(UInt32 index, IFolderFolder **resultFolder); - STDMETHOD(BindToFolder)(const wchar_t *name, IFolderFolder **resultFolder); - STDMETHOD(BindToParentFolder)(IFolderFolder **resultFolder); - STDMETHOD(GetName)(BSTR *name); - - STDMETHOD(GetNumberOfProperties)(UInt32 *numProperties); - STDMETHOD(GetPropertyInfo)(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType); - STDMETHOD(GetTypeID)(BSTR *name); - STDMETHOD(GetPath)(BSTR *path); - STDMETHOD(WasChanged)(INT32 *wasChanged); - STDMETHOD(Clone)(IFolderFolder **resultFolder); - STDMETHOD(GetItemFullSize)(UInt32 index, PROPVARIANT *value, IProgress *progress); - - // IFolderOperations - STDMETHOD(CreateFolder)(const wchar_t *name, IProgress *progress); - STDMETHOD(CreateFile)(const wchar_t *name, IProgress *progress); - STDMETHOD(Rename)(UInt32 index, const wchar_t *newName, IProgress *progress); - STDMETHOD(Delete)(const UInt32 *indices, UInt32 numItems, IProgress *progress); - STDMETHOD(CopyTo)(const UInt32 *indices, UInt32 numItems, - const wchar_t *path, IFolderOperationsExtractCallback *callback); - STDMETHOD(MoveTo)(const UInt32 *indices, UInt32 numItems, - const wchar_t *path, IFolderOperationsExtractCallback *callback); - STDMETHOD(CopyFrom)(const wchar_t *fromFolderPath, - const wchar_t **itemsPaths, UInt32 numItems, IProgress *progress); - STDMETHOD(SetProperty)(UInt32 index, PROPID propID, const PROPVARIANT *value, IProgress *progress); - // STDMETHOD(GetSystemIconIndex)(UInt32 index, INT32 *iconIndex); - -private: - UString _name; - UString _prefix; - UString _path; - UString GetFullPath() const { return _prefix + _path; } - UString GetFullPathWithName() const { return GetFullPath() + L'\\' + _name; } - CMyComPtr<IFolderFolder> _parentFolder; - - UINT _driveType; - DISK_GEOMETRY geom; - UInt64 _length; - -public: - HRESULT Init(const UString &path); - HRESULT GetLength(UInt64 &size) const; -}; - -#endif diff --git a/CPP/7zip/FileManager/Resource/AboutDialog/7zipLogo.ico b/CPP/7zip/FileManager/Resource/AboutDialog/7zipLogo.ico Binary files differdeleted file mode 100755 index 973241c8..00000000 --- a/CPP/7zip/FileManager/Resource/AboutDialog/7zipLogo.ico +++ /dev/null diff --git a/CPP/7zip/FileManager/Resource/AboutDialog/StdAfx.h b/CPP/7zip/FileManager/Resource/AboutDialog/StdAfx.h deleted file mode 100755 index a444ca31..00000000 --- a/CPP/7zip/FileManager/Resource/AboutDialog/StdAfx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/FileManager/Resource/ComboDialog/StdAfx.h b/CPP/7zip/FileManager/Resource/ComboDialog/StdAfx.h deleted file mode 100755 index a444ca31..00000000 --- a/CPP/7zip/FileManager/Resource/ComboDialog/StdAfx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/FileManager/Resource/CopyDialog/StdAfx.h b/CPP/7zip/FileManager/Resource/CopyDialog/StdAfx.h deleted file mode 100755 index a444ca31..00000000 --- a/CPP/7zip/FileManager/Resource/CopyDialog/StdAfx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/FileManager/Resource/EditPage/StdAfx.h b/CPP/7zip/FileManager/Resource/EditPage/StdAfx.h deleted file mode 100755 index a444ca31..00000000 --- a/CPP/7zip/FileManager/Resource/EditPage/StdAfx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/FileManager/Resource/LangPage/StdAfx.h b/CPP/7zip/FileManager/Resource/LangPage/StdAfx.h deleted file mode 100755 index a444ca31..00000000 --- a/CPP/7zip/FileManager/Resource/LangPage/StdAfx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/FileManager/Resource/ListBoxDialog/StdAfx.h b/CPP/7zip/FileManager/Resource/ListBoxDialog/StdAfx.h deleted file mode 100755 index a444ca31..00000000 --- a/CPP/7zip/FileManager/Resource/ListBoxDialog/StdAfx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/FileManager/Resource/ListBoxDialog/resource.h b/CPP/7zip/FileManager/Resource/ListBoxDialog/resource.h deleted file mode 100755 index 507e17bd..00000000 --- a/CPP/7zip/FileManager/Resource/ListBoxDialog/resource.h +++ /dev/null @@ -1,3 +0,0 @@ -#define IDD_DIALOG_LISTBOX 202 - -#define IDC_LISTBOX_LIST 1000 diff --git a/CPP/7zip/FileManager/Resource/ListBoxDialog/resource.rc b/CPP/7zip/FileManager/Resource/ListBoxDialog/resource.rc deleted file mode 100755 index 728aaa94..00000000 --- a/CPP/7zip/FileManager/Resource/ListBoxDialog/resource.rc +++ /dev/null @@ -1,22 +0,0 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" - -#define xSize2 223 -#define ySize2 177 - -#define xSize (xSize2 + marg + marg) -#define ySize (ySize2 + marg + marg) - -#define bYPos (ySize - marg - bYSize) -#define b1XPos (xSize - marg - bXSize) -#define b2XPos (b1XPos - 10 - bXSize) - - -IDD_DIALOG_LISTBOX DIALOG 0, 0, xSize, ySize MY_MODAL_DIALOG_STYLE -CAPTION "List Box" -MY_FONT -BEGIN - LISTBOX IDC_LISTBOX_LIST, marg, marg, xSize2, 149, LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "OK", IDOK, b2XPos, bYPos, bXSize, bYSize - PUSHBUTTON "Cancel", IDCANCEL, b1XPos, bYPos, bXSize, bYSize -END diff --git a/CPP/7zip/FileManager/Resource/ListViewDialog/StdAfx.h b/CPP/7zip/FileManager/Resource/ListViewDialog/StdAfx.h deleted file mode 100755 index a444ca31..00000000 --- a/CPP/7zip/FileManager/Resource/ListViewDialog/StdAfx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/FileManager/Resource/MessagesDialog/StdAfx.h b/CPP/7zip/FileManager/Resource/MessagesDialog/StdAfx.h deleted file mode 100755 index a444ca31..00000000 --- a/CPP/7zip/FileManager/Resource/MessagesDialog/StdAfx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/FileManager/Resource/OverwriteDialog/StdAfx.h b/CPP/7zip/FileManager/Resource/OverwriteDialog/StdAfx.h deleted file mode 100755 index a444ca31..00000000 --- a/CPP/7zip/FileManager/Resource/OverwriteDialog/StdAfx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/FileManager/Resource/PasswordDialog/StdAfx.h b/CPP/7zip/FileManager/Resource/PasswordDialog/StdAfx.h deleted file mode 100755 index a444ca31..00000000 --- a/CPP/7zip/FileManager/Resource/PasswordDialog/StdAfx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/FileManager/Resource/PluginsPage/StdAfx.h b/CPP/7zip/FileManager/Resource/PluginsPage/StdAfx.h deleted file mode 100755 index a444ca31..00000000 --- a/CPP/7zip/FileManager/Resource/PluginsPage/StdAfx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/FileManager/Resource/ProgressDialog/StdAfx.h b/CPP/7zip/FileManager/Resource/ProgressDialog/StdAfx.h deleted file mode 100755 index a444ca31..00000000 --- a/CPP/7zip/FileManager/Resource/ProgressDialog/StdAfx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/FileManager/Resource/ProgressDialog2/StdAfx.h b/CPP/7zip/FileManager/Resource/ProgressDialog2/StdAfx.h deleted file mode 100755 index a444ca31..00000000 --- a/CPP/7zip/FileManager/Resource/ProgressDialog2/StdAfx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/FileManager/Resource/ProgressDialog2/resource.rc b/CPP/7zip/FileManager/Resource/ProgressDialog2/resource.rc deleted file mode 100755 index 9f395bff..00000000 --- a/CPP/7zip/FileManager/Resource/ProgressDialog2/resource.rc +++ /dev/null @@ -1,56 +0,0 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" - -#define xSize2 290 -#define ySize2 76 - -#define xSize (xSize2 + marg + marg) -#define ySize (ySize2 + marg + marg) - -#define bYPos (ySize - marg - bYSize) - -#undef bXSize -#define bXSize 72 - -#define bXPos1 (xSize - marg - bXSize) -#define bXPos2 (bXPos1 - 10 - bXSize) -#define bXPos3 (bXPos2 - 10 - bXSize) - -#define valSize 42 -#define timeSize 91 -#define labelPos 178 -#define valPos1 (marg + timeSize) -#define valPos2 (xSize - marg - valSize) -#define labelSize (valPos2 - labelPos) - -#undef yPos -#define yPos (marg + 11) - - -IDD_DIALOG_PROGRESS DIALOG 0, 0, xSize, ySize MY_MODAL_DIALOG_STYLE | WS_MINIMIZEBOX -CAPTION "Progress" -MY_FONT -BEGIN - PUSHBUTTON "&Background", IDC_BUTTON_PROGRESS_PRIORITY, bXPos3, bYPos, bXSize, bYSize - PUSHBUTTON "&Pause", IDC_BUTTON_PAUSE, bXPos2, bYPos, bXSize, bYSize - PUSHBUTTON "Cancel", IDCANCEL, bXPos1, bYPos, bXSize, bYSize - LTEXT "Elapsed time:", IDC_PROGRESS_ELAPSED, marg, marg, timeSize, 8 - LTEXT "Remaining time:", IDC_PROGRESS_REMAINING, marg, yPos, timeSize, 8 - LTEXT "Size:", IDC_PROGRESS_TOTAL, labelPos, marg, labelSize, 8 - LTEXT "Speed:", IDC_PROGRESS_SPEED, labelPos, yPos, labelSize, 8 - RTEXT "00:00:00", IDC_PROGRESS_ELAPSED_VALUE, valPos1, marg, valSize, 8 - RTEXT "", IDC_PROGRESS_REMAINING_VALUE, valPos1, yPos, valSize, 8 - RTEXT "", IDC_PROGRESS_SPEED_TOTAL_VALUE, valPos2, marg, valSize, 8 - RTEXT "", IDC_PROGRESS_SPEED_VALUE, valPos2, yPos, valSize, 8 - LTEXT "", IDC_PROGRESS_FILE_NAME, marg, yPos + 16, xSize2, 8, SS_NOPREFIX - CONTROL "Progress1", IDC_PROGRESS1, "msctls_progress32", PBS_SMOOTH | WS_BORDER, marg, bYPos - 20, xSize2, 13 -END - - -STRINGTABLE DISCARDABLE -BEGIN - IDS_PROGRESS_PAUSED "Paused" - IDS_PROGRESS_FOREGROUND "&Foreground" - IDS_PROGRESS_CONTINUE "&Continue" - IDS_PROGRESS_ASK_CANCEL "Are you sure you want to cancel?" -END diff --git a/CPP/7zip/FileManager/Resource/SettingsPage/StdAfx.h b/CPP/7zip/FileManager/Resource/SettingsPage/StdAfx.h deleted file mode 100755 index a444ca31..00000000 --- a/CPP/7zip/FileManager/Resource/SettingsPage/StdAfx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/FileManager/Resource/SplitDialog/StdAfx.h b/CPP/7zip/FileManager/Resource/SplitDialog/StdAfx.h deleted file mode 100755 index eb2ba641..00000000 --- a/CPP/7zip/FileManager/Resource/SplitDialog/StdAfx.h +++ /dev/null @@ -1,18 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -// #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/FileManager/Resource/SystemPage/StdAfx.h b/CPP/7zip/FileManager/Resource/SystemPage/StdAfx.h deleted file mode 100755 index a444ca31..00000000 --- a/CPP/7zip/FileManager/Resource/SystemPage/StdAfx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/FileManager/RootFolder.h b/CPP/7zip/FileManager/RootFolder.h deleted file mode 100755 index d49f4d12..00000000 --- a/CPP/7zip/FileManager/RootFolder.h +++ /dev/null @@ -1,49 +0,0 @@ -// RootFolder.h - -#ifndef __ROOTFOLDER_H -#define __ROOTFOLDER_H - -#include "Common/MyString.h" - -#include "Windows/PropVariant.h" - -#include "FSFolder.h" - -class CRootFolder: - public IFolderFolder, - public IEnumProperties, - public IFolderGetTypeID, - public IFolderGetPath, - public IFolderGetSystemIconIndex, - public CMyUnknownImp -{ -public: - MY_UNKNOWN_IMP4( - IEnumProperties, - IFolderGetTypeID, - IFolderGetPath, - IFolderGetSystemIconIndex - ) - - STDMETHOD(LoadItems)(); - STDMETHOD(GetNumberOfItems)(UInt32 *numItems); - STDMETHOD(GetProperty)(UInt32 itemIndex, PROPID propID, PROPVARIANT *value); - STDMETHOD(BindToFolder)(UInt32 index, IFolderFolder **resultFolder); - STDMETHOD(BindToFolder)(const wchar_t *name, IFolderFolder **resultFolder); - STDMETHOD(BindToParentFolder)(IFolderFolder **resultFolder); - STDMETHOD(GetName)(BSTR *name); - - STDMETHOD(GetNumberOfProperties)(UInt32 *numProperties); - STDMETHOD(GetPropertyInfo)(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType); - STDMETHOD(GetTypeID)(BSTR *name); - STDMETHOD(GetPath)(BSTR *path); - STDMETHOD(GetSystemIconIndex)(UInt32 index, INT32 *iconIndex); - - void Init(); -private: - UString _computerName; - UString _networkName; -}; - -#endif diff --git a/CPP/7zip/Guid.txt b/CPP/7zip/Guid.txt index 3bc6ebe6..f97a61a7 100755 --- a/CPP/7zip/Guid.txt +++ b/CPP/7zip/Guid.txt @@ -1,104 +1,101 @@ -{23170F69-40C1-278A-0000-} +{23170F69-40C1-278A-0000-00yy00xx0000} -000000xx0000 IProgress.h +00 IProgress.h -05 IProgress + 05 IProgress +01 IFolderArchive.h -000300xx0000 IStream.h + 05 IArchiveFolder + 06 IInFolderArchive + 07 IFileExtractCallback.h::IFolderArchiveExtractCallback + 0A IOutFolderArchive + 0B IFolderArchiveUpdateCallback + 0Ñ Agent.h::IArchiveFolderInternal -01 ISequentialInStream -02 ISequentialOutStream -03 IInStream -04 IOutStream -06 IStreamGetSize -07 IOutStreamFlush +03 IStream.h + 01 ISequentialInStream + 02 ISequentialOutStream + 03 IInStream + 04 IOutStream + 06 IStreamGetSize + 07 IOutStreamFlush -000400xx0000 ICoder.h -04 ICompressProgressInfo -05 ICompressCoder -18 ICompressCoder2 -20 ICompressSetCoderProperties -21 ICompressSetDecoderProperties // -22 ICompressSetDecoderProperties2 -23 ICompressWriteCoderProperties -24 ICompressGetInStreamProcessedSize -25 ICompressSetCoderMt -30 ICompressGetSubStreamSize -31 ICompressSetInStream -32 ICompressSetOutStream -33 ICompressSetInStreamSize -34 ICompressSetOutStreamSize -40 ICompressFilter -60 ICompressCodecsInfo -61 ISetCompressCodecsInfo -80 ICryptoProperties -88 ICryptoResetSalt -8C ICryptoResetInitVector -90 ICryptoSetPassword -A0 ICryptoSetCRC +04 ICoder.h + 04 ICompressProgressInfo + 05 ICompressCoder + 18 ICompressCoder2 + 20 ICompressSetCoderProperties + 21 ICompressSetDecoderProperties // + 22 ICompressSetDecoderProperties2 + 23 ICompressWriteCoderProperties + 24 ICompressGetInStreamProcessedSize + 25 ICompressSetCoderMt + 30 ICompressGetSubStreamSize + 31 ICompressSetInStream + 32 ICompressSetOutStream + 33 ICompressSetInStreamSize + 34 ICompressSetOutStreamSize + 40 ICompressFilter + 60 ICompressCodecsInfo + 61 ISetCompressCodecsInfo + 80 ICryptoProperties + 88 ICryptoResetSalt + 8C ICryptoResetInitVector + 90 ICryptoSetPassword + A0 ICryptoSetCRC -000500xx0000 IPassword.h -10 ICryptoGetTextPassword -11 ICryptoGetTextPassword2 +05 IPassword.h + 10 ICryptoGetTextPassword + 11 ICryptoGetTextPassword2 -000600xx0000 IArchive.h -03 ISetProperties +06 IArchive.h -10 IArchiveOpenCallback -20 IArchiveExtractCallback -30 IArchiveOpenVolumeCallback -40 IInArchiveGetStream -50 IArchiveOpenSetSubArchiveName -60 IInArchive + 03 ISetProperties -80 IArchiveUpdateCallback -82 IArchiveUpdateCallback2 -A0 IOutArchive + 10 IArchiveOpenCallback + 20 IArchiveExtractCallback + 30 IArchiveOpenVolumeCallback + 40 IInArchiveGetStream + 50 IArchiveOpenSetSubArchiveName + 60 IInArchive + 80 IArchiveUpdateCallback + 82 IArchiveUpdateCallback2 + A0 IOutArchive -000100050001 Agent.h::IArchiveFolderInternal -000100xx0000 IFolderArchive.h +08 IFolder.h -05 IArchiveFolder -06 IInFolderArchive -07 IFileExtractCallback.h::IFolderArchiveExtractCallback -0A IOutFolderArchive -0B IFolderArchiveUpdateCallback + 00 IFolderFolder + 01 IEnumProperties + 02 IFolderGetTypeID + 03 IFolderGetPath + 04 IFolderWasChanged + 05 // IFolderReload + 06 IFolderOperations + 07 IFolderGetSystemIconIndex + 08 IFolderGetItemFullSize + 09 IFolderClone + 0A IFolderSetFlatMode + 0B IFolderOperationsExtractCallback +09 FolderInterface.h + 00 // old IFolderManager + 01 IFolderManager -000800xxyy00 FolderInterface.h:: -00 IFolderFolder -01 IEnumProperties -02 IFolderGetTypeID -03 IFolderGetPath -04 IFolderWasChanged -05 IFolderReload // -0504 IFolderChangeNotify -0505 IFolderSetChangeNotify -050A IFolderExtract // -06 IFolderOperations -0601 IFolderOperationsExtractCallback -0602 IFolderOperationsUpdateCallback // -0603 IFolderOperationsDeleteToRecycleBin // -07 IFolderGetSystemIconIndex -08 IFolderGetItemFullSize -09 IFolderClone -0A IFolderSetFlatMode -000900000000} FolderInterface.h::IFolderManager -000900010000} FolderInterface.h::IFolderManagerGetIconPath +------------------ {23170F69-40C1-278D-0000-000100010000} PluginInterface::IInitContextMenu @@ -110,28 +107,28 @@ Handler GUIDs: {23170F69-40C1-278A-1000-000110xx0000} -01 Zip -02 BZip2 -03 Rar -04 Arj -05 Z -06 Lzh -07 7z -08 Cab -09 Nsis -0A Lzma - -E5 Compound -E6 Wim -E7 Iso -E8 Bkf -E9 Chm -EA Split -EB Rpm -EC Deb -ED Cpio -EE Tar -EF GZip + 01 Zip + 02 BZip2 + 03 Rar + 04 Arj + 05 Z + 06 Lzh + 07 7z + 08 Cab + 09 Nsis + 0A Lzma + + E5 Compound + E6 Wim + E7 Iso + E8 Bkf + E9 Chm + EA Split + EB Rpm + EC Deb + ED Cpio + EE Tar + EF GZip {23170F69-40C1-278A-1000-000100030000} CAgentArchiveHandle {23170F69-40C1-278A-1000-000100020000} ContextMenu.h::CZipContextMenu @@ -142,4 +139,3 @@ EF GZip {23170F69-40C1-2790-id} Codec Decoders {23170F69-40C1-2791-id} Codec Encoders - diff --git a/CPP/7zip/ICoder.h b/CPP/7zip/ICoder.h index 0c10068e..a4976534 100755 --- a/CPP/7zip/ICoder.h +++ b/CPP/7zip/ICoder.h @@ -5,11 +5,7 @@ #include "IStream.h" -// "23170F69-40C1-278A-0000-000400xx0000" -#define CODER_INTERFACE(i, x) \ -DEFINE_GUID(IID_ ## i, \ -0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x04, 0x00, x, 0x00, 0x00); \ -struct i: public IUnknown +#define CODER_INTERFACE(i, x) DECL_INTERFACE(i, 4, x) CODER_INTERFACE(ICompressProgressInfo, 0x04) { diff --git a/CPP/7zip/IDecl.h b/CPP/7zip/IDecl.h new file mode 100755 index 00000000..8316eb3a --- /dev/null +++ b/CPP/7zip/IDecl.h @@ -0,0 +1,15 @@ +// IDecl.h + +#ifndef __IDECL_H +#define __IDECL_H + +#include "../Common/MyUnknown.h" + +#define DECL_INTERFACE_SUB(i, base, groupId, subId) \ +DEFINE_GUID(IID_ ## i, \ +0x23170F69, 0x40C1, 0x278A, 0, 0, 0, (groupId), 0, (subId), 0, 0); \ +struct i: public base + +#define DECL_INTERFACE(i, groupId, subId) DECL_INTERFACE_SUB(i, IUnknown, groupId, subId) + +#endif diff --git a/CPP/7zip/IPassword.h b/CPP/7zip/IPassword.h index 8f2adcca..3ca7b090 100755 --- a/CPP/7zip/IPassword.h +++ b/CPP/7zip/IPassword.h @@ -6,11 +6,9 @@ #include "../Common/MyUnknown.h" #include "../Common/Types.h" -// MIDL_INTERFACE("23170F69-40C1-278A-0000-000500xx0000") -#define PASSWORD_INTERFACE(i, x) \ -DEFINE_GUID(IID_ ## i, \ -0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x05, 0x00, x, 0x00, 0x00); \ -struct i: public IUnknown +#include "IDecl.h" + +#define PASSWORD_INTERFACE(i, x) DECL_INTERFACE(i, 5, x) PASSWORD_INTERFACE(ICryptoGetTextPassword, 0x10) { diff --git a/CPP/7zip/IProgress.h b/CPP/7zip/IProgress.h index aa3b64cc..f5f54b28 100755 --- a/CPP/7zip/IProgress.h +++ b/CPP/7zip/IProgress.h @@ -6,11 +6,9 @@ #include "../Common/MyUnknown.h" #include "../Common/Types.h" -// {23170F69-40C1-278A-0000-000000050000} -DEFINE_GUID(IID_IProgress, -0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00); -MIDL_INTERFACE("23170F69-40C1-278A-0000-000000050000") -IProgress: public IUnknown +#include "IDecl.h" + +DECL_INTERFACE(IProgress, 0, 5) { STDMETHOD(SetTotal)(UInt64 total) PURE; STDMETHOD(SetCompleted)(const UInt64 *completeValue) PURE; diff --git a/CPP/7zip/IStream.h b/CPP/7zip/IStream.h index bba21a31..a19d04f9 100755 --- a/CPP/7zip/IStream.h +++ b/CPP/7zip/IStream.h @@ -6,13 +6,9 @@ #include "../Common/MyUnknown.h" #include "../Common/Types.h" -// "23170F69-40C1-278A-0000-000300xx0000" - -#define STREAM_INTERFACE_SUB(i, b, x) \ -DEFINE_GUID(IID_ ## i, \ -0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x03, 0x00, x, 0x00, 0x00); \ -struct i: public b +#include "IDecl.h" +#define STREAM_INTERFACE_SUB(i, base, x) DECL_INTERFACE_SUB(i, base, 3, x) #define STREAM_INTERFACE(i, x) STREAM_INTERFACE_SUB(i, IUnknown, x) STREAM_INTERFACE(ISequentialInStream, 0x01) diff --git a/CPP/7zip/MyVersion.h b/CPP/7zip/MyVersion.h index 8ea6e3ac..0c2bb33d 100755 --- a/CPP/7zip/MyVersion.h +++ b/CPP/7zip/MyVersion.h @@ -1,8 +1,8 @@ #define MY_VER_MAJOR 4 -#define MY_VER_MINOR 52 -#define MY_VER_BUILD 0 -#define MY_VERSION "4.52 beta" -#define MY_7ZIP_VERSION "7-Zip 4.52 beta" -#define MY_DATE "2007-08-03" +#define MY_VER_MINOR 53 +#define MY_VER_BUILD 3 +#define MY_VERSION "4.53 beta" +#define MY_7ZIP_VERSION "7-Zip 4.53 beta" +#define MY_DATE "2007-08-27" #define MY_COPYRIGHT "Copyright (c) 1999-2007 Igor Pavlov" #define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " " MY_DATE diff --git a/CPP/7zip/PropID.h b/CPP/7zip/PropID.h index 79f82452..a13fe27f 100755 --- a/CPP/7zip/PropID.h +++ b/CPP/7zip/PropID.h @@ -36,6 +36,15 @@ enum kpidComment, kpidPosition, kpidPrefix, + kpidNumSubFolders, + kpidNumSubFiles, + kpidUnpackVer, + kpidVolume, + kpidIsVolume, + kpidOffset, + kpidLinks, + kpidNumBlocks, + kpidNumVolumes, kpidTotalSize = 0x1100, kpidFreeSpace, diff --git a/CPP/7zip/UI/Agent/Agent.cpp b/CPP/7zip/UI/Agent/Agent.cpp index 528abb53..82ae33bc 100755 --- a/CPP/7zip/UI/Agent/Agent.cpp +++ b/CPP/7zip/UI/Agent/Agent.cpp @@ -57,7 +57,7 @@ STDMETHODIMP CAgentFolder::LoadItems() return S_OK; } -STDMETHODIMP CAgentFolder::GetNumberOfItems(UINT32 *numItems) +STDMETHODIMP CAgentFolder::GetNumberOfItems(UInt32 *numItems) { if (_flatMode) *numItems = _items.Size(); @@ -66,14 +66,6 @@ STDMETHODIMP CAgentFolder::GetNumberOfItems(UINT32 *numItems) return S_OK; } -/* -STDMETHODIMP CAgentFolder::GetNumberOfSubFolders(UINT32 *aNumSubFolders) -{ - *aNumSubFolders = _proxyFolderItem->Folders.Size(); - return S_OK; -} -*/ - UString CAgentFolder::GetName(UInt32 index) const { UInt32 realIndex; @@ -90,7 +82,7 @@ UString CAgentFolder::GetName(UInt32 index) const realIndex = index; } - if (realIndex < (UINT32)folder->Folders.Size()) + if (realIndex < (UInt32)folder->Folders.Size()) return folder->Folders[realIndex].Name; return folder->Files[realIndex - folder->Folders.Size()].Name; } @@ -115,17 +107,17 @@ UString CAgentFolder::GetFullPathPrefixPlusPrefix(UInt32 index) const return _proxyFolderItem->GetFullPathPrefix() + GetPrefix(index); } -void CAgentFolder::GetPrefixIfAny(UInt32 index, NCOM::CPropVariant &propVariant) const +void CAgentFolder::GetPrefixIfAny(UInt32 index, NCOM::CPropVariant &prop) const { if (!_flatMode) return; - propVariant = GetPrefix(index); + prop = GetPrefix(index); } -STDMETHODIMP CAgentFolder::GetProperty(UINT32 itemIndex, PROPID propID, PROPVARIANT *value) +STDMETHODIMP CAgentFolder::GetProperty(UInt32 itemIndex, PROPID propID, PROPVARIANT *value) { - NCOM::CPropVariant propVariant; + NCOM::CPropVariant prop; const CProxyFolder *folder; UInt32 realIndex; if (_flatMode) @@ -140,20 +132,32 @@ STDMETHODIMP CAgentFolder::GetProperty(UINT32 itemIndex, PROPID propID, PROPVARI realIndex = itemIndex; } - if (realIndex < (UINT32)folder->Folders.Size()) + if (realIndex < (UInt32)folder->Folders.Size()) { const CProxyFolder &item = folder->Folders[realIndex]; + if (!_flatMode && propID == kpidSize) + prop = item.Size; + else if (!_flatMode && propID == kpidPackedSize) + prop = item.PackSize; + else switch(propID) { - case kpidIsFolder: - propVariant = true; - break; - case kpidName: - propVariant = item.Name; - break; - case kpidPrefix: - GetPrefixIfAny(itemIndex, propVariant); + case kpidIsFolder: prop = true; break; + case kpidNumSubFolders: prop = item.NumSubFolders; break; + case kpidNumSubFiles: prop = item.NumSubFiles; break; + case kpidName: prop = item.Name; break; + case kpidCRC: + { + if (item.IsLeaf) + { + RINOK(_agentSpec->GetArchive()->GetProperty(item.Index, propID, value)); + } + if (item.CrcIsDefined && value->vt == VT_EMPTY) + prop = item.Crc; break; + } + case kpidPrefix: GetPrefixIfAny(itemIndex, prop); break; + default: if (item.IsLeaf) return _agentSpec->GetArchive()->GetProperty(item.Index, propID, value); @@ -165,20 +169,14 @@ STDMETHODIMP CAgentFolder::GetProperty(UINT32 itemIndex, PROPID propID, PROPVARI const CProxyFile &item = folder->Files[realIndex]; switch(propID) { - case kpidIsFolder: - propVariant = false; - break; - case kpidName: - propVariant = item.Name; - break; - case kpidPrefix: - GetPrefixIfAny(itemIndex, propVariant); - break; - default: + case kpidIsFolder: prop = false; break; + case kpidName: prop = item.Name; break; + case kpidPrefix: GetPrefixIfAny(itemIndex, prop); break; + default: return _agentSpec->GetArchive()->GetProperty(item.Index, propID, value); } } - propVariant.Detach(value); + prop.Detach(value); return S_OK; } @@ -198,7 +196,7 @@ HRESULT CAgentFolder::BindToFolder(CProxyFolder *folder, IFolderFolder **resultF return S_OK; } -STDMETHODIMP CAgentFolder::BindToFolder(UINT32 index, IFolderFolder **resultFolder) +STDMETHODIMP CAgentFolder::BindToFolder(UInt32 index, IFolderFolder **resultFolder) { COM_TRY_BEGIN @@ -215,7 +213,7 @@ STDMETHODIMP CAgentFolder::BindToFolder(UINT32 index, IFolderFolder **resultFold folder = _proxyFolderItem; realIndex = index; } - if (realIndex >= (UINT32)folder->Folders.Size()) + if (realIndex >= (UInt32)folder->Folders.Size()) return E_INVALIDARG; return BindToFolder(&folder->Folders[realIndex], resultFolder); COM_TRY_END @@ -240,15 +238,14 @@ STDMETHODIMP CAgentFolder::BindToParentFolder(IFolderFolder **resultFolder) COM_TRY_END } -STDMETHODIMP CAgentFolder::GetName(BSTR *name) +STATPROPSTG kProperties[] = { - CMyComBSTR temp = _proxyFolderItem->Name; - *name = temp.Detach(); - return S_OK; -} - + { NULL, kpidNumSubFolders, VT_UI4}, + { NULL, kpidNumSubFiles, VT_UI4}, + { NULL, kpidPrefix, VT_BSTR} +}; -#ifdef NEW_FOLDER_INTERFACE +static const UInt32 kNumProperties = sizeof(kProperties) / sizeof(kProperties[0]); struct CArchiveItemPropertyTemp { @@ -257,21 +254,21 @@ struct CArchiveItemPropertyTemp VARTYPE Type; }; -STDMETHODIMP CAgentFolder::GetNumberOfProperties(UINT32 *numProperties) +STDMETHODIMP CAgentFolder::GetNumberOfProperties(UInt32 *numProperties) { COM_TRY_BEGIN RINOK(_agentSpec->GetArchive()->GetNumberOfProperties(numProperties)); - if (_flatMode) - (*numProperties)++; + *numProperties += kNumProperties; + if (!_flatMode) + (*numProperties)--; return S_OK; COM_TRY_END } -STDMETHODIMP CAgentFolder::GetPropertyInfo(UINT32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) +STDMETHODIMP CAgentFolder::GetPropertyInfo(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) { COM_TRY_BEGIN - UINT32 numProperties; + UInt32 numProperties; _agentSpec->GetArchive()->GetNumberOfProperties(&numProperties); if (index < numProperties) { @@ -281,55 +278,73 @@ STDMETHODIMP CAgentFolder::GetPropertyInfo(UINT32 index, } else { - *name = NULL; - *propID = kpidPrefix; - *varType = VT_BSTR; + const STATPROPSTG &srcItem = kProperties[index - numProperties]; + *propID = srcItem.propid; + *varType = srcItem.vt; + *name = 0; } return S_OK; COM_TRY_END } -STDMETHODIMP CAgentFolder::GetTypeID(BSTR *name) +STATPROPSTG kFolderProps[] = +{ + { NULL, kpidSize, VT_UI8}, + { NULL, kpidPackedSize, VT_UI8}, + { NULL, kpidNumSubFolders, VT_UI4}, + { NULL, kpidNumSubFiles, VT_UI4}, + { NULL, kpidCRC, VT_UI4} +}; + +static const UInt32 kNumFolderProps = sizeof(kFolderProps) / sizeof(kFolderProps[0]); + +STDMETHODIMP CAgentFolder::GetFolderProperty(PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - UString temp = UString(L"7-Zip.") + _agentSpec->ArchiveType; - CMyComBSTR bstrTemp = temp; - *name = bstrTemp.Detach(); + NWindows::NCOM::CPropVariant prop; + switch(propID) + { + case kpidSize: prop = _proxyFolderItem->Size; break; + case kpidPackedSize: prop = _proxyFolderItem->PackSize; break; + case kpidNumSubFolders: prop = _proxyFolderItem->NumSubFolders; break; + case kpidNumSubFiles: prop = _proxyFolderItem->NumSubFiles; break; + case kpidName: prop = _proxyFolderItem->Name; break; + case kpidPath: prop = _proxyFolderItem->GetFullPathPrefix(); break; + case kpidType: prop = UString(L"7-Zip.") + _agentSpec->ArchiveType; break; + case kpidCRC: if (_proxyFolderItem->CrcIsDefined) prop = _proxyFolderItem->Crc; break; + } + prop.Detach(value); return S_OK; COM_TRY_END } -STDMETHODIMP CAgentFolder::GetPath(BSTR *path) +STDMETHODIMP CAgentFolder::GetNumberOfFolderProperties(UInt32 *numProperties) { - COM_TRY_BEGIN - UStringVector pathParts; - pathParts.Clear(); - CMyComPtr<IFolderFolder> currentFolder = this; - for (;;) - { - CMyComPtr<IFolderFolder> newFolder; - currentFolder->BindToParentFolder(&newFolder); - if (newFolder == NULL) - break; - CMyComBSTR aName; - currentFolder->GetName(&aName); - pathParts.Insert(0, (const wchar_t *)aName); - currentFolder = newFolder; - } + *numProperties = kNumFolderProps; + return S_OK; +} - UString prefix; - for(int i = 0; i < pathParts.Size(); i++) +STDMETHODIMP CAgentFolder::GetFolderPropertyInfo(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) +{ + // if (index < kNumFolderProps) { - prefix += pathParts[i]; - prefix += L'\\'; + const STATPROPSTG &srcItem = kFolderProps[index]; + *propID = srcItem.propid; + *varType = srcItem.vt; + *name = 0; + return S_OK; } +} - CMyComBSTR tempPath = prefix; - *path = tempPath.Detach(); +STDMETHODIMP CAgentFolder::GetFolderArchiveProperties(IFolderArchiveProperties **object) +{ + CMyComPtr<IFolderArchiveProperties> temp = _agentSpec; + *object = temp.Detach(); return S_OK; - COM_TRY_END } +#ifdef NEW_FOLDER_INTERFACE + STDMETHODIMP CAgentFolder::SetFlatMode(Int32 flatMode) { _flatMode = IntToBool(flatMode); @@ -338,7 +353,7 @@ STDMETHODIMP CAgentFolder::SetFlatMode(Int32 flatMode) #endif -void CAgentFolder::GetRealIndices(const UINT32 *indices, UINT32 numItems, CUIntVector &realIndices) const +void CAgentFolder::GetRealIndices(const UInt32 *indices, UInt32 numItems, CUIntVector &realIndices) const { if (!_flatMode) { @@ -346,20 +361,20 @@ void CAgentFolder::GetRealIndices(const UINT32 *indices, UINT32 numItems, CUIntV return; } realIndices.Clear(); - for(UINT32 i = 0; i < numItems; i++) + for(UInt32 i = 0; i < numItems; i++) { const CProxyItem &item = _items[indices[i]]; const CProxyFolder *folder = item.Folder; UInt32 realIndex = item.Index; - if (realIndex < (UINT32)folder->Folders.Size()) + if (realIndex < (UInt32)folder->Folders.Size()) continue; realIndices.Add(folder->Files[realIndex - folder->Folders.Size()].Index); } HeapSort(&realIndices.Front(), realIndices.Size()); } -STDMETHODIMP CAgentFolder::Extract(const UINT32 *indices, - UINT32 numItems, +STDMETHODIMP CAgentFolder::Extract(const UInt32 *indices, + UInt32 numItems, NExtract::NPathMode::EEnum pathMode, NExtract::NOverwriteMode::EEnum overwriteMode, const wchar_t *path, @@ -382,16 +397,17 @@ STDMETHODIMP CAgentFolder::Extract(const UINT32 *indices, pathMode = NExtract::NPathMode::kNoPathnames; */ + extractCallbackSpec->InitForMulti(false, pathMode, overwriteMode); + extractCallbackSpec->Init(_agentSpec->GetArchive(), extractCallback2, false, - path, - pathMode, - overwriteMode, + (path ? path : L""), pathParts, _agentSpec->DefaultName, _agentSpec->DefaultTime, - _agentSpec->DefaultAttributes + _agentSpec->DefaultAttributes, + (UInt64)(Int64)-1 // ,_agentSpec->_srcDirectoryPrefix ); CUIntVector realIndices; @@ -522,30 +538,30 @@ STDMETHODIMP CAgent::Extract( COM_TRY_BEGIN CArchiveExtractCallback *extractCallbackSpec = new CArchiveExtractCallback; CMyComPtr<IArchiveExtractCallback> extractCallback = extractCallbackSpec; + extractCallbackSpec->InitForMulti(false, pathMode, overwriteMode); extractCallbackSpec->Init(GetArchive(), extractCallback2, false, path, - pathMode, - overwriteMode, UStringVector(), DefaultName, DefaultTime, - DefaultAttributes + DefaultAttributes, + (UInt64)(Int64)-1 // ,_srcDirectoryPrefix ); return GetArchive()->Extract(0, (UInt32)(Int32)-1, testMode, extractCallback); COM_TRY_END } -STDMETHODIMP CAgent::GetNumberOfProperties(UINT32 *numProperties) +STDMETHODIMP CAgent::GetNumberOfProperties(UInt32 *numProperties) { COM_TRY_BEGIN return GetArchive()->GetNumberOfProperties(numProperties); COM_TRY_END } -STDMETHODIMP CAgent::GetPropertyInfo(UINT32 index, +STDMETHODIMP CAgent::GetPropertyInfo(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) { COM_TRY_BEGIN @@ -563,14 +579,14 @@ STDMETHODIMP CAgent::GetArchiveProperty(PROPID propID, PROPVARIANT *value) COM_TRY_END } -STDMETHODIMP CAgent::GetNumberOfArchiveProperties(UINT32 *numProperties) +STDMETHODIMP CAgent::GetNumberOfArchiveProperties(UInt32 *numProperties) { COM_TRY_BEGIN return GetArchive()->GetNumberOfArchiveProperties(numProperties); COM_TRY_END } -STDMETHODIMP CAgent::GetArchivePropertyInfo(UINT32 index, +STDMETHODIMP CAgent::GetArchivePropertyInfo(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) { COM_TRY_BEGIN diff --git a/CPP/7zip/UI/Agent/Agent.h b/CPP/7zip/UI/Agent/Agent.h index 1be181a6..0f2d7573 100755 --- a/CPP/7zip/UI/Agent/Agent.h +++ b/CPP/7zip/UI/Agent/Agent.h @@ -13,19 +13,14 @@ #include "AgentProxy.h" #ifdef NEW_FOLDER_INTERFACE -#include "../../FileManager/IFolder.h" +#include "../FileManager/IFolder.h" #include "../Common/LoadCodecs.h" #endif class CAgentFolder; -// {23170F69-40C1-278A-0000-000100050001} -DEFINE_GUID(IID_IArchiveFolderInternal, -0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x00, 0x01); -MIDL_INTERFACE("23170F69-40C1-278A-0000-000100050001") -IArchiveFolderInternal: public IUnknown +DECL_INTERFACE(IArchiveFolderInternal, 0x01, 0xC) { -public: STDMETHOD(GetAgentFolder)(CAgentFolder **agentFolder) PURE; }; @@ -39,12 +34,11 @@ class CAgent; class CAgentFolder: public IFolderFolder, + public IFolderProperties, + public IGetFolderArchiveProperties, public IArchiveFolder, public IArchiveFolderInternal, #ifdef NEW_FOLDER_INTERFACE - public IEnumProperties, - public IFolderGetTypeID, - public IFolderGetPath, public IFolderOperations, public IFolderSetFlatMode, #endif @@ -54,31 +48,25 @@ public: MY_QUERYINTERFACE_BEGIN MY_QUERYINTERFACE_ENTRY(IFolderFolder) + MY_QUERYINTERFACE_ENTRY(IFolderProperties) + MY_QUERYINTERFACE_ENTRY(IGetFolderArchiveProperties) MY_QUERYINTERFACE_ENTRY(IArchiveFolder) MY_QUERYINTERFACE_ENTRY(IArchiveFolderInternal) #ifdef NEW_FOLDER_INTERFACE - MY_QUERYINTERFACE_ENTRY(IEnumProperties) - MY_QUERYINTERFACE_ENTRY(IFolderGetTypeID) - MY_QUERYINTERFACE_ENTRY(IFolderGetPath) MY_QUERYINTERFACE_ENTRY(IFolderOperations) MY_QUERYINTERFACE_ENTRY(IFolderSetFlatMode) #endif MY_QUERYINTERFACE_END MY_ADDREF_RELEASE - // IFolderFolder - void LoadFolder(CProxyFolder *folder); HRESULT BindToFolder(CProxyFolder *folder, IFolderFolder **resultFolder); void GetRealIndices(const UINT32 *indices, UINT32 numItems, CUIntVector &realIndices) const; - STDMETHOD(LoadItems)(); - STDMETHOD(GetNumberOfItems)(UINT32 *numItems); - STDMETHOD(GetProperty)(UINT32 itemIndex, PROPID propID, PROPVARIANT *value); - STDMETHOD(BindToFolder)(UINT32 index, IFolderFolder **resultFolder); - STDMETHOD(BindToFolder)(const wchar_t *name, IFolderFolder **resultFolder); - STDMETHOD(BindToParentFolder)(IFolderFolder **resultFolder); - STDMETHOD(GetName)(BSTR *name); + INTERFACE_FolderFolder(;) + INTERFACE_FolderProperties(;) + + STDMETHOD(GetFolderArchiveProperties)(IFolderArchiveProperties **object); // IArchiveFolder STDMETHOD(Extract)(const UINT32 *indices, UINT32 numItems, @@ -91,25 +79,7 @@ public: STDMETHOD(GetAgentFolder)(CAgentFolder **agentFolder); #ifdef NEW_FOLDER_INTERFACE - STDMETHOD(GetNumberOfProperties)(UINT32 *numProperties); - STDMETHOD(GetPropertyInfo)(UINT32 index, - BSTR *name, PROPID *propID, VARTYPE *varType); - STDMETHOD(GetTypeID)(BSTR *name); - STDMETHOD(GetPath)(BSTR *path); - - - // IFolderOperations - STDMETHOD(CreateFolder)(const wchar_t *name, IProgress *progress); - STDMETHOD(CreateFile)(const wchar_t *name, IProgress *progress); - STDMETHOD(Rename)(UINT32 index, const wchar_t *newName, IProgress *progress); - STDMETHOD(Delete)(const UINT32 *indices, UINT32 numItems, IProgress *progress); - STDMETHOD(CopyTo)(const UINT32 *indices, UINT32 numItems, - const wchar_t *path, IFolderOperationsExtractCallback *callback); - STDMETHOD(MoveTo)(const UINT32 *indices, UINT32 numItems, - const wchar_t *path, IFolderOperationsExtractCallback *callback); - STDMETHOD(CopyFrom)(const wchar_t *fromFolderPath, - const wchar_t **itemsPaths, UINT32 numItems, IProgress *progress); - STDMETHOD(SetProperty)(UINT32 index, PROPID propID, const PROPVARIANT *value, IProgress *progress); + INTERFACE_FolderOperations(;) STDMETHOD(SetFlatMode)(Int32 flatMode); #endif @@ -156,12 +126,9 @@ public: private: }; -// {23170F69-40C1-278A-1000-000100030000} -DEFINE_GUID(CLSID_CAgentArchiveHandler, - 0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00); - class CAgent: public IInFolderArchive, + public IFolderArchiveProperties, #ifndef EXTRACT_ONLY public IOutFolderArchive, public ISetProperties, @@ -172,6 +139,7 @@ public: MY_QUERYINTERFACE_BEGIN MY_QUERYINTERFACE_ENTRY(IInFolderArchive) + MY_QUERYINTERFACE_ENTRY(IFolderArchiveProperties) #ifndef EXTRACT_ONLY MY_QUERYINTERFACE_ENTRY(IOutFolderArchive) MY_QUERYINTERFACE_ENTRY(ISetProperties) @@ -179,45 +147,11 @@ public: MY_QUERYINTERFACE_END MY_ADDREF_RELEASE - STDMETHOD(Open)( - const wchar_t *filePath, - BSTR *archiveType, - IArchiveOpenCallback *openArchiveCallback); - - STDMETHOD(ReOpen)(IArchiveOpenCallback *openArchiveCallback); - STDMETHOD(Close)(); - STDMETHOD(GetArchiveProperty)(PROPID propID, PROPVARIANT *value); - STDMETHOD(GetNumberOfProperties)(UINT32 *numProperties); - STDMETHOD(GetPropertyInfo)(UINT32 index, - BSTR *name, PROPID *propID, VARTYPE *varType); - STDMETHOD(GetNumberOfArchiveProperties)(UINT32 *numProperties); - STDMETHOD(GetArchivePropertyInfo)(UINT32 index, - BSTR *name, PROPID *propID, VARTYPE *varType); - STDMETHOD(BindToRootFolder)(IFolderFolder **resultFolder); - STDMETHOD(Extract)( - NExtract::NPathMode::EEnum pathMode, - NExtract::NOverwriteMode::EEnum overwriteMode, - const wchar_t *path, - INT32 testMode, - IFolderArchiveExtractCallback *extractCallback2); + INTERFACE_IInFolderArchive(;) + INTERFACE_IFolderArchiveProperties(;) #ifndef EXTRACT_ONLY - STDMETHOD(SetFolder)(IFolderFolder *folder); - STDMETHOD(SetFiles)(const wchar_t *folderPrefix, const wchar_t **names, UINT32 numNames); - STDMETHOD(DeleteItems)(const wchar_t *newArchiveName, const UINT32 *indices, - UINT32 numItems, IFolderArchiveUpdateCallback *updateCallback); - STDMETHOD(DoOperation)( - CCodecs *codecs, - int formatIndex, - const wchar_t *newArchiveName, - const Byte *stateActions, - const wchar_t *sfxModule, - IFolderArchiveUpdateCallback *updateCallback); - STDMETHOD(DoOperation2)( - const wchar_t *newArchiveName, - const Byte *stateActions, - const wchar_t *sfxModule, - IFolderArchiveUpdateCallback *updateCallback); + INTERFACE_IOutFolderArchive(;) HRESULT CommonUpdate( const wchar_t *newArchiveName, @@ -252,9 +186,6 @@ public: CArchiveLink _archiveLink; // IInArchive *_archive2; - // CLSID _CLSID; - // CMyComPtr<IArchiveFolder> m_RootFolder; - UString DefaultName; FILETIME DefaultTime; @@ -286,12 +217,9 @@ class CArchiveFolderManager: { public: MY_UNKNOWN_IMP1(IFolderManager) - // IFolderManager - STDMETHOD(OpenFolderFile)(const wchar_t *filePath, IFolderFolder **resultFolder, IProgress *progress); - STDMETHOD(GetExtensions)(BSTR *extensions); - STDMETHOD(GetIconPath)(const wchar_t *ext, BSTR *iconPath, Int32 *iconIndex); - // STDMETHOD(GetTypes)(BSTR *types); - // STDMETHOD(CreateFolderFile)(const wchar_t *type, const wchar_t *filePath, IProgress *progress); + + INTERFACE_IFolderManager(;) + CArchiveFolderManager(): _codecs(0) {} private: void LoadFormats(); diff --git a/CPP/7zip/UI/Agent/AgentOut.cpp b/CPP/7zip/UI/Agent/AgentOut.cpp index a9e4ee8f..f2750234 100755 --- a/CPP/7zip/UI/Agent/AgentOut.cpp +++ b/CPP/7zip/UI/Agent/AgentOut.cpp @@ -57,9 +57,11 @@ STDMETHODIMP CAgent::SetFolder(IFolderFolder *folder) folderItem->BindToParentFolder(&newFolder); if (newFolder == NULL) break; - CMyComBSTR name; - folderItem->GetName(&name); - pathParts.Insert(0, (const wchar_t *)name); + + NCOM::CPropVariant prop; + if (folderItem->GetFolderProperty(kpidName, &prop) == S_OK) + if (prop.vt == VT_BSTR) + pathParts.Insert(0, (const wchar_t *)prop.bstrVal); folderItem = newFolder; } @@ -218,9 +220,17 @@ STDMETHODIMP CAgent::DoOperation( CObjectVector<CUpdatePair2> updatePairs2; UpdateProduce(updatePairs, actionSet, updatePairs2); + + UInt32 numFiles = 0; + for (i = 0; i < updatePairs2.Size(); i++) + if (updatePairs2[i].NewData) + numFiles++; + + RINOK(updateCallback100->SetNumFiles(numFiles)); + CUpdateCallbackAgent updateCallbackAgent; - updateCallbackAgent.Callback = updateCallback100; + updateCallbackAgent.SetCallback(updateCallback100); CArchiveUpdateCallback *updateCallbackSpec = new CArchiveUpdateCallback; CMyComPtr<IArchiveUpdateCallback> updateCallback(updateCallbackSpec ); @@ -362,7 +372,7 @@ STDMETHODIMP CAgent::DeleteItems( if (!CanUpdate()) return E_NOTIMPL; CUpdateCallbackAgent updateCallbackAgent; - updateCallbackAgent.Callback = updateCallback100; + updateCallbackAgent.SetCallback(updateCallback100); CArchiveUpdateCallback *updateCallbackSpec = new CArchiveUpdateCallback; CMyComPtr<IArchiveUpdateCallback> updateCallback(updateCallbackSpec); @@ -402,7 +412,7 @@ HRESULT CAgent::CreateFolder( if (!CanUpdate()) return E_NOTIMPL; CUpdateCallbackAgent updateCallbackAgent; - updateCallbackAgent.Callback = updateCallback100; + updateCallbackAgent.SetCallback(updateCallback100); CArchiveUpdateCallback *updateCallbackSpec = new CArchiveUpdateCallback; CMyComPtr<IArchiveUpdateCallback> updateCallback(updateCallbackSpec); @@ -464,7 +474,7 @@ HRESULT CAgent::RenameItem( if (numItems != 1) return E_INVALIDARG; CUpdateCallbackAgent updateCallbackAgent; - updateCallbackAgent.Callback = updateCallback100; + updateCallbackAgent.SetCallback(updateCallback100); CArchiveUpdateCallback *updateCallbackSpec = new CArchiveUpdateCallback; CMyComPtr<IArchiveUpdateCallback> updateCallback(updateCallbackSpec); diff --git a/CPP/7zip/UI/Agent/AgentProxy.cpp b/CPP/7zip/UI/Agent/AgentProxy.cpp index 42063e67..bb0d0530 100755 --- a/CPP/7zip/UI/Agent/AgentProxy.cpp +++ b/CPP/7zip/UI/Agent/AgentProxy.cpp @@ -6,6 +6,7 @@ #include "Common/MyCom.h" #include "Windows/PropVariant.h" +#include "Windows/PropVariantConversions.h" #include "Windows/Defs.h" #include "../Common/OpenArchive.h" @@ -43,15 +44,14 @@ int CProxyFolder::FindDirSubItemIndex(const UString &name) const return FindDirSubItemIndex(name, insertPos); } -void CProxyFolder::AddFileSubItem(UINT32 index, const UString &name) +void CProxyFolder::AddFileSubItem(UInt32 index, const UString &name) { Files.Add(CProxyFile()); Files.Back().Name = name; Files.Back().Index = index; } -CProxyFolder* CProxyFolder::AddDirSubItem(UINT32 index, bool leaf, - const UString &name) +CProxyFolder* CProxyFolder::AddDirSubItem(UInt32 index, bool leaf, const UString &name) { int insertPos; int folderIndex = FindDirSubItemIndex(name, insertPos); @@ -80,6 +80,18 @@ void CProxyFolder::Clear() Files.Clear(); } +void CProxyFolder::GetPathParts(UStringVector &pathParts) const +{ + pathParts.Clear(); + UString result; + const CProxyFolder *current = this; + while (current->Parent != NULL) + { + pathParts.Insert(0, (const wchar_t *)current->Name); + current = current->Parent; + } +} + UString CProxyFolder::GetFullPathPrefix() const { UString result; @@ -92,9 +104,9 @@ UString CProxyFolder::GetFullPathPrefix() const return result; } -UString CProxyFolder::GetItemName(UINT32 index) const +UString CProxyFolder::GetItemName(UInt32 index) const { - if (index < (UINT32)Folders.Size()) + if (index < (UInt32)Folders.Size()) return Folders[index].Name; return Files[index - Folders.Size()].Name; } @@ -110,11 +122,10 @@ void CProxyFolder::AddRealIndices(CUIntVector &realIndices) const realIndices.Add(Files[i].Index); } -void CProxyFolder::GetRealIndices(const UINT32 *indices, - UINT32 numItems, CUIntVector &realIndices) const +void CProxyFolder::GetRealIndices(const UInt32 *indices, UInt32 numItems, CUIntVector &realIndices) const { realIndices.Clear(); - for(UINT32 i = 0; i < numItems; i++) + for(UInt32 i = 0; i < numItems; i++) { int index = indices[i]; int numDirItems = Folders.Size(); @@ -138,7 +149,7 @@ HRESULT CProxyArchive::Reload(IInArchive *archive, IProgress *progress) HRESULT CProxyArchive::Load(IInArchive *archive, const UString &defaultName, // const FILETIME &defaultTime, - // UINT32 defaultAttributes, + // UInt32 defaultAttributes, IProgress *progress) { DefaultName = defaultName; @@ -147,17 +158,65 @@ HRESULT CProxyArchive::Load(IInArchive *archive, return Reload(archive, progress); } +static UInt64 GetSize(IInArchive *archive, UInt32 index, PROPID propID) +{ + NCOM::CPropVariant prop; + if (archive->GetProperty(index, propID, &prop) == S_OK) + if (prop.vt != VT_EMPTY) + return ConvertPropVariantToUInt64(prop); + return 0; +} + +void CProxyFolder::CalculateSizes(IInArchive *archive) +{ + Size = PackSize = 0; + NumSubFolders = Folders.Size(); + NumSubFiles = Files.Size(); + CrcIsDefined = true; + Crc = 0; + int i; + for (i = 0; i < Files.Size(); i++) + { + UInt32 index = Files[i].Index; + Size += GetSize(archive, index, kpidSize); + PackSize += GetSize(archive, index, kpidPackedSize); + { + NCOM::CPropVariant prop; + if (archive->GetProperty(index, kpidCRC, &prop) == S_OK) + { + if (prop.vt == VT_UI4) + Crc += prop.ulVal; + else + CrcIsDefined = false; + } + else + CrcIsDefined = false; + } + } + for (i = 0; i < Folders.Size(); i++) + { + CProxyFolder &f = Folders[i]; + f.CalculateSizes(archive); + Size += f.Size; + PackSize += f.PackSize; + NumSubFiles += f.NumSubFiles; + NumSubFolders += f.NumSubFolders; + Crc += f.Crc; + if (!f.CrcIsDefined) + CrcIsDefined = false; + } +} -HRESULT CProxyArchive::ReadObjects(IInArchive *archiveHandler, IProgress *progress) +HRESULT CProxyArchive::ReadObjects(IInArchive *archive, IProgress *progress) { - UINT32 numItems; - RINOK(archiveHandler->GetNumberOfItems(&numItems)); + UInt32 numItems; + RINOK(archive->GetNumberOfItems(&numItems)); if (progress != NULL) { UINT64 totalItems = numItems; RINOK(progress->SetTotal(totalItems)); } - for(UINT32 i = 0; i < numItems; i++) + for(UInt32 i = 0; i < numItems; i++) { if (progress != NULL) { @@ -165,7 +224,7 @@ HRESULT CProxyArchive::ReadObjects(IInArchive *archiveHandler, IProgress *progre RINOK(progress->SetCompleted(¤tItemIndex)); } NCOM::CPropVariant propVariantPath; - RINOK(archiveHandler->GetProperty(i, kpidPath, &propVariantPath)); + RINOK(archive->GetProperty(i, kpidPath, &propVariantPath)); CProxyFolder *currentItem = &RootFolder; UString fileName; if(propVariantPath.vt == VT_EMPTY) @@ -192,12 +251,13 @@ HRESULT CProxyArchive::ReadObjects(IInArchive *archiveHandler, IProgress *progre NCOM::CPropVariant propVariantIsFolder; bool isFolder; - RINOK(IsArchiveItemFolder(archiveHandler, i, isFolder)); + RINOK(IsArchiveItemFolder(archive, i, isFolder)); if(isFolder) currentItem->AddDirSubItem(i, true, fileName); else currentItem->AddFileSubItem(i, fileName); } + RootFolder.CalculateSizes(archive); return S_OK; } diff --git a/CPP/7zip/UI/Agent/AgentProxy.h b/CPP/7zip/UI/Agent/AgentProxy.h index 70f47f40..5cf7a05b 100755 --- a/CPP/7zip/UI/Agent/AgentProxy.h +++ b/CPP/7zip/UI/Agent/AgentProxy.h @@ -10,7 +10,7 @@ class CProxyFile { public: - UINT32 Index; + UInt32 Index; UString Name; }; @@ -22,34 +22,41 @@ public: CObjectVector<CProxyFile> Files; bool IsLeaf; + bool CrcIsDefined; + UInt64 Size; + UInt64 PackSize; + UInt32 Crc; + UInt32 NumSubFolders; + UInt32 NumSubFiles; + CProxyFolder(): Parent(NULL) {}; int FindDirSubItemIndex(const UString &name, int &insertPos) const; int FindDirSubItemIndex(const UString &name) const; - CProxyFolder* AddDirSubItem(UINT32 index, - bool leaf, const UString &name); - void AddFileSubItem(UINT32 index, const UString &name); + CProxyFolder* AddDirSubItem(UInt32 index, bool leaf, const UString &name); + void AddFileSubItem(UInt32 index, const UString &name); void Clear(); + void GetPathParts(UStringVector &pathParts) const; UString GetFullPathPrefix() const; - UString GetItemName(UINT32 index) const; + UString GetItemName(UInt32 index) const; void AddRealIndices(CUIntVector &realIndices) const; - void GetRealIndices(const UINT32 *indices, UINT32 numItems, - CUIntVector &realIndices) const; + void GetRealIndices(const UInt32 *indices, UInt32 numItems, CUIntVector &realIndices) const; + void CalculateSizes(IInArchive *archive); }; class CProxyArchive { - HRESULT ReadObjects(IInArchive *inArchive, IProgress *progress); + HRESULT ReadObjects(IInArchive *archive, IProgress *progress); public: UString DefaultName; // FILETIME DefaultTime; - // UINT32 DefaultAttributes; + // UInt32 DefaultAttributes; CProxyFolder RootFolder; HRESULT Reload(IInArchive *archive, IProgress *progress); HRESULT Load(IInArchive *archive, const UString &defaultName, // const FILETIME &defaultTime, - // UINT32 defaultAttributes, + // UInt32 defaultAttributes, IProgress *progress); }; diff --git a/CPP/7zip/UI/Agent/ArchiveFolder.cpp b/CPP/7zip/UI/Agent/ArchiveFolder.cpp index 0ce553dc..3baa6202 100755 --- a/CPP/7zip/UI/Agent/ArchiveFolder.cpp +++ b/CPP/7zip/UI/Agent/ArchiveFolder.cpp @@ -45,16 +45,17 @@ STDMETHODIMP CAgentFolder::CopyTo(const UINT32 *indices, UINT32 numItems, NExtract::NPathMode::kNoPathnames : NExtract::NPathMode::kCurrentPathnames; + extractCallbackSpec->InitForMulti(false, pathMode, NExtract::NOverwriteMode::kAskBefore); extractCallbackSpec->Init(_agentSpec->GetArchive(), extractCallback2, false, path, - pathMode, - NExtract::NOverwriteMode::kAskBefore, pathParts, _agentSpec->DefaultName, _agentSpec->DefaultTime, - _agentSpec->DefaultAttributes + _agentSpec->DefaultAttributes, + (UInt64)(Int64)-1 + // ,_agentSpec->_srcDirectoryPrefix ); CUIntVector realIndices; diff --git a/CPP/7zip/UI/Agent/ArchiveFolderOut.cpp b/CPP/7zip/UI/Agent/ArchiveFolderOut.cpp index 336f5fda..6bf41d61 100755 --- a/CPP/7zip/UI/Agent/ArchiveFolderOut.cpp +++ b/CPP/7zip/UI/Agent/ArchiveFolderOut.cpp @@ -20,19 +20,7 @@ static LPCWSTR kTempArcivePrefix = L"7zA"; void CAgentFolder::GetPathParts(UStringVector &pathParts) { - pathParts.Clear(); - CMyComPtr<IFolderFolder> folder = this; - for (;;) - { - CMyComPtr<IFolderFolder> newFolder; - folder->BindToParentFolder(&newFolder); - if (newFolder == NULL) - break; - CMyComBSTR name; - folder->GetName(&name); - pathParts.Insert(0, (const wchar_t *)name); - folder = newFolder; - } + _proxyFolderItem->GetPathParts(pathParts); } HRESULT CAgentFolder::CommonUpdateOperation( diff --git a/CPP/7zip/UI/Agent/IFolderArchive.h b/CPP/7zip/UI/Agent/IFolderArchive.h index ece56112..7bb12482 100755 --- a/CPP/7zip/UI/Agent/IFolderArchive.h +++ b/CPP/7zip/UI/Agent/IFolderArchive.h @@ -5,92 +5,70 @@ #include "../../Archive/IArchive.h" // #include "../Format/Common/ArchiveInterface.h" -#include "../../FileManager/IFolder.h" +#include "../../UI/FileManager/IFolder.h" #include "../Common/IFileExtractCallback.h" #include "../Common/ExtractMode.h" #include "../../UI/Common/LoadCodecs.h" -// {23170F69-40C1-278A-0000-000100050000} -DEFINE_GUID(IID_IArchiveFolder, -0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00); -MIDL_INTERFACE("23170F69-40C1-278A-0000-000100050000") -IArchiveFolder: public IUnknown +#include "../../IDecl.h" + +#define FOLDER_ARCHIVE_INTERFACE_SUB(i, base, x) DECL_INTERFACE_SUB(i, base, 0x01, x) +#define FOLDER_ARCHIVE_INTERFACE(i, x) FOLDER_ARCHIVE_INTERFACE_SUB(i, IUnknown, x) + +#define INTERFACE_IArchiveFolder(x) \ + STDMETHOD(Extract)(const UInt32 *indices, UInt32 numItems, \ + NExtract::NPathMode::EEnum pathMode, \ + NExtract::NOverwriteMode::EEnum overwriteMode, \ + const wchar_t *path, Int32 testMode, \ + IFolderArchiveExtractCallback *extractCallback2) x; \ + +FOLDER_ARCHIVE_INTERFACE(IArchiveFolder, 0x05) { -public: - STDMETHOD(Extract)(const UINT32 *indices, UINT32 numItems, - NExtract::NPathMode::EEnum pathMode, - NExtract::NOverwriteMode::EEnum overwriteMode, - const wchar_t *path, - INT32 testMode, - IFolderArchiveExtractCallback *extractCallback2) PURE; + INTERFACE_IArchiveFolder(PURE) }; -// {23170F69-40C1-278A-0000-000100060000} -DEFINE_GUID(IID_IInFolderArchive, -0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x06, 0x00, 0x00); -MIDL_INTERFACE("23170F69-40C1-278A-0000-000100060000") -IInFolderArchive: public IUnknown +#define INTERFACE_IInFolderArchive(x) \ + STDMETHOD(Open)(const wchar_t *filePath, BSTR *archiveType, IArchiveOpenCallback *openArchiveCallback) x; \ + STDMETHOD(ReOpen)(IArchiveOpenCallback *openArchiveCallback) x; \ + STDMETHOD(Close)() x; \ + STDMETHOD(GetNumberOfProperties)(UInt32 *numProperties) x; \ + STDMETHOD(GetPropertyInfo)(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) x; \ + STDMETHOD(BindToRootFolder)(IFolderFolder **resultFolder) x; \ + STDMETHOD(Extract)(NExtract::NPathMode::EEnum pathMode, \ + NExtract::NOverwriteMode::EEnum overwriteMode, const wchar_t *path, \ + Int32 testMode, IFolderArchiveExtractCallback *extractCallback2) x; \ + +FOLDER_ARCHIVE_INTERFACE(IInFolderArchive, 0x06) { -public: - STDMETHOD(Open)( - const wchar_t *filePath, - // CLSID *clsIDResult, - BSTR *archiveType, - IArchiveOpenCallback *openArchiveCallback) PURE; - STDMETHOD(ReOpen)( - // const wchar_t *filePath, - IArchiveOpenCallback *openArchiveCallback) PURE; - STDMETHOD(Close)() PURE; - STDMETHOD(GetArchiveProperty)(PROPID propID, PROPVARIANT *value) PURE; - STDMETHOD(GetNumberOfProperties)(UINT32 *numProperties) PURE; - STDMETHOD(GetPropertyInfo)(UINT32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) PURE; - STDMETHOD(GetNumberOfArchiveProperties)(UINT32 *numProperties) PURE; - STDMETHOD(GetArchivePropertyInfo)(UINT32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) PURE; - STDMETHOD(BindToRootFolder)(IFolderFolder **resultFolder) PURE; - STDMETHOD(Extract)( - NExtract::NPathMode::EEnum pathMode, - NExtract::NOverwriteMode::EEnum overwriteMode, - const wchar_t *path, - INT32 testMode, - IFolderArchiveExtractCallback *extractCallback2) PURE; + INTERFACE_IInFolderArchive(PURE) }; -// {23170F69-40C1-278A-0000-0001000B0000} -DEFINE_GUID(IID_IFolderArchiveUpdateCallback, -0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x00); -MIDL_INTERFACE("23170F69-40C1-278A-0000-0001000B0000") -IFolderArchiveUpdateCallback: public IProgress +#define INTERFACE_IFolderArchiveUpdateCallback(x) \ + STDMETHOD(CompressOperation)(const wchar_t *name) x; \ + STDMETHOD(DeleteOperation)(const wchar_t *name) x; \ + STDMETHOD(OperationResult)(Int32 operationResult) x; \ + STDMETHOD(UpdateErrorMessage)(const wchar_t *message) x; \ + STDMETHOD(SetNumFiles)(UInt64 numFiles) x; \ + +FOLDER_ARCHIVE_INTERFACE_SUB(IFolderArchiveUpdateCallback, IProgress, 0x0B) { -public: - STDMETHOD(CompressOperation)(const wchar_t *name) PURE; - STDMETHOD(DeleteOperation)(const wchar_t *name) PURE; - STDMETHOD(OperationResult)(INT32 operationResult) PURE; - STDMETHOD(UpdateErrorMessage)(const wchar_t *message) PURE; + INTERFACE_IFolderArchiveUpdateCallback(PURE) }; -DEFINE_GUID(IID_IOutFolderArchive, -0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0A, 0x00, 0x02); -MIDL_INTERFACE("23170F69-40C1-278A-0000-0001000A0002") -IOutFolderArchive: public IUnknown +#define INTERFACE_IOutFolderArchive(x) \ + STDMETHOD(SetFolder)(IFolderFolder *folder) x; \ + STDMETHOD(SetFiles)(const wchar_t *folderPrefix, const wchar_t **names, UInt32 numNames) x; \ + STDMETHOD(DeleteItems)(const wchar_t *newArchiveName, \ + const UInt32 *indices, UInt32 numItems, IFolderArchiveUpdateCallback *updateCallback) x; \ + STDMETHOD(DoOperation)(CCodecs *codecs, int index, \ + const wchar_t *newArchiveName, const Byte *stateActions, const wchar_t *sfxModule, \ + IFolderArchiveUpdateCallback *updateCallback) x; \ + STDMETHOD(DoOperation2)(const wchar_t *newArchiveName, const Byte *stateActions, \ + const wchar_t *sfxModule, IFolderArchiveUpdateCallback *updateCallback) x; \ + +FOLDER_ARCHIVE_INTERFACE(IOutFolderArchive, 0x0A) { - STDMETHOD(SetFolder)(IFolderFolder *folder) PURE; - STDMETHOD(SetFiles)(const wchar_t *folderPrefix, const wchar_t **names, UINT32 numNames) PURE; - STDMETHOD(DeleteItems)(const wchar_t *newArchiveName, - const UINT32 *indices, UINT32 numItems, IFolderArchiveUpdateCallback *updateCallback) PURE; - STDMETHOD(DoOperation)( - CCodecs *codecs, - int index, - const wchar_t *newArchiveName, - const Byte *stateActions, - const wchar_t *sfxModule, - IFolderArchiveUpdateCallback *updateCallback) PURE; - STDMETHOD(DoOperation2)( - const wchar_t *newArchiveName, - const Byte *stateActions, - const wchar_t *sfxModule, - IFolderArchiveUpdateCallback *updateCallback) PURE; + INTERFACE_IOutFolderArchive(PURE) }; #endif diff --git a/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp b/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp index 0d57307c..e00d837a 100755 --- a/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp +++ b/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp @@ -3,11 +3,28 @@ #include "StdAfx.h" #include "Windows/Error.h" +#include "Common/IntToString.h" #include "UpdateCallbackAgent.h" using namespace NWindows; +void CUpdateCallbackAgent::SetCallback(IFolderArchiveUpdateCallback *callback) +{ + Callback = callback; + _compressProgress.Release(); + if (Callback) + Callback.QueryInterface(IID_ICompressProgressInfo, &_compressProgress); +} + +HRESULT CUpdateCallbackAgent::SetNumFiles(UInt64 numFiles) +{ + if (Callback) + return Callback->SetNumFiles(numFiles); + return S_OK; +} + + HRESULT CUpdateCallbackAgent::SetTotal(UINT64 size) { if (Callback) @@ -22,6 +39,13 @@ HRESULT CUpdateCallbackAgent::SetCompleted(const UINT64 *completeValue) return S_OK; } +HRESULT CUpdateCallbackAgent::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize) +{ + if (_compressProgress) + return _compressProgress->SetRatioInfo(inSize, outSize); + return S_OK; +} + HRESULT CUpdateCallbackAgent::CheckBreak() { return S_OK; @@ -57,14 +81,14 @@ HRESULT CUpdateCallbackAgent::GetStream(const wchar_t *name, bool /* isAnti */) return S_OK; } -HRESULT CUpdateCallbackAgent::SetOperationResult(INT32 operationResult) +HRESULT CUpdateCallbackAgent::SetOperationResult(Int32 operationResult) { if (Callback) return Callback->OperationResult(operationResult); return S_OK; } -HRESULT CUpdateCallbackAgent::CryptoGetTextPassword2(INT32 *passwordIsDefined, BSTR *password) +HRESULT CUpdateCallbackAgent::CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password) { *passwordIsDefined = BoolToInt(false); if (!_cryptoGetTextPassword) diff --git a/CPP/7zip/UI/Agent/UpdateCallbackAgent.h b/CPP/7zip/UI/Agent/UpdateCallbackAgent.h index 1cff501a..1d5ed17a 100755 --- a/CPP/7zip/UI/Agent/UpdateCallbackAgent.h +++ b/CPP/7zip/UI/Agent/UpdateCallbackAgent.h @@ -8,17 +8,12 @@ class CUpdateCallbackAgent: public IUpdateCallbackUI { - virtual HRESULT SetTotal(UINT64 size); - virtual HRESULT SetCompleted(const UINT64 *completeValue); - virtual HRESULT CheckBreak(); - virtual HRESULT Finilize(); - virtual HRESULT GetStream(const wchar_t *name, bool isAnti); - virtual HRESULT OpenFileError(const wchar_t *name, DWORD systemError); - virtual HRESULT SetOperationResult(INT32 operationResult); - virtual HRESULT CryptoGetTextPassword2(INT32 *passwordIsDefined, BSTR *password); + INTERFACE_IUpdateCallbackUI(;) CMyComPtr<ICryptoGetTextPassword2> _cryptoGetTextPassword; -public: CMyComPtr<IFolderArchiveUpdateCallback> Callback; + CMyComPtr<ICompressProgressInfo> _compressProgress; +public: + void SetCallback(IFolderArchiveUpdateCallback *callback); }; #endif diff --git a/CPP/7zip/UI/Client7z/Client7z.cpp b/CPP/7zip/UI/Client7z/Client7z.cpp index a04b6eb0..079345f7 100755 --- a/CPP/7zip/UI/Client7z/Client7z.cpp +++ b/CPP/7zip/UI/Client7z/Client7z.cpp @@ -333,7 +333,7 @@ STDMETHODIMP CArchiveExtractCallback::GetStream(UInt32 index, _outFileStreamSpec = new COutFileStream; CMyComPtr<ISequentialOutStream> outStreamLoc(_outFileStreamSpec); - if (!_outFileStreamSpec->File.Open(fullProcessedPath, CREATE_ALWAYS)) + if (!_outFileStreamSpec->Open(fullProcessedPath, CREATE_ALWAYS)) { PrintString((UString)L"can not open output file " + fullProcessedPath); return E_ABORT; @@ -396,7 +396,7 @@ STDMETHODIMP CArchiveExtractCallback::SetOperationResult(Int32 operationResult) } if(_outFileStream != NULL && _processedFileInfo.UTCLastWriteTimeIsDefined) - _outFileStreamSpec->File.SetLastWriteTime(&_processedFileInfo.UTCLastWriteTime); + _outFileStreamSpec->SetLastWriteTime(&_processedFileInfo.UTCLastWriteTime); _outFileStream.Release(); if (_extractMode && _processedFileInfo.AttributesAreDefined) NFile::NDirectory::MySetFileAttributes(_diskFilePath, _processedFileInfo.Attributes); diff --git a/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp b/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp index a38d4173..b03bf48e 100755 --- a/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp +++ b/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp @@ -33,22 +33,32 @@ void CArchiveExtractCallback::Init( IFolderArchiveExtractCallback *extractCallback2, bool stdOutMode, const UString &directoryPath, - NExtract::NPathMode::EEnum pathMode, - NExtract::NOverwriteMode::EEnum overwriteMode, const UStringVector &removePathParts, const UString &itemDefaultName, const FILETIME &utcLastWriteTimeDefault, - UInt32 attributesDefault) + UInt32 attributesDefault, + UInt64 packSize) { _stdOutMode = stdOutMode; _numErrors = 0; + _ratioMode = false; + _unpTotal = 1; + _packTotal = packSize; + _extractCallback2 = extractCallback2; + _compressProgress.Release(); + _extractCallback2.QueryInterface(IID_ICompressProgressInfo, &_compressProgress); + if (!_localProgress) + { + LocalProgressSpec = new CLocalProgress(); + _localProgress = LocalProgressSpec; + } + LocalProgressSpec->Init(extractCallback2, true); + _itemDefaultName = itemDefaultName; _utcLastWriteTimeDefault = utcLastWriteTimeDefault; _attributesDefault = attributesDefault; _removePathParts = removePathParts; - _pathMode = pathMode; - _overwriteMode = overwriteMode; _archiveHandler = archiveHandler; _directoryPath = directoryPath; NFile::NName::NormalizeDirPathPrefix(_directoryPath); @@ -57,17 +67,60 @@ void CArchiveExtractCallback::Init( STDMETHODIMP CArchiveExtractCallback::SetTotal(UInt64 size) { COM_TRY_BEGIN - return _extractCallback2->SetTotal(size); + _unpTotal = size; + if (!_multiArchives && _extractCallback2) + return _extractCallback2->SetTotal(size); + return S_OK; COM_TRY_END } +static void NormalizeVals(UInt64 &v1, UInt64 &v2) +{ + const UInt64 kMax = (UInt64)1 << 31; + while (v1 > kMax) + { + v1 >>= 1; + v2 >>= 1; + } +} + +static UInt64 MyMultDiv64(UInt64 unpCur, UInt64 unpTotal, UInt64 packTotal) +{ + NormalizeVals(packTotal, unpTotal); + NormalizeVals(unpCur, unpTotal); + if (unpTotal == 0) + unpTotal = 1; + return unpCur * packTotal / unpTotal; +} + STDMETHODIMP CArchiveExtractCallback::SetCompleted(const UInt64 *completeValue) { COM_TRY_BEGIN + if (!_extractCallback2) + return S_OK; + + if (_multiArchives) + { + if (_ratioMode) + return S_OK; + if (completeValue != NULL) + { + UInt64 packCur = LocalProgressSpec->InSize + MyMultDiv64(*completeValue, _unpTotal, _packTotal); + return _extractCallback2->SetCompleted(&packCur); + } + } return _extractCallback2->SetCompleted(completeValue); COM_TRY_END } +STDMETHODIMP CArchiveExtractCallback::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize) +{ + COM_TRY_BEGIN + _ratioMode = true; + return _localProgress->SetRatioInfo(inSize, outSize); + COM_TRY_END +} + void CArchiveExtractCallback::CreateComplexDirectory(const UStringVector &dirPathParts, UString &fullPath) { fullPath = _directoryPath; @@ -116,10 +169,12 @@ STDMETHODIMP CArchiveExtractCallback::GetStream(UInt32 index, ISequentialOutStre _encrypted = false; _isSplit = false; + _curSize = 0; UString fullPath; RINOK(GetArchiveItemPath(_archiveHandler, index, _itemDefaultName, fullPath)); + RINOK(IsArchiveItemFolder(_archiveHandler, index, _processedFileInfo.IsDirectory)); _filePath = fullPath; @@ -137,6 +192,19 @@ STDMETHODIMP CArchiveExtractCallback::GetStream(UInt32 index, ISequentialOutStre RINOK(IsArchiveItemProp(_archiveHandler, index, kpidEncrypted, _encrypted)); + bool newFileSizeDefined; + UInt64 newFileSize; + { + NCOM::CPropVariant prop; + RINOK(_archiveHandler->GetProperty(index, kpidSize, &prop)); + newFileSizeDefined = (prop.vt != VT_EMPTY); + if (newFileSizeDefined) + { + newFileSize = ConvertPropVariantToUInt64(prop); + _curSize = newFileSize; + } + } + if(askExtractMode == NArchive::NExtract::NAskMode::kExtract) { if (_stdOutMode) @@ -163,8 +231,6 @@ STDMETHODIMP CArchiveExtractCallback::GetStream(UInt32 index, ISequentialOutStre } } - RINOK(IsArchiveItemFolder(_archiveHandler, index, _processedFileInfo.IsDirectory)); - RINOK(GetTime(index, kpidCreationTime, _processedFileInfo.CreationTime, _processedFileInfo.IsCreationTimeDefined)); RINOK(GetTime(index, kpidLastWriteTime, _processedFileInfo.LastWriteTime, @@ -172,16 +238,6 @@ STDMETHODIMP CArchiveExtractCallback::GetStream(UInt32 index, ISequentialOutStre RINOK(GetTime(index, kpidLastAccessTime, _processedFileInfo.LastAccessTime, _processedFileInfo.IsLastAccessTimeDefined)); - bool newFileSizeDefined; - UInt64 newFileSize; - { - NCOM::CPropVariant prop; - RINOK(_archiveHandler->GetProperty(index, kpidSize, &prop)); - newFileSizeDefined = (prop.vt != VT_EMPTY); - if (newFileSizeDefined) - newFileSize = ConvertPropVariantToUInt64(prop); - } - bool isAnti = false; RINOK(IsArchiveItemProp(_archiveHandler, index, kpidIsAnti, isAnti)); @@ -324,8 +380,7 @@ STDMETHODIMP CArchiveExtractCallback::GetStream(UInt32 index, ISequentialOutStre { _outFileStreamSpec = new COutFileStream; CMyComPtr<ISequentialOutStream> outStreamLoc(_outFileStreamSpec); - if (!_outFileStreamSpec->File.Open(fullProcessedPath, - _isSplit ? OPEN_ALWAYS: CREATE_ALWAYS)) + if (!_outFileStreamSpec->Open(fullProcessedPath, _isSplit ? OPEN_ALWAYS: CREATE_ALWAYS)) { // if (::GetLastError() != ERROR_FILE_EXISTS || !isSplit) { @@ -360,7 +415,8 @@ STDMETHODIMP CArchiveExtractCallback::PrepareOperation(Int32 askExtractMode) case NArchive::NExtract::NAskMode::kExtract: _extractMode = true; }; - return _extractCallback2->PrepareOperation(_filePath, askExtractMode, _isSplit ? &_position: 0); + return _extractCallback2->PrepareOperation(_filePath, _processedFileInfo.IsDirectory, + askExtractMode, _isSplit ? &_position: 0); COM_TRY_END } @@ -378,12 +434,21 @@ STDMETHODIMP CArchiveExtractCallback::SetOperationResult(Int32 operationResult) _outFileStream.Release(); return E_FAIL; } - if(_outFileStream != NULL) - _outFileStreamSpec->File.SetTime( + if (_outFileStream != NULL) + { + _outFileStreamSpec->SetTime( (WriteCreated && _processedFileInfo.IsCreationTimeDefined) ? &_processedFileInfo.CreationTime : NULL, (WriteAccessed && _processedFileInfo.IsLastAccessTimeDefined) ? &_processedFileInfo.LastAccessTime : NULL, (WriteModified && _processedFileInfo.IsLastWriteTimeDefined) ? &_processedFileInfo.LastWriteTime : &_utcLastWriteTimeDefault); - _outFileStream.Release(); + _curSize = _outFileStreamSpec->ProcessedSize; + _outFileStream.Release(); + } + UnpackSize += _curSize; + if (_processedFileInfo.IsDirectory) + NumFolders++; + else + NumFiles++; + if (_extractMode && _processedFileInfo.AttributesAreDefined) NFile::NDirectory::MySetFileAttributes(_diskFilePath, _processedFileInfo.Attributes); RINOK(_extractCallback2->SetOperationResult(operationResult, _encrypted)); diff --git a/CPP/7zip/UI/Common/ArchiveExtractCallback.h b/CPP/7zip/UI/Common/ArchiveExtractCallback.h index 489cdcdb..7c8bb832 100755 --- a/CPP/7zip/UI/Common/ArchiveExtractCallback.h +++ b/CPP/7zip/UI/Common/ArchiveExtractCallback.h @@ -10,6 +10,7 @@ #include "Common/MyCom.h" #include "../../Common/FileStreams.h" +#include "../../Common/ProgressUtils.h" #include "../../IPassword.h" #include "ExtractMode.h" @@ -18,15 +19,17 @@ class CArchiveExtractCallback: public IArchiveExtractCallback, // public IArchiveVolumeExtractCallback, public ICryptoGetTextPassword, + public ICompressProgressInfo, public CMyUnknownImp { public: - MY_UNKNOWN_IMP1(ICryptoGetTextPassword) + MY_UNKNOWN_IMP2(ICryptoGetTextPassword, ICompressProgressInfo) // COM_INTERFACE_ENTRY(IArchiveVolumeExtractCallback) // IProgress STDMETHOD(SetTotal)(UInt64 size); STDMETHOD(SetCompleted)(const UInt64 *completeValue); + STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize); // IExtractCallBack STDMETHOD(GetStream)(UInt32 index, ISequentialOutStream **outStream, Int32 askExtractMode); @@ -42,6 +45,7 @@ public: private: CMyComPtr<IInArchive> _archiveHandler; CMyComPtr<IFolderArchiveExtractCallback> _extractCallback2; + CMyComPtr<ICompressProgressInfo> _compressProgress; CMyComPtr<ICryptoGetTextPassword> _cryptoGetTextPassword; UString _directoryPath; NExtract::NPathMode::EEnum _pathMode; @@ -76,6 +80,7 @@ private: bool AttributesAreDefined; } _processedFileInfo; + UInt64 _curSize; COutFileStream *_outFileStreamSpec; CMyComPtr<ISequentialOutStream> _outFileStream; UStringVector _removePathParts; @@ -91,19 +96,39 @@ public: CArchiveExtractCallback(): WriteModified(true), WriteCreated(false), - WriteAccessed(false) + WriteAccessed(false), + _multiArchives(false) {} + CLocalProgress *LocalProgressSpec; + CMyComPtr<ICompressProgressInfo> _localProgress; + bool _ratioMode; + UInt64 _packTotal; + UInt64 _unpTotal; + + bool _multiArchives; + UInt64 NumFolders; + UInt64 NumFiles; + UInt64 UnpackSize; + + void InitForMulti(bool multiArchives, + NExtract::NPathMode::EEnum pathMode, + NExtract::NOverwriteMode::EEnum overwriteMode) + { + _multiArchives = multiArchives; NumFolders = NumFiles = UnpackSize = 0; + _pathMode = pathMode; + _overwriteMode = overwriteMode; + } + void Init( IInArchive *archiveHandler, IFolderArchiveExtractCallback *extractCallback2, bool stdOutMode, const UString &directoryPath, - NExtract::NPathMode::EEnum pathMode, - NExtract::NOverwriteMode::EEnum overwriteMode, const UStringVector &removePathParts, const UString &itemDefaultName, const FILETIME &utcLastWriteTimeDefault, - UInt32 attributesDefault); + UInt32 attributesDefault, + UInt64 packSize); UInt64 _numErrors; }; diff --git a/CPP/7zip/UI/Common/CompressCall.cpp b/CPP/7zip/UI/Common/CompressCall.cpp index ccf4e287..5eba9194 100755 --- a/CPP/7zip/UI/Common/CompressCall.cpp +++ b/CPP/7zip/UI/Common/CompressCall.cpp @@ -13,8 +13,8 @@ #include "Windows/FileMapping.h" #include "Windows/FileDir.h" -#include "../../FileManager/ProgramLocation.h" -#include "../../FileManager/RegistryUtils.h" +#include "../FileManager/ProgramLocation.h" +#include "../FileManager/RegistryUtils.h" #ifndef _UNICODE extern bool g_IsNT; diff --git a/CPP/7zip/UI/Common/Extract.cpp b/CPP/7zip/UI/Common/Extract.cpp index 8d3df8e1..6b6eb329 100755 --- a/CPP/7zip/UI/Common/Extract.cpp +++ b/CPP/7zip/UI/Common/Extract.cpp @@ -14,10 +14,12 @@ using namespace NWindows; HRESULT DecompressArchive( IInArchive *archive, + UInt64 packSize, const UString &defaultName, const NWildcard::CCensorNode &wildcardCensor, const CExtractOptions &options, IExtractCallbackUI *callback, + CArchiveExtractCallback *extractCallbackSpec, UString &errorMessage) { CRecordVector<UInt32> realIndices; @@ -40,9 +42,6 @@ HRESULT DecompressArchive( return S_OK; } - CArchiveExtractCallback *extractCallbackSpec = new CArchiveExtractCallback; - CMyComPtr<IArchiveExtractCallback> extractCallback(extractCallbackSpec); - UStringVector removePathParts; UString outDir = options.OutputDir; @@ -62,20 +61,18 @@ HRESULT DecompressArchive( callback, options.StdOutMode, outDir, - options.PathMode, - options.OverwriteMode, removePathParts, options.DefaultItemName, options.ArchiveFileInfo.LastWriteTime, - options.ArchiveFileInfo.Attributes); + options.ArchiveFileInfo.Attributes, + packSize); #ifdef COMPRESS_MT RINOK(SetProperties(archive, options.Properties)); #endif HRESULT result = archive->Extract(&realIndices.Front(), - realIndices.Size(), options.TestMode? 1: 0, - extractCallback); + realIndices.Size(), options.TestMode? 1: 0, extractCallbackSpec); return callback->ExtractResult(result); } @@ -87,10 +84,32 @@ HRESULT DecompressArchives( const CExtractOptions &optionsSpec, IOpenCallbackUI *openCallback, IExtractCallbackUI *extractCallback, - UString &errorMessage) + UString &errorMessage, + CDecompressStat &stat) { + stat.Clear(); CExtractOptions options = optionsSpec; - for (int i = 0; i < archivePaths.Size(); i++) + int i; + UInt64 totalPackSize = 0; + for (i = 0; i < archivePaths.Size(); i++) + { + const UString &archivePath = archivePaths[i]; + NFile::NFind::CFileInfoW archiveFileInfo; + if (!NFile::NFind::FindFile(archivePath, archiveFileInfo)) + throw "there is no such archive"; + if (archiveFileInfo.IsDirectory()) + throw "can't decompress folder"; + totalPackSize += archiveFileInfo.Size; + } + CArchiveExtractCallback *extractCallbackSpec = new CArchiveExtractCallback; + CMyComPtr<IArchiveExtractCallback> ec(extractCallbackSpec); + bool multi = (archivePaths.Size() > 1); + extractCallbackSpec->InitForMulti(multi, options.PathMode, options.OverwriteMode); + if (multi) + { + RINOK(extractCallback->SetTotal(totalPackSize)); + } + for (i = 0; i < archivePaths.Size(); i++) { const UString &archivePath = archivePaths[i]; NFile::NFind::CFileInfoW archiveFileInfo; @@ -140,10 +159,19 @@ HRESULT DecompressArchives( options.DefaultItemName = archiveLink.GetDefaultItemName(); RINOK(DecompressArchive( - archiveLink.GetArchive(), archiveLink.GetDefaultItemName(), - wildcardCensor, options, extractCallback, errorMessage)); + archiveLink.GetArchive(), + archiveFileInfo.Size, + archiveLink.GetDefaultItemName(), + wildcardCensor, options, extractCallback, extractCallbackSpec, errorMessage)); + extractCallbackSpec->LocalProgressSpec->InSize += archiveFileInfo.Size; + extractCallbackSpec->LocalProgressSpec->OutSize = extractCallbackSpec->UnpackSize; if (!errorMessage.IsEmpty()) return E_FAIL; } + stat.NumFolders = extractCallbackSpec->NumFolders; + stat.NumFiles = extractCallbackSpec->NumFiles; + stat.UnpackSize = extractCallbackSpec->UnpackSize; + stat.NumArchives = archivePaths.Size(); + stat.PackSize = extractCallbackSpec->LocalProgressSpec->InSize; return S_OK; } diff --git a/CPP/7zip/UI/Common/Extract.h b/CPP/7zip/UI/Common/Extract.h index 232f988f..e7add12e 100755 --- a/CPP/7zip/UI/Common/Extract.h +++ b/CPP/7zip/UI/Common/Extract.h @@ -54,6 +54,16 @@ public: */ }; +struct CDecompressStat +{ + UInt64 NumArchives; + UInt64 UnpackSize; + UInt64 PackSize; + UInt64 NumFolders; + UInt64 NumFiles; + void Clear() { NumArchives = PackSize = UnpackSize = NumFolders = NumFiles = 0; } +}; + HRESULT DecompressArchives( CCodecs *codecs, UStringVector &archivePaths, UStringVector &archivePathsFull, @@ -61,6 +71,7 @@ HRESULT DecompressArchives( const CExtractOptions &options, IOpenCallbackUI *openCallback, IExtractCallbackUI *extractCallback, - UString &errorMessage); + UString &errorMessage, + CDecompressStat &stat); #endif diff --git a/CPP/7zip/UI/Common/IFileExtractCallback.h b/CPP/7zip/UI/Common/IFileExtractCallback.h index 466b1e62..284e9cb3 100755 --- a/CPP/7zip/UI/Common/IFileExtractCallback.h +++ b/CPP/7zip/UI/Common/IFileExtractCallback.h @@ -4,6 +4,7 @@ #define __IFILEEXTRACTCALLBACK_H #include "Common/MyString.h" +#include "../../IDecl.h" namespace NOverwriteAnswer { @@ -18,18 +19,14 @@ namespace NOverwriteAnswer }; } -// {23170F69-40C1-278A-0000-000100070000} -DEFINE_GUID(IID_IFolderArchiveExtractCallback, -0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x07, 0x00, 0x00); -MIDL_INTERFACE("23170F69-40C1-278A-0000-000100070000") -IFolderArchiveExtractCallback: public IProgress +DECL_INTERFACE_SUB(IFolderArchiveExtractCallback, IProgress, 0x01, 0x07) { public: STDMETHOD(AskOverwrite)( const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize, const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize, Int32 *answer) PURE; - STDMETHOD(PrepareOperation)(const wchar_t *name, Int32 askExtractMode, const UInt64 *position) PURE; + STDMETHOD(PrepareOperation)(const wchar_t *name, bool isFolder, Int32 askExtractMode, const UInt64 *position) PURE; STDMETHOD(MessageError)(const wchar_t *message) PURE; STDMETHOD(SetOperationResult)(Int32 operationResult, bool encrypted) PURE; }; diff --git a/CPP/7zip/UI/Common/OpenArchive.cpp b/CPP/7zip/UI/Common/OpenArchive.cpp index ed02130e..b2941df5 100755 --- a/CPP/7zip/UI/Common/OpenArchive.cpp +++ b/CPP/7zip/UI/Common/OpenArchive.cpp @@ -156,6 +156,33 @@ HRESULT OpenArchive( orderIndices2 += orderIndices; orderIndices = orderIndices2; } + else if (extension == L"000" || extension == L"001") + { + CByteBuffer byteBuffer; + const UInt32 kBufferSize = (1 << 10); + byteBuffer.SetCapacity(kBufferSize); + Byte *buffer = byteBuffer; + RINOK(inStream->Seek(0, STREAM_SEEK_SET, NULL)); + UInt32 processedSize; + RINOK(ReadStream(inStream, buffer, kBufferSize, &processedSize)); + if (processedSize >= 16) + { + Byte kRarHeader[] = {0x52 , 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00}; + if (TestSignature(buffer, kRarHeader, 7) && buffer[9] == 0x73 && (buffer[10] && 1) != 0) + { + for (int i = 0; i < orderIndices.Size(); i++) + { + int index = orderIndices[i]; + const CArcInfoEx &ai = codecs->Formats[index]; + if (ai.Name.CompareNoCase(L"rar") != 0) + continue; + orderIndices.Delete(i--); + orderIndices.Insert(0, index); + break; + } + } + } + } #endif HRESULT badResult = S_OK; diff --git a/CPP/7zip/UI/Common/Update.cpp b/CPP/7zip/UI/Common/Update.cpp index 3c292754..e4857225 100755 --- a/CPP/7zip/UI/Common/Update.cpp +++ b/CPP/7zip/UI/Common/Update.cpp @@ -332,9 +332,17 @@ static HRESULT Compress( CObjectVector<CUpdatePair2> updatePairs2; UpdateProduce(updatePairs, actionSet, updatePairs2); + + UInt32 numFiles = 0; + for (int i = 0; i < updatePairs2.Size(); i++) + if (updatePairs2[i].NewData) + numFiles++; + + RINOK(callback->SetNumFiles(numFiles)); + CArchiveUpdateCallback *updateCallbackSpec = new CArchiveUpdateCallback; - CMyComPtr<IArchiveUpdateCallback> updateCallback(updateCallbackSpec ); + CMyComPtr<IArchiveUpdateCallback> updateCallback(updateCallbackSpec); updateCallbackSpec->ShareForWrite = shareForWrite; updateCallbackSpec->StdInMode = stdInMode; diff --git a/CPP/7zip/UI/Common/Update.h b/CPP/7zip/UI/Common/Update.h index 33f4eecd..49e4be81 100755 --- a/CPP/7zip/UI/Common/Update.h +++ b/CPP/7zip/UI/Common/Update.h @@ -140,16 +140,18 @@ struct CUpdateErrorInfo: public CErrorInfo { }; +#define INTERFACE_IUpdateCallbackUI2(x) \ + INTERFACE_IUpdateCallbackUI(x) \ + virtual HRESULT OpenResult(const wchar_t *name, HRESULT result) x; \ + virtual HRESULT StartScanning() x; \ + virtual HRESULT CanNotFindError(const wchar_t *name, DWORD systemError) x; \ + virtual HRESULT FinishScanning() x; \ + virtual HRESULT StartArchive(const wchar_t *name, bool updating) x; \ + virtual HRESULT FinishArchive() x; \ + struct IUpdateCallbackUI2: public IUpdateCallbackUI { - virtual HRESULT OpenResult(const wchar_t *name, HRESULT result) = 0; - - virtual HRESULT StartScanning() = 0; - virtual HRESULT CanNotFindError(const wchar_t *name, DWORD systemError) = 0; - virtual HRESULT FinishScanning() = 0; - - virtual HRESULT StartArchive(const wchar_t *name, bool updating) = 0; - virtual HRESULT FinishArchive() = 0; + INTERFACE_IUpdateCallbackUI2(=0) }; HRESULT UpdateArchive( diff --git a/CPP/7zip/UI/Common/UpdateCallback.cpp b/CPP/7zip/UI/Common/UpdateCallback.cpp index 6fc4242d..a5f0a54f 100755 --- a/CPP/7zip/UI/Common/UpdateCallback.cpp +++ b/CPP/7zip/UI/Common/UpdateCallback.cpp @@ -39,6 +39,14 @@ STDMETHODIMP CArchiveUpdateCallback::SetCompleted(const UInt64 *completeValue) COM_TRY_END } +STDMETHODIMP CArchiveUpdateCallback::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize) +{ + COM_TRY_BEGIN + return Callback->SetRatioInfo(inSize, outSize); + COM_TRY_END +} + + /* STATPROPSTG kProperties[] = { diff --git a/CPP/7zip/UI/Common/UpdateCallback.h b/CPP/7zip/UI/Common/UpdateCallback.h index 31e42e33..bf90ff9e 100755 --- a/CPP/7zip/UI/Common/UpdateCallback.h +++ b/CPP/7zip/UI/Common/UpdateCallback.h @@ -7,35 +7,46 @@ #include "Common/MyString.h" #include "../../IPassword.h" +#include "../../ICoder.h" #include "../Common/UpdatePair.h" #include "../Common/UpdateProduce.h" +#define INTERFACE_IUpdateCallbackUI(x) \ + virtual HRESULT SetTotal(UInt64 size) x; \ + virtual HRESULT SetCompleted(const UInt64 *completeValue) x; \ + virtual HRESULT SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize) x; \ + virtual HRESULT CheckBreak() x; \ + virtual HRESULT Finilize() x; \ + virtual HRESULT SetNumFiles(UInt64 numFiles) x; \ + virtual HRESULT GetStream(const wchar_t *name, bool isAnti) x; \ + virtual HRESULT OpenFileError(const wchar_t *name, DWORD systemError) x; \ + virtual HRESULT SetOperationResult(Int32 operationResult) x; \ + virtual HRESULT CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password) x; \ + + // virtual HRESULT CloseProgress() { return S_OK; }; + struct IUpdateCallbackUI { - virtual HRESULT SetTotal(UInt64 size) = 0; - virtual HRESULT SetCompleted(const UInt64 *completeValue) = 0; - virtual HRESULT CheckBreak() = 0; - virtual HRESULT Finilize() = 0; - virtual HRESULT GetStream(const wchar_t *name, bool isAnti) = 0; - virtual HRESULT OpenFileError(const wchar_t *name, DWORD systemError) = 0; - virtual HRESULT SetOperationResult(Int32 operationResult) = 0; - virtual HRESULT CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password) = 0; - virtual HRESULT CloseProgress() { return S_OK; }; + INTERFACE_IUpdateCallbackUI(=0) }; class CArchiveUpdateCallback: public IArchiveUpdateCallback2, public ICryptoGetTextPassword2, + public ICompressProgressInfo, public CMyUnknownImp { public: - MY_UNKNOWN_IMP2(IArchiveUpdateCallback2, - ICryptoGetTextPassword2) + MY_UNKNOWN_IMP3( + IArchiveUpdateCallback2, + ICryptoGetTextPassword2, + ICompressProgressInfo) // IProgress STDMETHOD(SetTotal)(UInt64 size); STDMETHOD(SetCompleted)(const UInt64 *completeValue); + STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize); // IUpdateCallback STDMETHOD(EnumProperties)(IEnumSTATPROPSTG **enumerator); diff --git a/CPP/7zip/UI/Console/Console.dsp b/CPP/7zip/UI/Console/Console.dsp index e68c34dc..e8f83664 100755 --- a/CPP/7zip/UI/Console/Console.dsp +++ b/CPP/7zip/UI/Console/Console.dsp @@ -648,6 +648,14 @@ SOURCE=..\..\Common\FileStreams.h # End Source File # Begin Source File +SOURCE=..\..\Common\ProgressUtils.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\ProgressUtils.h +# End Source File +# Begin Source File + SOURCE=..\..\Common\RegisterArc.h # End Source File # Begin Source File diff --git a/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp b/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp index f4badb78..d693cb4b 100755 --- a/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp +++ b/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp @@ -95,7 +95,7 @@ STDMETHODIMP CExtractCallbackConsole::AskOverwrite( return S_OK; } -STDMETHODIMP CExtractCallbackConsole::PrepareOperation(const wchar_t *name, Int32 askExtractMode, const UInt64 *position) +STDMETHODIMP CExtractCallbackConsole::PrepareOperation(const wchar_t *name, bool /* isFolder */, Int32 askExtractMode, const UInt64 *position) { switch (askExtractMode) { diff --git a/CPP/7zip/UI/Console/ExtractCallbackConsole.h b/CPP/7zip/UI/Console/ExtractCallbackConsole.h index bf81a803..7e5d9c5d 100755 --- a/CPP/7zip/UI/Console/ExtractCallbackConsole.h +++ b/CPP/7zip/UI/Console/ExtractCallbackConsole.h @@ -26,7 +26,7 @@ public: const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize, const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize, Int32 *answer); - STDMETHOD (PrepareOperation)(const wchar_t *name, Int32 askExtractMode, const UInt64 *position); + STDMETHOD (PrepareOperation)(const wchar_t *name, bool isFolder, Int32 askExtractMode, const UInt64 *position); STDMETHOD(MessageError)(const wchar_t *message); STDMETHOD(SetOperationResult)(Int32 operationResult, bool encrypted); diff --git a/CPP/7zip/UI/Console/List.cpp b/CPP/7zip/UI/Console/List.cpp index 0958a3e5..7a2b9628 100755 --- a/CPP/7zip/UI/Console/List.cpp +++ b/CPP/7zip/UI/Console/List.cpp @@ -57,7 +57,17 @@ static CPropIdToName kPropIdToName[] = { kpidGroup, L"Group" }, { kpidBlock, L"Block" }, { kpidComment, L"Comment" }, - { kpidPosition, L"Position" } + { kpidPosition, L"Position" }, + { kpidPrefix, L"Prefix" }, + { kpidNumSubFolders, L"Folders" }, + { kpidNumSubFiles, L"Files" }, + { kpidUnpackVer, L"Version" }, + { kpidVolume, L"Volume" }, + { kpidIsVolume, L"Multivolume" }, + { kpidOffset, L"Offset" }, + { kpidLinks, L"Links" }, + { kpidNumBlocks, L"Blocks" }, + { kpidNumVolumes, L"Volumes" } }; static const char kEmptyAttributeChar = '.'; @@ -184,6 +194,19 @@ void CFieldPrinter::Init(const CFieldInfoInit *standardFieldTable, int numItems) } } +static UString GetPropName(PROPID propID, BSTR name) +{ + for (int i = 0; i < sizeof(kPropIdToName) / sizeof(kPropIdToName[0]); i++) + { + const CPropIdToName &propIdToName = kPropIdToName[i]; + if (propIdToName.PropID == propID) + return propIdToName.Name; + } + if (name) + return name; + return L"?"; +} + HRESULT CFieldPrinter::Init(IInArchive *archive) { Clear(); @@ -197,21 +220,7 @@ HRESULT CFieldPrinter::Init(IInArchive *archive) RINOK(archive->GetPropertyInfo(i, &name, &propID, &vt)); CFieldInfo fieldInfo; fieldInfo.PropID = propID; - if (name != NULL) - fieldInfo.Name = name; - else - { - fieldInfo.Name = L"Unknown"; - for (int i = 0; i < sizeof(kPropIdToName) / sizeof(kPropIdToName[0]); i++) - { - const CPropIdToName &propIdToName = kPropIdToName[i]; - if (propIdToName.PropID == propID) - { - fieldInfo.Name = propIdToName.Name; - break; - } - } - } + fieldInfo.Name = GetPropName(propID, name); _fields.Add(fieldInfo); } return S_OK; @@ -463,14 +472,28 @@ HRESULT ListArchives( { g_StdOut << endl << kListing << archiveName << endl << endl; - NCOM::CPropVariant propVariant; - RINOK(archive->GetArchiveProperty(kpidComment, &propVariant)); - if (propVariant.vt != VT_EMPTY) + UInt32 numProps; + if (archive->GetNumberOfArchiveProperties(&numProps) == S_OK) { - UString s = ConvertPropertyToString(propVariant, kpidComment); - if (!s.IsEmpty()) - g_StdOut << "Comment:\n" << s << "\n\n"; + for (UInt32 i = 0; i < numProps; i++) + { + CMyComBSTR name; + PROPID propID; + VARTYPE vt; + if (archive->GetArchivePropertyInfo(i, &name, &propID, &vt) != S_OK) + continue; + NCOM::CPropVariant prop; + if (archive->GetArchiveProperty(propID, &prop) != S_OK) + continue; + UString s = ConvertPropertyToString(prop, propID); + if (!s.IsEmpty()) + g_StdOut << GetPropName(propID, name) << " = " << s << endl; + } } + if (techMode) + g_StdOut << "----------\n"; + if (numProps > 0) + g_StdOut << endl; } if (enableHeaders && !techMode) diff --git a/CPP/7zip/UI/Console/Main.cpp b/CPP/7zip/UI/Console/Main.cpp index 17eb29ec..7afc6f7c 100755 --- a/CPP/7zip/UI/Console/Main.cpp +++ b/CPP/7zip/UI/Console/Main.cpp @@ -1,4 +1,4 @@ -// Main.cpp +/ Main.cpp #include "StdAfx.h" @@ -396,12 +396,13 @@ int Main2( eo.Properties = options.ExtractProperties; #endif UString errorMessage; + CDecompressStat stat; HRESULT result = DecompressArchives( codecs, options.ArchivePathsSorted, options.ArchivePathsFullSorted, options.WildcardCensor.Pairs.Front().Head, - eo, &openCallback, ecs, errorMessage); + eo, &openCallback, ecs, errorMessage, stat); if (!errorMessage.IsEmpty()) { stdStream << endl << "Error: " << errorMessage; @@ -409,15 +410,20 @@ int Main2( result = E_FAIL; } + stdStream << endl << endl << "Total:" << endl; if (ecs->NumArchives > 1) - { - stdStream << endl << endl << "Total:" << endl; stdStream << "Archives: " << ecs->NumArchives << endl; + { + stdStream << "Folders: " << stat.NumFolders << endl; + stdStream << "Files: " << stat.NumFiles << endl; + stdStream << "Size: " << stat.UnpackSize << endl; + stdStream << "Compressed: " << stat.PackSize << endl; } if (ecs->NumArchiveErrors != 0 || ecs->NumFileErrors != 0) { if (ecs->NumArchives > 1) { + stdStream << endl; if (ecs->NumArchiveErrors != 0) stdStream << "Archive Errors: " << ecs->NumArchiveErrors << endl; if (ecs->NumFileErrors != 0) diff --git a/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp b/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp index b060b196..1d4420da 100755 --- a/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp +++ b/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp @@ -112,6 +112,11 @@ HRESULT CUpdateCallbackConsole::Finilize() return S_OK; } +HRESULT CUpdateCallbackConsole::SetNumFiles(UInt64 /* numFiles */) +{ + return S_OK; +} + HRESULT CUpdateCallbackConsole::SetTotal(UInt64 size) { MT_LOCK @@ -137,6 +142,15 @@ HRESULT CUpdateCallbackConsole::SetCompleted(const UInt64 *completeValue) return S_OK; } +HRESULT CUpdateCallbackConsole::SetRatioInfo(const UInt64 * /* inSize */, const UInt64 * /* outSize */) +{ + /* + if (NConsoleClose::TestBreakSignal()) + return E_ABORT; + */ + return S_OK; +} + HRESULT CUpdateCallbackConsole::GetStream(const wchar_t *name, bool isAnti) { MT_LOCK diff --git a/CPP/7zip/UI/Console/UpdateCallbackConsole.h b/CPP/7zip/UI/Console/UpdateCallbackConsole.h index ca7cc742..d04e1ad4 100755 --- a/CPP/7zip/UI/Console/UpdateCallbackConsole.h +++ b/CPP/7zip/UI/Console/UpdateCallbackConsole.h @@ -46,24 +46,7 @@ public: m_PercentPrinter.OutStream = outStream; } - HRESULT OpenResult(const wchar_t *name, HRESULT result); - - HRESULT StartScanning(); - HRESULT CanNotFindError(const wchar_t *name, DWORD systemError); - HRESULT FinishScanning(); - - HRESULT StartArchive(const wchar_t *name, bool updating); - HRESULT FinishArchive(); - - HRESULT CheckBreak(); - HRESULT Finilize(); - HRESULT SetTotal(UInt64 size); - HRESULT SetCompleted(const UInt64 *completeValue); - - HRESULT GetStream(const wchar_t *name, bool isAnti); - HRESULT OpenFileError(const wchar_t *name, DWORD systemError); - HRESULT SetOperationResult(Int32 operationResult); - HRESULT CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password); + INTERFACE_IUpdateCallbackUI2(;) UStringVector FailedFiles; CRecordVector<HRESULT> FailedCodes; diff --git a/CPP/7zip/UI/Console/makefile b/CPP/7zip/UI/Console/makefile index bd3b7a4e..dc347889 100755 --- a/CPP/7zip/UI/Console/makefile +++ b/CPP/7zip/UI/Console/makefile @@ -51,6 +51,7 @@ WIN_OBJS = \ 7ZIP_COMMON_OBJS = \ $O\FilePathAutoRename.obj \ $O\FileStreams.obj \ + $O\ProgressUtils.obj \ $O\StreamUtils.obj \ UI_COMMON_OBJS = \ diff --git a/CPP/7zip/UI/Explorer/ContextMenu.cpp b/CPP/7zip/UI/Explorer/ContextMenu.cpp index 53f778cc..06210412 100755 --- a/CPP/7zip/UI/Explorer/ContextMenu.cpp +++ b/CPP/7zip/UI/Explorer/ContextMenu.cpp @@ -19,14 +19,14 @@ #include "Windows/Menu.h" #include "Windows/ResourceString.h" -#include "../../FileManager/FormatUtils.h" -#include "../../FileManager/ProgramLocation.h" +#include "../FileManager/FormatUtils.h" +#include "../FileManager/ProgramLocation.h" #include "../Common/ZipRegistry.h" #include "../Common/ArchiveName.h" #ifdef LANG -#include "../../FileManager/LangUtils.h" +#include "../FileManager/LangUtils.h" #endif #include "resource.h" @@ -37,7 +37,7 @@ // #include "CompressEngine.h" #include "MyMessages.h" -#include "../Resource/Extract/resource.h" +#include "../GUI/ExtractRes.h" #include "../Common/CompressCall.h" using namespace NWindows; @@ -311,7 +311,7 @@ static UString GetReducedString(const UString &s) static const wchar_t *kExtractExludeExtensions[] = { - L"txt", L"htm", L"html", L"xml", L"doc", L"xls", + L"txt", L"htm", L"html", L"xml", L"bmp", L"gif", L"jpeg", L"jpg" }; diff --git a/CPP/7zip/UI/Explorer/ContextMenu.h b/CPP/7zip/UI/Explorer/ContextMenu.h index 9ab80dfd..88b33178 100755 --- a/CPP/7zip/UI/Explorer/ContextMenu.h +++ b/CPP/7zip/UI/Explorer/ContextMenu.h @@ -9,8 +9,8 @@ DEFINE_GUID(CLSID_CZipContextMenu, #include "Common/MyString.h" -#include "../../FileManager/PluginInterface.h" -#include "../../FileManager/MyCom2.h" +#include "../FileManager/PluginInterface.h" +#include "../FileManager/MyCom2.h" class CZipContextMenu: diff --git a/CPP/7zip/UI/Explorer/DllExports.cpp b/CPP/7zip/UI/Explorer/DllExports.cpp index fb7daf04..6072e92a 100755 --- a/CPP/7zip/UI/Explorer/DllExports.cpp +++ b/CPP/7zip/UI/Explorer/DllExports.cpp @@ -20,9 +20,8 @@ #include "Windows/DLL.h" #include "Windows/Registry.h" -#include "../../IPassword.h" -#include "../../FileManager/LangUtils.h" -#include "../Agent/Agent.h" +#include "../FileManager/LangUtils.h" +#include "../FileManager/IFolder.h" #include "ContextMenu.h" #include "OptionsDialog.h" @@ -51,7 +50,6 @@ public: CShellExtClassFactory() { InterlockedIncrement(&g_DllRefCount); } ~CShellExtClassFactory() { InterlockedDecrement(&g_DllRefCount); } - MY_UNKNOWN_IMP1_MT(IClassFactory) STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, void**); @@ -258,16 +256,6 @@ STDAPI CreateObject( LoadLangOneTime(); COM_TRY_BEGIN *outObject = 0; - if (*classID == CLSID_CAgentArchiveHandler) - { - if (*interfaceID == IID_IFolderManager) - { - CMyComPtr<IFolderManager> manager = new CArchiveFolderManager; - *outObject = manager.Detach(); - return S_OK; - } - return E_NOINTERFACE; - } if (*classID == CLSID_CSevenZipOptions) { if (*interfaceID == IID_IPluginOptions) @@ -291,13 +279,6 @@ STDAPI GetPluginProperty(PROPID propID, PROPVARIANT *value) if ((value->bstrVal = ::SysAllocString(L"7-Zip")) != 0) value->vt = VT_BSTR; return S_OK; - case NPlugin::kClassID: - { - if ((value->bstrVal = ::SysAllocStringByteLen( - (const char *)&CLSID_CAgentArchiveHandler, sizeof(GUID))) != 0) - value->vt = VT_BSTR; - return S_OK; - } case NPlugin::kOptionsClassID: { if ((value->bstrVal = ::SysAllocStringByteLen( @@ -305,11 +286,6 @@ STDAPI GetPluginProperty(PROPID propID, PROPVARIANT *value) value->vt = VT_BSTR; return S_OK; } - /* - case NArchive::kType: - propVariant = UINT32(0); - break; - */ } return S_OK; } diff --git a/CPP/7zip/UI/Explorer/Explorer.dsp b/CPP/7zip/UI/Explorer/Explorer.dsp index 586d9aae..2f9252c7 100755 --- a/CPP/7zip/UI/Explorer/Explorer.dsp +++ b/CPP/7zip/UI/Explorer/Explorer.dsp @@ -45,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 1 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /YX /FD /c -# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /c +# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /Yu"StdAfx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" @@ -72,7 +72,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 1 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /GZ /c +# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /Yu"StdAfx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" @@ -99,7 +99,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 1 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /D "_MBCS" /Yu"StdAfx.h" /FD /c -# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /c +# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /Yu"StdAfx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" @@ -128,7 +128,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 1 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /D "_MBCS" /Yu"StdAfx.h" /FD /GZ /c -# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /GZ /c +# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /Yu"StdAfx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" @@ -182,14 +182,6 @@ SOURCE=.\StdAfx.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\Common\ArchiveExtractCallback.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\ArchiveExtractCallback.h -# End Source File -# Begin Source File - SOURCE=..\Common\ArchiveName.cpp # End Source File # Begin Source File @@ -198,14 +190,6 @@ SOURCE=..\Common\ArchiveName.h # End Source File # Begin Source File -SOURCE=..\Common\ArchiveOpenCallback.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\ArchiveOpenCallback.h -# End Source File -# Begin Source File - SOURCE=..\Common\CompressCall.cpp # End Source File # Begin Source File @@ -214,106 +198,6 @@ SOURCE=..\Common\CompressCall.h # End Source File # Begin Source File -SOURCE=..\Common\DefaultName.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\DefaultName.h -# End Source File -# Begin Source File - -SOURCE=..\Common\EnumDirItems.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\EnumDirItems.h -# End Source File -# Begin Source File - -SOURCE=..\Common\ExtractingFilePath.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\ExtractingFilePath.h -# End Source File -# Begin Source File - -SOURCE=..\Common\HandlerLoader.h -# End Source File -# Begin Source File - -SOURCE=..\Common\LoadCodecs.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\LoadCodecs.h -# End Source File -# Begin Source File - -SOURCE=..\Common\OpenArchive.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\OpenArchive.h -# End Source File -# Begin Source File - -SOURCE=..\Common\PropIDUtils.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\PropIDUtils.h -# End Source File -# Begin Source File - -SOURCE=..\Common\SortUtils.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\SortUtils.h -# End Source File -# Begin Source File - -SOURCE=..\Common\UpdateAction.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\UpdateAction.h -# End Source File -# Begin Source File - -SOURCE=..\Common\UpdateCallback.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\UpdateCallback.h -# End Source File -# Begin Source File - -SOURCE=..\Common\UpdatePair.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\UpdatePair.h -# End Source File -# Begin Source File - -SOURCE=..\Common\UpdateProduce.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\UpdateProduce.h -# End Source File -# Begin Source File - -SOURCE=..\Common\WorkDir.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\WorkDir.h -# End Source File -# Begin Source File - SOURCE=..\Common\ZipRegistry.cpp # End Source File # Begin Source File @@ -344,85 +228,29 @@ SOURCE=.\MyMessages.h # Begin Group "Dialogs" # PROP Default_Filter "" -# Begin Group "Options" - -# PROP Default_Filter "" -# Begin Group "SystemPage" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\SystemPage\SystemPage.cpp +SOURCE=.\FoldersPage.cpp # End Source File # Begin Source File -SOURCE=.\SystemPage\SystemPage.h -# End Source File -# End Group -# Begin Group "FoldersPage" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\FoldersPage\FoldersPage.cpp -# End Source File -# Begin Source File - -SOURCE=.\FoldersPage\FoldersPage.h -# End Source File -# End Group -# End Group -# End Group -# Begin Group "Agent" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\Agent\Agent.cpp -# End Source File -# Begin Source File - -SOURCE=..\Agent\Agent.h -# End Source File -# Begin Source File - -SOURCE=..\Agent\AgentOut.cpp -# End Source File -# Begin Source File - -SOURCE=..\Agent\AgentProxy.cpp -# End Source File -# Begin Source File - -SOURCE=..\Agent\AgentProxy.h -# End Source File -# Begin Source File - -SOURCE=..\Agent\ArchiveFolder.cpp -# End Source File -# Begin Source File - -SOURCE=..\Agent\ArchiveFolderOpen.cpp +SOURCE=.\FoldersPage.h # End Source File # Begin Source File -SOURCE=..\Agent\ArchiveFolderOut.cpp +SOURCE=.\FoldersPageRes.h # End Source File # Begin Source File -SOURCE=..\Agent\IFileExtractCallback.h +SOURCE=.\SystemPage.cpp # End Source File # Begin Source File -SOURCE=..\Agent\IFolderArchive.h +SOURCE=.\SystemPage.h # End Source File # Begin Source File -SOURCE=..\Agent\UpdateCallbackAgent.cpp -# End Source File -# Begin Source File - -SOURCE=..\Agent\UpdateCallbackAgent.h +SOURCE=.\SystemPageRes.h # End Source File # End Group # Begin Group "FileManager" @@ -430,87 +258,47 @@ SOURCE=..\Agent\UpdateCallbackAgent.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\FileManager\FormatUtils.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\FileManager\FormatUtils.h -# End Source File -# Begin Source File - -SOURCE=..\..\FileManager\HelpUtils.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\FileManager\HelpUtils.h -# End Source File -# Begin Source File - -SOURCE=..\..\FileManager\IFolder.h -# End Source File -# Begin Source File - -SOURCE=..\..\FileManager\LangUtils.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\FileManager\LangUtils.h +SOURCE=..\FileManager\FormatUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\ProgramLocation.cpp +SOURCE=..\FileManager\FormatUtils.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\ProgramLocation.h +SOURCE=..\FileManager\HelpUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\RegistryUtils.cpp +SOURCE=..\FileManager\HelpUtils.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\RegistryUtils.h +SOURCE=..\FileManager\IFolder.h # End Source File -# End Group -# Begin Group "7-zip common" - -# PROP Default_Filter "" # Begin Source File -SOURCE=..\..\Common\FilePathAutoRename.cpp +SOURCE=..\FileManager\LangUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\FilePathAutoRename.h +SOURCE=..\FileManager\LangUtils.h # End Source File # Begin Source File -SOURCE=..\..\Common\FileStreams.cpp +SOURCE=..\FileManager\ProgramLocation.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\FileStreams.h +SOURCE=..\FileManager\ProgramLocation.h # End Source File # Begin Source File -SOURCE=..\..\Common\StreamUtils.cpp +SOURCE=..\FileManager\RegistryUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\StreamUtils.h -# End Source File -# End Group -# Begin Group "Compress" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\Compress\Copy\CopyCoder.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\Compress\Copy\CopyCoder.h +SOURCE=..\FileManager\RegistryUtils.h # End Source File # End Group # Begin Group "C" @@ -518,24 +306,6 @@ SOURCE=..\..\Compress\Copy\CopyCoder.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\..\..\C\Alloc.c -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\..\..\C\Alloc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\..\C\Sort.c -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\..\..\C\Sort.h -# End Source File -# Begin Source File - SOURCE=..\..\..\..\C\Threads.c # SUBTRACT CPP /YX /Yc /Yu # End Source File @@ -745,22 +515,6 @@ SOURCE=..\..\..\Windows\Menu.h # End Source File # Begin Source File -SOURCE=..\..\..\Windows\PropVariant.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\..\Windows\PropVariant.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\Windows\PropVariantConversions.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\..\Windows\PropVariantConversions.h -# End Source File -# Begin Source File - SOURCE=..\..\..\Windows\Registry.cpp # End Source File # Begin Source File diff --git a/CPP/7zip/UI/Explorer/FoldersPage/FoldersPage.cpp b/CPP/7zip/UI/Explorer/FoldersPage.cpp index 776813d8..b3470390 100755 --- a/CPP/7zip/UI/Explorer/FoldersPage/FoldersPage.cpp +++ b/CPP/7zip/UI/Explorer/FoldersPage.cpp @@ -2,7 +2,7 @@ #include "StdAfx.h" -#include "resource.h" +#include "FoldersPageRes.h" #include "FoldersPage.h" #include "Common/StringConvert.h" @@ -10,10 +10,10 @@ #include "Windows/Shell.h" #include "Windows/ResourceString.h" -#include "../../../FileManager/HelpUtils.h" -#include "../../Common/ZipRegistry.h" +#include "../Common/ZipRegistry.h" -#include "../../../FileManager/LangUtils.h" +#include "../FileManager/HelpUtils.h" +#include "../FileManager/LangUtils.h" using namespace NWindows; diff --git a/CPP/7zip/UI/Explorer/FoldersPage/FoldersPage.h b/CPP/7zip/UI/Explorer/FoldersPage.h index 97950fc6..be8a362f 100755 --- a/CPP/7zip/UI/Explorer/FoldersPage/FoldersPage.h +++ b/CPP/7zip/UI/Explorer/FoldersPage.h @@ -5,7 +5,7 @@ #include "Windows/Control/PropertyPage.h" -#include "../../Common/ZipRegistry.h" +#include "../Common/ZipRegistry.h" class CFoldersPage : public NWindows::NControl::CPropertyPage { diff --git a/CPP/7zip/UI/Explorer/FoldersPage/resource.rc b/CPP/7zip/UI/Explorer/FoldersPage.rc index 96b2c9d3..cb9694a6 100755 --- a/CPP/7zip/UI/Explorer/FoldersPage/resource.rc +++ b/CPP/7zip/UI/Explorer/FoldersPage.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "FoldersPageRes.h" +#include "../../GuiCommon.rc" #define xSize2 196 #define ySize2 140 diff --git a/CPP/7zip/UI/Explorer/FoldersPage/resource.h b/CPP/7zip/UI/Explorer/FoldersPageRes.h index 3052409b..3052409b 100755 --- a/CPP/7zip/UI/Explorer/FoldersPage/resource.h +++ b/CPP/7zip/UI/Explorer/FoldersPageRes.h diff --git a/CPP/7zip/UI/Explorer/MyMessages.cpp b/CPP/7zip/UI/Explorer/MyMessages.cpp index a29581be..58ab1f85 100755 --- a/CPP/7zip/UI/Explorer/MyMessages.cpp +++ b/CPP/7zip/UI/Explorer/MyMessages.cpp @@ -8,7 +8,7 @@ #include "Windows/ResourceString.h" #ifdef LANG -#include "../../FileManager/LangUtils.h" +#include "../FileManager/LangUtils.h" #endif using namespace NWindows; diff --git a/CPP/7zip/UI/Explorer/OptionsDialog.cpp b/CPP/7zip/UI/Explorer/OptionsDialog.cpp index b7831afd..4b2d3b51 100755 --- a/CPP/7zip/UI/Explorer/OptionsDialog.cpp +++ b/CPP/7zip/UI/Explorer/OptionsDialog.cpp @@ -9,11 +9,11 @@ #include "Common/StringConvert.h" #include "Windows/Control/PropertyPage.h" -#include "../../FileManager/LangUtils.h" -#include "FoldersPage/FoldersPage.h" -#include "FoldersPage/resource.h" -#include "SystemPage/SystemPage.h" -#include "SystemPage/resource.h" +#include "../FileManager/LangUtils.h" +#include "FoldersPage.h" +#include "FoldersPageRes.h" +#include "SystemPage.h" +#include "SystemPageRes.h" using namespace NWindows; diff --git a/CPP/7zip/UI/Explorer/OptionsDialog.h b/CPP/7zip/UI/Explorer/OptionsDialog.h index 7e85d357..affa4329 100755 --- a/CPP/7zip/UI/Explorer/OptionsDialog.h +++ b/CPP/7zip/UI/Explorer/OptionsDialog.h @@ -3,7 +3,7 @@ #ifndef __SEVENZIP_OPTIONSDIALOG_H #define __SEVENZIP_OPTIONSDIALOG_H -#include "../../FileManager/PluginInterface.h" +#include "../FileManager/PluginInterface.h" #include "Common/MyCom.h" // {23170F69-40C1-278D-1000-000100020000} diff --git a/CPP/7zip/UI/Explorer/SystemPage/SystemPage.cpp b/CPP/7zip/UI/Explorer/SystemPage.cpp index cc2f974d..dd60b6d5 100755 --- a/CPP/7zip/UI/Explorer/SystemPage/SystemPage.cpp +++ b/CPP/7zip/UI/Explorer/SystemPage.cpp @@ -1,22 +1,23 @@ // SystemPage.cpp #include "StdAfx.h" + #include "resource.h" -#include "../resource.h" +#include "SystemPageRes.h" +#include "SystemPage.h" #include "Common/StringConvert.h" #include "Windows/Defs.h" #include "Windows/Control/ListView.h" -#include "SystemPage.h" +#include "../Common/ZipRegistry.h" -#include "../../Common/ZipRegistry.h" -#include "../RegistryContextMenu.h" -#include "../ContextMenuFlags.h" +#include "../FileManager/HelpUtils.h" +#include "../FileManager/LangUtils.h" +#include "../FileManager/FormatUtils.h" -#include "../../../FileManager/HelpUtils.h" -#include "../../../FileManager/LangUtils.h" -#include "../../../FileManager/FormatUtils.h" +#include "RegistryContextMenu.h" +#include "ContextMenuFlags.h" using namespace NContextMenuFlags; @@ -32,8 +33,8 @@ static LPCWSTR kSystemTopic = L"fm/plugins/7-zip/options.htm#system"; struct CContextMenuItem { int ControlID; - UINT32 LangID; - UINT32 Flag; + UInt32 LangID; + UInt32 Flag; }; static CContextMenuItem kMenuItems[] = @@ -50,7 +51,7 @@ static CContextMenuItem kMenuItems[] = { IDS_CONTEXT_COMPRESS_TO, 0x0200010F, kCompressTo7z }, { IDS_CONTEXT_COMPRESS_TO_EMAIL, 0x02000113, kCompressTo7zEmail}, { IDS_CONTEXT_COMPRESS_TO, 0x0200010F, kCompressToZip }, - { IDS_CONTEXT_COMPRESS_TO_EMAIL, 0x02000113, kCompressToZipEmail}, + { IDS_CONTEXT_COMPRESS_TO_EMAIL, 0x02000113, kCompressToZipEmail} }; const int kNumMenuItems = sizeof(kMenuItems) / sizeof(kMenuItems[0]); @@ -65,7 +66,7 @@ bool CSystemPage::OnInit() CheckButton(IDC_SYSTEM_CASCADED_MENU, ReadCascadedMenu()); - UINT32 contextMenuFlags; + UInt32 contextMenuFlags; if (!ReadContextMenuStatus(contextMenuFlags)) contextMenuFlags = NContextMenuFlags::GetDefaultFlags(); @@ -76,7 +77,7 @@ bool CSystemPage::OnInit() NRegistryAssociations::CheckContextMenuHandler()); */ - UINT32 newFlags = LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT; + UInt32 newFlags = LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT; m_ListView.SetExtendedListViewStyle(newFlags, newFlags); UString s; // = TEXT("Items"); // LangLoadString(IDS_PROPERTY_EXTENSION, 0x02000205); @@ -154,7 +155,7 @@ LONG CSystemPage::OnApply() } SaveCascadedMenu(IsButtonCheckedBool(IDC_SYSTEM_CASCADED_MENU)); - UINT32 flags = 0; + UInt32 flags = 0; for (int i = 0; i < kNumMenuItems; i++) if (m_ListView.GetCheckState(i)) flags |= kMenuItems[i].Flag; @@ -181,7 +182,7 @@ bool CSystemPage::OnButtonClicked(int buttonID, HWND buttonHWND) } -bool CSystemPage::OnNotify(UINT aControlID, LPNMHDR lParam) +bool CSystemPage::OnNotify(UINT controlID, LPNMHDR lParam) { if (lParam->hwndFrom == HWND(m_ListView)) { @@ -191,7 +192,7 @@ bool CSystemPage::OnNotify(UINT aControlID, LPNMHDR lParam) return OnItemChanged((const NMLISTVIEW *)lParam); } } - return CPropertyPage::OnNotify(aControlID, lParam); + return CPropertyPage::OnNotify(controlID, lParam); } diff --git a/CPP/7zip/UI/Explorer/SystemPage/SystemPage.h b/CPP/7zip/UI/Explorer/SystemPage.h index 75130189..75fdeb2b 100755 --- a/CPP/7zip/UI/Explorer/SystemPage/SystemPage.h +++ b/CPP/7zip/UI/Explorer/SystemPage.h @@ -6,7 +6,7 @@ #include "Windows/Control/PropertyPage.h" #include "Windows/Control/ListView.h" -#include "../../Common/LoadCodecs.h" +#include "../Common/LoadCodecs.h" class CSystemPage: public NWindows::NControl::CPropertyPage { @@ -16,10 +16,10 @@ class CSystemPage: public NWindows::NControl::CPropertyPage public: virtual bool OnInit(); virtual void OnNotifyHelp(); - virtual bool OnNotify(UINT aControlID, LPNMHDR lParam); + virtual bool OnNotify(UINT controlID, LPNMHDR lParam); virtual bool OnItemChanged(const NMLISTVIEW *info); virtual LONG OnApply(); - virtual bool OnButtonClicked(int aButtonID, HWND aButtonHWND); + virtual bool OnButtonClicked(int buttonID, HWND buttonHWND); }; #endif diff --git a/CPP/7zip/UI/Explorer/SystemPage/resource.rc b/CPP/7zip/UI/Explorer/SystemPage.rc index fdfed433..a3b36409 100755 --- a/CPP/7zip/UI/Explorer/SystemPage/resource.rc +++ b/CPP/7zip/UI/Explorer/SystemPage.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "SystemPageRes.h" +#include "../../GuiCommon.rc" #define xSize2 196 #define ySize2 164 diff --git a/CPP/7zip/UI/Explorer/SystemPage/resource.h b/CPP/7zip/UI/Explorer/SystemPageRes.h index b125849c..b125849c 100755 --- a/CPP/7zip/UI/Explorer/SystemPage/resource.h +++ b/CPP/7zip/UI/Explorer/SystemPageRes.h diff --git a/CPP/7zip/UI/Explorer/makefile b/CPP/7zip/UI/Explorer/makefile index f208988b..d2203b2c 100755 --- a/CPP/7zip/UI/Explorer/makefile +++ b/CPP/7zip/UI/Explorer/makefile @@ -1,11 +1,9 @@ PROG = 7-zip.dll DEF_FILE = Explorer.def LIBS = $(LIBS) user32.lib oleaut32.lib advapi32.lib htmlhelp.lib shell32.lib comctl32.lib ole32.lib comdlg32.lib -CFLAGS = $(CFLAGS) -I ../../../ \ +CFLAGS = $(CFLAGS) -I ../../../ -Ob2 \ -DLANG \ - -DNEW_FOLDER_INTERFACE \ -DWIN_LONG_PATH \ - -DEXTERNAL_CODECS \ EXPLORER_OBJS = \ $O\DllExports.obj \ @@ -13,6 +11,8 @@ EXPLORER_OBJS = \ $O\MyMessages.obj \ $O\OptionsDialog.obj \ $O\RegistryContextMenu.obj \ + $O\SystemPage.obj \ + $O\FoldersPage.obj \ COMMON_OBJS = \ $O\IntToString.obj \ @@ -37,8 +37,6 @@ WIN_OBJS = \ $O\FileIO.obj \ $O\FileName.obj \ $O\Menu.obj \ - $O\PropVariant.obj \ - $O\PropVariantConversions.obj \ $O\Registry.obj \ $O\ResourceString.obj \ $O\Shell.obj \ @@ -49,40 +47,11 @@ WIN_CTRL_OBJS = \ $O\Dialog.obj \ $O\PropertyPage.obj \ -7ZIP_COMMON_OBJS = \ - $O\FilePathAutoRename.obj \ - $O\FileStreams.obj \ - $O\StreamUtils.obj \ - UI_COMMON_OBJS = \ - $O\ArchiveExtractCallback.obj \ $O\ArchiveName.obj \ - $O\ArchiveOpenCallback.obj \ $O\CompressCall.obj \ - $O\DefaultName.obj \ - $O\EnumDirItems.obj \ - $O\ExtractingFilePath.obj \ - $O\LoadCodecs.obj \ - $O\OpenArchive.obj \ - $O\PropIDUtils.obj \ - $O\SortUtils.obj \ - $O\UpdateAction.obj \ - $O\UpdateCallback.obj \ - $O\UpdatePair.obj \ - $O\UpdateProduce.obj \ - $O\WorkDir.obj \ $O\ZipRegistry.obj \ -AGENT_OBJS = \ - $O\Agent.obj \ - $O\AgentOut.obj \ - $O\AgentProxy.obj \ - $O\ArchiveFolder.obj \ - $O\ArchiveFolderOpen.obj \ - $O\ArchiveFolderOut.obj \ - $O\UpdateCallbackAgent.obj \ - - FM_COMMON_OBJS = \ $O\FormatUtils.obj \ $O\HelpUtils.obj \ @@ -91,8 +60,6 @@ FM_COMMON_OBJS = \ $O\RegistryUtils.obj \ C_OBJS = \ - $O\Alloc.obj \ - $O\Sort.obj \ $O\Threads.obj \ OBJS = \ @@ -101,14 +68,9 @@ OBJS = \ $(COMMON_OBJS) \ $(WIN_OBJS) \ $(WIN_CTRL_OBJS) \ - $(7ZIP_COMMON_OBJS) \ $(UI_COMMON_OBJS) \ - $(AGENT_OBJS) \ $(FM_COMMON_OBJS)\ $(C_OBJS) \ - $O\SystemPage.obj \ - $O\FoldersPage.obj \ - $O\CopyCoder.obj \ $O\resource.res !include "../../../Build.mak" @@ -121,19 +83,9 @@ $(WIN_OBJS): ../../../Windows/$(*B).cpp $(COMPL) $(WIN_CTRL_OBJS): ../../../Windows/Control/$(*B).cpp $(COMPL) -$(7ZIP_COMMON_OBJS): ../../Common/$(*B).cpp - $(COMPL) $(UI_COMMON_OBJS): ../Common/$(*B).cpp $(COMPL) -$(AGENT_OBJS): ../Agent/$(*B).cpp - $(COMPL) -$(FM_COMMON_OBJS): ../../FileManager/$(*B).cpp - $(COMPL) -$O\SystemPage.obj: SystemPage/$(*B).cpp - $(COMPL) -$O\FoldersPage.obj: FoldersPage/$(*B).cpp - $(COMPL) -$O\CopyCoder.obj: ../../Compress/Copy/$(*B).cpp +$(FM_COMMON_OBJS): ../FileManager/$(*B).cpp $(COMPL) $(C_OBJS): ../../../../C/$(*B).c $(COMPL_O2) diff --git a/CPP/7zip/UI/Explorer/resource.rc b/CPP/7zip/UI/Explorer/resource.rc index bf7601d9..157fa4cc 100755 --- a/CPP/7zip/UI/Explorer/resource.rc +++ b/CPP/7zip/UI/Explorer/resource.rc @@ -33,6 +33,6 @@ BEGIN IDS_CONFIG_DIALOG_CAPTION "7-Zip Options" END -#include "FoldersPage/resource.rc" -#include "SystemPage/resource.rc" +#include "FoldersPage.rc" +#include "SystemPage.rc" diff --git a/CPP/7zip/UI/Far/ExtractEngine.cpp b/CPP/7zip/UI/Far/ExtractEngine.cpp index d9499a04..c6583aae 100755 --- a/CPP/7zip/UI/Far/ExtractEngine.cpp +++ b/CPP/7zip/UI/Far/ExtractEngine.cpp @@ -106,7 +106,7 @@ STDMETHODIMP CExtractCallBackImp::AskOverwrite( return S_OK; } -STDMETHODIMP CExtractCallBackImp::PrepareOperation(const wchar_t *name, INT32 /* askExtractMode */, const UINT64 * /* position */) +STDMETHODIMP CExtractCallBackImp::PrepareOperation(const wchar_t *name, bool /* isFolder */, INT32 /* askExtractMode */, const UINT64 * /* position */) { m_CurrentFilePath = name; return S_OK; diff --git a/CPP/7zip/UI/Far/ExtractEngine.h b/CPP/7zip/UI/Far/ExtractEngine.h index ee17ff55..5cccf6ef 100755 --- a/CPP/7zip/UI/Far/ExtractEngine.h +++ b/CPP/7zip/UI/Far/ExtractEngine.h @@ -28,7 +28,7 @@ public: const wchar_t *existName, const FILETIME *existTime, const UINT64 *existSize, const wchar_t *newName, const FILETIME *newTime, const UINT64 *newSize, INT32 *result); - STDMETHOD (PrepareOperation)(const wchar_t *name, INT32 askExtractMode, const UINT64 *position); + STDMETHOD (PrepareOperation)(const wchar_t *name, bool isFolder, INT32 askExtractMode, const UINT64 *position); STDMETHOD(MessageError)(const wchar_t *message); STDMETHOD(SetOperationResult)(INT32 resultEOperationResult, bool encrypted); diff --git a/CPP/7zip/UI/Far/Far.dsp b/CPP/7zip/UI/Far/Far.dsp index 2cddd717..9856f41f 100755 --- a/CPP/7zip/UI/Far/Far.dsp +++ b/CPP/7zip/UI/Far/Far.dsp @@ -410,6 +410,14 @@ SOURCE=..\Common\OpenArchive.h # End Source File # Begin Source File +SOURCE=..\..\Common\ProgressUtils.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\ProgressUtils.h +# End Source File +# Begin Source File + SOURCE=..\Common\PropIDUtils.cpp # End Source File # Begin Source File diff --git a/CPP/7zip/UI/Far/FarPlugin.h b/CPP/7zip/UI/Far/FarPlugin.h index f61bbcb4..a1c9715b 100755 --- a/CPP/7zip/UI/Far/FarPlugin.h +++ b/CPP/7zip/UI/Far/FarPlugin.h @@ -456,11 +456,12 @@ struct PluginInfo char *CommandPrefix; }; +const int kInfoPanelLineSize = 80; struct InfoPanelLine { - char Text[80]; - char Data[80]; + char Text[kInfoPanelLineSize]; + char Data[kInfoPanelLineSize]; int Separator; }; diff --git a/CPP/7zip/UI/Far/Messages.h b/CPP/7zip/UI/Far/Messages.h index 7a36ab30..9d3060a1 100755 --- a/CPP/7zip/UI/Far/Messages.h +++ b/CPP/7zip/UI/Far/Messages.h @@ -46,6 +46,15 @@ enum EEnum kBlock, kComment, kPosition, + kNumSubFolders, + kNumSubFiles, + kUnpackVer, + kVolume, + kIsVolume, + kOffset, + kLinks, + kNumBlocks, + kNumVolumes, kGetPasswordTitle, kEnterPasswordForFile, diff --git a/CPP/7zip/UI/Far/Plugin.cpp b/CPP/7zip/UI/Far/Plugin.cpp index fde53756..d0957a40 100755 --- a/CPP/7zip/UI/Far/Plugin.cpp +++ b/CPP/7zip/UI/Far/Plugin.cpp @@ -50,7 +50,7 @@ CPlugin::~CPlugin() { } -static void MyGetFileTime(IFolderFolder *anArchiveFolder, UINT32 itemIndex, +static void MyGetFileTime(IFolderFolder *anArchiveFolder, UInt32 itemIndex, PROPID propID, FILETIME &fileTime) { NCOM::CPropVariant propVariant; @@ -69,7 +69,7 @@ static void MyGetFileTime(IFolderFolder *anArchiveFolder, UINT32 itemIndex, } } -void CPlugin::ReadPluginPanelItem(PluginPanelItem &panelItem, UINT32 itemIndex) +void CPlugin::ReadPluginPanelItem(PluginPanelItem &panelItem, UInt32 itemIndex) { NCOM::CPropVariant propVariant; if (_folder->GetProperty(itemIndex, kpidName, &propVariant) != S_OK) @@ -103,13 +103,13 @@ void CPlugin::ReadPluginPanelItem(PluginPanelItem &panelItem, UINT32 itemIndex) if (_folder->GetProperty(itemIndex, kpidSize, &propVariant) != S_OK) throw 271932; - UINT64 length; + UInt64 length; if (propVariant.vt == VT_EMPTY) length = 0; else length = ::ConvertPropVariantToUInt64(propVariant); - panelItem.FindData.nFileSizeLow = UINT32(length); - panelItem.FindData.nFileSizeHigh = UINT32(length >> 32); + panelItem.FindData.nFileSizeLow = (UInt32)length; + panelItem.FindData.nFileSizeHigh = (UInt32)(length >> 32); MyGetFileTime(_folder, itemIndex, kpidCreationTime, panelItem.FindData.ftCreationTime); MyGetFileTime(_folder, itemIndex, kpidLastAccessTime, panelItem.FindData.ftLastAccessTime); @@ -125,8 +125,8 @@ void CPlugin::ReadPluginPanelItem(PluginPanelItem &panelItem, UINT32 itemIndex) length = 0; else length = ::ConvertPropVariantToUInt64(propVariant); - panelItem.PackSize = UINT32(length); - panelItem.PackSizeHigh = UINT32(length >> 32); + panelItem.PackSize = UInt32(length); + panelItem.PackSizeHigh = UInt32(length >> 32); panelItem.Flags = 0; panelItem.NumberOfLinks = 0; @@ -139,8 +139,6 @@ void CPlugin::ReadPluginPanelItem(PluginPanelItem &panelItem, UINT32 itemIndex) panelItem.Reserved[0] = 0; panelItem.Reserved[1] = 0; panelItem.Reserved[2] = 0; - - } int CPlugin::GetFindData(PluginPanelItem **panelItems, @@ -151,22 +149,22 @@ int CPlugin::GetFindData(PluginPanelItem **panelItems, { /* screenRestorer.Save(); - const char *aMsgItems[]= + const char *msgItems[]= { g_StartupInfo.GetMsgString(NMessageID::kWaitTitle), g_StartupInfo.GetMsgString(NMessageID::kReadingList) }; - g_StartupInfo.ShowMessage(0, NULL, aMsgItems, - sizeof(aMsgItems) / sizeof(aMsgItems[0]), 0); + g_StartupInfo.ShowMessage(0, NULL, msgItems, + sizeof(msgItems) / sizeof(msgItems[0]), 0); */ } - UINT32 numItems; + UInt32 numItems; _folder->GetNumberOfItems(&numItems); *panelItems = new PluginPanelItem[numItems]; try { - for(UINT32 i = 0; i < numItems; i++) + for (UInt32 i = 0; i < numItems; i++) { PluginPanelItem &panelItem = (*panelItems)[i]; ReadPluginPanelItem(panelItem, i); @@ -185,8 +183,8 @@ int CPlugin::GetFindData(PluginPanelItem **panelItems, void CPlugin::FreeFindData(struct PluginPanelItem *panelItems, int itemsNumber) { - for(int i = 0; i < itemsNumber; i++) - if(panelItems[i].Description != NULL) + for (int i = 0; i < itemsNumber; i++) + if (panelItems[i].Description != NULL) delete []panelItems[i].Description; delete []panelItems; } @@ -196,7 +194,7 @@ void CPlugin::EnterToDirectory(const UString &aDirName) { CMyComPtr<IFolderFolder> newFolder; _folder->BindToFolder(aDirName, &newFolder); - if(newFolder == NULL) + if (newFolder == NULL) if (aDirName.IsEmpty()) return; else @@ -232,7 +230,7 @@ int CPlugin::SetDirectory(const char *aszDir, int /* opMode */) } UStringVector pathParts; SplitPathToParts(path, pathParts); - for(int i = 0; i < pathParts.Size(); i++) + for (int i = 0; i < pathParts.Size(); i++) EnterToDirectory(pathParts[i]); } GetCurrentDir(); @@ -249,9 +247,10 @@ void CPlugin::GetPathParts(UStringVector &pathParts) folderItem->BindToParentFolder(&newFolder); if (newFolder == NULL) break; - CMyComBSTR name; - folderItem->GetName(&name); - pathParts.Insert(0, (const wchar_t *)name); + NCOM::CPropVariant prop; + if (folderItem->GetFolderProperty(kpidName, &prop) == S_OK) + if (prop.vt == VT_BSTR) + pathParts.Insert(0, (const wchar_t *)prop.bstrVal); folderItem = newFolder; } } @@ -304,16 +303,24 @@ static CPROPIDToName kPROPIDToName[] = { kpidGroup, NMessageID::kGroup }, { kpidBlock, NMessageID::kBlock }, { kpidComment, NMessageID::kComment }, - { kpidPosition, NMessageID::kPosition } - + { kpidPosition, NMessageID::kPosition }, + { kpidNumSubFolders, NMessageID::kNumSubFolders }, + { kpidNumSubFiles, NMessageID::kNumSubFiles }, + { kpidUnpackVer, NMessageID::kUnpackVer }, + { kpidVolume, NMessageID::kVolume }, + { kpidIsVolume, NMessageID::kIsVolume }, + { kpidOffset, NMessageID::kOffset }, + { kpidLinks, NMessageID::kLinks }, + { kpidNumBlocks, NMessageID::kNumBlocks }, + { kpidNumVolumes, NMessageID::kNumVolumes } }; static const int kNumPROPIDToName = sizeof(kPROPIDToName) / sizeof(kPROPIDToName[0]); static int FindPropertyToName(PROPID propID) { - for(int i = 0; i < kNumPROPIDToName; i++) - if(kPROPIDToName[i].PropID == propID) + for (int i = 0; i < kNumPROPIDToName; i++) + if (kPROPIDToName[i].PropID == propID) return i; return -1; } @@ -353,8 +360,8 @@ static const int kNumPropertyIDInfos = sizeof(kPropertyIDInfos) / static int FindPropertyInfo(PROPID propID) { - for(int i = 0; i < kNumPropertyIDInfos; i++) - if(kPropertyIDInfos[i].PropID == propID) + for (int i = 0; i < kNumPropertyIDInfos; i++) + if (kPropertyIDInfos[i].PropID == propID) return i; return -1; } @@ -376,7 +383,7 @@ void CPlugin::AddColumn(PROPID propID) int index = FindPropertyInfo(propID); if (index >= 0) { - for(int i = 0; i < m_ProxyHandler->m_InternalProperties.Size(); i++) + for (int i = 0; i < m_ProxyHandler->m_InternalProperties.Size(); i++) { const CArchiveItemProperty &aHandlerProperty = m_ProxyHandler->m_InternalProperties[i]; if (aHandlerProperty.ID == propID) @@ -385,11 +392,11 @@ void CPlugin::AddColumn(PROPID propID) if (i == m_ProxyHandler->m_InternalProperties.Size()) return; - const CPropertyIDInfo &aPropertyIDInfo = kPropertyIDInfos[index]; - SmartAddToString(PanelModeColumnTypes, aPropertyIDInfo.FarID); - char aTmp[32]; - itoa(aPropertyIDInfo.Width, aTmp, 10); - SmartAddToString(PanelModeColumnWidths, aTmp); + const CPropertyIDInfo &propertyIDInfo = kPropertyIDInfos[index]; + SmartAddToString(PanelModeColumnTypes, propertyIDInfo.FarID); + char tmp[32]; + itoa(propertyIDInfo.Width, tmp, 10); + SmartAddToString(PanelModeColumnWidths, tmp); return; } } @@ -425,7 +432,7 @@ void CPlugin::GetOpenPluginInfo(struct OpenPluginInfo *info) UString(L':') + name + UString(L' '); - if(!m_CurrentDir.IsEmpty()) + if (!m_CurrentDir.IsEmpty()) { // m_PannelTitle += '\\'; m_PannelTitle += m_CurrentDir; @@ -434,44 +441,56 @@ void CPlugin::GetOpenPluginInfo(struct OpenPluginInfo *info) MyStringCopy(m_PannelTitleBuffer, (const char *)UnicodeStringToMultiByte(m_PannelTitle, CP_OEMCP)); info->PanelTitle = m_PannelTitleBuffer; - memset(m_InfoLines,0,sizeof(m_InfoLines)); - MyStringCopy(m_InfoLines[0].Text,""); + memset(m_InfoLines, 0, sizeof(m_InfoLines)); + MyStringCopy(m_InfoLines[0].Text, ""); m_InfoLines[0].Separator = TRUE; MyStringCopy(m_InfoLines[1].Text, g_StartupInfo.GetMsgString(NMessageID::kArchiveType)); MyStringCopy(m_InfoLines[1].Data, (const char *)UnicodeStringToMultiByte(_archiveTypeName, CP_OEMCP)); int numItems = 2; - UINT32 numProps; - if (m_ArchiveHandler->GetNumberOfArchiveProperties(&numProps) == S_OK) + + CMyComPtr<IFolderProperties> folderProperties; + _folder.QueryInterface(IID_IFolderProperties, &folderProperties); + if (folderProperties) { - for (UINT32 i = 0; i < numProps && numItems < 30; i++) + UInt32 numProps; + if (folderProperties->GetNumberOfFolderProperties(&numProps) == S_OK) { - CMyComBSTR name; - PROPID propID; - VARTYPE vt; - if (m_ArchiveHandler->GetArchivePropertyInfo(i, &name, &propID, &vt) != S_OK) - continue; - - InfoPanelLine &item = m_InfoLines[numItems]; - int index = FindPropertyToName(propID); - if (index < 0) + for (UInt32 i = 0; i < numProps && numItems < kNumInfoLinesMax; i++) { - if (name != 0) - MyStringCopy(item.Text, (const char *)UnicodeStringToMultiByte( - (const wchar_t *)name, CP_OEMCP)); + CMyComBSTR name; + PROPID propID; + VARTYPE vt; + if (folderProperties->GetFolderPropertyInfo(i, &name, &propID, &vt) != S_OK) + continue; + + InfoPanelLine &item = m_InfoLines[numItems]; + int index = FindPropertyToName(propID); + AString s; + if (index < 0) + { + if (name != 0) + s = (const char *)UnicodeStringToMultiByte((const wchar_t *)name, CP_OEMCP); + } else - MyStringCopy(item.Text, ""); + s = g_StartupInfo.GetMsgString(kPROPIDToName[index].PluginID); + + if (s.Length() > (kInfoPanelLineSize - 1)) + s = s.Left(kInfoPanelLineSize - 1); + MyStringCopy(item.Text, (const char *)s); + + NCOM::CPropVariant propVariant; + if (_folder->GetFolderProperty(propID, &propVariant) != S_OK) + continue; + s = ConvertPropertyToString2(propVariant, propID); + s.Replace((char)0xA, ' '); + s.Replace((char)0xD, ' '); + if (s.Length() > (kInfoPanelLineSize - 1)) + s = s.Left(kInfoPanelLineSize - 1); + MyStringCopy(item.Data, (const char *)s); + numItems++; } - else - MyStringCopy(item.Text, g_StartupInfo.GetMsgString(kPROPIDToName[index].PluginID)); - - NCOM::CPropVariant propVariant; - if (m_ArchiveHandler->GetArchiveProperty(propID, &propVariant) != S_OK) - continue; - CSysString s = ConvertPropertyToString2(propVariant, propID); - MyStringCopy(item.Data, (const char *)s); - numItems++; } } @@ -539,15 +558,15 @@ HRESULT CPlugin::ShowAttributesWindow() int itemIndex = pluginPanelItem.UserData; CObjectVector<CArchiveItemProperty> properties; - UINT32 numProps; - RINOK(m_ArchiveHandler->GetNumberOfProperties(&numProps)); + UInt32 numProps; + RINOK(_folder->GetNumberOfProperties(&numProps)); int i; for (i = 0; i < (int)numProps; i++) { CMyComBSTR name; PROPID propID; VARTYPE vt; - RINOK(m_ArchiveHandler->GetPropertyInfo(i, &name, &propID, &vt)); + RINOK(_folder->GetPropertyInfo(i, &name, &propID, &vt)); CArchiveItemProperty destProperty; destProperty.Type = vt; destProperty.ID = propID; @@ -556,29 +575,13 @@ HRESULT CPlugin::ShowAttributesWindow() AString propName; { if (name != NULL) - destProperty.Name = UnicodeStringToMultiByte( - (const wchar_t *)name, CP_OEMCP); + destProperty.Name = UnicodeStringToMultiByte((const wchar_t *)name, CP_OEMCP); else - destProperty.Name = "Error"; + destProperty.Name = "?"; } properties.Add(destProperty); } - /* - LPCITEMIDLIST aProperties; - if (index < m_FolderItem->m_DirSubItems.Size()) - { - const CArchiveFolderItem &anItem = m_FolderItem->m_DirSubItems[index]; - aProperties = anItem.m_Properties; - } - else - { - const CArchiveFolderFileItem &anItem = - m_FolderItem->m_FileSubItems[index - m_FolderItem->m_DirSubItems.Size()]; - aProperties = anItem.m_Properties; - } - */ - int size = 2; CRecordVector<CInitDialogItem> initDialogItems; @@ -586,7 +589,7 @@ HRESULT CPlugin::ShowAttributesWindow() CInitDialogItem initDialogItem = { DI_DOUBLEBOX, 3, 1, xSize - 4, size - 2, false, false, 0, false, NMessageID::kProperties, NULL, NULL }; initDialogItems.Add(initDialogItem); - AStringVector aValues; + AStringVector values; for (i = 0; i < properties.Size(); i++) { @@ -605,10 +608,9 @@ HRESULT CPlugin::ShowAttributesWindow() initDialogItems.Add(initDialogItem); NCOM::CPropVariant propVariant; - RINOK(_folder->GetProperty(itemIndex, - property.ID, &propVariant)); - CSysString aString = ConvertPropertyToString2(propVariant, property.ID); - aValues.Add(aString); + RINOK(_folder->GetProperty(itemIndex, property.ID, &propVariant)); + CSysString s = ConvertPropertyToString2(propVariant, property.ID); + values.Add(s); { CInitDialogItem initDialogItem = @@ -617,18 +619,18 @@ HRESULT CPlugin::ShowAttributesWindow() } } - int numLines = aValues.Size(); - for(i = 0; i < numLines; i++) + int numLines = values.Size(); + for (i = 0; i < numLines; i++) { CInitDialogItem &initDialogItem = initDialogItems[1 + i * 2 + 1]; - initDialogItem.DataString = aValues[i]; + initDialogItem.DataString = values[i]; } int numDialogItems = initDialogItems.Size(); CRecordVector<FarDialogItem> dialogItems; dialogItems.Reserve(numDialogItems); - for(i = 0; i < numDialogItems; i++) + for (i = 0; i < numDialogItems; i++) dialogItems.Add(FarDialogItem()); g_StartupInfo.InitDialogItems(&initDialogItems.Front(), &dialogItems.Front(), numDialogItems); @@ -653,17 +655,17 @@ HRESULT CPlugin::ShowAttributesWindow() } size = numLines + 6; xSize = maxLen + kSpace + maxLen2 + 5; - FarDialogItem &aFirstDialogItem = dialogItems.Front(); - aFirstDialogItem.Y2 = size - 2; - aFirstDialogItem.X2 = xSize - 4; + FarDialogItem &firstDialogItem = dialogItems.Front(); + firstDialogItem.Y2 = size - 2; + firstDialogItem.X2 = xSize - 4; /* int askCode = */ g_StartupInfo.ShowDialog(xSize, size, NULL, &dialogItems.Front(), numDialogItems); return S_OK; } -int CPlugin::ProcessKey(int aKey, unsigned int controlState) +int CPlugin::ProcessKey(int key, unsigned int controlState) { - if (controlState == PKF_CONTROL && aKey == 'A') + if (controlState == PKF_CONTROL && key == 'A') { HRESULT result = ShowAttributesWindow(); if (result == S_OK) @@ -672,7 +674,7 @@ int CPlugin::ProcessKey(int aKey, unsigned int controlState) return FALSE; throw "Error"; } - if ((controlState & PKF_ALT) != 0 && aKey == VK_F6) + if ((controlState & PKF_ALT) != 0 && key == VK_F6) { UString folderPath; if (!NFile::NDirectory::GetOnlyDirPrefix(m_FileName, folderPath)) diff --git a/CPP/7zip/UI/Far/Plugin.h b/CPP/7zip/UI/Far/Plugin.h index 736fc7d0..d9b99fa9 100755 --- a/CPP/7zip/UI/Far/Plugin.h +++ b/CPP/7zip/UI/Far/Plugin.h @@ -13,6 +13,8 @@ #include "FarUtils.h" +const UInt32 kNumInfoLinesMax = 30; // Change it; + class CPlugin { NWindows::NCOM::CComInitializer m_ComInitializer; @@ -20,7 +22,7 @@ class CPlugin UString m_PannelTitle; - InfoPanelLine m_InfoLines[30]; // Change it; + InfoPanelLine m_InfoLines[kNumInfoLinesMax]; char m_FileNameBuffer[1024]; char m_CurrentDirBuffer[1024]; diff --git a/CPP/7zip/UI/Far/UpdateCallback100.cpp b/CPP/7zip/UI/Far/UpdateCallback100.cpp index 96699174..ce4fa05e 100755 --- a/CPP/7zip/UI/Far/UpdateCallback100.cpp +++ b/CPP/7zip/UI/Far/UpdateCallback100.cpp @@ -10,6 +10,11 @@ using namespace NFar; +STDMETHODIMP CUpdateCallback100Imp::SetNumFiles(UInt64 /* numFiles */) +{ + return S_OK; +} + STDMETHODIMP CUpdateCallback100Imp::SetTotal(UINT64 aSize) { if (m_ProgressBox != 0) diff --git a/CPP/7zip/UI/Far/UpdateCallback100.h b/CPP/7zip/UI/Far/UpdateCallback100.h index 87c55dc3..f12193e9 100755 --- a/CPP/7zip/UI/Far/UpdateCallback100.h +++ b/CPP/7zip/UI/Far/UpdateCallback100.h @@ -26,6 +26,7 @@ public: STDMETHOD(DeleteOperation)(const wchar_t *aName); STDMETHOD(OperationResult)(INT32 aOperationResult); STDMETHOD(UpdateErrorMessage)(const wchar_t *message); + STDMETHOD(SetNumFiles)(UInt64 numFiles); private: CMyComPtr<IInFolderArchive> m_ArchiveHandler; diff --git a/CPP/7zip/UI/Far/makefile b/CPP/7zip/UI/Far/makefile index 2e22d862..1210e961 100755 --- a/CPP/7zip/UI/Far/makefile +++ b/CPP/7zip/UI/Far/makefile @@ -43,6 +43,7 @@ WIN_OBJS = \ 7ZIP_COMMON_OBJS = \ $O\FilePathAutoRename.obj \ $O\FileStreams.obj \ + $O\ProgressUtils.obj \ $O\StreamUtils.obj \ UI_COMMON_OBJS = \ diff --git a/CPP/7zip/FileManager/7zFM.exe.manifest b/CPP/7zip/UI/FileManager/7zFM.exe.manifest index 06710e04..06710e04 100755 --- a/CPP/7zip/FileManager/7zFM.exe.manifest +++ b/CPP/7zip/UI/FileManager/7zFM.exe.manifest diff --git a/CPP/7zip/FileManager/7zipLogo.ico b/CPP/7zip/UI/FileManager/7zipLogo.ico Binary files differindex 973241c8..973241c8 100755 --- a/CPP/7zip/FileManager/7zipLogo.ico +++ b/CPP/7zip/UI/FileManager/7zipLogo.ico diff --git a/CPP/7zip/FileManager/Resource/AboutDialog/AboutDialog.cpp b/CPP/7zip/UI/FileManager/AboutDialog.cpp index e4dd2313..fcdea7e0 100755 --- a/CPP/7zip/FileManager/Resource/AboutDialog/AboutDialog.cpp +++ b/CPP/7zip/UI/FileManager/AboutDialog.cpp @@ -2,10 +2,10 @@ #include "StdAfx.h" -#include "resource.h" +#include "AboutDialogRes.h" #include "AboutDialog.h" -#include "../../HelpUtils.h" -#include "../../LangUtils.h" +#include "HelpUtils.h" +#include "LangUtils.h" static CIDLangPair kIDLangPairs[] = { diff --git a/CPP/7zip/FileManager/Resource/AboutDialog/AboutDialog.h b/CPP/7zip/UI/FileManager/AboutDialog.h index 278d7c82..c8a4ea9b 100755 --- a/CPP/7zip/FileManager/Resource/AboutDialog/AboutDialog.h +++ b/CPP/7zip/UI/FileManager/AboutDialog.h @@ -3,7 +3,7 @@ #ifndef __ABOUTDIALOG_H #define __ABOUTDIALOG_H -#include "resource.h" +#include "AboutDialogRes.h" #include "Windows/Control/Dialog.h" class CAboutDialog: public NWindows::NControl::CModalDialog diff --git a/CPP/7zip/FileManager/Resource/AboutDialog/resource.rc b/CPP/7zip/UI/FileManager/AboutDialog.rc index b93fdd41..7e2438ff 100755 --- a/CPP/7zip/FileManager/Resource/AboutDialog/resource.rc +++ b/CPP/7zip/UI/FileManager/AboutDialog.rc @@ -1,6 +1,6 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" -#include "../../../MyVersion.h" +#include "AboutDialogRes.h" +#include "../../GuiCommon.rc" +#include "../../MyVersion.h" #define xSize2 224 #define ySize2 158 diff --git a/CPP/7zip/FileManager/Resource/AboutDialog/resource.h b/CPP/7zip/UI/FileManager/AboutDialogRes.h index 54475484..54475484 100755 --- a/CPP/7zip/FileManager/Resource/AboutDialog/resource.h +++ b/CPP/7zip/UI/FileManager/AboutDialogRes.h diff --git a/CPP/7zip/FileManager/Add.bmp b/CPP/7zip/UI/FileManager/Add.bmp Binary files differindex a8577fc7..a8577fc7 100755 --- a/CPP/7zip/FileManager/Add.bmp +++ b/CPP/7zip/UI/FileManager/Add.bmp diff --git a/CPP/7zip/FileManager/Add2.bmp b/CPP/7zip/UI/FileManager/Add2.bmp Binary files differindex 252fc253..252fc253 100755 --- a/CPP/7zip/FileManager/Add2.bmp +++ b/CPP/7zip/UI/FileManager/Add2.bmp diff --git a/CPP/7zip/FileManager/App.cpp b/CPP/7zip/UI/FileManager/App.cpp index 28e2ff0f..0f88ce47 100755 --- a/CPP/7zip/FileManager/App.cpp +++ b/CPP/7zip/UI/FileManager/App.cpp @@ -13,7 +13,7 @@ #include "App.h" -#include "Resource/CopyDialog/CopyDialog.h" +#include "CopyDialog.h" #include "ExtractCallback.h" #include "ViewSettings.h" diff --git a/CPP/7zip/FileManager/App.h b/CPP/7zip/UI/FileManager/App.h index faa40afe..faa40afe 100755 --- a/CPP/7zip/FileManager/App.h +++ b/CPP/7zip/UI/FileManager/App.h diff --git a/CPP/7zip/FileManager/AppState.h b/CPP/7zip/UI/FileManager/AppState.h index 318c0258..318c0258 100755 --- a/CPP/7zip/FileManager/AppState.h +++ b/CPP/7zip/UI/FileManager/AppState.h diff --git a/CPP/7zip/FileManager/ClassDefs.cpp b/CPP/7zip/UI/FileManager/ClassDefs.cpp index ded9c8d8..0b4c9093 100755 --- a/CPP/7zip/FileManager/ClassDefs.cpp +++ b/CPP/7zip/UI/FileManager/ClassDefs.cpp @@ -5,10 +5,12 @@ #include <initguid.h> #include "IFolder.h" -#include "../IPassword.h" +#include "../../IPassword.h" #include "PluginInterface.h" #include "ExtractCallback.h" -#include "../ICoder.h" +#include "../../ICoder.h" + +#include "../Agent/Agent.h" // {23170F69-40C1-278A-1000-000100020000} DEFINE_GUID(CLSID_CZipContextMenu, diff --git a/CPP/7zip/FileManager/Resource/ComboDialog/ComboDialog.cpp b/CPP/7zip/UI/FileManager/ComboDialog.cpp index 2dc42ee0..83c142ff 100755 --- a/CPP/7zip/FileManager/Resource/ComboDialog/ComboDialog.cpp +++ b/CPP/7zip/UI/FileManager/ComboDialog.cpp @@ -6,7 +6,7 @@ #include "Windows/Control/Static.h" #ifdef LANG -#include "../../LangUtils.h" +#include "LangUtils.h" #endif using namespace NWindows; diff --git a/CPP/7zip/FileManager/Resource/ComboDialog/ComboDialog.h b/CPP/7zip/UI/FileManager/ComboDialog.h index 1838783d..0a1addc5 100755 --- a/CPP/7zip/FileManager/Resource/ComboDialog/ComboDialog.h +++ b/CPP/7zip/UI/FileManager/ComboDialog.h @@ -5,7 +5,7 @@ #include "Windows/Control/Dialog.h" #include "Windows/Control/ComboBox.h" -#include "resource.h" +#include "ComboDialogRes.h" class CComboDialog: public NWindows::NControl::CModalDialog { diff --git a/CPP/7zip/FileManager/Resource/ComboDialog/resource.rc b/CPP/7zip/UI/FileManager/ComboDialog.rc index 7bf25365..7005e09e 100755 --- a/CPP/7zip/FileManager/Resource/ComboDialog/resource.rc +++ b/CPP/7zip/UI/FileManager/ComboDialog.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "ComboDialogRes.h" +#include "../../GuiCommon.rc" #define xSize2 233 #define ySize2 57 diff --git a/CPP/7zip/FileManager/Resource/ComboDialog/resource.h b/CPP/7zip/UI/FileManager/ComboDialogRes.h index b5111ddf..b5111ddf 100755 --- a/CPP/7zip/FileManager/Resource/ComboDialog/resource.h +++ b/CPP/7zip/UI/FileManager/ComboDialogRes.h diff --git a/CPP/7zip/FileManager/Copy.bmp b/CPP/7zip/UI/FileManager/Copy.bmp Binary files differindex 0f28a324..0f28a324 100755 --- a/CPP/7zip/FileManager/Copy.bmp +++ b/CPP/7zip/UI/FileManager/Copy.bmp diff --git a/CPP/7zip/FileManager/Copy2.bmp b/CPP/7zip/UI/FileManager/Copy2.bmp Binary files differindex ba88ded0..ba88ded0 100755 --- a/CPP/7zip/FileManager/Copy2.bmp +++ b/CPP/7zip/UI/FileManager/Copy2.bmp diff --git a/CPP/7zip/FileManager/Resource/CopyDialog/CopyDialog.cpp b/CPP/7zip/UI/FileManager/CopyDialog.cpp index c0bcf2bc..77b62ec0 100755 --- a/CPP/7zip/FileManager/Resource/CopyDialog/CopyDialog.cpp +++ b/CPP/7zip/UI/FileManager/CopyDialog.cpp @@ -10,7 +10,7 @@ #include "Windows/FileName.h" #ifdef LANG -#include "../../LangUtils.h" +#include "LangUtils.h" #endif using namespace NWindows; diff --git a/CPP/7zip/FileManager/Resource/CopyDialog/CopyDialog.h b/CPP/7zip/UI/FileManager/CopyDialog.h index 353f6807..ed894bf8 100755 --- a/CPP/7zip/FileManager/Resource/CopyDialog/CopyDialog.h +++ b/CPP/7zip/UI/FileManager/CopyDialog.h @@ -5,7 +5,7 @@ #include "Windows/Control/Dialog.h" #include "Windows/Control/ComboBox.h" -#include "resource.h" +#include "CopyDialogRes.h" class CCopyDialog: public NWindows::NControl::CModalDialog { diff --git a/CPP/7zip/FileManager/Resource/CopyDialog/resource.rc b/CPP/7zip/UI/FileManager/CopyDialog.rc index 156b56cf..bf3aebde 100755 --- a/CPP/7zip/FileManager/Resource/CopyDialog/resource.rc +++ b/CPP/7zip/UI/FileManager/CopyDialog.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "CopyDialogRes.h" +#include "../../GuiCommon.rc" #define xSize2 346 #define ySize2 57 diff --git a/CPP/7zip/FileManager/Resource/CopyDialog/resource.h b/CPP/7zip/UI/FileManager/CopyDialogRes.h index 7ec6162a..7ec6162a 100755 --- a/CPP/7zip/FileManager/Resource/CopyDialog/resource.h +++ b/CPP/7zip/UI/FileManager/CopyDialogRes.h diff --git a/CPP/7zip/FileManager/Delete.bmp b/CPP/7zip/UI/FileManager/Delete.bmp Binary files differindex d1004d82..d1004d82 100755 --- a/CPP/7zip/FileManager/Delete.bmp +++ b/CPP/7zip/UI/FileManager/Delete.bmp diff --git a/CPP/7zip/FileManager/Delete2.bmp b/CPP/7zip/UI/FileManager/Delete2.bmp Binary files differindex 60e08c6a..60e08c6a 100755 --- a/CPP/7zip/FileManager/Delete2.bmp +++ b/CPP/7zip/UI/FileManager/Delete2.bmp diff --git a/CPP/7zip/FileManager/Resource/EditPage/EditPage.cpp b/CPP/7zip/UI/FileManager/EditPage.cpp index 0e6e1d71..06bde407 100755 --- a/CPP/7zip/FileManager/Resource/EditPage/EditPage.cpp +++ b/CPP/7zip/UI/FileManager/EditPage.cpp @@ -1,7 +1,7 @@ // EditPage.cpp #include "StdAfx.h" -#include "resource.h" +#include "EditPageRes.h" #include "EditPage.h" #include "Common/StringConvert.h" @@ -11,10 +11,10 @@ // #include "Windows/FileFind.h" // #include "Windows/FileDir.h" -#include "../../RegistryUtils.h" -#include "../../HelpUtils.h" -#include "../../LangUtils.h" -#include "../../ProgramLocation.h" +#include "RegistryUtils.h" +#include "HelpUtils.h" +#include "LangUtils.h" +#include "ProgramLocation.h" using namespace NWindows; diff --git a/CPP/7zip/FileManager/Resource/EditPage/EditPage.h b/CPP/7zip/UI/FileManager/EditPage.h index 26999dcf..26999dcf 100755 --- a/CPP/7zip/FileManager/Resource/EditPage/EditPage.h +++ b/CPP/7zip/UI/FileManager/EditPage.h diff --git a/CPP/7zip/FileManager/Resource/EditPage/resource.rc b/CPP/7zip/UI/FileManager/EditPage.rc index d4d8b9cd..ea261286 100755 --- a/CPP/7zip/FileManager/Resource/EditPage/resource.rc +++ b/CPP/7zip/UI/FileManager/EditPage.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "EditPageRes.h" +#include "../../GuiCommon.rc" #define xSize2 196 #define ySize2 140 diff --git a/CPP/7zip/FileManager/Resource/EditPage/resource.h b/CPP/7zip/UI/FileManager/EditPageRes.h index a2de1970..a2de1970 100755 --- a/CPP/7zip/FileManager/Resource/EditPage/resource.h +++ b/CPP/7zip/UI/FileManager/EditPageRes.h diff --git a/CPP/7zip/FileManager/EnumFormatEtc.cpp b/CPP/7zip/UI/FileManager/EnumFormatEtc.cpp index ef9463fb..ef9463fb 100755 --- a/CPP/7zip/FileManager/EnumFormatEtc.cpp +++ b/CPP/7zip/UI/FileManager/EnumFormatEtc.cpp diff --git a/CPP/7zip/FileManager/EnumFormatEtc.h b/CPP/7zip/UI/FileManager/EnumFormatEtc.h index 6c476f1a..6c476f1a 100755 --- a/CPP/7zip/FileManager/EnumFormatEtc.h +++ b/CPP/7zip/UI/FileManager/EnumFormatEtc.h diff --git a/CPP/7zip/FileManager/Extract.bmp b/CPP/7zip/UI/FileManager/Extract.bmp Binary files differindex 0aeba923..0aeba923 100755 --- a/CPP/7zip/FileManager/Extract.bmp +++ b/CPP/7zip/UI/FileManager/Extract.bmp diff --git a/CPP/7zip/FileManager/Extract2.bmp b/CPP/7zip/UI/FileManager/Extract2.bmp Binary files differindex a7e57753..a7e57753 100755 --- a/CPP/7zip/FileManager/Extract2.bmp +++ b/CPP/7zip/UI/FileManager/Extract2.bmp diff --git a/CPP/7zip/FileManager/ExtractCallback.cpp b/CPP/7zip/UI/FileManager/ExtractCallback.cpp index d6ea8f8f..8b27b217 100755 --- a/CPP/7zip/FileManager/ExtractCallback.cpp +++ b/CPP/7zip/UI/FileManager/ExtractCallback.cpp @@ -8,20 +8,20 @@ #include "Windows/FileDir.h" #include "Windows/Error.h" -#include "Resource/OverwriteDialog/OverwriteDialog.h" +#include "OverwriteDialog.h" #ifndef _NO_CRYPTO -#include "Resource/PasswordDialog/PasswordDialog.h" +#include "PasswordDialog.h" #endif -#include "Resource/MessagesDialog/MessagesDialog.h" -#include "../UI/Resource/Extract/resource.h" -#include "../UI/GUI/resource.h" +#include "MessagesDialog.h" +#include "../GUI/ExtractRes.h" +#include "../GUI/resource.h" #include "Common/Wildcard.h" #include "Common/StringConvert.h" #include "FormatUtils.h" -#include "../Common/FilePathAutoRename.h" +#include "../../Common/FilePathAutoRename.h" using namespace NWindows; using namespace NFile; @@ -41,6 +41,10 @@ void CExtractCallbackImp::Init() { Messages.Clear(); NumArchiveErrors = 0; + #ifndef _SFX + NumFolders = NumFiles = 0; + NeedAddFile = false; + #endif } void CExtractCallbackImp::AddErrorMessage(LPCWSTR message) @@ -48,13 +52,25 @@ void CExtractCallbackImp::AddErrorMessage(LPCWSTR message) Messages.Add(message); } +STDMETHODIMP CExtractCallbackImp::SetNumFiles(UInt64 + #ifndef _SFX + numFiles + #endif + ) +{ + #ifndef _SFX + ProgressDialog.ProgressSynch.SetNumFilesTotal(numFiles); + #endif + return S_OK; +} + STDMETHODIMP CExtractCallbackImp::SetTotal(UInt64 total) { ProgressDialog.ProgressSynch.SetProgress(total, 0); return S_OK; } -STDMETHODIMP CExtractCallbackImp::SetCompleted(const UInt64 *completeValue) +STDMETHODIMP CExtractCallbackImp::SetCompleted(const UInt64 *value) { for (;;) { @@ -64,10 +80,33 @@ STDMETHODIMP CExtractCallbackImp::SetCompleted(const UInt64 *completeValue) break; ::Sleep(100); } - if (completeValue != NULL) - ProgressDialog.ProgressSynch.SetPos(*completeValue); + if (value != NULL) + ProgressDialog.ProgressSynch.SetPos(*value); + return S_OK; +} + +#ifndef _SFX +STDMETHODIMP CExtractCallbackImp::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize) +{ + ProgressDialog.ProgressSynch.SetRatioInfo(inSize, outSize); return S_OK; } +#endif + +/* +STDMETHODIMP CExtractCallbackImp::SetTotalFiles(UInt64 total) +{ + ProgressDialog.ProgressSynch.SetNumFilesTotal(total); + return S_OK; +} + +STDMETHODIMP CExtractCallbackImp::SetCompletedFiles(const UInt64 *value) +{ + if (value != NULL) + ProgressDialog.ProgressSynch.SetNumFilesCur(*value); + return S_OK; +} +*/ STDMETHODIMP CExtractCallbackImp::AskOverwrite( const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize, @@ -129,9 +168,10 @@ STDMETHODIMP CExtractCallbackImp::AskOverwrite( } -STDMETHODIMP CExtractCallbackImp::PrepareOperation(const wchar_t *name, Int32 /* askExtractMode */, const UInt64 * /* position */) +STDMETHODIMP CExtractCallbackImp::PrepareOperation(const wchar_t *name, bool isFolder, Int32 /* askExtractMode */, const UInt64 * /* position */) { - return SetCurrentFilePath(name); + _isFolder = isFolder; + return SetCurrentFilePath2(name); } STDMETHODIMP CExtractCallbackImp::MessageError(const wchar_t *message) @@ -190,6 +230,13 @@ STDMETHODIMP CExtractCallbackImp::SetOperationResult(Int32 operationResult, bool _currentFilePath)); } } + #ifndef _SFX + if (_isFolder) + NumFolders++; + else + NumFiles++; + ProgressDialog.ProgressSynch.SetNumFilesCur(NumFiles); + #endif return S_OK; } @@ -205,7 +252,7 @@ HRESULT CExtractCallbackImp::BeforeOpen(const wchar_t *name) return S_OK; } -HRESULT CExtractCallbackImp::SetCurrentFilePath(const wchar_t *path) +HRESULT CExtractCallbackImp::SetCurrentFilePath2(const wchar_t *path) { _currentFilePath = path; #ifndef _SFX @@ -214,6 +261,17 @@ HRESULT CExtractCallbackImp::SetCurrentFilePath(const wchar_t *path) return S_OK; } +HRESULT CExtractCallbackImp::SetCurrentFilePath(const wchar_t *path) +{ + #ifndef _SFX + if (NeedAddFile) + NumFiles++; + NeedAddFile = true; + ProgressDialog.ProgressSynch.SetNumFilesCur(NumFiles); + #endif + return SetCurrentFilePath2(path); +} + HRESULT CExtractCallbackImp::OpenResult(const wchar_t *name, HRESULT result, bool encrypted) { if (result != S_OK) diff --git a/CPP/7zip/FileManager/ExtractCallback.h b/CPP/7zip/UI/FileManager/ExtractCallback.h index 5cf8d635..13117871 100755 --- a/CPP/7zip/FileManager/ExtractCallback.h +++ b/CPP/7zip/UI/FileManager/ExtractCallback.h @@ -3,13 +3,13 @@ #ifndef __EXTRACTCALLBACK_H #define __EXTRACTCALLBACK_H -#include "../UI/Agent/IFolderArchive.h" +#include "../Agent/IFolderArchive.h" #include "Common/MyString.h" #ifdef _SFX -#include "Resource/ProgressDialog/ProgressDialog.h" +#include "ProgressDialog.h" #else -#include "Resource/ProgressDialog2/ProgressDialog.h" +#include "ProgressDialog2.h" #endif #include "Windows/ResourceString.h" @@ -19,7 +19,7 @@ #endif #ifndef _NO_CRYPTO -#include "../IPassword.h" +#include "../../IPassword.h" #endif #include "Common/MyCom.h" #include "IFolder.h" @@ -27,28 +27,43 @@ class CExtractCallbackImp: public IExtractCallbackUI, public IFolderOperationsExtractCallback, + // public IFolderArchiveExtractCallback, // mkultiple from IProgress + #ifndef _SFX + public ICompressProgressInfo, + #endif #ifndef _NO_CRYPTO public ICryptoGetTextPassword, #endif public CMyUnknownImp { public: - MY_UNKNOWN_IMP3( - IFolderArchiveExtractCallback, - IFolderOperationsExtractCallback, - ICryptoGetTextPassword - ) + MY_QUERYINTERFACE_BEGIN2(IFolderOperationsExtractCallback) + MY_QUERYINTERFACE_ENTRY(IFolderArchiveExtractCallback) + #ifndef _SFX + MY_QUERYINTERFACE_ENTRY(ICompressProgressInfo) + #endif + #ifndef _NO_CRYPTO + MY_QUERYINTERFACE_ENTRY(ICryptoGetTextPassword) + #endif + MY_QUERYINTERFACE_END + MY_ADDREF_RELEASE // IProgress STDMETHOD(SetTotal)(UInt64 total); - STDMETHOD(SetCompleted)(const UInt64 *completeValue); + STDMETHOD(SetCompleted)(const UInt64 *value); + + #ifndef _SFX + STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize); + #endif // IFolderArchiveExtractCallback + // STDMETHOD(SetTotalFiles)(UInt64 total); + // STDMETHOD(SetCompletedFiles)(const UInt64 *value); STDMETHOD(AskOverwrite)( const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize, const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize, Int32 *answer); - STDMETHOD (PrepareOperation)(const wchar_t *name, Int32 askExtractMode, const UInt64 *position); + STDMETHOD (PrepareOperation)(const wchar_t *name, bool isFolder, Int32 askExtractMode, const UInt64 *position); STDMETHOD(MessageError)(const wchar_t *message); STDMETHOD(SetOperationResult)(Int32 operationResult, bool encrypted); @@ -75,6 +90,7 @@ public: Int32 *writeAnswer); STDMETHOD(ShowMessage)(const wchar_t *message); STDMETHOD(SetCurrentFilePath)(const wchar_t *filePath); + STDMETHOD(SetNumFiles)(UInt64 numFiles); // ICryptoGetTextPassword #ifndef _NO_CRYPTO @@ -87,14 +103,21 @@ private: bool _needWriteArchivePath; UString _currentFilePath; + bool _isFolder; // void CreateComplexDirectory(const UStringVector &aDirPathParts); + HRESULT SetCurrentFilePath2(const wchar_t *filePath); void AddErrorMessage(LPCWSTR message); public: CProgressDialog ProgressDialog; UStringVector Messages; bool ShowMessages; + #ifndef _SFX + UInt64 NumFolders; + UInt64 NumFiles; + bool NeedAddFile; + #endif HWND ParentWindow; INT_PTR StartProgressDialog(const UString &title) { diff --git a/CPP/7zip/FileManager/FM.cpp b/CPP/7zip/UI/FileManager/FM.cpp index 17670423..b9a51193 100755 --- a/CPP/7zip/FileManager/FM.cpp +++ b/CPP/7zip/UI/FileManager/FM.cpp @@ -7,7 +7,7 @@ extern "C" { - #include "../../../C/Alloc.h" + #include "../../../../C/Alloc.h" } #include "Common/Defs.h" @@ -22,7 +22,7 @@ extern "C" #include "Windows/MemoryLock.h" #include "ViewSettings.h" -#include "../UI/Resource/Extract/resource.h" +#include "../GUI/ExtractRes.h" #include "App.h" #include "StringUtils.h" @@ -388,6 +388,8 @@ static const CSwitchForm kSwitchForms[kNumSwitches] = }; */ +// int APIENTRY WinMain2(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, LPSTR /* lpCmdLine */, int /* nCmdShow */); + int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, LPSTR /* lpCmdLine */, int nCmdShow) { #ifndef _UNICODE @@ -419,6 +421,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, LPSTR /* if (!paramString.IsEmpty()) { g_MainPath = paramString; + // return WinMain2(hInstance, hPrevInstance, lpCmdLine, nCmdShow); + // MessageBoxW(0, paramString, L"", 0); } /* diff --git a/CPP/7zip/FileManager/FM.dsp b/CPP/7zip/UI/FileManager/FM.dsp index e39ce3af..1ba0bcf1 100755 --- a/CPP/7zip/FileManager/FM.dsp +++ b/CPP/7zip/UI/FileManager/FM.dsp @@ -45,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\\" /D "NDEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "LANG" /D "WIN_LONG_PATH" /Yu"StdAfx.h" /FD /c +# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "LANG" /D "WIN_LONG_PATH" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" @@ -72,7 +72,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /Gz /MDd /W3 /Gm /GX /ZI /Od /I "..\..\\" /D "_DEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "LANG" /D "WIN_LONG_PATH" /Yu"StdAfx.h" /FD /GZ /c +# ADD CPP /nologo /Gz /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "LANG" /D "WIN_LONG_PATH" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" @@ -99,7 +99,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"StdAfx.h" /FD /c -# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "LANG" /D "WIN_LONG_PATH" /Yu"StdAfx.h" /FD /c +# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "LANG" /D "WIN_LONG_PATH" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" @@ -109,7 +109,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib Mpr.lib htmlhelp.lib Urlmon.lib /nologo /subsystem:windows /machine:I386 /out:"C:\Program Files\7-ZIP\7zFMn.exe" /opt:NOWIN98 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib Mpr.lib htmlhelp.lib Urlmon.lib /nologo /subsystem:windows /machine:I386 /out:"C:\Program Files\7-ZIP\7zFM.exe" /opt:NOWIN98 # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "FM - Win32 DebugU" @@ -127,7 +127,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"StdAfx.h" /FD /GZ /c -# ADD CPP /nologo /Gz /MDd /W3 /Gm /GX /ZI /Od /I "..\..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "LANG" /D "WIN_LONG_PATH" /Yu"StdAfx.h" /FD /GZ /c +# ADD CPP /nologo /Gz /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "LANG" /D "WIN_LONG_PATH" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" @@ -137,7 +137,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib Mpr.lib htmlhelp.lib Urlmon.lib /nologo /subsystem:windows /debug /machine:I386 /out:"C:\Program Files\7-ZIP\7zFMn.exe" /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib Mpr.lib htmlhelp.lib Urlmon.lib /nologo /subsystem:windows /debug /machine:I386 /out:"C:\Program Files\7-ZIP\7zFM.exe" /pdbtype:sept !ENDIF @@ -152,7 +152,7 @@ LINK32=link.exe # PROP Default_Filter "" # Begin Source File -SOURCE=.\Resource\AboutDialog\7zipLogo.ico +SOURCE=.\7zipLogo.ico # End Source File # Begin Source File @@ -215,11 +215,7 @@ SOURCE=.\Test.bmp # PROP Default_Filter "" # Begin Source File -SOURCE=..\Archive\IArchive.h -# End Source File -# Begin Source File - -SOURCE=..\UI\Agent\IFolderArchive.h +SOURCE=..\..\Archive\IArchive.h # End Source File # End Group # Begin Group "Folders" @@ -413,44 +409,44 @@ SOURCE=.\PanelSplitFile.cpp # PROP Default_Filter "" # Begin Source File -SOURCE=.\Resource\SettingsPage\SettingsPage.cpp +SOURCE=.\SettingsPage.cpp # End Source File # Begin Source File -SOURCE=.\Resource\SettingsPage\SettingsPage.h +SOURCE=.\SettingsPage.h # End Source File # End Group # Begin Source File -SOURCE=.\Resource\EditPage\EditPage.cpp +SOURCE=.\EditPage.cpp # End Source File # Begin Source File -SOURCE=.\Resource\EditPage\EditPage.h +SOURCE=.\EditPage.h # End Source File # Begin Source File -SOURCE=.\Resource\LangPage\LangPage.cpp +SOURCE=.\LangPage.cpp # End Source File # Begin Source File -SOURCE=.\Resource\LangPage\LangPage.h +SOURCE=.\LangPage.h # End Source File # Begin Source File -SOURCE=.\Resource\PluginsPage\PluginsPage.cpp +SOURCE=.\PluginsPage.cpp # End Source File # Begin Source File -SOURCE=.\Resource\PluginsPage\PluginsPage.h +SOURCE=.\PluginsPage.h # End Source File # Begin Source File -SOURCE=.\Resource\SystemPage\SystemPage.cpp +SOURCE=.\SystemPage.cpp # End Source File # Begin Source File -SOURCE=.\Resource\SystemPage\SystemPage.h +SOURCE=.\SystemPage.h # End Source File # End Group # Begin Group "Password" @@ -458,11 +454,11 @@ SOURCE=.\Resource\SystemPage\SystemPage.h # PROP Default_Filter "" # Begin Source File -SOURCE=Resource\PasswordDialog\PasswordDialog.cpp +SOURCE=.\PasswordDialog.cpp # End Source File # Begin Source File -SOURCE=Resource\PasswordDialog\PasswordDialog.h +SOURCE=.\PasswordDialog.h # End Source File # End Group # Begin Group "Progress" @@ -470,11 +466,11 @@ SOURCE=Resource\PasswordDialog\PasswordDialog.h # PROP Default_Filter "" # Begin Source File -SOURCE=.\Resource\ProgressDialog2\ProgressDialog.cpp +SOURCE=.\ProgressDialog2.cpp # End Source File # Begin Source File -SOURCE=.\Resource\ProgressDialog2\ProgressDialog.h +SOURCE=.\ProgressDialog2.h # End Source File # End Group # Begin Group "About" @@ -482,11 +478,11 @@ SOURCE=.\Resource\ProgressDialog2\ProgressDialog.h # PROP Default_Filter "" # Begin Source File -SOURCE=.\Resource\AboutDialog\AboutDialog.cpp +SOURCE=.\AboutDialog.cpp # End Source File # Begin Source File -SOURCE=.\Resource\AboutDialog\AboutDialog.h +SOURCE=.\AboutDialog.h # End Source File # End Group # Begin Group "Split" @@ -494,52 +490,52 @@ SOURCE=.\Resource\AboutDialog\AboutDialog.h # PROP Default_Filter "" # Begin Source File -SOURCE=.\Resource\SplitDialog\SplitDialog.cpp +SOURCE=.\SplitDialog.cpp # End Source File # Begin Source File -SOURCE=.\Resource\SplitDialog\SplitDialog.h +SOURCE=.\SplitDialog.h # End Source File # End Group # Begin Source File -SOURCE=.\Resource\ComboDialog\ComboDialog.cpp +SOURCE=.\ComboDialog.cpp # End Source File # Begin Source File -SOURCE=.\Resource\ComboDialog\ComboDialog.h +SOURCE=.\ComboDialog.h # End Source File # Begin Source File -SOURCE=.\Resource\CopyDialog\CopyDialog.cpp +SOURCE=CopyDialog.cpp # End Source File # Begin Source File -SOURCE=.\Resource\CopyDialog\CopyDialog.h +SOURCE=CopyDialog.h # End Source File # Begin Source File -SOURCE=.\Resource\ListViewDialog\ListViewDialog.cpp +SOURCE=.\ListViewDialog.cpp # End Source File # Begin Source File -SOURCE=.\Resource\ListViewDialog\ListViewDialog.h +SOURCE=.\ListViewDialog.h # End Source File # Begin Source File -SOURCE=Resource\MessagesDialog\MessagesDialog.cpp +SOURCE=MessagesDialog.cpp # End Source File # Begin Source File -SOURCE=Resource\MessagesDialog\MessagesDialog.h +SOURCE=MessagesDialog.h # End Source File # Begin Source File -SOURCE=Resource\OverwriteDialog\OverwriteDialog.cpp +SOURCE=OverwriteDialog.cpp # End Source File # Begin Source File -SOURCE=Resource\OverwriteDialog\OverwriteDialog.h +SOURCE=OverwriteDialog.h # End Source File # End Group # Begin Group "FM Common" @@ -594,60 +590,48 @@ SOURCE=.\UpdateCallback100.cpp SOURCE=.\UpdateCallback100.h # End Source File # End Group -# Begin Group "UI Common" +# Begin Group "7-Zip Common" # PROP Default_Filter "" # Begin Source File -SOURCE=..\UI\Common\ArchiveName.cpp -# End Source File -# Begin Source File - -SOURCE=..\UI\Common\ArchiveName.h -# End Source File -# Begin Source File - -SOURCE=..\UI\Common\CompressCall.cpp +SOURCE=..\..\Common\FilePathAutoRename.cpp # End Source File # Begin Source File -SOURCE=..\UI\Common\CompressCall.h +SOURCE=..\..\Common\FilePathAutoRename.h # End Source File # Begin Source File -SOURCE=..\UI\Common\PropIDUtils.cpp +SOURCE=..\..\Common\FileStreams.cpp # End Source File # Begin Source File -SOURCE=..\UI\Common\PropIDUtils.h +SOURCE=..\..\Common\FileStreams.h # End Source File -# End Group -# Begin Group "7-Zip Common" - -# PROP Default_Filter "" # Begin Source File -SOURCE=..\Common\FilePathAutoRename.cpp +SOURCE=..\..\Common\ProgressUtils.cpp # End Source File # Begin Source File -SOURCE=..\Common\FilePathAutoRename.h +SOURCE=..\..\Common\ProgressUtils.h # End Source File # Begin Source File -SOURCE=..\Common\FileStreams.cpp +SOURCE=..\..\Common\StreamObjects.cpp # End Source File # Begin Source File -SOURCE=..\Common\FileStreams.h +SOURCE=..\..\Common\StreamObjects.h # End Source File # Begin Source File -SOURCE=..\Common\StreamObjects.cpp +SOURCE=..\..\Common\StreamUtils.cpp # End Source File # Begin Source File -SOURCE=..\Common\StreamObjects.h +SOURCE=..\..\Common\StreamUtils.h # End Source File # End Group # Begin Group "C" @@ -655,39 +639,39 @@ SOURCE=..\Common\StreamObjects.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\..\C\7zCrc.c +SOURCE=..\..\..\..\C\7zCrc.c # SUBTRACT CPP /YX /Yc /Yu # End Source File # Begin Source File -SOURCE=..\..\..\C\7zCrc.h +SOURCE=..\..\..\..\C\7zCrc.h # End Source File # Begin Source File -SOURCE=..\..\..\C\Alloc.c +SOURCE=..\..\..\..\C\Alloc.c # SUBTRACT CPP /YX /Yc /Yu # End Source File # Begin Source File -SOURCE=..\..\..\C\Alloc.h +SOURCE=..\..\..\..\C\Alloc.h # End Source File # Begin Source File -SOURCE=..\..\..\C\Sort.c +SOURCE=..\..\..\..\C\Sort.c # SUBTRACT CPP /YX /Yc /Yu # End Source File # Begin Source File -SOURCE=..\..\..\C\Sort.h +SOURCE=..\..\..\..\C\Sort.h # End Source File # Begin Source File -SOURCE=..\..\..\C\Threads.c +SOURCE=..\..\..\..\C\Threads.c # SUBTRACT CPP /YX /Yc /Yu # End Source File # Begin Source File -SOURCE=..\..\..\C\Threads.h +SOURCE=..\..\..\..\C\Threads.h # End Source File # End Group # Begin Group "Windows" @@ -698,276 +682,276 @@ SOURCE=..\..\..\C\Threads.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\Windows\Control\ComboBox.cpp +SOURCE=..\..\..\Windows\Control\ComboBox.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\ComboBox.h +SOURCE=..\..\..\Windows\Control\ComboBox.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\CommandBar.h +SOURCE=..\..\..\Windows\Control\CommandBar.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\Dialog.cpp +SOURCE=..\..\..\Windows\Control\Dialog.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\Dialog.h +SOURCE=..\..\..\Windows\Control\Dialog.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\Edit.h +SOURCE=..\..\..\Windows\Control\Edit.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\ImageList.h +SOURCE=..\..\..\Windows\Control\ImageList.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\ListView.cpp +SOURCE=..\..\..\Windows\Control\ListView.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\ListView.h +SOURCE=..\..\..\Windows\Control\ListView.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\ProgressBar.h +SOURCE=..\..\..\Windows\Control\ProgressBar.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\PropertyPage.cpp +SOURCE=..\..\..\Windows\Control\PropertyPage.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\PropertyPage.h +SOURCE=..\..\..\Windows\Control\PropertyPage.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\ReBar.h +SOURCE=..\..\..\Windows\Control\ReBar.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\Static.h +SOURCE=..\..\..\Windows\Control\Static.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\StatusBar.h +SOURCE=..\..\..\Windows\Control\StatusBar.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\ToolBar.h +SOURCE=..\..\..\Windows\Control\ToolBar.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\Trackbar.h +SOURCE=..\..\..\Windows\Control\Trackbar.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\Window2.cpp +SOURCE=..\..\..\Windows\Control\Window2.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\Control\Window2.h +SOURCE=..\..\..\Windows\Control\Window2.h # End Source File # End Group # Begin Source File -SOURCE=..\..\Windows\CommonDialog.cpp +SOURCE=..\..\..\Windows\CommonDialog.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\CommonDialog.h +SOURCE=..\..\..\Windows\CommonDialog.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Defs.h +SOURCE=..\..\..\Windows\Defs.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Device.h +SOURCE=..\..\..\Windows\Device.h # End Source File # Begin Source File -SOURCE=..\..\Windows\DLL.cpp +SOURCE=..\..\..\Windows\DLL.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\DLL.h +SOURCE=..\..\..\Windows\DLL.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Error.cpp +SOURCE=..\..\..\Windows\Error.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\Error.h +SOURCE=..\..\..\Windows\Error.h # End Source File # Begin Source File -SOURCE=..\..\Windows\FileDevice.cpp +SOURCE=..\..\..\Windows\FileDevice.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\FileDevice.h +SOURCE=..\..\..\Windows\FileDevice.h # End Source File # Begin Source File -SOURCE=..\..\Windows\FileDir.cpp +SOURCE=..\..\..\Windows\FileDir.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\FileDir.h +SOURCE=..\..\..\Windows\FileDir.h # End Source File # Begin Source File -SOURCE=..\..\Windows\FileFind.cpp +SOURCE=..\..\..\Windows\FileFind.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\FileFind.h +SOURCE=..\..\..\Windows\FileFind.h # End Source File # Begin Source File -SOURCE=..\..\Windows\FileIO.cpp +SOURCE=..\..\..\Windows\FileIO.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\FileIO.h +SOURCE=..\..\..\Windows\FileIO.h # End Source File # Begin Source File -SOURCE=..\..\Windows\FileName.cpp +SOURCE=..\..\..\Windows\FileName.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\FileName.h +SOURCE=..\..\..\Windows\FileName.h # End Source File # Begin Source File -SOURCE=..\..\Windows\FileSystem.cpp +SOURCE=..\..\..\Windows\FileSystem.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\FileSystem.h +SOURCE=..\..\..\Windows\FileSystem.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Handle.h +SOURCE=..\..\..\Windows\Handle.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Memory.cpp +SOURCE=..\..\..\Windows\Memory.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\Memory.h +SOURCE=..\..\..\Windows\Memory.h # End Source File # Begin Source File -SOURCE=..\..\Windows\MemoryLock.cpp +SOURCE=..\..\..\Windows\MemoryLock.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\MemoryLock.h +SOURCE=..\..\..\Windows\MemoryLock.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Menu.cpp +SOURCE=..\..\..\Windows\Menu.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\Menu.h +SOURCE=..\..\..\Windows\Menu.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Net.cpp +SOURCE=..\..\..\Windows\Net.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\Net.h +SOURCE=..\..\..\Windows\Net.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Process.h +SOURCE=..\..\..\Windows\Process.h # End Source File # Begin Source File -SOURCE=..\..\Windows\PropVariant.cpp +SOURCE=..\..\..\Windows\PropVariant.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\PropVariant.h +SOURCE=..\..\..\Windows\PropVariant.h # End Source File # Begin Source File -SOURCE=..\..\Windows\PropVariantConversions.cpp +SOURCE=..\..\..\Windows\PropVariantConversions.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\PropVariantConversions.h +SOURCE=..\..\..\Windows\PropVariantConversions.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Registry.cpp +SOURCE=..\..\..\Windows\Registry.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\Registry.h +SOURCE=..\..\..\Windows\Registry.h # End Source File # Begin Source File -SOURCE=..\..\Windows\ResourceString.cpp +SOURCE=..\..\..\Windows\ResourceString.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\ResourceString.h +SOURCE=..\..\..\Windows\ResourceString.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Security.cpp +SOURCE=..\..\..\Windows\Security.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\Security.h +SOURCE=..\..\..\Windows\Security.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Shell.cpp +SOURCE=..\..\..\Windows\Shell.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\Shell.h +SOURCE=..\..\..\Windows\Shell.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Synchronization.cpp +SOURCE=..\..\..\Windows\Synchronization.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\Synchronization.h +SOURCE=..\..\..\Windows\Synchronization.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Thread.h +SOURCE=..\..\..\Windows\Thread.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Time.h +SOURCE=..\..\..\Windows\Time.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Timer.h +SOURCE=..\..\..\Windows\Timer.h # End Source File # Begin Source File -SOURCE=..\..\Windows\Window.cpp +SOURCE=..\..\..\Windows\Window.cpp # End Source File # Begin Source File -SOURCE=..\..\Windows\Window.h +SOURCE=..\..\..\Windows\Window.h # End Source File # End Group # Begin Group "Common" @@ -975,147 +959,399 @@ SOURCE=..\..\Windows\Window.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\Common\Buffer.h +SOURCE=..\..\..\Common\Buffer.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\ComTry.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\CRC.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\Defs.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\DynamicBuffer.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\Exception.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\IntToString.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\IntToString.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\Lang.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\Lang.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\ListFileUtils.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\ListFileUtils.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\MyCom.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\MyString.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\MyString.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\MyVector.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\MyVector.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\NewHandler.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\NewHandler.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\Random.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\Random.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\StdInStream.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\StdInStream.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\StdOutStream.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\StdOutStream.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\StringConvert.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\StringConvert.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\StringToInt.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\StringToInt.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\TextConfig.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\TextConfig.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\Types.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\UTFConvert.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\UTFConvert.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\Wildcard.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\Wildcard.h +# End Source File +# End Group +# Begin Group "UI" + +# PROP Default_Filter "" +# Begin Group "UI Common" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\Common\ArchiveExtractCallback.cpp +# End Source File +# Begin Source File + +SOURCE=..\Common\ArchiveExtractCallback.h +# End Source File +# Begin Source File + +SOURCE=..\Common\ArchiveName.cpp +# End Source File +# Begin Source File + +SOURCE=..\Common\ArchiveName.h +# End Source File +# Begin Source File + +SOURCE=..\Common\ArchiveOpenCallback.cpp +# End Source File +# Begin Source File + +SOURCE=..\Common\ArchiveOpenCallback.h +# End Source File +# Begin Source File + +SOURCE=..\Common\CompressCall.cpp +# End Source File +# Begin Source File + +SOURCE=..\Common\CompressCall.h +# End Source File +# Begin Source File + +SOURCE=..\Common\DefaultName.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\CommandLineParser.cpp +SOURCE=..\Common\DefaultName.h # End Source File # Begin Source File -SOURCE=..\..\Common\CommandLineParser.h +SOURCE=..\Common\DirItem.h # End Source File # Begin Source File -SOURCE=..\..\Common\ComTry.h +SOURCE=..\Common\EnumDirItems.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\CRC.cpp +SOURCE=..\Common\EnumDirItems.h # End Source File # Begin Source File -SOURCE=..\..\Common\Defs.h +SOURCE=..\Common\ExitCode.h # End Source File # Begin Source File -SOURCE=..\..\Common\DynamicBuffer.h +SOURCE=..\Common\ExtractingFilePath.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\Exception.h +SOURCE=..\Common\ExtractingFilePath.h # End Source File # Begin Source File -SOURCE=..\..\Common\IntToString.cpp +SOURCE=..\Common\ExtractMode.h # End Source File # Begin Source File -SOURCE=..\..\Common\IntToString.h +SOURCE=..\Common\HandlerLoader.h # End Source File # Begin Source File -SOURCE=..\..\Common\Lang.cpp +SOURCE=..\Common\IFileExtractCallback.h # End Source File # Begin Source File -SOURCE=..\..\Common\Lang.h +SOURCE=..\Common\LoadCodecs.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\MyCom.h +SOURCE=..\Common\LoadCodecs.h # End Source File # Begin Source File -SOURCE=..\..\Common\MyString.cpp +SOURCE=..\Common\OpenArchive.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\MyString.h +SOURCE=..\Common\OpenArchive.h # End Source File # Begin Source File -SOURCE=..\..\Common\MyVector.cpp +SOURCE=..\Common\Property.h # End Source File # Begin Source File -SOURCE=..\..\Common\MyVector.h +SOURCE=..\Common\PropIDUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\NewHandler.cpp +SOURCE=..\Common\PropIDUtils.h # End Source File # Begin Source File -SOURCE=..\..\Common\NewHandler.h +SOURCE=..\Common\SortUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\Random.cpp +SOURCE=..\Common\SortUtils.h # End Source File # Begin Source File -SOURCE=..\..\Common\Random.h +SOURCE=..\Common\StdAfx.h # End Source File # Begin Source File -SOURCE=..\..\Common\StdInStream.cpp +SOURCE=..\Common\UpdateAction.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\StdInStream.h +SOURCE=..\Common\UpdateAction.h # End Source File # Begin Source File -SOURCE=..\..\Common\StdOutStream.cpp +SOURCE=..\Common\UpdateCallback.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\StdOutStream.h +SOURCE=..\Common\UpdateCallback.h # End Source File # Begin Source File -SOURCE=..\..\Common\StringConvert.cpp +SOURCE=..\Common\UpdatePair.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\StringConvert.h +SOURCE=..\Common\UpdatePair.h # End Source File # Begin Source File -SOURCE=..\..\Common\StringToInt.cpp +SOURCE=..\Common\UpdateProduce.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\StringToInt.h +SOURCE=..\Common\UpdateProduce.h # End Source File # Begin Source File -SOURCE=..\..\Common\TextConfig.cpp +SOURCE=..\Common\WorkDir.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\TextConfig.h +SOURCE=..\Common\WorkDir.h # End Source File # Begin Source File -SOURCE=..\..\Common\Types.h +SOURCE=..\Common\ZipRegistry.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\UTFConvert.cpp +SOURCE=..\Common\ZipRegistry.h +# End Source File +# End Group +# Begin Group "Agent" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\Agent\Agent.cpp +# End Source File +# Begin Source File + +SOURCE=..\Agent\Agent.h +# End Source File +# Begin Source File + +SOURCE=..\Agent\AgentOut.cpp +# End Source File +# Begin Source File + +SOURCE=..\Agent\AgentProxy.cpp +# End Source File +# Begin Source File + +SOURCE=..\Agent\AgentProxy.h +# End Source File +# Begin Source File + +SOURCE=..\Agent\ArchiveFolder.cpp +# End Source File +# Begin Source File + +SOURCE=..\Agent\ArchiveFolderOpen.cpp +# End Source File +# Begin Source File + +SOURCE=..\Agent\ArchiveFolderOut.cpp +# End Source File +# Begin Source File + +SOURCE=..\Agent\IFolderArchive.h +# End Source File +# Begin Source File + +SOURCE=..\Agent\UpdateCallbackAgent.cpp +# End Source File +# Begin Source File + +SOURCE=..\Agent\UpdateCallbackAgent.h +# End Source File +# End Group +# End Group +# Begin Group "Compress" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\Compress\Copy\CopyCoder.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\Copy\CopyCoder.h +# End Source File +# End Group +# Begin Group "Interface" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\ICoder.h # End Source File # Begin Source File -SOURCE=..\..\Common\UTFConvert.h +SOURCE=..\..\IDecl.h # End Source File # Begin Source File -SOURCE=..\..\Common\Wildcard.cpp +SOURCE=..\..\IPassword.h # End Source File # Begin Source File -SOURCE=..\..\Common\Wildcard.h +SOURCE=..\..\IProgress.h # End Source File # End Group # Begin Source File diff --git a/CPP/7zip/FileManager/FM.dsw b/CPP/7zip/UI/FileManager/FM.dsw index 1c955d95..1c955d95 100755 --- a/CPP/7zip/FileManager/FM.dsw +++ b/CPP/7zip/UI/FileManager/FM.dsw diff --git a/CPP/7zip/FileManager/FM.ico b/CPP/7zip/UI/FileManager/FM.ico Binary files differindex 3a0a34da..3a0a34da 100755 --- a/CPP/7zip/FileManager/FM.ico +++ b/CPP/7zip/UI/FileManager/FM.ico diff --git a/CPP/7zip/FileManager/FSDrives.cpp b/CPP/7zip/UI/FileManager/FSDrives.cpp index 447ff4dc..42540287 100755 --- a/CPP/7zip/FileManager/FSDrives.cpp +++ b/CPP/7zip/UI/FileManager/FSDrives.cpp @@ -7,7 +7,8 @@ #include "FSDrives.h" #include "Common/StringConvert.h" -#include "../PropID.h" +#include "Common/ComTry.h" +#include "../../PropID.h" #include "Windows/Defs.h" #include "Windows/PropVariant.h" #include "Windows/FileDir.h" @@ -151,7 +152,7 @@ STDMETHODIMP CFSDrives::GetProperty(UInt32 itemIndex, PROPID propID, PROPVARIANT HRESULT CFSDrives::BindToFolderSpec(const wchar_t *name, IFolderFolder **resultFolder) { *resultFolder = 0; - CFSFolder *fsFolderSpec = new CFSFolder; + NFsFolder::CFSFolder *fsFolderSpec = new NFsFolder::CFSFolder; CMyComPtr<IFolderFolder> subFolder = fsFolderSpec; RINOK(fsFolderSpec->Init(name, 0)); *resultFolder = subFolder.Detach(); @@ -187,11 +188,6 @@ STDMETHODIMP CFSDrives::BindToParentFolder(IFolderFolder **resultFolder) return S_OK; } -STDMETHODIMP CFSDrives::GetName(BSTR * /* name */) -{ - return E_NOTIMPL; -} - STDMETHODIMP CFSDrives::GetNumberOfProperties(UInt32 *numProperties) { *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); @@ -211,18 +207,18 @@ STDMETHODIMP CFSDrives::GetPropertyInfo(UInt32 index, } -STDMETHODIMP CFSDrives::GetTypeID(BSTR *name) -{ - CMyComBSTR temp = L"FSDrives"; - *name = temp.Detach(); - return S_OK; -} - -STDMETHODIMP CFSDrives::GetPath(BSTR *path) +STDMETHODIMP CFSDrives::GetFolderProperty(PROPID propID, PROPVARIANT *value) { - CMyComBSTR temp = LangString(IDS_COMPUTER, 0x03020300) + UString(L'\\'); - *path = temp.Detach(); + COM_TRY_BEGIN + NWindows::NCOM::CPropVariant prop; + switch(propID) + { + case kpidType: prop = L"FSDrives"; break; + case kpidPath: prop = LangString(IDS_COMPUTER, 0x03020300) + UString(L'\\'); break; + } + prop.Detach(value); return S_OK; + COM_TRY_END } STDMETHODIMP CFSDrives::GetSystemIconIndex(UInt32 index, INT32 *iconIndex) diff --git a/CPP/7zip/FileManager/FSDrives.h b/CPP/7zip/UI/FileManager/FSDrives.h index 47afa0cf..527c2438 100755 --- a/CPP/7zip/FileManager/FSDrives.h +++ b/CPP/7zip/UI/FileManager/FSDrives.h @@ -26,33 +26,16 @@ struct CDriveInfo class CFSDrives: public IFolderFolder, - public IEnumProperties, - public IFolderGetTypeID, - public IFolderGetPath, public IFolderGetSystemIconIndex, public CMyUnknownImp { public: - MY_UNKNOWN_IMP4( - IEnumProperties, - IFolderGetTypeID, - IFolderGetPath, + MY_UNKNOWN_IMP1( IFolderGetSystemIconIndex ) - STDMETHOD(LoadItems)(); - STDMETHOD(GetNumberOfItems)(UInt32 *numItems); - STDMETHOD(GetProperty)(UInt32 itemIndex, PROPID propID, PROPVARIANT *value); - STDMETHOD(BindToFolder)(UInt32 index, IFolderFolder **resultFolder); - STDMETHOD(BindToFolder)(const wchar_t *name, IFolderFolder **resultFolder); - STDMETHOD(BindToParentFolder)(IFolderFolder **resultFolder); - STDMETHOD(GetName)(BSTR *name); + INTERFACE_FolderFolder(;) - STDMETHOD(GetNumberOfProperties)(UInt32 *numProperties); - STDMETHOD(GetPropertyInfo)(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType); - STDMETHOD(GetTypeID)(BSTR *name); - STDMETHOD(GetPath)(BSTR *path); STDMETHOD(GetSystemIconIndex)(UInt32 index, INT32 *iconIndex); private: diff --git a/CPP/7zip/FileManager/FSFolder.cpp b/CPP/7zip/UI/FileManager/FSFolder.cpp index 309128ae..9a88f674 100755 --- a/CPP/7zip/FileManager/FSFolder.cpp +++ b/CPP/7zip/UI/FileManager/FSFolder.cpp @@ -8,13 +8,14 @@ #include "Common/StdInStream.h" #include "Common/StdOutStream.h" #include "Common/UTFConvert.h" +#include "Common/ComTry.h" #include "Windows/Defs.h" #include "Windows/PropVariant.h" #include "Windows/FileDir.h" #include "Windows/FileIO.h" -#include "../PropID.h" +#include "../../PropID.h" #include "SysIconUtils.h" #include "FSDrives.h" @@ -31,6 +32,8 @@ using namespace NWindows; using namespace NFile; using namespace NFind; +namespace NFsFolder { + static STATPROPSTG kProperties[] = { { NULL, kpidName, VT_BSTR}, @@ -70,22 +73,28 @@ HRESULT CFSFolder::Init(const UString &path, IFolderFolder *parentFolder) return S_OK; } -static HRESULT GetFolderSize(const UString &path, UInt64 &size, IProgress *progress) +static HRESULT GetFolderSize(const UString &path, UInt64 &numFolders, UInt64 &numFiles, UInt64 &size, IProgress *progress) { RINOK(progress->SetCompleted(NULL)); - size = 0; + numFiles = numFolders = size = 0; CEnumeratorW enumerator(path + UString(L"\\*")); CFileInfoW fileInfo; while (enumerator.Next(fileInfo)) { if (fileInfo.IsDirectory()) { - UInt64 subSize; - RINOK(GetFolderSize(path + UString(L"\\") + fileInfo.Name, subSize, progress)); + UInt64 subFolders, subFiles, subSize; + RINOK(GetFolderSize(path + UString(L"\\") + fileInfo.Name, subFolders, subFiles, subSize, progress)); + numFolders += subFolders; + numFolders++; + numFiles += subFiles; size += subSize; } else + { + numFiles++; size += fileInfo.Size; + } } return S_OK; } @@ -401,16 +410,6 @@ STDMETHODIMP CFSFolder::BindToParentFolder(IFolderFolder **resultFolder) return S_OK; } -STDMETHODIMP CFSFolder::GetName(BSTR * /* name */) -{ - return E_NOTIMPL; - /* - CMyComBSTR aBSTRName = m_ProxyFolderItem->m_Name; - *name = aBSTRName.Detach(); - return S_OK; - */ -} - STDMETHODIMP CFSFolder::GetNumberOfProperties(UInt32 *numProperties) { *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); @@ -432,21 +431,20 @@ STDMETHODIMP CFSFolder::GetPropertyInfo(UInt32 index, } -STDMETHODIMP CFSFolder::GetTypeID(BSTR *name) -{ - CMyComBSTR temp = L"FSFolder"; - *name = temp.Detach(); - return S_OK; -} - -STDMETHODIMP CFSFolder::GetPath(BSTR *path) +STDMETHODIMP CFSFolder::GetFolderProperty(PROPID propID, PROPVARIANT *value) { - CMyComBSTR temp = _path; - *path = temp.Detach(); + COM_TRY_BEGIN + NWindows::NCOM::CPropVariant prop; + switch(propID) + { + case kpidType: prop = L"FSFolder"; break; + case kpidPath: prop = _path; break; + } + prop.Detach(value); return S_OK; + COM_TRY_END } - STDMETHODIMP CFSFolder::WasChanged(INT32 *wasChanged) { bool wasChangedMain = false; @@ -481,6 +479,35 @@ STDMETHODIMP CFSFolder::Clone(IFolderFolder **resultFolder) return S_OK; } +HRESULT CFSFolder::GetItemsFullSize(const UInt32 *indices, UInt32 numItems, + UInt64 &numFolders, UInt64 &numFiles, UInt64 &size, IProgress *progress) +{ + numFiles = numFolders = size = 0; + UInt32 i; + for (i = 0; i < numItems; i++) + { + int index = indices[i]; + if (index >= _refs.Size()) + return E_INVALIDARG; + const CDirItem &fileInfo = *_refs[index]; + if (fileInfo.IsDirectory()) + { + UInt64 subFolders, subFiles, subSize; + RINOK(GetFolderSize(_path + GetRelPath(fileInfo), subFolders, subFiles, subSize, progress)); + numFolders += subFolders; + numFolders++; + numFiles += subFiles; + size += subSize; + } + else + { + numFiles++; + size += fileInfo.Size; + } + } + return S_OK; +} + HRESULT CFSFolder::GetItemFullSize(int index, UInt64 &size, IProgress *progress) { const CDirItem &fileInfo = *_refs[index]; @@ -503,7 +530,8 @@ HRESULT CFSFolder::GetItemFullSize(int index, UInt64 &size, IProgress *progress) *totalSize += size; } */ - return GetFolderSize(_path + GetRelPath(fileInfo), size, progress); + UInt64 numFolders, numFiles; + return GetFolderSize(_path + GetRelPath(fileInfo), numFolders, numFiles, size, progress); } size = fileInfo.Size; return S_OK; @@ -651,5 +679,4 @@ STDMETHODIMP CFSFolder::SetFlatMode(Int32 flatMode) return S_OK; } -// static const LPCTSTR kInvalidFileChars = TEXT("\\/:*?\"<>|"); - +} diff --git a/CPP/7zip/FileManager/FSFolder.h b/CPP/7zip/UI/FileManager/FSFolder.h index 898aff2c..63de80cc 100755 --- a/CPP/7zip/FileManager/FSFolder.h +++ b/CPP/7zip/UI/FileManager/FSFolder.h @@ -12,6 +12,8 @@ #include "TextPairs.h" +namespace NFsFolder { + class CFSFolder; struct CFileInfoEx: public NWindows::NFile::NFind::CFileInfoW @@ -37,9 +39,6 @@ struct CDirItem: public CFileInfoEx class CFSFolder: public IFolderFolder, - public IEnumProperties, - public IFolderGetTypeID, - public IFolderGetPath, public IFolderWasChanged, public IFolderOperations, // public IFolderOperationsDeleteToRecycleBin, @@ -52,9 +51,6 @@ class CFSFolder: UInt64 GetSizeOfItem(int anIndex) const; public: MY_QUERYINTERFACE_BEGIN - MY_QUERYINTERFACE_ENTRY(IEnumProperties) - MY_QUERYINTERFACE_ENTRY(IFolderGetTypeID) - MY_QUERYINTERFACE_ENTRY(IFolderGetPath) MY_QUERYINTERFACE_ENTRY(IFolderWasChanged) // MY_QUERYINTERFACE_ENTRY(IFolderOperationsDeleteToRecycleBin) MY_QUERYINTERFACE_ENTRY(IFolderOperations) @@ -66,38 +62,15 @@ public: MY_ADDREF_RELEASE - STDMETHOD(LoadItems)(); - STDMETHOD(GetNumberOfItems)(UInt32 *numItems); - STDMETHOD(GetProperty)(UInt32 itemIndex, PROPID propID, PROPVARIANT *value); - STDMETHOD(BindToFolder)(UInt32 index, IFolderFolder **resultFolder); - STDMETHOD(BindToFolder)(const wchar_t *name, IFolderFolder **resultFolder); - STDMETHOD(BindToParentFolder)(IFolderFolder **resultFolder); - STDMETHOD(GetName)(BSTR *name); + INTERFACE_FolderFolder(;) + INTERFACE_FolderOperations(;) - STDMETHOD(GetNumberOfProperties)(UInt32 *numProperties); - STDMETHOD(GetPropertyInfo)(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType); - STDMETHOD(GetTypeID)(BSTR *name); - STDMETHOD(GetPath)(BSTR *path); STDMETHOD(WasChanged)(INT32 *wasChanged); STDMETHOD(Clone)(IFolderFolder **resultFolder); STDMETHOD(GetItemFullSize)(UInt32 index, PROPVARIANT *value, IProgress *progress); STDMETHOD(SetFlatMode)(Int32 flatMode); - // IFolderOperations - - STDMETHOD(CreateFolder)(const wchar_t *name, IProgress *progress); - STDMETHOD(CreateFile)(const wchar_t *name, IProgress *progress); - STDMETHOD(Rename)(UInt32 index, const wchar_t *newName, IProgress *progress); - STDMETHOD(Delete)(const UInt32 *indices, UInt32 numItems, IProgress *progress); - STDMETHOD(CopyTo)(const UInt32 *indices, UInt32 numItems, - const wchar_t *path, IFolderOperationsExtractCallback *callback); - STDMETHOD(MoveTo)(const UInt32 *indices, UInt32 numItems, - const wchar_t *path, IFolderOperationsExtractCallback *callback); - STDMETHOD(CopyFrom)(const wchar_t *fromFolderPath, - const wchar_t **itemsPaths, UInt32 numItems, IProgress *progress); - STDMETHOD(SetProperty)(UInt32 index, PROPID propID, const PROPVARIANT *value, IProgress *progress); STDMETHOD(GetSystemIconIndex)(UInt32 index, INT32 *iconIndex); private: @@ -114,6 +87,8 @@ private: NWindows::NFile::NFind::CFindChangeNotification _findChangeNotification; + HRESULT GetItemsFullSize(const UInt32 *indices, UInt32 numItems, + UInt64 &numFolders, UInt64 &numFiles, UInt64 &size, IProgress *progress); HRESULT GetItemFullSize(int index, UInt64 &size, IProgress *progress); HRESULT GetComplexName(const wchar_t *name, UString &resultPath); HRESULT BindToFolderSpec(const wchar_t *name, IFolderFolder **resultFolder); @@ -138,4 +113,6 @@ public: } }; +} + #endif diff --git a/CPP/7zip/FileManager/FSFolderCopy.cpp b/CPP/7zip/UI/FileManager/FSFolderCopy.cpp index 7566c8f2..1a1b2250 100755 --- a/CPP/7zip/FileManager/FSFolderCopy.cpp +++ b/CPP/7zip/UI/FileManager/FSFolderCopy.cpp @@ -10,7 +10,7 @@ #include "Common/StringConvert.h" -#include "../Common/FilePathAutoRename.h" +#include "../../Common/FilePathAutoRename.h" using namespace NWindows; using namespace NFile; @@ -20,6 +20,8 @@ using namespace NFind; extern bool g_IsNT; #endif +namespace NFsFolder { + /* static bool IsItWindows2000orHigher() { @@ -34,7 +36,7 @@ static bool IsItWindows2000orHigher() struct CProgressInfo { - UINT64 StartPos; + UInt64 StartPos; IProgress *Progress; }; @@ -51,7 +53,7 @@ static DWORD CALLBACK CopyProgressRoutine( ) { CProgressInfo &progressInfo = *(CProgressInfo *)lpData; - UINT64 completed = progressInfo.StartPos + TotalBytesTransferred.QuadPart; + UInt64 completed = progressInfo.StartPos + TotalBytesTransferred.QuadPart; if (progressInfo.Progress->SetCompleted(&completed) != S_OK) return PROGRESS_CANCEL; return PROGRESS_CONTINUE; @@ -81,8 +83,7 @@ static CSysString GetSysPath(LPCWSTR sysPath) { return UnicodeStringToMultiByte(sysPath, GetCurrentCodePage()); } #endif -static bool MyCopyFile(LPCWSTR existingFile, LPCWSTR newFile, - IProgress *progress, UINT64 &completedSize) +static bool MyCopyFile(LPCWSTR existingFile, LPCWSTR newFile, IProgress *progress, UInt64 &completedSize) { CProgressInfo progressInfo; progressInfo.Progress = progress; @@ -137,8 +138,7 @@ typedef BOOL (WINAPI * MoveFileWithProgressPointer)( IN DWORD dwFlags ); -static bool MyMoveFile(LPCWSTR existingFile, LPCWSTR newFile, - IProgress *progress, UINT64 &completedSize) +static bool MyMoveFile(LPCWSTR existingFile, LPCWSTR newFile, IProgress *progress, UInt64 &completedSize) { // if (IsItWindows2000orHigher()) // { @@ -179,7 +179,7 @@ static HRESULT MyCopyFile( const CFileInfoW &srcFileInfo, const UString &destPathSpec, IFolderOperationsExtractCallback *callback, - UINT64 &completedSize) + UInt64 &completedSize) { UString destPath = destPathSpec; if (destPath.CompareNoCase(srcPath) == 0) @@ -202,7 +202,7 @@ static HRESULT MyCopyFile( { UString destPathNew = UString(destPathResult); RINOK(callback->SetCurrentFilePath(srcPath)); - if (!::MyCopyFile(srcPath, destPathNew, callback, completedSize)) + if (!MyCopyFile(srcPath, destPathNew, callback, completedSize)) { UString message = NError::MyFormatMessageW(GetLastError()) + UString(L" \'") + @@ -220,7 +220,7 @@ static HRESULT CopyFolder( const UString &srcPath, const UString &destPathSpec, IFolderOperationsExtractCallback *callback, - UINT64 &completedSize) + UInt64 &completedSize) { RINOK(callback->SetCompleted(&completedSize)); @@ -266,19 +266,12 @@ STDMETHODIMP CFSFolder::CopyTo(const UInt32 *indices, UInt32 numItems, { if (numItems == 0) return S_OK; - UINT64 totalSize = 0; - UInt32 i; - for (i = 0; i < numItems; i++) - { - int index = indices[i]; - if (index >= _refs.Size()) - return E_INVALIDARG; - UINT64 size; - RINOK(GetItemFullSize(indices[i], size, callback)); - totalSize += size; - } - - callback->SetTotal(totalSize); + + UInt64 numFolders, numFiles, totalSize; + GetItemsFullSize(indices, numItems, numFolders, numFiles, totalSize, callback); + RINOK(callback->SetTotal(totalSize)); + RINOK(callback->SetNumFiles(numFiles)); + UString destPath = path; if (destPath.IsEmpty()) return E_INVALIDARG; @@ -301,9 +294,9 @@ STDMETHODIMP CFSFolder::CopyTo(const UInt32 *indices, UInt32 numItems, } */ - UINT64 completedSize = 0; + UInt64 completedSize = 0; RINOK(callback->SetCompleted(&completedSize)); - for (i = 0; i < numItems; i++) + for (UInt32 i = 0; i < numItems; i++) { const CDirItem &fileInfo = *_refs[indices[i]]; UString destPath2 = destPath; @@ -330,7 +323,7 @@ HRESULT MyMoveFile( const CFileInfoW &srcFileInfo, const UString &destPathSpec, IFolderOperationsExtractCallback *callback, - UINT64 &completedSize) + UInt64 &completedSize) { UString destPath = destPathSpec; if (destPath.CompareNoCase(srcPath) == 0) @@ -370,7 +363,7 @@ HRESULT MyMoveFolder( const UString &srcPath, const UString &destPathSpec, IFolderOperationsExtractCallback *callback, - UINT64 &completedSize) + UInt64 &completedSize) { UString destPath = destPathSpec; int len = srcPath.Length(); @@ -429,18 +422,10 @@ STDMETHODIMP CFSFolder::MoveTo( if (numItems == 0) return S_OK; - UINT64 totalSize = 0; - UInt32 i; - for (i = 0; i < numItems; i++) - { - int index = indices[i]; - if (index >= _refs.Size()) - return E_INVALIDARG; - UINT64 size; - RINOK(GetItemFullSize(indices[i], size, callback)); - totalSize += size; - } - callback->SetTotal(totalSize); + UInt64 numFolders, numFiles, totalSize; + GetItemsFullSize(indices, numItems, numFolders, numFiles, totalSize, callback); + RINOK(callback->SetTotal(totalSize)); + RINOK(callback->SetNumFiles(numFiles)); UString destPath = path; if (destPath.IsEmpty()) @@ -460,9 +445,9 @@ STDMETHODIMP CFSFolder::MoveTo( return E_ABORT; } - UINT64 completedSize = 0; + UInt64 completedSize = 0; RINOK(callback->SetCompleted(&completedSize)); - for (i = 0; i < numItems; i++) + for (UInt32 i = 0; i < numItems; i++) { const CDirItem &fileInfo = *_refs[indices[i]]; UString destPath2 = destPath; @@ -487,4 +472,4 @@ STDMETHODIMP CFSFolder::CopyFrom(const wchar_t * /* fromFolderPath */, return E_NOTIMPL; } - +} diff --git a/CPP/7zip/FileManager/FileFolderPluginOpen.cpp b/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp index 3e3f40ba..a3a19414 100755 --- a/CPP/7zip/FileManager/FileFolderPluginOpen.cpp +++ b/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp @@ -14,6 +14,7 @@ #include "OpenCallback.h" #include "PluginLoader.h" +#include "../Agent/Agent.h" using namespace NWindows; using namespace NRegistryAssociations; @@ -78,12 +79,14 @@ HRESULT OpenFileFolderPlugin( for (int i = 0; i < plugins.Size(); i++) { const CPluginInfo &plugin = plugins[i]; + if (!plugin.ClassIDDefined) + continue; CPluginLibrary library; CMyComPtr<IFolderManager> folderManager; CMyComPtr<IFolderFolder> folder; - HRESULT result = library.LoadAndCreateManager( - plugin.FilePath, plugin.ClassID, &folderManager); - if (result != S_OK) + if (plugin.FilePath.IsEmpty()) + folderManager = new CArchiveFolderManager; + else if (library.LoadAndCreateManager(plugin.FilePath, plugin.ClassID, &folderManager) != S_OK) continue; COpenArchiveCallback *openCallbackSpec = new COpenArchiveCallback; @@ -91,7 +94,7 @@ HRESULT OpenFileFolderPlugin( openCallbackSpec->PasswordIsDefined = false; openCallbackSpec->ParentWindow = parentWindow; openCallbackSpec->LoadFileInfo(dirPrefix, fileName); - result = folderManager->OpenFolderFile(path, &folder, openCallback); + HRESULT result = folderManager->OpenFolderFile(path, &folder, openCallback); if (openCallbackSpec->PasswordWasAsked) encrypted = true; if (result == S_OK) diff --git a/CPP/7zip/FileManager/FileFolderPluginOpen.h b/CPP/7zip/UI/FileManager/FileFolderPluginOpen.h index 295048a9..295048a9 100755 --- a/CPP/7zip/FileManager/FileFolderPluginOpen.h +++ b/CPP/7zip/UI/FileManager/FileFolderPluginOpen.h diff --git a/CPP/7zip/FileManager/FilePlugins.cpp b/CPP/7zip/UI/FileManager/FilePlugins.cpp index 0ae8279d..1812312e 100755 --- a/CPP/7zip/FileManager/FilePlugins.cpp +++ b/CPP/7zip/UI/FileManager/FilePlugins.cpp @@ -9,6 +9,7 @@ #include "FilePlugins.h" #include "StringUtils.h" #include "PluginLoader.h" +#include "../Agent/Agent.h" using namespace NRegistryAssociations; @@ -50,14 +51,14 @@ void CExtDatabase::Read() for (int pluginIndex = 0; pluginIndex < Plugins.Size(); pluginIndex++) { const CPluginInfo &pluginInfo = Plugins[pluginIndex]; - if (!pluginInfo.OptionsClassIDDefined) - continue; CPluginLibrary pluginLibrary; CMyComPtr<IFolderManager> folderManager; - if (pluginLibrary.LoadAndCreateManager(pluginInfo.FilePath, - pluginInfo.ClassID, &folderManager) != S_OK) + if (pluginInfo.FilePath.IsEmpty()) + folderManager = new CArchiveFolderManager; + else if (pluginLibrary.LoadAndCreateManager(pluginInfo.FilePath, + pluginInfo.ClassID, &folderManager) != S_OK) continue; CMyComBSTR extBSTR; if (folderManager->GetExtensions(&extBSTR) != S_OK) diff --git a/CPP/7zip/FileManager/FilePlugins.h b/CPP/7zip/UI/FileManager/FilePlugins.h index 1becb9d1..1becb9d1 100755 --- a/CPP/7zip/FileManager/FilePlugins.h +++ b/CPP/7zip/UI/FileManager/FilePlugins.h diff --git a/CPP/7zip/FileManager/FormatUtils.cpp b/CPP/7zip/UI/FileManager/FormatUtils.cpp index 553d8bcd..553d8bcd 100755 --- a/CPP/7zip/FileManager/FormatUtils.cpp +++ b/CPP/7zip/UI/FileManager/FormatUtils.cpp diff --git a/CPP/7zip/FileManager/FormatUtils.h b/CPP/7zip/UI/FileManager/FormatUtils.h index 35536871..35536871 100755 --- a/CPP/7zip/FileManager/FormatUtils.h +++ b/CPP/7zip/UI/FileManager/FormatUtils.h diff --git a/CPP/7zip/FileManager/HelpUtils.cpp b/CPP/7zip/UI/FileManager/HelpUtils.cpp index c2bf49a5..c2bf49a5 100755 --- a/CPP/7zip/FileManager/HelpUtils.cpp +++ b/CPP/7zip/UI/FileManager/HelpUtils.cpp diff --git a/CPP/7zip/FileManager/HelpUtils.h b/CPP/7zip/UI/FileManager/HelpUtils.h index 2a7b85af..2a7b85af 100755 --- a/CPP/7zip/FileManager/HelpUtils.h +++ b/CPP/7zip/UI/FileManager/HelpUtils.h diff --git a/CPP/7zip/UI/FileManager/IFolder.h b/CPP/7zip/UI/FileManager/IFolder.h new file mode 100755 index 00000000..fdd9fa3c --- /dev/null +++ b/CPP/7zip/UI/FileManager/IFolder.h @@ -0,0 +1,145 @@ +// IFolder.h + +#ifndef __IFOLDER_H +#define __IFOLDER_H + +#include "../../IProgress.h" + +#define FOLDER_INTERFACE_SUB(i, b, x) DECL_INTERFACE_SUB(i, b, 8, x) +#define FOLDER_INTERFACE(i, x) FOLDER_INTERFACE_SUB(i, IUnknown, x) + +namespace NPlugin +{ + enum + { + kName = 0, + kType, + kClassID, + kOptionsClassID + }; +} + +#define INTERFACE_FolderFolder(x) \ + STDMETHOD(LoadItems)() x; \ + STDMETHOD(GetNumberOfItems)(UInt32 *numItems) x; \ + STDMETHOD(GetProperty)(UInt32 itemIndex, PROPID propID, PROPVARIANT *value) x; \ + STDMETHOD(BindToFolder)(UInt32 index, IFolderFolder **resultFolder) x; \ + STDMETHOD(BindToFolder)(const wchar_t *name, IFolderFolder **resultFolder) x; \ + STDMETHOD(BindToParentFolder)(IFolderFolder **resultFolder) x; \ + STDMETHOD(GetNumberOfProperties)(UInt32 *numProperties) x; \ + STDMETHOD(GetPropertyInfo)(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) x; \ + STDMETHOD(GetFolderProperty)(PROPID propID, PROPVARIANT *value) x; \ + +FOLDER_INTERFACE(IFolderFolder, 0x00) +{ + INTERFACE_FolderFolder(PURE) +}; + +FOLDER_INTERFACE(IFolderWasChanged, 0x04) +{ + STDMETHOD(WasChanged)(Int32 *wasChanged) PURE; +}; + +FOLDER_INTERFACE_SUB(IFolderOperationsExtractCallback, IProgress, 0x0B) +{ + // STDMETHOD(SetTotalFiles)(UInt64 total) PURE; + // STDMETHOD(SetCompletedFiles)(const UInt64 *completedValue) PURE; + STDMETHOD(AskWrite)( + const wchar_t *srcPath, + Int32 srcIsFolder, + const FILETIME *srcTime, + const UInt64 *srcSize, + const wchar_t *destPathRequest, + BSTR *destPathResult, + Int32 *writeAnswer) PURE; + STDMETHOD(ShowMessage)(const wchar_t *message) PURE; + STDMETHOD(SetCurrentFilePath)(const wchar_t *filePath) PURE; + STDMETHOD(SetNumFiles)(UInt64 numFiles) PURE; +}; + +#define INTERFACE_FolderOperations(x) \ + STDMETHOD(CreateFolder)(const wchar_t *name, IProgress *progress) x; \ + STDMETHOD(CreateFile)(const wchar_t *name, IProgress *progress) x; \ + STDMETHOD(Rename)(UInt32 index, const wchar_t *newName, IProgress *progress) x; \ + STDMETHOD(Delete)(const UInt32 *indices, UInt32 numItems, IProgress *progress) x; \ + STDMETHOD(CopyTo)(const UInt32 *indices, UInt32 numItems, \ + const wchar_t *path, IFolderOperationsExtractCallback *callback) x; \ + STDMETHOD(MoveTo)(const UInt32 *indices, UInt32 numItems, \ + const wchar_t *path, IFolderOperationsExtractCallback *callback) x; \ + STDMETHOD(CopyFrom)(const wchar_t *fromFolderPath, \ + const wchar_t **itemsPaths, UInt32 numItems, IProgress *progress) x; \ + STDMETHOD(SetProperty)(UInt32 index, PROPID propID, const PROPVARIANT *value, IProgress *progress) x; \ + +FOLDER_INTERFACE(IFolderOperations, 0x06) +{ + INTERFACE_FolderOperations(PURE) +}; + +/* +FOLDER_INTERFACE2(IFolderOperationsDeleteToRecycleBin, 0x06, 0x03) +{ + STDMETHOD(DeleteToRecycleBin)(const UInt32 *indices, UInt32 numItems, IProgress *progress) PURE; +}; +*/ + +FOLDER_INTERFACE(IFolderGetSystemIconIndex, 0x07) +{ + STDMETHOD(GetSystemIconIndex)(UInt32 index, Int32 *iconIndex) PURE; +}; + +FOLDER_INTERFACE(IFolderGetItemFullSize, 0x08) +{ + STDMETHOD(GetItemFullSize)(UInt32 index, PROPVARIANT *value, IProgress *progress) PURE; +}; + +FOLDER_INTERFACE(IFolderClone, 0x09) +{ + STDMETHOD(Clone)(IFolderFolder **resultFolder) PURE; +}; + +FOLDER_INTERFACE(IFolderSetFlatMode, 0x0A) +{ + STDMETHOD(SetFlatMode)(Int32 flatMode) PURE; +}; + +#define INTERFACE_FolderProperties(x) \ + STDMETHOD(GetNumberOfFolderProperties)(UInt32 *numProperties) x; \ + STDMETHOD(GetFolderPropertyInfo)(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) x; \ + +FOLDER_INTERFACE(IFolderProperties, 0x0B) +{ + INTERFACE_FolderProperties(PURE) +}; + +#define INTERFACE_IFolderArchiveProperties(x) \ + STDMETHOD(GetArchiveProperty)(PROPID propID, PROPVARIANT *value) x; \ + STDMETHOD(GetNumberOfArchiveProperties)(UInt32 *numProperties) x; \ + STDMETHOD(GetArchivePropertyInfo)(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) x; + +FOLDER_INTERFACE(IFolderArchiveProperties, 0x0C) +{ + INTERFACE_IFolderArchiveProperties(PURE) +}; + +FOLDER_INTERFACE(IGetFolderArchiveProperties, 0x0D) +{ + STDMETHOD(GetFolderArchiveProperties)(IFolderArchiveProperties **object) PURE; +}; + +#define FOLDER_MANAGER_INTERFACE(i, x) DECL_INTERFACE(i, 9, x) + +#define INTERFACE_IFolderManager(x) \ + STDMETHOD(OpenFolderFile)(const wchar_t *filePath, IFolderFolder **resultFolder, IProgress *progress) x; \ + STDMETHOD(GetExtensions)(BSTR *extensions) x; \ + STDMETHOD(GetIconPath)(const wchar_t *ext, BSTR *iconPath, Int32 *iconIndex) x; \ + + // STDMETHOD(GetTypes)(BSTR *types) PURE; + // STDMETHOD(CreateFolderFile)(const wchar_t *type, const wchar_t *filePath, IProgress *progress) PURE; + +FOLDER_MANAGER_INTERFACE(IFolderManager, 0x03) +{ + INTERFACE_IFolderManager(PURE); +}; + + +#endif diff --git a/CPP/7zip/FileManager/Info.bmp b/CPP/7zip/UI/FileManager/Info.bmp Binary files differindex d769a661..d769a661 100755 --- a/CPP/7zip/FileManager/Info.bmp +++ b/CPP/7zip/UI/FileManager/Info.bmp diff --git a/CPP/7zip/FileManager/Info2.bmp b/CPP/7zip/UI/FileManager/Info2.bmp Binary files differindex af724d27..af724d27 100755 --- a/CPP/7zip/FileManager/Info2.bmp +++ b/CPP/7zip/UI/FileManager/Info2.bmp diff --git a/CPP/7zip/FileManager/Resource/LangPage/LangPage.cpp b/CPP/7zip/UI/FileManager/LangPage.cpp index 9974759a..3300213b 100755 --- a/CPP/7zip/FileManager/Resource/LangPage/LangPage.cpp +++ b/CPP/7zip/UI/FileManager/LangPage.cpp @@ -1,16 +1,16 @@ // LangPage.cpp #include "StdAfx.h" -#include "resource.h" +#include "LangPageRes.h" #include "LangPage.h" #include "Common/StringConvert.h" #include "Windows/ResourceString.h" -#include "../../RegistryUtils.h" -#include "../../HelpUtils.h" -#include "../../LangUtils.h" +#include "RegistryUtils.h" +#include "HelpUtils.h" +#include "LangUtils.h" static CIDLangPair kIDLangPairs[] = { diff --git a/CPP/7zip/FileManager/Resource/LangPage/LangPage.h b/CPP/7zip/UI/FileManager/LangPage.h index b28d6984..b28d6984 100755 --- a/CPP/7zip/FileManager/Resource/LangPage/LangPage.h +++ b/CPP/7zip/UI/FileManager/LangPage.h diff --git a/CPP/7zip/FileManager/Resource/LangPage/resource.rc b/CPP/7zip/UI/FileManager/LangPage.rc index abaa9481..0e06406c 100755 --- a/CPP/7zip/FileManager/Resource/LangPage/resource.rc +++ b/CPP/7zip/UI/FileManager/LangPage.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "LangPageRes.h" +#include "../../GuiCommon.rc" #define xSize2 238 #define ySize2 204 diff --git a/CPP/7zip/FileManager/Resource/LangPage/resource.h b/CPP/7zip/UI/FileManager/LangPageRes.h index 39571e53..39571e53 100755 --- a/CPP/7zip/FileManager/Resource/LangPage/resource.h +++ b/CPP/7zip/UI/FileManager/LangPageRes.h diff --git a/CPP/7zip/FileManager/LangUtils.cpp b/CPP/7zip/UI/FileManager/LangUtils.cpp index f41e764e..f41e764e 100755 --- a/CPP/7zip/FileManager/LangUtils.cpp +++ b/CPP/7zip/UI/FileManager/LangUtils.cpp diff --git a/CPP/7zip/FileManager/LangUtils.h b/CPP/7zip/UI/FileManager/LangUtils.h index 40debdfe..40debdfe 100755 --- a/CPP/7zip/FileManager/LangUtils.h +++ b/CPP/7zip/UI/FileManager/LangUtils.h diff --git a/CPP/7zip/FileManager/Resource/ListViewDialog/ListViewDialog.cpp b/CPP/7zip/UI/FileManager/ListViewDialog.cpp index e6a6779e..67423501 100755 --- a/CPP/7zip/FileManager/Resource/ListViewDialog/ListViewDialog.cpp +++ b/CPP/7zip/UI/FileManager/ListViewDialog.cpp @@ -4,7 +4,7 @@ #include "ListViewDialog.h" #ifdef LANG -#include "../../LangUtils.h" +#include "LangUtils.h" static CIDLangPair kIDLangPairs[] = { { IDOK, 0x02000702 }, diff --git a/CPP/7zip/FileManager/Resource/ListViewDialog/ListViewDialog.h b/CPP/7zip/UI/FileManager/ListViewDialog.h index ad107eba..57375c8b 100755 --- a/CPP/7zip/FileManager/Resource/ListViewDialog/ListViewDialog.h +++ b/CPP/7zip/UI/FileManager/ListViewDialog.h @@ -5,7 +5,7 @@ #include "Windows/Control/Dialog.h" #include "Windows/Control/ListView.h" -#include "resource.h" +#include "ListViewDialogRes.h" class CListViewDialog: public NWindows::NControl::CModalDialog { diff --git a/CPP/7zip/FileManager/Resource/ListViewDialog/resource.rc b/CPP/7zip/UI/FileManager/ListViewDialog.rc index 5c0bdbcd..e83f3330 100755 --- a/CPP/7zip/FileManager/Resource/ListViewDialog/resource.rc +++ b/CPP/7zip/UI/FileManager/ListViewDialog.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "ListViewDialogRes.h" +#include "../../GuiCommon.rc" #define xSize2 342 #define ySize2 220 diff --git a/CPP/7zip/FileManager/Resource/ListViewDialog/resource.h b/CPP/7zip/UI/FileManager/ListViewDialogRes.h index 440d14b0..440d14b0 100755 --- a/CPP/7zip/FileManager/Resource/ListViewDialog/resource.h +++ b/CPP/7zip/UI/FileManager/ListViewDialogRes.h diff --git a/CPP/7zip/FileManager/Resource/MessagesDialog/MessagesDialog.cpp b/CPP/7zip/UI/FileManager/MessagesDialog.cpp index d156f823..57879d64 100755 --- a/CPP/7zip/FileManager/Resource/MessagesDialog/MessagesDialog.cpp +++ b/CPP/7zip/UI/FileManager/MessagesDialog.cpp @@ -7,7 +7,7 @@ #include "Windows/ResourceString.h" #ifdef LANG -#include "../../LangUtils.h" +#include "LangUtils.h" #endif using namespace NWindows; diff --git a/CPP/7zip/FileManager/Resource/MessagesDialog/MessagesDialog.h b/CPP/7zip/UI/FileManager/MessagesDialog.h index 2ec22d80..6df0d46c 100755 --- a/CPP/7zip/FileManager/Resource/MessagesDialog/MessagesDialog.h +++ b/CPP/7zip/UI/FileManager/MessagesDialog.h @@ -3,7 +3,7 @@ #ifndef __MESSAGESDIALOG_H #define __MESSAGESDIALOG_H -#include "resource.h" +#include "MessagesDialogRes.h" #include "Windows/Control/Dialog.h" #include "Windows/Control/ListView.h" diff --git a/CPP/7zip/FileManager/Resource/MessagesDialog/resource.rc b/CPP/7zip/UI/FileManager/MessagesDialog.rc index eae00bf0..fdefb172 100755 --- a/CPP/7zip/FileManager/Resource/MessagesDialog/resource.rc +++ b/CPP/7zip/UI/FileManager/MessagesDialog.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "MessagesDialogRes.h" +#include "../../GuiCommon.rc" #define xSize2 430 #define ySize2 140 diff --git a/CPP/7zip/FileManager/Resource/MessagesDialog/resource.h b/CPP/7zip/UI/FileManager/MessagesDialogRes.h index 39d49f57..39d49f57 100755 --- a/CPP/7zip/FileManager/Resource/MessagesDialog/resource.h +++ b/CPP/7zip/UI/FileManager/MessagesDialogRes.h diff --git a/CPP/7zip/FileManager/Move.bmp b/CPP/7zip/UI/FileManager/Move.bmp Binary files differindex eb5f20f9..eb5f20f9 100755 --- a/CPP/7zip/FileManager/Move.bmp +++ b/CPP/7zip/UI/FileManager/Move.bmp diff --git a/CPP/7zip/FileManager/Move2.bmp b/CPP/7zip/UI/FileManager/Move2.bmp Binary files differindex 58679eff..58679eff 100755 --- a/CPP/7zip/FileManager/Move2.bmp +++ b/CPP/7zip/UI/FileManager/Move2.bmp diff --git a/CPP/7zip/FileManager/MyCom2.h b/CPP/7zip/UI/FileManager/MyCom2.h index 756a8169..756a8169 100755 --- a/CPP/7zip/FileManager/MyCom2.h +++ b/CPP/7zip/UI/FileManager/MyCom2.h diff --git a/CPP/7zip/FileManager/MyLoadMenu.cpp b/CPP/7zip/UI/FileManager/MyLoadMenu.cpp index 41b0ace0..a2a6c202 100755 --- a/CPP/7zip/FileManager/MyLoadMenu.cpp +++ b/CPP/7zip/UI/FileManager/MyLoadMenu.cpp @@ -7,12 +7,12 @@ #include "Windows/Menu.h" #include "Windows/Error.h" -#include "../PropID.h" +#include "../../PropID.h" #include "resource.h" #include "App.h" -#include "Resource/AboutDialog/AboutDialog.h" -#include "../UI/Common/CompressCall.h" +#include "AboutDialog.h" +#include "../Common/CompressCall.h" #include "HelpUtils.h" #include "LangUtils.h" diff --git a/CPP/7zip/FileManager/MyLoadMenu.h b/CPP/7zip/UI/FileManager/MyLoadMenu.h index 490dc6d8..490dc6d8 100755 --- a/CPP/7zip/FileManager/MyLoadMenu.h +++ b/CPP/7zip/UI/FileManager/MyLoadMenu.h diff --git a/CPP/7zip/FileManager/NetFolder.cpp b/CPP/7zip/UI/FileManager/NetFolder.cpp index a5cd379a..7bd5d2e5 100755 --- a/CPP/7zip/FileManager/NetFolder.cpp +++ b/CPP/7zip/UI/FileManager/NetFolder.cpp @@ -5,7 +5,7 @@ #include "NetFolder.h" #include "Common/StringConvert.h" -#include "../PropID.h" +#include "../../PropID.h" #include "Windows/Defs.h" #include "Windows/PropVariant.h" #include "Windows/FileFind.h" @@ -197,7 +197,7 @@ STDMETHODIMP CNetFolder::BindToFolder(UInt32 index, IFolderFolder **resultFolder if (resource.Usage == RESOURCEUSAGE_CONNECTABLE || resource.DisplayType == RESOURCEDISPLAYTYPE_SHARE) { - CFSFolder *fsFolderSpec = new CFSFolder; + NFsFolder::CFSFolder *fsFolderSpec = new NFsFolder::CFSFolder; CMyComPtr<IFolderFolder> subFolder = fsFolderSpec; RINOK(fsFolderSpec->Init(resource.RemoteName + L'\\', this)); *resultFolder = subFolder.Detach(); @@ -243,17 +243,6 @@ STDMETHODIMP CNetFolder::BindToParentFolder(IFolderFolder **resultFolder) return S_OK; } -STDMETHODIMP CNetFolder::GetName(BSTR *name) -{ - *name = 0; - return E_NOTIMPL; - /* - CMyComBSTR aBSTRName = m_ProxyFolderItem->m_Name; - *aName = aBSTRName.Detach(); - return S_OK; - */ -} - STDMETHODIMP CNetFolder::GetNumberOfProperties(UInt32 *numProperties) { *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); @@ -272,17 +261,15 @@ STDMETHODIMP CNetFolder::GetPropertyInfo(UInt32 index, return S_OK; } -STDMETHODIMP CNetFolder::GetTypeID(BSTR *name) +STDMETHODIMP CNetFolder::GetFolderProperty(PROPID propID, PROPVARIANT *value) { - CMyComBSTR aBSTRName = L"NetFolder"; - *name = aBSTRName.Detach(); - return S_OK; -} - -STDMETHODIMP CNetFolder::GetPath(BSTR *path) -{ - CMyComBSTR aBSTRName = _path; - *path = aBSTRName.Detach(); + NWindows::NCOM::CPropVariant prop; + switch(propID) + { + case kpidType: prop = L"NetFolder"; break; + case kpidPath: prop = _path; break; + } + prop.Detach(value); return S_OK; } diff --git a/CPP/7zip/FileManager/NetFolder.h b/CPP/7zip/UI/FileManager/NetFolder.h index acc7cad2..0214cfdb 100755 --- a/CPP/7zip/FileManager/NetFolder.h +++ b/CPP/7zip/UI/FileManager/NetFolder.h @@ -18,33 +18,16 @@ struct CResourceEx: public NWindows::NNet::CResourceW class CNetFolder: public IFolderFolder, - public IEnumProperties, - public IFolderGetTypeID, - public IFolderGetPath, public IFolderGetSystemIconIndex, public CMyUnknownImp { public: - MY_UNKNOWN_IMP4( - IEnumProperties, - IFolderGetTypeID, - IFolderGetPath, + MY_UNKNOWN_IMP1( IFolderGetSystemIconIndex ) - STDMETHOD(LoadItems)(); - STDMETHOD(GetNumberOfItems)(UInt32 *numItems); - STDMETHOD(GetProperty)(UInt32 itemIndex, PROPID propID, PROPVARIANT *value); - STDMETHOD(BindToFolder)(UInt32 index, IFolderFolder **resultFolder); - STDMETHOD(BindToFolder)(const wchar_t *name, IFolderFolder **resultFolder); - STDMETHOD(BindToParentFolder)(IFolderFolder **resultFolder); - STDMETHOD(GetName)(BSTR *name); + INTERFACE_FolderFolder(;) - STDMETHOD(GetNumberOfProperties)(UInt32 *numProperties); - STDMETHOD(GetPropertyInfo)(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType); - STDMETHOD(GetTypeID)(BSTR *name); - STDMETHOD(GetPath)(BSTR *path); STDMETHOD(GetSystemIconIndex)(UInt32 index, INT32 *iconIndex); private: diff --git a/CPP/7zip/FileManager/OpenCallback.cpp b/CPP/7zip/UI/FileManager/OpenCallback.cpp index a69de62c..70ec3f39 100755 --- a/CPP/7zip/FileManager/OpenCallback.cpp +++ b/CPP/7zip/UI/FileManager/OpenCallback.cpp @@ -5,9 +5,11 @@ #include "OpenCallback.h" #include "Common/StringConvert.h" -#include "Resource/PasswordDialog/PasswordDialog.h" #include "Windows/PropVariant.h" -#include "../Common/FileStreams.h" + +#include "../../Common/FileStreams.h" + +#include "PasswordDialog.h" STDMETHODIMP COpenArchiveCallback::SetTotal(const UINT64 * /* numFiles */, const UINT64 * /* numBytes */) { diff --git a/CPP/7zip/FileManager/OpenCallback.h b/CPP/7zip/UI/FileManager/OpenCallback.h index d7e9a5ed..15b50168 100755 --- a/CPP/7zip/FileManager/OpenCallback.h +++ b/CPP/7zip/UI/FileManager/OpenCallback.h @@ -7,9 +7,9 @@ #include "Common/MyCom.h" #include "Windows/FileFind.h" -#include "../IPassword.h" +#include "../../IPassword.h" -#include "../Archive/IArchive.h" +#include "../../Archive/IArchive.h" class COpenArchiveCallback: public IArchiveOpenCallback, diff --git a/CPP/7zip/FileManager/OptionsDialog.cpp b/CPP/7zip/UI/FileManager/OptionsDialog.cpp index 7413bafc..09d74705 100755 --- a/CPP/7zip/FileManager/OptionsDialog.cpp +++ b/CPP/7zip/UI/FileManager/OptionsDialog.cpp @@ -9,16 +9,16 @@ #include "Windows/Control/PropertyPage.h" #include "Windows/Error.h" -#include "Resource/LangPage/LangPage.h" -#include "Resource/LangPage/resource.h" -#include "Resource/PluginsPage/PluginsPage.h" -#include "Resource/PluginsPage/resource.h" -#include "Resource/SystemPage/SystemPage.h" -#include "Resource/SystemPage/resource.h" -#include "Resource/EditPage/EditPage.h" -#include "Resource/EditPage/resource.h" -#include "Resource/SettingsPage/SettingsPage.h" -#include "Resource/SettingsPage/resource.h" +#include "LangPage.h" +#include "LangPageRes.h" +#include "PluginsPage.h" +#include "PluginsPageRes.h" +#include "SystemPage.h" +#include "SystemPageRes.h" +#include "EditPage.h" +#include "EditPageRes.h" +#include "SettingsPage.h" +#include "SettingsPageRes.h" #include "LangUtils.h" #include "MyLoadMenu.h" diff --git a/CPP/7zip/FileManager/Resource/OverwriteDialog/OverwriteDialog.cpp b/CPP/7zip/UI/FileManager/OverwriteDialog.cpp index 8f13a43a..442df929 100755 --- a/CPP/7zip/FileManager/Resource/OverwriteDialog/OverwriteDialog.cpp +++ b/CPP/7zip/UI/FileManager/OverwriteDialog.cpp @@ -11,12 +11,12 @@ #include "Windows/Control/Static.h" #include "Windows/PropVariantConversions.h" -#include "../../FormatUtils.h" +#include "FormatUtils.h" // #include "../resource.h" #ifdef LANG -#include "../../LangUtils.h" +#include "LangUtils.h" #endif using namespace NWindows; diff --git a/CPP/7zip/FileManager/Resource/OverwriteDialog/OverwriteDialog.h b/CPP/7zip/UI/FileManager/OverwriteDialog.h index 193efb85..fd7444eb 100755 --- a/CPP/7zip/FileManager/Resource/OverwriteDialog/OverwriteDialog.h +++ b/CPP/7zip/UI/FileManager/OverwriteDialog.h @@ -3,7 +3,7 @@ #ifndef __OVERWRITEDIALOG_H #define __OVERWRITEDIALOG_H -#include "resource.h" +#include "OverwriteDialogRes.h" #include "Windows/Control/Dialog.h" namespace NOverwriteDialog diff --git a/CPP/7zip/FileManager/Resource/OverwriteDialog/resource.rc b/CPP/7zip/UI/FileManager/OverwriteDialog.rc index 1a907955..1cce0876 100755 --- a/CPP/7zip/FileManager/Resource/OverwriteDialog/resource.rc +++ b/CPP/7zip/UI/FileManager/OverwriteDialog.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "OverwriteDialogRes.h" +#include "../../GuiCommon.rc" #define xSize2 357 #define ySize2 204 diff --git a/CPP/7zip/FileManager/Resource/OverwriteDialog/resource.h b/CPP/7zip/UI/FileManager/OverwriteDialogRes.h index 66710f84..66710f84 100755 --- a/CPP/7zip/FileManager/Resource/OverwriteDialog/resource.h +++ b/CPP/7zip/UI/FileManager/OverwriteDialogRes.h diff --git a/CPP/7zip/FileManager/Panel.cpp b/CPP/7zip/UI/FileManager/Panel.cpp index fcc33edf..b1ef614f 100755 --- a/CPP/7zip/FileManager/Panel.cpp +++ b/CPP/7zip/UI/FileManager/Panel.cpp @@ -6,19 +6,26 @@ #include "Common/Defs.h" #include "Common/StringConvert.h" +#include "Common/IntToString.h" #include "Windows/Error.h" #include "Windows/PropVariant.h" +#include "Windows/Thread.h" -#include "../PropID.h" +#include "../../PropID.h" #include "Panel.h" #include "RootFolder.h" #include "FSFolder.h" #include "FormatUtils.h" #include "App.h" +#include "ExtractCallback.h" -#include "../UI/Common/CompressCall.h" -#include "../UI/Common/ArchiveName.h" +#include "resource.h" + +#include "../Agent/IFolderArchive.h" + +#include "../Common/CompressCall.h" +#include "../Common/ArchiveName.h" using namespace NWindows; @@ -311,7 +318,7 @@ bool CPanel::OnCreate(CREATESTRUCT * /* createStruct */) style |= WS_CLIPCHILDREN; style |= WS_CLIPSIBLINGS; - const UINT32 kNumListModes = sizeof(kStyles) / sizeof(kStyles[0]); + const UInt32 kNumListModes = sizeof(kStyles) / sizeof(kStyles[0]); if (_ListViewMode >= kNumListModes) _ListViewMode = kNumListModes - 1; @@ -666,12 +673,11 @@ void CPanel::SetFocusToLastRememberedItem() UString CPanel::GetFolderTypeID() const { - CMyComPtr<IFolderGetTypeID> folderGetTypeID; - if(_folder.QueryInterface(IID_IFolderGetTypeID, &folderGetTypeID) != S_OK) - return L""; - CMyComBSTR typeID; - folderGetTypeID->GetTypeID(&typeID); - return (wchar_t *)typeID; + NCOM::CPropVariant prop; + if (_folder->GetFolderProperty(kpidType, &prop) == S_OK) + if (prop.vt == VT_BSTR) + return (const wchar_t *)prop.bstrVal; + return L""; } bool CPanel::IsRootFolder() const @@ -725,7 +731,7 @@ bool CPanel::DoesItSupportOperations() const return _folder.QueryInterface(IID_IFolderOperations, &folderOperations) == S_OK; } -void CPanel::SetListViewMode(UINT32 index) +void CPanel::SetListViewMode(UInt32 index) { if (index >= 4) return; @@ -751,7 +757,7 @@ void CPanel::RefreshStatusBar() void CPanel::AddToArchive() { - CRecordVector<UINT32> indices; + CRecordVector<UInt32> indices; GetOperatedItemIndices(indices); if (!IsFSFolder()) { @@ -800,11 +806,12 @@ void CPanel::ExtractArchives() _panelCallback->OnCopy(false, false); return; } - CRecordVector<UINT32> indices; + CRecordVector<UInt32> indices; GetOperatedItemIndices(indices); UStringVector paths; if (indices.Size() == 0) { + // GetAllItemIndices(indices); MessageBox(kSelectOneFile); return; } @@ -826,10 +833,114 @@ void CPanel::ExtractArchives() ::ExtractArchives(paths, _currentFolderPrefix + folderName + UString(L"\\"), true); } +struct CThreadTest +{ + CRecordVector<UInt32> Indices; + CExtractCallbackImp *ExtractCallbackSpec; + CMyComPtr<IFolderArchiveExtractCallback> ExtractCallback; + CMyComPtr<IArchiveFolder> ArchiveFolder; + HRESULT Result; + + DWORD Test() + { + ExtractCallbackSpec->ProgressDialog.WaitCreating(); + Result = ArchiveFolder->Extract(&Indices[0], Indices.Size(), + NExtract::NPathMode::kFullPathnames, NExtract::NOverwriteMode::kAskBefore, + NULL, BoolToInt(true), ExtractCallback); + ExtractCallbackSpec->ProgressDialog.MyClose(); + return 0; + } + + static THREAD_FUNC_DECL MyThreadFunction(void *param) + { + return ((CThreadTest*)param)->Test(); + } +}; + +static void AddValuePair(UINT resourceID, UInt32 langID, UInt64 values, UString &s) +{ + wchar_t sz[32]; + s += LangString(resourceID, langID); + s += L" "; + ConvertUInt64ToString(values, sz); + s += sz; + s += L"\n"; +} + +/* +static void AddSizePair(UINT resourceID, UInt32 langID, UInt64 value, UString &s) +{ + wchar_t sz[32]; + s += LangString(resourceID, langID); + s += L" "; + ConvertUInt64ToString(value, sz); + s += sz; + ConvertUInt64ToString(value >> 20, sz); + s += L" ("; + s += sz; + s += L" MB)"; + s += L"\n"; +} +*/ + void CPanel::TestArchives() { - CRecordVector<UINT32> indices; + CRecordVector<UInt32> indices; GetOperatedItemIndices(indices); + CMyComPtr<IArchiveFolder> archiveFolder; + _folder.QueryInterface(IID_IArchiveFolder, &archiveFolder); + if (archiveFolder) + { + CThreadTest extracter; + + extracter.ArchiveFolder = archiveFolder; + extracter.ExtractCallbackSpec = new CExtractCallbackImp; + extracter.ExtractCallback = extracter.ExtractCallbackSpec; + extracter.ExtractCallbackSpec->ParentWindow = GetParent(); + extracter.ExtractCallbackSpec->ShowMessages = true; + + if (indices.IsEmpty()) + GetAllItemIndices(indices); + if (indices.IsEmpty()) + return; + + extracter.Indices = indices; + + UString title = LangString(IDS_PROGRESS_TESTING, 0x02000F90); + UString progressWindowTitle = LangString(IDS_APP_TITLE, 0x03000000); + + extracter.ExtractCallbackSpec->ProgressDialog.CompressingMode = false; + extracter.ExtractCallbackSpec->ProgressDialog.MainWindow = GetParent(); + extracter.ExtractCallbackSpec->ProgressDialog.MainTitle = progressWindowTitle; + extracter.ExtractCallbackSpec->ProgressDialog.MainAddTitle = title + L" "; + + extracter.ExtractCallbackSpec->OverwriteMode = NExtract::NOverwriteMode::kAskBefore; + extracter.ExtractCallbackSpec->Init(); + + NWindows::CThread extractThread; + if (extractThread.Create(CThreadTest::MyThreadFunction, &extracter) != S_OK) + return; + extracter.ExtractCallbackSpec->StartProgressDialog(title); + + if (extracter.ExtractCallbackSpec->Messages.IsEmpty() && extracter.Result == S_OK) + { + UString s; + AddValuePair(IDS_FOLDERS_COLON, 0x02000321, extracter.ExtractCallbackSpec->NumFolders, s); + AddValuePair(IDS_FILES_COLON, 0x02000320, extracter.ExtractCallbackSpec->NumFiles, s); + // AddSizePair(IDS_SIZE_COLON, 0x02000322, extracter.Stat.UnpackSize, s); + // AddSizePair(IDS_COMPRESSED_COLON, 0x02000323, extracter.Stat.PackSize, s); + s += L"\n"; + s += LangString(IDS_MESSAGE_NO_ERRORS, 0x02000608); + MessageBoxInfo(s, LangString(IDS_PROGRESS_TESTING, 0x02000F90)); + } + else + { + if (extracter.Result != S_OK && extracter.Result != E_ABORT) + MessageBoxError(extracter.Result, L"Testing Error"); + } + return; + } + if (!IsFSFolder()) { MessageBox(L"Test archive operation is not supported for that folder"); diff --git a/CPP/7zip/FileManager/Panel.h b/CPP/7zip/UI/FileManager/Panel.h index ba0e0884..1f6dc140 100755 --- a/CPP/7zip/FileManager/Panel.h +++ b/CPP/7zip/UI/FileManager/Panel.h @@ -393,6 +393,7 @@ public: void GetSelectedItemsIndices(CRecordVector<UInt32> &indices) const; void GetOperatedItemIndices(CRecordVector<UInt32> &indices) const; + void GetAllItemIndices(CRecordVector<UInt32> &indices) const; // void GetOperatedListViewIndices(CRecordVector<UInt32> &indices) const; void KillSelection(); diff --git a/CPP/7zip/FileManager/PanelCopy.cpp b/CPP/7zip/UI/FileManager/PanelCopy.cpp index 88a6a669..0bb5dafa 100755 --- a/CPP/7zip/FileManager/PanelCopy.cpp +++ b/CPP/7zip/UI/FileManager/PanelCopy.cpp @@ -2,8 +2,6 @@ #include "StdAfx.h" -#include "Windows/COM.h" - #include "Panel.h" #include "resource.h" #include "LangUtils.h" @@ -29,7 +27,6 @@ struct CThreadExtractInArchive2 DWORD Extract() { - // NCOM::CComInitializer comInitializer; ExtractCallbackSpec->ProgressDialog.WaitCreating(); if (MoveMode) Result = FolderOperations->MoveTo(&Indices.Front(), Indices.Size(), @@ -67,6 +64,7 @@ HRESULT CPanel::CopyTo(const CRecordVector<UInt32> &indices, const UString &fold extracter.ExtractCallback = extracter.ExtractCallbackSpec; extracter.ExtractCallbackSpec->ParentWindow = GetParent(); extracter.ExtractCallbackSpec->ShowMessages = showErrorMessages; + extracter.ExtractCallbackSpec->ProgressDialog.CompressingMode = false; UString title = moveMode ? LangString(IDS_MOVING, 0x03020206): @@ -106,7 +104,6 @@ struct CThreadUpdate DWORD Process() { - NCOM::CComInitializer comInitializer; UpdateCallbackSpec->ProgressDialog.WaitCreating(); Result = FolderOperations->CopyFrom( FolderPrefix, diff --git a/CPP/7zip/FileManager/PanelCrc.cpp b/CPP/7zip/UI/FileManager/PanelCrc.cpp index 5e49390f..b2163742 100755 --- a/CPP/7zip/FileManager/PanelCrc.cpp +++ b/CPP/7zip/UI/FileManager/PanelCrc.cpp @@ -6,8 +6,8 @@ extern "C" { - #include "../../../C/Alloc.h" - #include "../../../C/7zCrc.h" + #include "../../../../C/Alloc.h" + #include "../../../../C/7zCrc.h" } #include "Common/IntToString.h" @@ -19,8 +19,8 @@ extern "C" #include "Windows/Thread.h" #include "Windows/Error.h" -#include "Resource/ProgressDialog2/ProgressDialog.h" -#include "Resource/OverwriteDialog/resource.h" +#include "ProgressDialog2.h" +#include "OverwriteDialogRes.h" #include "App.h" #include "FormatUtils.h" diff --git a/CPP/7zip/FileManager/PanelDrag.cpp b/CPP/7zip/UI/FileManager/PanelDrag.cpp index 24f1def0..0baa151a 100755 --- a/CPP/7zip/FileManager/PanelDrag.cpp +++ b/CPP/7zip/UI/FileManager/PanelDrag.cpp @@ -8,10 +8,10 @@ #include "Windows/FileDir.h" #include "Windows/Shell.h" -#include "../UI/Common/ArchiveName.h" -#include "../UI/Common/CompressCall.h" +#include "../Common/ArchiveName.h" +#include "../Common/CompressCall.h" -#include "Resource/MessagesDialog/MessagesDialog.h" +#include "MessagesDialog.h" #include "App.h" #include "EnumFormatEtc.h" diff --git a/CPP/7zip/FileManager/PanelFolderChange.cpp b/CPP/7zip/UI/FileManager/PanelFolderChange.cpp index 29841f54..a8cfb3be 100755 --- a/CPP/7zip/FileManager/PanelFolderChange.cpp +++ b/CPP/7zip/UI/FileManager/PanelFolderChange.cpp @@ -6,8 +6,10 @@ #include "Common/Wildcard.h" #include "Windows/FileDir.h" +#include "../../PropID.h" + #include "Panel.h" -#include "Resource/ListViewDialog/ListViewDialog.h" +#include "ListViewDialog.h" #include "RootFolder.h" #include "ViewSettings.h" #include "FSDrives.h" @@ -113,15 +115,12 @@ void CPanel::OpenBookmark(int index) BindToPathAndRefresh(_appState->FastFolders.GetString(index)); } -UString GetFolderPath(IFolderFolder * folder) +UString GetFolderPath(IFolderFolder *folder) { - CMyComPtr<IFolderGetPath> folderGetPath; - if (folder->QueryInterface(IID_IFolderGetPath, (void **)&folderGetPath) == S_OK) - { - CMyComBSTR path; - if (folderGetPath->GetPath(&path) == S_OK) - return (const wchar_t *)path; - } + NCOM::CPropVariant prop; + if (folder->GetFolderProperty(kpidPath, &prop) == S_OK) + if (prop.vt == VT_BSTR) + return (wchar_t *)prop.bstrVal; return UString(); } diff --git a/CPP/7zip/FileManager/PanelItemOpen.cpp b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp index 8ec6596f..1795da41 100755 --- a/CPP/7zip/FileManager/PanelItemOpen.cpp +++ b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp @@ -14,7 +14,7 @@ #include "Windows/Thread.h" #include "Windows/Synchronization.h" #include "Windows/Error.h" -#include "Windows/COM.h" +// #include "Windows/COM.h" #include "ExtractCallback.h" #include "IFolder.h" diff --git a/CPP/7zip/FileManager/PanelItems.cpp b/CPP/7zip/UI/FileManager/PanelItems.cpp index 07d10a76..41ef45dd 100755 --- a/CPP/7zip/FileManager/PanelItems.cpp +++ b/CPP/7zip/UI/FileManager/PanelItems.cpp @@ -8,7 +8,7 @@ #include "Windows/PropVariantConversions.h" #include "Windows/Menu.h" -#include "../PropID.h" +#include "../../PropID.h" #include "Panel.h" #include "resource.h" @@ -20,7 +20,7 @@ extern "C" { - #include "../../../C/Sort.h" + #include "../../../../C/Sort.h" } using namespace NWindows; @@ -81,29 +81,10 @@ void CPanel::InitColumns() _properties.Clear(); - CMyComPtr<IEnumProperties> enumProperties; - // CMyComPtr<IEnumSTATPROPSTG> enumSTATPROPSTG; - /* - if (m_ArchiveHandler) - { - if (m_ArchiveHandler->EnumProperties(&enumSTATPROPSTG) != S_OK) - throw 1; - } - else - */ - { - if (_folder.QueryInterface(IID_IEnumProperties, &enumProperties) != S_OK) - throw 1; - /* - if (enumProperties->EnumProperties(&enumSTATPROPSTG)!= S_OK) - throw 1; - */ - } - _needSaveInfo = true; - UINT32 numProperties; - enumProperties->GetNumberOfProperties(&numProperties); + UInt32 numProperties; + _folder->GetNumberOfProperties(&numProperties); int i; for (i = 0; i < (int)numProperties; i++) { @@ -111,7 +92,7 @@ void CPanel::InitColumns() PROPID propID; VARTYPE varType; - if (enumProperties->GetPropertyInfo(i, &name, &propID, &varType) != S_OK) + if (_folder->GetPropertyInfo(i, &name, &propID, &varType) != S_OK) throw 1; CItemProperty destProperty; @@ -215,7 +196,7 @@ void CPanel::GetSelectedNames(UStringVector &selectedNames) { selectedNames.Clear(); - CRecordVector<UINT32> indices; + CRecordVector<UInt32> indices; GetSelectedItemsIndices(indices); selectedNames.Reserve(indices.Size()); for (int i = 0; i < indices.Size(); i++) @@ -349,7 +330,7 @@ void CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool se // OutputDebugString(TEXT("Start Dir\n")); - UINT32 numItems; + UInt32 numItems; _folder->GetNumberOfItems(&numItems); bool showDots = _showDots && !IsRootFolder(); @@ -374,7 +355,7 @@ void CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool se item.iSubItem = subItem++; item.lParam = kParentIndex; item.pszText = (wchar_t *)(const wchar_t *)itemName; - UINT32 attributes = FILE_ATTRIBUTE_DIRECTORY; + UInt32 attributes = FILE_ATTRIBUTE_DIRECTORY; item.iImage = _extToIconMap.GetIconIndex(attributes, itemName); if (item.iImage < 0) item.iImage = 0; @@ -434,7 +415,7 @@ void CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool se NCOM::CPropVariant propVariant; _folder->GetProperty(i, kpidAttributes, &propVariant); - UINT32 attributes = 0; + UInt32 attributes = 0; if (propVariant.vt == VT_UI4) attributes = propVariant.ulVal; else @@ -490,7 +471,7 @@ void CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool se */ } -void CPanel::GetSelectedItemsIndices(CRecordVector<UINT32> &indices) const +void CPanel::GetSelectedItemsIndices(CRecordVector<UInt32> &indices) const { indices.Clear(); /* @@ -508,7 +489,7 @@ void CPanel::GetSelectedItemsIndices(CRecordVector<UINT32> &indices) const HeapSort(&indices.Front(), indices.Size()); } -void CPanel::GetOperatedItemIndices(CRecordVector<UINT32> &indices) const +void CPanel::GetOperatedItemIndices(CRecordVector<UInt32> &indices) const { GetSelectedItemsIndices(indices); if (!indices.IsEmpty()) @@ -527,6 +508,15 @@ void CPanel::GetOperatedItemIndices(CRecordVector<UINT32> &indices) const } } +void CPanel::GetAllItemIndices(CRecordVector<UInt32> &indices) const +{ + indices.Clear(); + UInt32 numItems; + if (_folder->GetNumberOfItems(&numItems) == S_OK) + for (UInt32 i = 0; i < numItems; i++) + indices.Add(i); +} + /* void CPanel::GetOperatedListViewIndices(CRecordVector<UInt32> &indices) const { @@ -574,7 +564,7 @@ void CPanel::OpenFocusedItemAsInternal() void CPanel::OpenSelectedItems(bool tryInternal) { - CRecordVector<UINT32> indices; + CRecordVector<UInt32> indices; GetOperatedItemIndices(indices); if (indices.Size() > 20) { @@ -593,7 +583,7 @@ void CPanel::OpenSelectedItems(bool tryInternal) bool dirIsStarted = false; for(int i = 0; i < indices.Size(); i++) { - UINT32 index = indices[i]; + UInt32 index = indices[i]; // CFileInfo &aFile = m_Files[index]; if (IsItemFolder(index)) { @@ -673,13 +663,9 @@ UINT64 CPanel::GetItemSize(int itemIndex) const void CPanel::ReadListViewInfo() { - CMyComPtr<IFolderGetTypeID> folderGetTypeID; - if(_folder.QueryInterface(IID_IFolderGetTypeID, &folderGetTypeID) != S_OK) - return; - CMyComBSTR typeID; - folderGetTypeID->GetTypeID(&typeID); - _typeIDString = typeID; - ::ReadListViewInfo(_typeIDString, _listViewInfo); + _typeIDString = GetFolderTypeID(); + if (!_typeIDString.IsEmpty()) + ::ReadListViewInfo(_typeIDString, _listViewInfo); } void CPanel::SaveListViewInfo() diff --git a/CPP/7zip/FileManager/PanelKey.cpp b/CPP/7zip/UI/FileManager/PanelKey.cpp index 9c6ddac1..5f002de9 100755 --- a/CPP/7zip/FileManager/PanelKey.cpp +++ b/CPP/7zip/UI/FileManager/PanelKey.cpp @@ -5,7 +5,7 @@ #include "Panel.h" #include "HelpUtils.h" -#include "../PropID.h" +#include "../../PropID.h" #include "App.h" // static LPCWSTR kHelpTopic = L"FM/index.htm"; diff --git a/CPP/7zip/FileManager/PanelListNotify.cpp b/CPP/7zip/UI/FileManager/PanelListNotify.cpp index 9e319cce..69b06119 100755 --- a/CPP/7zip/FileManager/PanelListNotify.cpp +++ b/CPP/7zip/UI/FileManager/PanelListNotify.cpp @@ -9,10 +9,10 @@ #include "Windows/PropVariant.h" #include "Windows/PropVariantConversions.h" -#include "Windows/COM.h" +// #include "Windows/COM.h" -#include "../UI/Common/PropIDUtils.h" -#include "../PropID.h" +#include "../Common/PropIDUtils.h" +#include "../../PropID.h" #include "Panel.h" #include "FormatUtils.h" diff --git a/CPP/7zip/FileManager/PanelMenu.cpp b/CPP/7zip/UI/FileManager/PanelMenu.cpp index 64db53ee..58d457cb 100755 --- a/CPP/7zip/FileManager/PanelMenu.cpp +++ b/CPP/7zip/UI/FileManager/PanelMenu.cpp @@ -3,6 +3,9 @@ #include "Common/StringConvert.h" #include "Windows/Menu.h" #include "Windows/COM.h" +#include "Windows/PropVariant.h" +#include "../Common/PropIDUtils.h" +#include "../../PropID.h" #include "Panel.h" #include "PluginInterface.h" @@ -10,6 +13,8 @@ #include "App.h" #include "LangUtils.h" #include "resource.h" +#include "PropertyName.h" +#include "PropertyNameRes.h" using namespace NWindows; @@ -24,7 +29,7 @@ void CPanel::InvokeSystemCommand(const char *command) { if (!IsFSFolder() && !IsFSDrivesFolder()) return; - CRecordVector<UINT32> operatedIndices; + CRecordVector<UInt32> operatedIndices; GetOperatedItemIndices(operatedIndices); if (operatedIndices.IsEmpty()) return; @@ -40,9 +45,140 @@ void CPanel::InvokeSystemCommand(const char *command) contextMenu->InvokeCommand(&ci); } -void CPanel::Properties() +static const wchar_t *kSeparator = L"--------------------------------------\n"; +static const wchar_t *kPropValueSeparator = L": "; + +static void AddPropertyString(PROPID propID, const wchar_t *nameBSTR, + const NCOM::CPropVariant &prop, UString &s) { - InvokeSystemCommand("properties"); + if (prop.vt != VT_EMPTY) + { + UString name = GetNameOfProperty(propID); + if (name.IsEmpty() && nameBSTR != NULL) + name = nameBSTR; + if (name.IsEmpty()) + name = L"?"; + + const UString val = ConvertPropertyToString(prop, propID); + if (!val.IsEmpty()) + { + s += name; + s += kPropValueSeparator; + /* + if (propID == kpidComment) + s += L'\n'; + */ + s += val; + s += L'\n'; + } + } +} + +void CPanel::Properties() +{ + CMyComPtr<IGetFolderArchiveProperties> getFolderArchiveProperties; + _folder.QueryInterface(IID_IGetFolderArchiveProperties, &getFolderArchiveProperties); + if (!getFolderArchiveProperties) + { + InvokeSystemCommand("properties"); + return; + } + + { + UString message; + + CRecordVector<UInt32> operatedIndices; + GetOperatedItemIndices(operatedIndices); + if (operatedIndices.Size() == 1) + { + UInt32 index = operatedIndices[0]; + // message += L"Item:\n"; + UInt32 numProps; + if (_folder->GetNumberOfProperties(&numProps) == S_OK) + { + for (UInt32 i = 0; i < numProps; i++) + { + CMyComBSTR name; + PROPID propID; + VARTYPE varType; + + if (_folder->GetPropertyInfo(i, &name, &propID, &varType) != S_OK) + continue; + + NCOM::CPropVariant prop; + if (_folder->GetProperty(index, propID, &prop) != S_OK) + continue; + AddPropertyString(propID, name, prop, message); + } + } + message += kSeparator; + } + + message += LangString(IDS_PROPERTY_FILE_TYPE, 0x02000214); + message += kPropValueSeparator; + message += GetFolderTypeID(); + message += L"\n"; + + { + NCOM::CPropVariant prop; + if (_folder->GetFolderProperty(kpidPath, &prop) == S_OK) + { + AddPropertyString(kpidName, L"Path", prop, message); + } + } + + CMyComPtr<IFolderProperties> folderProperties; + _folder.QueryInterface(IID_IFolderProperties, &folderProperties); + if (folderProperties) + { + UInt32 numProps; + if (folderProperties->GetNumberOfFolderProperties(&numProps) == S_OK) + { + for (UInt32 i = 0; i < numProps; i++) + { + CMyComBSTR name; + PROPID propID; + VARTYPE vt; + if (folderProperties->GetFolderPropertyInfo(i, &name, &propID, &vt) != S_OK) + continue; + NCOM::CPropVariant prop; + if (_folder->GetFolderProperty(propID, &prop) != S_OK) + continue; + AddPropertyString(propID, name, prop, message); + } + } + } + + CMyComPtr<IGetFolderArchiveProperties> getFolderArchiveProperties; + _folder.QueryInterface(IID_IGetFolderArchiveProperties, &getFolderArchiveProperties); + if (getFolderArchiveProperties) + { + CMyComPtr<IFolderArchiveProperties> getProps; + getFolderArchiveProperties->GetFolderArchiveProperties(&getProps); + if (getProps) + { + UInt32 numProps; + if (getProps->GetNumberOfArchiveProperties(&numProps) == S_OK) + { + if (numProps > 0) + message += kSeparator; + for (UInt32 i = 0; i < numProps; i++) + { + CMyComBSTR name; + PROPID propID; + VARTYPE vt; + if (getProps->GetArchivePropertyInfo(i, &name, &propID, &vt) != S_OK) + continue; + NCOM::CPropVariant prop; + if (getProps->GetArchiveProperty(propID, &prop) != S_OK) + continue; + AddPropertyString(propID, name, prop, message); + } + } + } + } + ::MessageBoxW(*(this), message, LangString(IDS_PROPERTIES, 0x03020900), MB_OK); + } } // Copy and paste do not work, if you know why write me. @@ -60,7 +196,7 @@ void CPanel::EditPaste() } HRESULT CPanel::CreateShellContextMenu( - const CRecordVector<UINT32> &operatedIndices, + const CRecordVector<UInt32> &operatedIndices, CMyComPtr<IContextMenu> &systemContextMenu) { systemContextMenu.Release(); @@ -138,7 +274,7 @@ HRESULT CPanel::CreateShellContextMenu( } void CPanel::CreateSystemMenu(HMENU menuSpec, - const CRecordVector<UINT32> &operatedIndices, + const CRecordVector<UInt32> &operatedIndices, CMyComPtr<IContextMenu> &systemContextMenu) { systemContextMenu.Release(); @@ -241,7 +377,7 @@ void CPanel::CreateFileMenu(HMENU menuSpec) } void CPanel::CreateSevenZipMenu(HMENU menuSpec, - const CRecordVector<UINT32> &operatedIndices, + const CRecordVector<UInt32> &operatedIndices, CMyComPtr<IContextMenu> &sevenZipContextMenu) { sevenZipContextMenu.Release(); @@ -291,7 +427,7 @@ void CPanel::CreateFileMenu(HMENU menuSpec, sevenZipContextMenu.Release(); systemContextMenu.Release(); - CRecordVector<UINT32> operatedIndices; + CRecordVector<UInt32> operatedIndices; GetOperatedItemIndices(operatedIndices); CMenu menu; @@ -315,7 +451,7 @@ bool CPanel::InvokePluginCommand(int id) bool CPanel::InvokePluginCommand(int id, IContextMenu *sevenZipContextMenu, IContextMenu *systemContextMenu) { - UINT32 offset; + UInt32 offset; bool isSystemMenu = (id >= kSystemStartMenuID); if (isSystemMenu) offset = id - kSystemStartMenuID; @@ -370,7 +506,7 @@ bool CPanel::OnContextMenu(HANDLE windowHandle, int xPos, int yPos) int index = _listView.HitTest(&info); */ - CRecordVector<UINT32> operatedIndices; + CRecordVector<UInt32> operatedIndices; GetOperatedItemIndices(operatedIndices); if (xPos < 0 || yPos < 0) diff --git a/CPP/7zip/FileManager/PanelOperations.cpp b/CPP/7zip/UI/FileManager/PanelOperations.cpp index 40c03c13..392ca370 100755 --- a/CPP/7zip/FileManager/PanelOperations.cpp +++ b/CPP/7zip/UI/FileManager/PanelOperations.cpp @@ -13,7 +13,7 @@ #include "Windows/Thread.h" #include "Windows/COM.h" -#include "Resource/ComboDialog/ComboDialog.h" +#include "ComboDialog.h" #include "FSFolder.h" #include "LangUtils.h" @@ -32,7 +32,7 @@ struct CThreadDelete { CMyComPtr<IFolderOperations> FolderOperations; CRecordVector<UInt32> Indices; - CMyComPtr<IFolderArchiveUpdateCallback> UpdateCallback; + CMyComPtr<IProgress> UpdateCallback; CUpdateCallback100Imp *UpdateCallbackSpec; HRESULT Result; @@ -51,6 +51,29 @@ struct CThreadDelete } }; +struct CThreadCreateFolder +{ + CMyComPtr<IFolderOperations> FolderOperations; + UString Name; + CMyComPtr<IProgress> UpdateCallback; + CUpdateCallback100Imp *UpdateCallbackSpec; + HRESULT Result; + + DWORD Process() + { + NCOM::CComInitializer comInitializer; + UpdateCallbackSpec->ProgressDialog.WaitCreating(); + Result = FolderOperations->CreateFolder(Name, UpdateCallback); + UpdateCallbackSpec->ProgressDialog.MyClose(); + return 0; + } + + static THREAD_FUNC_DECL MyThreadFunction(void *param) + { + return ((CThreadCreateFolder *)param)->Process(); + } +}; + #ifndef _UNICODE typedef int (WINAPI * SHFileOperationWP)(LPSHFILEOPSTRUCTW lpFileOp); #endif @@ -291,8 +314,32 @@ void CPanel::CreateFolder() comboDialog.Value = LangString(IDS_CREATE_FOLDER_DEFAULT_NAME, /*0x03020232*/ (UInt32)-1); if (comboDialog.Create(GetParent()) == IDCANCEL) return; + UString newName = comboDialog.Value; - HRESULT result = folderOperations->CreateFolder(newName, 0); + + // HRESULT result = folderOperations->CreateFolder(newName, 0); + + CThreadCreateFolder upd; + upd.UpdateCallbackSpec = new CUpdateCallback100Imp; + upd.UpdateCallback = upd.UpdateCallbackSpec; + upd.UpdateCallbackSpec->Init(GetParent(), false, L""); + + UString progressTitle = LangString(IDS_CREATE_FOLDER, 0x03020230); + + upd.UpdateCallbackSpec->ProgressDialog.MainWindow = _mainWindow; + upd.UpdateCallbackSpec->ProgressDialog.MainTitle = LangString(IDS_APP_TITLE, 0x03000000); + upd.UpdateCallbackSpec->ProgressDialog.MainAddTitle = progressTitle + UString(L" "); + + upd.FolderOperations = folderOperations; + upd.Name = newName; + + NWindows::CThread thread; + if (thread.Create(CThreadCreateFolder::MyThreadFunction, &upd) != S_OK) + throw 271824; + upd.UpdateCallbackSpec->StartProgressDialog(progressTitle); + + HRESULT result = upd.Result; + if (result != S_OK) { MessageBoxError(result, LangString(IDS_CREATE_FOLDER_ERROR, 0x03020233)); diff --git a/CPP/7zip/FileManager/PanelSelect.cpp b/CPP/7zip/UI/FileManager/PanelSelect.cpp index e769195f..4b726b1e 100755 --- a/CPP/7zip/FileManager/PanelSelect.cpp +++ b/CPP/7zip/UI/FileManager/PanelSelect.cpp @@ -9,7 +9,7 @@ #include "Panel.h" -#include "Resource/ComboDialog/ComboDialog.h" +#include "ComboDialog.h" #include "LangUtils.h" diff --git a/CPP/7zip/FileManager/PanelSort.cpp b/CPP/7zip/UI/FileManager/PanelSort.cpp index fd9027b9..c5fddcd6 100755 --- a/CPP/7zip/FileManager/PanelSort.cpp +++ b/CPP/7zip/UI/FileManager/PanelSort.cpp @@ -4,7 +4,7 @@ #include "Windows/PropVariant.h" -#include "../PropID.h" +#include "../../PropID.h" #include "Panel.h" diff --git a/CPP/7zip/FileManager/PanelSplitFile.cpp b/CPP/7zip/UI/FileManager/PanelSplitFile.cpp index ac06623b..b9cce2d8 100755 --- a/CPP/7zip/FileManager/PanelSplitFile.cpp +++ b/CPP/7zip/UI/FileManager/PanelSplitFile.cpp @@ -6,21 +6,21 @@ extern "C" { - #include "../../../C/Alloc.h" + #include "../../../../C/Alloc.h" } #include "Common/Types.h" #include "Common/IntToString.h" -#include "Windows/COM.h" +// #include "Windows/COM.h" #include "Windows/FileIO.h" #include "Windows/FileFind.h" #include "Windows/Thread.h" -#include "Resource/ProgressDialog2/ProgressDialog.h" -#include "Resource/SplitDialog/SplitDialog.h" -#include "Resource/CopyDialog/CopyDialog.h" +#include "ProgressDialog2.h" +#include "SplitDialog.h" +#include "CopyDialog.h" -#include "../UI/Resource/Extract/resource.h" +#include "../GUI/ExtractRes.h" #include "SplitUtils.h" #include "App.h" diff --git a/CPP/7zip/FileManager/Resource/PasswordDialog/PasswordDialog.cpp b/CPP/7zip/UI/FileManager/PasswordDialog.cpp index 4f09f7f7..a366a61e 100755 --- a/CPP/7zip/FileManager/Resource/PasswordDialog/PasswordDialog.cpp +++ b/CPP/7zip/UI/FileManager/PasswordDialog.cpp @@ -4,7 +4,7 @@ #include "PasswordDialog.h" #ifdef LANG -#include "../../LangUtils.h" +#include "LangUtils.h" #endif #ifdef LANG diff --git a/CPP/7zip/FileManager/Resource/PasswordDialog/PasswordDialog.h b/CPP/7zip/UI/FileManager/PasswordDialog.h index f77cd2be..e5a96073 100755 --- a/CPP/7zip/FileManager/Resource/PasswordDialog/PasswordDialog.h +++ b/CPP/7zip/UI/FileManager/PasswordDialog.h @@ -5,7 +5,7 @@ #include "Windows/Control/Dialog.h" #include "Windows/Control/Edit.h" -#include "resource.h" +#include "PasswordDialogRes.h" class CPasswordDialog: public NWindows::NControl::CModalDialog { diff --git a/CPP/7zip/FileManager/Resource/PasswordDialog/resource.rc b/CPP/7zip/UI/FileManager/PasswordDialog.rc index 7e2658c7..64381aff 100755 --- a/CPP/7zip/FileManager/Resource/PasswordDialog/resource.rc +++ b/CPP/7zip/UI/FileManager/PasswordDialog.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "PasswordDialogRes.h" +#include "../../GuiCommon.rc" #define xSize2 172 #define ySize2 68 diff --git a/CPP/7zip/FileManager/Resource/PasswordDialog/resource.h b/CPP/7zip/UI/FileManager/PasswordDialogRes.h index e0b42661..e0b42661 100755 --- a/CPP/7zip/FileManager/Resource/PasswordDialog/resource.h +++ b/CPP/7zip/UI/FileManager/PasswordDialogRes.h diff --git a/CPP/7zip/FileManager/PhysDriveFolder.cpp b/CPP/7zip/UI/FileManager/PhysDriveFolder.cpp index fc5045eb..d611e096 100755 --- a/CPP/7zip/FileManager/PhysDriveFolder.cpp +++ b/CPP/7zip/UI/FileManager/PhysDriveFolder.cpp @@ -4,7 +4,7 @@ extern "C" { - #include "../../../C/Alloc.h" + #include "../../../../C/Alloc.h" } #include "PhysDriveFolder.h" @@ -12,7 +12,7 @@ extern "C" #include "Windows/FileDevice.h" #include "Windows/FileSystem.h" -#include "../PropID.h" +#include "../../PropID.h" using namespace NWindows; @@ -87,9 +87,6 @@ STDMETHODIMP CPhysDriveFolder::BindToParentFolder(IFolderFolder **resultFolder) return S_OK; } -STDMETHODIMP CPhysDriveFolder::GetName(BSTR * /* name */) - { return E_NOTIMPL; } - STDMETHODIMP CPhysDriveFolder::GetNumberOfProperties(UInt32 *numProperties) { *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); @@ -109,18 +106,15 @@ STDMETHODIMP CPhysDriveFolder::GetPropertyInfo(UInt32 index, } -STDMETHODIMP CPhysDriveFolder::GetTypeID(BSTR *name) +STDMETHODIMP CPhysDriveFolder::GetFolderProperty(PROPID propID, PROPVARIANT *value) { - CMyComBSTR temp = L"PhysDrive"; - *name = temp.Detach(); - return S_OK; -} - -STDMETHODIMP CPhysDriveFolder::GetPath(BSTR *path) -{ - UString tempPath = GetFullPath() + L"\\"; - CMyComBSTR temp = tempPath; - *path = temp.Detach(); + NWindows::NCOM::CPropVariant prop; + switch(propID) + { + case kpidType: prop = L"PhysDrive"; break; + case kpidPath: prop = (GetFullPath() + L"\\"); break; + } + prop.Detach(value); return S_OK; } diff --git a/CPP/7zip/UI/FileManager/PhysDriveFolder.h b/CPP/7zip/UI/FileManager/PhysDriveFolder.h new file mode 100755 index 00000000..996dda13 --- /dev/null +++ b/CPP/7zip/UI/FileManager/PhysDriveFolder.h @@ -0,0 +1,58 @@ +// PhysDriveFolder.h + +#ifndef __PHYSDRIVEFOLDER_H +#define __PHYSDRIVEFOLDER_H + +#include "Common/MyString.h" +#include "Common/MyCom.h" + +#include "IFolder.h" + +class CPhysDriveFolder: + public IFolderFolder, + public IFolderWasChanged, + public IFolderOperations, + public IFolderGetItemFullSize, + public IFolderClone, + // public IFolderGetSystemIconIndex, + public CMyUnknownImp +{ + UInt64 GetSizeOfItem(int anIndex) const; +public: + MY_QUERYINTERFACE_BEGIN + MY_QUERYINTERFACE_ENTRY(IFolderWasChanged) + MY_QUERYINTERFACE_ENTRY(IFolderOperations) + MY_QUERYINTERFACE_ENTRY(IFolderGetItemFullSize) + MY_QUERYINTERFACE_ENTRY(IFolderClone) + // MY_QUERYINTERFACE_ENTRY(IFolderGetSystemIconIndex) + MY_QUERYINTERFACE_END + MY_ADDREF_RELEASE + + + INTERFACE_FolderFolder(;) + INTERFACE_FolderOperations(;) + + STDMETHOD(WasChanged)(INT32 *wasChanged); + STDMETHOD(Clone)(IFolderFolder **resultFolder); + STDMETHOD(GetItemFullSize)(UInt32 index, PROPVARIANT *value, IProgress *progress); + + // STDMETHOD(GetSystemIconIndex)(UInt32 index, INT32 *iconIndex); + +private: + UString _name; + UString _prefix; + UString _path; + UString GetFullPath() const { return _prefix + _path; } + UString GetFullPathWithName() const { return GetFullPath() + L'\\' + _name; } + CMyComPtr<IFolderFolder> _parentFolder; + + UINT _driveType; + DISK_GEOMETRY geom; + UInt64 _length; + +public: + HRESULT Init(const UString &path); + HRESULT GetLength(UInt64 &size) const; +}; + +#endif diff --git a/CPP/7zip/FileManager/PluginInterface.h b/CPP/7zip/UI/FileManager/PluginInterface.h index 7bef6950..7bef6950 100755 --- a/CPP/7zip/FileManager/PluginInterface.h +++ b/CPP/7zip/UI/FileManager/PluginInterface.h diff --git a/CPP/7zip/FileManager/PluginLoader.h b/CPP/7zip/UI/FileManager/PluginLoader.h index 598a874b..598a874b 100755 --- a/CPP/7zip/FileManager/PluginLoader.h +++ b/CPP/7zip/UI/FileManager/PluginLoader.h diff --git a/CPP/7zip/FileManager/Resource/PluginsPage/PluginsPage.cpp b/CPP/7zip/UI/FileManager/PluginsPage.cpp index 0ccdf07e..3be15b18 100755 --- a/CPP/7zip/FileManager/Resource/PluginsPage/PluginsPage.cpp +++ b/CPP/7zip/UI/FileManager/PluginsPage.cpp @@ -1,7 +1,7 @@ // PluginsPage.cpp #include "StdAfx.h" -#include "resource.h" +#include "PluginsPageRes.h" #include "PluginsPage.h" #include "Common/StringConvert.h" @@ -12,12 +12,12 @@ #include "Windows/Control/ListView.h" #include "Windows/FileFind.h" -#include "../../RegistryUtils.h" -#include "../../HelpUtils.h" -#include "../../LangUtils.h" -#include "../../ProgramLocation.h" +#include "RegistryUtils.h" +#include "HelpUtils.h" +#include "LangUtils.h" +#include "ProgramLocation.h" -#include "../../PluginInterface.h" +#include "PluginInterface.h" static CIDLangPair kIDLangPairs[] = { @@ -51,10 +51,13 @@ bool CPluginsPage::OnInit() // _listView.DeleteAllItems(); for(int i = 0; i < _plugins.Size(); i++) { + const CPluginInfo &p = _plugins[i]; + if (!p.OptionsClassIDDefined) + continue; LVITEMW item; item.iItem = i; item.mask = LVIF_TEXT | LVIF_STATE; - UString pluginName = _plugins[i].Name; + UString pluginName = p.Name; item.pszText = (WCHAR *)(const WCHAR *)pluginName; item.state = 0; item.stateMask = UINT(-1); diff --git a/CPP/7zip/FileManager/Resource/PluginsPage/PluginsPage.h b/CPP/7zip/UI/FileManager/PluginsPage.h index 78e81dbb..1dcd62d2 100755 --- a/CPP/7zip/FileManager/Resource/PluginsPage/PluginsPage.h +++ b/CPP/7zip/UI/FileManager/PluginsPage.h @@ -8,7 +8,7 @@ #include "Windows/Control/PropertyPage.h" #include "Windows/Control/ComboBox.h" -#include "../../RegistryPlugins.h" +#include "RegistryPlugins.h" class CPluginsPage: public NWindows::NControl::CPropertyPage { diff --git a/CPP/7zip/FileManager/Resource/PluginsPage/resource.rc b/CPP/7zip/UI/FileManager/PluginsPage.rc index 7b74107b..5a1f48ec 100755 --- a/CPP/7zip/FileManager/Resource/PluginsPage/resource.rc +++ b/CPP/7zip/UI/FileManager/PluginsPage.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "PluginsPageRes.h" +#include "../../GuiCommon.rc" #define xSize2 196 #define ySize2 140 diff --git a/CPP/7zip/FileManager/Resource/PluginsPage/resource.h b/CPP/7zip/UI/FileManager/PluginsPageRes.h index 8fc923ee..8fc923ee 100755 --- a/CPP/7zip/FileManager/Resource/PluginsPage/resource.h +++ b/CPP/7zip/UI/FileManager/PluginsPageRes.h diff --git a/CPP/7zip/FileManager/ProgramLocation.cpp b/CPP/7zip/UI/FileManager/ProgramLocation.cpp index 88c18d5e..88c18d5e 100755 --- a/CPP/7zip/FileManager/ProgramLocation.cpp +++ b/CPP/7zip/UI/FileManager/ProgramLocation.cpp diff --git a/CPP/7zip/FileManager/ProgramLocation.h b/CPP/7zip/UI/FileManager/ProgramLocation.h index 38317b45..38317b45 100755 --- a/CPP/7zip/FileManager/ProgramLocation.h +++ b/CPP/7zip/UI/FileManager/ProgramLocation.h diff --git a/CPP/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.cpp b/CPP/7zip/UI/FileManager/ProgressDialog.cpp index 81504ca5..b185868b 100755 --- a/CPP/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.cpp +++ b/CPP/7zip/UI/FileManager/ProgressDialog.cpp @@ -12,7 +12,7 @@ static const UINT_PTR kTimerID = 3; static const UINT kTimerElapse = 50; #ifdef LANG -#include "../../LangUtils.h" +#include "LangUtils.h" #endif #ifdef LANG diff --git a/CPP/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.h b/CPP/7zip/UI/FileManager/ProgressDialog.h index 07f0d859..0ef2dc99 100755 --- a/CPP/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.h +++ b/CPP/7zip/UI/FileManager/ProgressDialog.h @@ -3,7 +3,7 @@ #ifndef __PROGRESSDIALOG_H #define __PROGRESSDIALOG_H -#include "resource.h" +#include "ProgressDialogRes.h" #include "Windows/Control/Dialog.h" #include "Windows/Control/ProgressBar.h" diff --git a/CPP/7zip/FileManager/Resource/ProgressDialog/resource.rc b/CPP/7zip/UI/FileManager/ProgressDialog.rc index a6b375ed..e5cdd7e8 100755 --- a/CPP/7zip/FileManager/Resource/ProgressDialog/resource.rc +++ b/CPP/7zip/UI/FileManager/ProgressDialog.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "ProgressDialogRes.h" +#include "../../GuiCommon.rc" #define xSize2 172 #define ySize2 42 diff --git a/CPP/7zip/FileManager/Resource/ProgressDialog2/ProgressDialog.cpp b/CPP/7zip/UI/FileManager/ProgressDialog2.cpp index e5a496bd..ae4752ef 100755 --- a/CPP/7zip/FileManager/Resource/ProgressDialog2/ProgressDialog.cpp +++ b/CPP/7zip/UI/FileManager/ProgressDialog2.cpp @@ -1,18 +1,17 @@ -// ProgressDialog.cpp +// ProgressDialog2.cpp #include "StdAfx.h" #include "resource.h" -#include "ProgressDialog.h" -#include "Common/IntToString.h" +#include "ProgressDialog2.h" #include "Common/IntToString.h" using namespace NWindows; static const UINT_PTR kTimerID = 3; -static const UINT kTimerElapse = 50; +static const UINT kTimerElapse = 100; #ifdef LANG -#include "../../LangUtils.h" +#include "LangUtils.h" #endif #ifdef LANG @@ -23,6 +22,11 @@ static CIDLangPair kIDLangPairs[] = { IDC_PROGRESS_REMAINING, 0x02000C02 }, { IDC_PROGRESS_TOTAL, 0x02000C03 }, { IDC_PROGRESS_SPEED, 0x02000C04 }, + { IDC_PROGRESS_UNPACKED, 0x02000C05 }, + { IDC_PROGRESS_PACKED, 0x02000323 }, + { IDC_PROGRESS_RATIO, 0x02000C06 }, + { IDC_PROGRESS_SPEED, 0x02000C04 }, + { IDC_PROGRESS_FILES, 0x02000320 }, { IDC_BUTTON_PROGRESS_PRIORITY, 0x02000C10 }, { IDC_BUTTON_PAUSE, 0x02000C12 }, { IDCANCEL, 0x02000711 }, @@ -113,9 +117,9 @@ void CProgressDialog::OnCancel() static void ConvertSizeToString(UInt64 value, wchar_t *s) { - const wchar_t *kModif = L" KMGTP"; + const wchar_t *kModif = L" KM"; for (int i = 0; ; i++) - if (i == 5 || value < (UInt64(10000) << (i * 10))) + if (i == 2 || value < (UInt64(10000) << (i * 10))) { ConvertUInt64ToString(value >> (i * 10), s); s += wcslen(s); @@ -137,7 +141,7 @@ void CProgressDialog::SetRange(UInt64 range) wchar_t s[32]; ConvertSizeToString(_range, s); - SetItemText(IDC_PROGRESS_SPEED_TOTAL_VALUE, s); + SetItemText(IDC_PROGRESS_TOTAL_VALUE, s); } void CProgressDialog::SetPos(UInt64 pos) @@ -163,12 +167,21 @@ static void GetTimeString(UInt64 timeValue, TCHAR *s) UInt32(timeValue % 60)); } +void CProgressDialog::ShowSize(int id, UInt64 value) +{ + wchar_t s[40]; + s[0] = 0; + if (value != (UInt64)(Int64)-1) + ConvertSizeToString(value, s); + SetItemText(id, s); +} + bool CProgressDialog::OnTimer(WPARAM /* timerID */, LPARAM /* callback */) { if (ProgressSynch.GetPaused()) return true; - UInt64 total, completed; - ProgressSynch.GetProgress(total, completed); + UInt64 total, completed, totalFiles, completedFiles, inSize, outSize; + ProgressSynch.GetProgress(total, completed, totalFiles, completedFiles, inSize, outSize); UInt32 curTime = ::GetTickCount(); @@ -197,8 +210,11 @@ bool CProgressDialog::OnTimer(WPARAM /* timerID */, LPARAM /* callback */) elapsedChanged = true; } - if (completed != 0 && elapsedChanged) + if (elapsedChanged) { + if (completed != 0) + { + if (total == (UInt64)(Int64)-1) { SetItemText(IDC_PROGRESS_REMAINING_VALUE, L""); @@ -261,19 +277,54 @@ bool CProgressDialog::OnTimer(WPARAM /* timerID */, LPARAM /* callback */) if (needRedraw) SetItemText(IDC_PROGRESS_SPEED_VALUE, s); } - } + } - if (total == 0) - total = 1; - UInt32 percentValue = (UInt32)(completed * 100 / total); - UString titleName; - ProgressSynch.GetTitleFileName(titleName); - if (percentValue != _prevPercentValue || _prevTitleName != titleName) - { - _prevPercentValue = percentValue; - SetTitleText(); - _prevTitleName = titleName; + if (total == 0) + total = 1; + UInt32 percentValue = (UInt32)(completed * 100 / total); + UString titleName; + ProgressSynch.GetTitleFileName(titleName); + if (percentValue != _prevPercentValue || _prevTitleName != titleName) + { + _prevPercentValue = percentValue; + SetTitleText(); + _prevTitleName = titleName; + } + + TCHAR s[64]; + ConvertUInt64ToString(completedFiles, s); + if (totalFiles != (UInt64)(Int64)-1) + { + lstrcat(s, TEXT(" / ")); + ConvertUInt64ToString(totalFiles, s + lstrlen(s)); + } + + SetItemText(IDC_PROGRESS_FILES_VALUE, s); + + const UInt64 packSize = CompressingMode ? outSize : inSize; + const UInt64 unpackSize = CompressingMode ? inSize : outSize; + + if (unpackSize == (UInt64)(Int64)-1 && packSize == (UInt64)(Int64)-1) + { + ShowSize(IDC_PROGRESS_UNPACKED_VALUE, completed); + SetItemText(IDC_PROGRESS_PACKED_VALUE, L""); + } + else + { + ShowSize(IDC_PROGRESS_UNPACKED_VALUE, unpackSize); + ShowSize(IDC_PROGRESS_PACKED_VALUE, packSize); + + if (packSize != (UInt64)(Int64)-1 && unpackSize != (UInt64)(Int64)-1 && unpackSize != 0) + { + UInt64 ratio = packSize * 100 / unpackSize; + ConvertUInt64ToString(ratio, s); + lstrcat(s, TEXT("%")); + SetItemText(IDC_PROGRESS_RATIO_VALUE, s); + } + } } + + UString fileName; ProgressSynch.GetCurrentFileName(fileName); if (_prevFileName != fileName) diff --git a/CPP/7zip/FileManager/Resource/ProgressDialog2/ProgressDialog.h b/CPP/7zip/UI/FileManager/ProgressDialog2.h index cd53c76e..9acaf9de 100755 --- a/CPP/7zip/FileManager/Resource/ProgressDialog2/ProgressDialog.h +++ b/CPP/7zip/UI/FileManager/ProgressDialog2.h @@ -1,9 +1,9 @@ -// ProgressDialog.h +// ProgressDialog2.h -#ifndef __PROGRESSDIALOG_H -#define __PROGRESSDIALOG_H +#ifndef __PROGRESSDIALOG2_H +#define __PROGRESSDIALOG2_H -#include "resource.h" +#include "ProgressDialog2Res.h" #include "Common/Types.h" @@ -18,10 +18,22 @@ class CProgressSynch bool _paused; UInt64 _total; UInt64 _completed; + UInt64 _inSize; + UInt64 _outSize; + UInt64 _totalFiles; + UInt64 _completedFiles; UString TitleFileName; UString CurrentFileName; public: - CProgressSynch(): _stopped(false), _paused(false), _total((UInt64)(Int64)-1), _completed(0) {} + CProgressSynch(): + _stopped(false), _paused(false), + _total((UInt64)(Int64)-1), + _completed(0), + _totalFiles((UInt64)(Int64)-1), + _completedFiles(0), + _inSize((UInt64)(Int64)-1), + _outSize((UInt64)(Int64)-1) + {} bool GetStopped() { @@ -49,17 +61,41 @@ public: _total = total; _completed = completed; } + void SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize) + { + NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection); + if (inSize) + _inSize = *inSize; + if (outSize) + _outSize = *outSize; + } void SetPos(UInt64 completed) { NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection); _completed = completed; } + void SetNumFilesTotal(UInt64 value) + { + NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection); + _totalFiles = value; + } + void SetNumFilesCur(UInt64 value) + { + NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection); + _completedFiles = value; + } HRESULT SetPosAndCheckPaused(UInt64 completed); - void GetProgress(UInt64 &total, UInt64 &completed) + void GetProgress(UInt64 &total, UInt64 &completed, + UInt64 &totalFiles, UInt64 &completedFiles, + UInt64 &inSize, UInt64 &outSize) { NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection); total = _total; completed = _completed; + totalFiles = _totalFiles; + completedFiles = _completedFiles; + inSize = _inSize; + outSize = _outSize; } void SetTitleFileName(const UString &fileName) { @@ -149,9 +185,12 @@ private: bool OnButtonClicked(int buttonID, HWND buttonHWND); void SetTitleText(); + void ShowSize(int id, UInt64 value); + public: CProgressSynch ProgressSynch; - + bool CompressingMode; + #ifndef _SFX HWND MainWindow; UString MainTitle; @@ -159,7 +198,7 @@ public: ~CProgressDialog(); #endif - CProgressDialog(): _timer(0) + CProgressDialog(): _timer(0), CompressingMode(true) #ifndef _SFX ,MainWindow(0) #endif diff --git a/CPP/7zip/UI/FileManager/ProgressDialog2.rc b/CPP/7zip/UI/FileManager/ProgressDialog2.rc new file mode 100755 index 00000000..5818dfb3 --- /dev/null +++ b/CPP/7zip/UI/FileManager/ProgressDialog2.rc @@ -0,0 +1,77 @@ +#include "ProgressDialog2Res.h" +#include "../../GuiCommon.rc" + +#define xSize2 300 +#define ySize2 98 + +#define xSize (xSize2 + marg + marg) +#define ySize (ySize2 + marg + marg) + +#define bYPos (ySize - marg - bYSize) + +#undef bXSize +#define bXSize 72 + +#define bXPos1 (xSize - marg - bXSize) +#define bXPos2 (bXPos1 - 10 - bXSize) +#define bXPos3 (bXPos2 - 10 - bXSize) + +#define x0Size 90 +#define x1 (marg + x0Size) +#define x1Size 40 + +#define x3Size 40 +#define x3 (xSize - marg - x3Size) + +#define x2Size 90 +#define x2 (x3 - x2Size) + +#undef y0 +#undef y1 +#undef y2 +#undef y3 +#define y0 marg +#define y1 (y0 + 11) +#define y2 (y1 + 11) +#define y3 (y2 + 11) + + +IDD_DIALOG_PROGRESS DIALOG 0, 0, xSize, ySize MY_MODAL_DIALOG_STYLE | WS_MINIMIZEBOX +CAPTION "Progress" +MY_FONT +BEGIN + PUSHBUTTON "&Background", IDC_BUTTON_PROGRESS_PRIORITY, bXPos3, bYPos, bXSize, bYSize + PUSHBUTTON "&Pause", IDC_BUTTON_PAUSE, bXPos2, bYPos, bXSize, bYSize + PUSHBUTTON "Cancel", IDCANCEL, bXPos1, bYPos, bXSize, bYSize + LTEXT "Elapsed time:", IDC_PROGRESS_ELAPSED, marg, y0, x0Size, 8 + LTEXT "Remaining time:", IDC_PROGRESS_REMAINING, marg, y1, x0Size, 8 + LTEXT "Files:", IDC_PROGRESS_FILES, marg, y2, x0Size, 8 + LTEXT "Compression ratio:",IDC_PROGRESS_RATIO, marg, y3, x0Size, 8 + + LTEXT "Total size:", IDC_PROGRESS_TOTAL, x2, y0, x2Size, 8 + LTEXT "Speed:", IDC_PROGRESS_SPEED, x2, y1, x2Size, 8 + LTEXT "Processed:", IDC_PROGRESS_UNPACKED, x2, y2, x2Size, 8 + LTEXT "Compressed size:", IDC_PROGRESS_PACKED, x2, y3, x2Size, 8 + + RTEXT "00:00:00", IDC_PROGRESS_ELAPSED_VALUE, x1, y0, x1Size, 8 + RTEXT "", IDC_PROGRESS_REMAINING_VALUE, x1, y1, x1Size, 8 + RTEXT "", IDC_PROGRESS_FILES_VALUE, x1, y2, x1Size, 8 + RTEXT "", IDC_PROGRESS_RATIO_VALUE, x1, y3, x1Size, 8 + + RTEXT "", IDC_PROGRESS_TOTAL_VALUE, x3, y0, x3Size, 8 + RTEXT "", IDC_PROGRESS_SPEED_VALUE, x3, y1, x3Size, 8 + RTEXT "", IDC_PROGRESS_UNPACKED_VALUE, x3, y2, x3Size, 8 + RTEXT "", IDC_PROGRESS_PACKED_VALUE, x3, y3, x3Size, 8 + + LTEXT "", IDC_PROGRESS_FILE_NAME, marg, bYPos - 30, xSize2, 8, SS_NOPREFIX + CONTROL "Progress1", IDC_PROGRESS1, "msctls_progress32", PBS_SMOOTH | WS_BORDER, marg, bYPos - 20, xSize2, 13 +END + + +STRINGTABLE DISCARDABLE +BEGIN + IDS_PROGRESS_PAUSED "Paused" + IDS_PROGRESS_FOREGROUND "&Foreground" + IDS_PROGRESS_CONTINUE "&Continue" + IDS_PROGRESS_ASK_CANCEL "Are you sure you want to cancel?" +END diff --git a/CPP/7zip/FileManager/Resource/ProgressDialog2/resource.h b/CPP/7zip/UI/FileManager/ProgressDialog2Res.h index be1da4ad..16bf2634 100755 --- a/CPP/7zip/FileManager/Resource/ProgressDialog2/resource.h +++ b/CPP/7zip/UI/FileManager/ProgressDialog2Res.h @@ -13,5 +13,14 @@ #define IDC_PROGRESS_SPEED 1006 #define IDC_PROGRESS_SPEED_VALUE 1007 #define IDC_PROGRESS_TOTAL 1008 -#define IDC_PROGRESS_SPEED_TOTAL_VALUE 1009 +#define IDC_PROGRESS_TOTAL_VALUE 1009 #define IDC_PROGRESS_FILE_NAME 1010 + +#define IDC_PROGRESS_FILES 1012 +#define IDC_PROGRESS_FILES_VALUE 1013 +#define IDC_PROGRESS_RATIO 1014 +#define IDC_PROGRESS_RATIO_VALUE 1015 +#define IDC_PROGRESS_PACKED 1016 +#define IDC_PROGRESS_PACKED_VALUE 1017 +#define IDC_PROGRESS_UNPACKED 1018 +#define IDC_PROGRESS_UNPACKED_VALUE 1019 diff --git a/CPP/7zip/FileManager/Resource/ProgressDialog/resource.h b/CPP/7zip/UI/FileManager/ProgressDialogRes.h index 97e47228..97e47228 100755 --- a/CPP/7zip/FileManager/Resource/ProgressDialog/resource.h +++ b/CPP/7zip/UI/FileManager/ProgressDialogRes.h diff --git a/CPP/7zip/FileManager/PropertyName.cpp b/CPP/7zip/UI/FileManager/PropertyName.cpp index 848a8855..fb8f707e 100755 --- a/CPP/7zip/FileManager/PropertyName.cpp +++ b/CPP/7zip/UI/FileManager/PropertyName.cpp @@ -2,11 +2,11 @@ #include "StdAfx.h" -#include "../PropID.h" +#include "../../PropID.h" #include "Windows/ResourceString.h" #include "resource.h" #include "PropertyName.h" -#include "Resource/PropertyName/resource.h" +#include "PropertyNameRes.h" #include "LangUtils.h" struct CPropertyIDNamePair @@ -46,6 +46,15 @@ static CPropertyIDNamePair kPropertyIDNamePairs[] = { kpidComment, IDS_PROPERTY_COMMENT, 0x0200021C }, { kpidPosition, IDS_PROPERTY_POSITION, 0x0200021D }, { kpidPrefix, IDS_PROPERTY_PREFIX, 0x0200021E }, + { kpidNumSubFolders, IDS_PROPERTY_FOLDERS, 0x0200021F }, + { kpidNumSubFiles, IDS_PROPERTY_FILES, 0x02000220 }, + { kpidUnpackVer, IDS_PROPERTY_VERSION, 0x02000221}, + { kpidVolume, IDS_PROPERTY_VOLUME, 0x02000222}, + { kpidIsVolume, IDS_PROPERTY_IS_VOLUME, 0x02000223}, + { kpidOffset, IDS_PROPERTY_OFFSET, 0x02000224}, + { kpidLinks, IDS_PROPERTY_LINKS, 0x02000225}, + { kpidNumBlocks, IDS_PROPERTY_NUM_BLOCKS, 0x02000226}, + { kpidNumVolumes, IDS_PROPERTY_NUM_VOLUMES, 0x02000227}, { kpidTotalSize, IDS_PROPERTY_TOTAL_SIZE, 0x03031100 }, { kpidFreeSpace, IDS_PROPERTY_FREE_SPACE, 0x03031101 }, diff --git a/CPP/7zip/FileManager/PropertyName.h b/CPP/7zip/UI/FileManager/PropertyName.h index 413d2343..413d2343 100755 --- a/CPP/7zip/FileManager/PropertyName.h +++ b/CPP/7zip/UI/FileManager/PropertyName.h diff --git a/CPP/7zip/FileManager/Resource/PropertyName/resource.rc b/CPP/7zip/UI/FileManager/PropertyName.rc index 3f517aff..94171ee3 100755 --- a/CPP/7zip/FileManager/Resource/PropertyName/resource.rc +++ b/CPP/7zip/UI/FileManager/PropertyName.rc @@ -1,4 +1,4 @@ -#include "resource.h" +#include "PropertyNameRes.h" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US @@ -32,4 +32,14 @@ BEGIN IDS_PROPERTY_COMMENT "Comment" IDS_PROPERTY_POSITION "Position" IDS_PROPERTY_PREFIX "Path Prefix" + IDS_PROPERTY_FOLDERS "Folders" + IDS_PROPERTY_FILES "Files" + IDS_PROPERTY_VERSION "Version" + IDS_PROPERTY_VOLUME "Volume" + IDS_PROPERTY_IS_VOLUME "Multivolume" + IDS_PROPERTY_OFFSET "Offset" + IDS_PROPERTY_LINKS "Links" + IDS_PROPERTY_NUM_BLOCKS "Blocks" + IDS_PROPERTY_NUM_VOLUMES "Volumes" + END diff --git a/CPP/7zip/FileManager/Resource/PropertyName/resource.h b/CPP/7zip/UI/FileManager/PropertyNameRes.h index f3d56ef3..80c9637f 100755 --- a/CPP/7zip/FileManager/Resource/PropertyName/resource.h +++ b/CPP/7zip/UI/FileManager/PropertyNameRes.h @@ -26,3 +26,12 @@ #define IDS_PROPERTY_COMMENT 28 #define IDS_PROPERTY_POSITION 29 #define IDS_PROPERTY_PREFIX 30 +#define IDS_PROPERTY_FOLDERS 31 +#define IDS_PROPERTY_FILES 32 +#define IDS_PROPERTY_VERSION 33 +#define IDS_PROPERTY_VOLUME 34 +#define IDS_PROPERTY_IS_VOLUME 35 +#define IDS_PROPERTY_OFFSET 36 +#define IDS_PROPERTY_LINKS 37 +#define IDS_PROPERTY_NUM_BLOCKS 38 +#define IDS_PROPERTY_NUM_VOLUMES 39 diff --git a/CPP/7zip/FileManager/RegistryAssociations.cpp b/CPP/7zip/UI/FileManager/RegistryAssociations.cpp index fe5cfae8..a03762ef 100755 --- a/CPP/7zip/FileManager/RegistryAssociations.cpp +++ b/CPP/7zip/UI/FileManager/RegistryAssociations.cpp @@ -8,7 +8,6 @@ #include "Common/IntToString.h" #include "Common/StringToInt.h" -#include "Windows/COM.h" #include "Windows/Synchronization.h" #include "Windows/Registry.h" @@ -17,7 +16,6 @@ #include "StringUtils.h" using namespace NWindows; -using namespace NCOM; using namespace NRegistry; diff --git a/CPP/7zip/FileManager/RegistryAssociations.h b/CPP/7zip/UI/FileManager/RegistryAssociations.h index c1a64c96..c1a64c96 100755 --- a/CPP/7zip/FileManager/RegistryAssociations.h +++ b/CPP/7zip/UI/FileManager/RegistryAssociations.h diff --git a/CPP/7zip/FileManager/RegistryPlugins.cpp b/CPP/7zip/UI/FileManager/RegistryPlugins.cpp index cad3b43d..771166ca 100755 --- a/CPP/7zip/FileManager/RegistryPlugins.cpp +++ b/CPP/7zip/UI/FileManager/RegistryPlugins.cpp @@ -5,7 +5,6 @@ #include "Common/StringConvert.h" // #include "Windows/Registry.h" // #include "Windows/Synchronization.h" -// #include "Windows/COM.h" #include "Windows/DLL.h" #include "Windows/PropVariant.h" @@ -63,9 +62,15 @@ static bool ReadPluginInfo(CPluginInfo &pluginInfo) if (getPluginProperty(NPlugin::kClassID, &propVariant) != S_OK) return false; - if (propVariant.vt != VT_BSTR) + if (propVariant.vt == VT_EMPTY) + pluginInfo.ClassIDDefined = false; + else if (propVariant.vt != VT_BSTR) return false; - pluginInfo.ClassID = *(const GUID *)propVariant.bstrVal; + else + { + pluginInfo.ClassIDDefined = true; + pluginInfo.ClassID = *(const GUID *)propVariant.bstrVal; + } propVariant.Clear(); if (getPluginProperty(NPlugin::kOptionsClassID, &propVariant) != S_OK) @@ -127,4 +132,15 @@ void ReadFileFolderPluginInfoList(CObjectVector<CPluginInfo> &plugins) plugins.Delete(i); else i++; + { + CPluginInfo p; + // p.FilePath.Empty(); + p.Type = kPluginTypeFF; + p.Name = L"7-Zip"; + // p.ClassID = CLSID_CAgentArchiveHandler; + p.ClassIDDefined = true; + // p.OptionsClassID; + p.OptionsClassIDDefined = false; + plugins.Add(p); + } } diff --git a/CPP/7zip/FileManager/RegistryPlugins.h b/CPP/7zip/UI/FileManager/RegistryPlugins.h index 55f9ebbc..90bab7b5 100755 --- a/CPP/7zip/FileManager/RegistryPlugins.h +++ b/CPP/7zip/UI/FileManager/RegistryPlugins.h @@ -17,6 +17,7 @@ struct CPluginInfo UString Name; CLSID ClassID; CLSID OptionsClassID; + bool ClassIDDefined; bool OptionsClassIDDefined; // CSysString Extension; diff --git a/CPP/7zip/FileManager/RegistryUtils.cpp b/CPP/7zip/UI/FileManager/RegistryUtils.cpp index e9c13d19..e9c13d19 100755 --- a/CPP/7zip/FileManager/RegistryUtils.cpp +++ b/CPP/7zip/UI/FileManager/RegistryUtils.cpp diff --git a/CPP/7zip/FileManager/RegistryUtils.h b/CPP/7zip/UI/FileManager/RegistryUtils.h index 0fec6f80..0fec6f80 100755 --- a/CPP/7zip/FileManager/RegistryUtils.h +++ b/CPP/7zip/UI/FileManager/RegistryUtils.h diff --git a/CPP/7zip/FileManager/RootFolder.cpp b/CPP/7zip/UI/FileManager/RootFolder.cpp index 4ff0660b..5c8e0e28 100755 --- a/CPP/7zip/FileManager/RootFolder.cpp +++ b/CPP/7zip/UI/FileManager/RootFolder.cpp @@ -7,7 +7,7 @@ #include "RootFolder.h" #include "Common/StringConvert.h" -#include "../PropID.h" +#include "../../PropID.h" #include "Windows/Defs.h" #include "Windows/PropVariant.h" @@ -127,7 +127,7 @@ STDMETHODIMP CRootFolder::BindToFolder(const wchar_t *name, IFolderFolder **resu { if (name2[name2.Length () - 1] != L'\\') name2 += L'\\'; - CFSFolder *fsFolderSpec = new CFSFolder; + NFsFolder::CFSFolder *fsFolderSpec = new NFsFolder::CFSFolder; subFolder = fsFolderSpec; if (fsFolderSpec->Init(name2, 0) != S_OK) { @@ -151,11 +151,6 @@ STDMETHODIMP CRootFolder::BindToParentFolder(IFolderFolder **resultFolder) return S_OK; } -STDMETHODIMP CRootFolder::GetName(BSTR * /* name */) -{ - return E_NOTIMPL; -} - STDMETHODIMP CRootFolder::GetNumberOfProperties(UInt32 *numProperties) { *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); @@ -174,17 +169,15 @@ STDMETHODIMP CRootFolder::GetPropertyInfo(UInt32 index, return S_OK; } -STDMETHODIMP CRootFolder::GetTypeID(BSTR *name) -{ - CMyComBSTR temp = L"RootFolder"; - *name = temp.Detach(); - return S_OK; -} - -STDMETHODIMP CRootFolder::GetPath(BSTR *path) +STDMETHODIMP CRootFolder::GetFolderProperty(PROPID propID, PROPVARIANT *value) { - CMyComBSTR temp = L""; - *path = temp.Detach(); + NWindows::NCOM::CPropVariant prop; + switch(propID) + { + case kpidType: prop = L"RootFolder"; break; + case kpidPath: prop = L""; break; + } + prop.Detach(value); return S_OK; } diff --git a/CPP/7zip/UI/FileManager/RootFolder.h b/CPP/7zip/UI/FileManager/RootFolder.h new file mode 100755 index 00000000..7dad969d --- /dev/null +++ b/CPP/7zip/UI/FileManager/RootFolder.h @@ -0,0 +1,32 @@ +// RootFolder.h + +#ifndef __ROOTFOLDER_H +#define __ROOTFOLDER_H + +#include "Common/MyString.h" + +#include "Windows/PropVariant.h" + +#include "FSFolder.h" + +class CRootFolder: + public IFolderFolder, + public IFolderGetSystemIconIndex, + public CMyUnknownImp +{ +public: + MY_UNKNOWN_IMP1( + IFolderGetSystemIconIndex + ) + + INTERFACE_FolderFolder(;) + + STDMETHOD(GetSystemIconIndex)(UInt32 index, INT32 *iconIndex); + + void Init(); +private: + UString _computerName; + UString _networkName; +}; + +#endif diff --git a/CPP/7zip/FileManager/Resource/SettingsPage/SettingsPage.cpp b/CPP/7zip/UI/FileManager/SettingsPage.cpp index 6a681fbc..4ce2919d 100755 --- a/CPP/7zip/FileManager/Resource/SettingsPage/SettingsPage.cpp +++ b/CPP/7zip/UI/FileManager/SettingsPage.cpp @@ -1,7 +1,7 @@ // SettingsPage.cpp #include "StdAfx.h" -#include "resource.h" +#include "SettingsPageRes.h" #include "SettingsPage.h" #include "Common/StringConvert.h" @@ -9,10 +9,10 @@ #include "Windows/Defs.h" #include "Windows/MemoryLock.h" -#include "../../RegistryUtils.h" -#include "../../HelpUtils.h" -#include "../../LangUtils.h" -#include "../../ProgramLocation.h" +#include "RegistryUtils.h" +#include "HelpUtils.h" +#include "LangUtils.h" +#include "ProgramLocation.h" using namespace NWindows; diff --git a/CPP/7zip/FileManager/Resource/SettingsPage/SettingsPage.h b/CPP/7zip/UI/FileManager/SettingsPage.h index e5fe6e67..e5fe6e67 100755 --- a/CPP/7zip/FileManager/Resource/SettingsPage/SettingsPage.h +++ b/CPP/7zip/UI/FileManager/SettingsPage.h diff --git a/CPP/7zip/FileManager/Resource/SettingsPage/resource.rc b/CPP/7zip/UI/FileManager/SettingsPage.rc index 69afeba7..ddd0911b 100755 --- a/CPP/7zip/FileManager/Resource/SettingsPage/resource.rc +++ b/CPP/7zip/UI/FileManager/SettingsPage.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "SettingsPageRes.h" +#include "../../GuiCommon.rc" #define xSize2 196 #define ySize2 140 diff --git a/CPP/7zip/FileManager/Resource/SettingsPage/resource.h b/CPP/7zip/UI/FileManager/SettingsPageRes.h index 8932dc0e..8932dc0e 100755 --- a/CPP/7zip/FileManager/Resource/SettingsPage/resource.h +++ b/CPP/7zip/UI/FileManager/SettingsPageRes.h diff --git a/CPP/7zip/FileManager/Resource/SplitDialog/SplitDialog.cpp b/CPP/7zip/UI/FileManager/SplitDialog.cpp index 383fa48a..1a3770ee 100755 --- a/CPP/7zip/FileManager/Resource/SplitDialog/SplitDialog.cpp +++ b/CPP/7zip/UI/FileManager/SplitDialog.cpp @@ -7,12 +7,12 @@ #include "Windows/Shell.h" #include "Windows/FileName.h" -#include "../../SplitUtils.h" +#include "SplitUtils.h" #ifdef LANG -#include "../../LangUtils.h" +#include "LangUtils.h" #endif -#include "../CopyDialog/resource.h" +#include "CopyDialogRes.h" using namespace NWindows; diff --git a/CPP/7zip/FileManager/Resource/SplitDialog/SplitDialog.h b/CPP/7zip/UI/FileManager/SplitDialog.h index d73dcbca..607a3daf 100755 --- a/CPP/7zip/FileManager/Resource/SplitDialog/SplitDialog.h +++ b/CPP/7zip/UI/FileManager/SplitDialog.h @@ -6,7 +6,7 @@ #include "Common/Types.h" #include "Windows/Control/Dialog.h" #include "Windows/Control/ComboBox.h" -#include "resource.h" +#include "SplitDialogRes.h" class CSplitDialog: public NWindows::NControl::CModalDialog { diff --git a/CPP/7zip/FileManager/Resource/SplitDialog/resource.rc b/CPP/7zip/UI/FileManager/SplitDialog.rc index 5282ee7d..7e78daaf 100755 --- a/CPP/7zip/FileManager/Resource/SplitDialog/resource.rc +++ b/CPP/7zip/UI/FileManager/SplitDialog.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "SplitDialogRes.h" +#include "../../GuiCommon.rc" #define xSize2 223 #define ySize2 89 diff --git a/CPP/7zip/FileManager/Resource/SplitDialog/resource.h b/CPP/7zip/UI/FileManager/SplitDialogRes.h index 019b7029..019b7029 100755 --- a/CPP/7zip/FileManager/Resource/SplitDialog/resource.h +++ b/CPP/7zip/UI/FileManager/SplitDialogRes.h diff --git a/CPP/7zip/FileManager/SplitUtils.cpp b/CPP/7zip/UI/FileManager/SplitUtils.cpp index 3a7635fa..3a7635fa 100755 --- a/CPP/7zip/FileManager/SplitUtils.cpp +++ b/CPP/7zip/UI/FileManager/SplitUtils.cpp diff --git a/CPP/7zip/FileManager/SplitUtils.h b/CPP/7zip/UI/FileManager/SplitUtils.h index 755c707c..755c707c 100755 --- a/CPP/7zip/FileManager/SplitUtils.h +++ b/CPP/7zip/UI/FileManager/SplitUtils.h diff --git a/CPP/7zip/FileManager/StdAfx.cpp b/CPP/7zip/UI/FileManager/StdAfx.cpp index d0feea85..d0feea85 100755 --- a/CPP/7zip/FileManager/StdAfx.cpp +++ b/CPP/7zip/UI/FileManager/StdAfx.cpp diff --git a/CPP/7zip/FileManager/StdAfx.h b/CPP/7zip/UI/FileManager/StdAfx.h index b09de592..b09de592 100755 --- a/CPP/7zip/FileManager/StdAfx.h +++ b/CPP/7zip/UI/FileManager/StdAfx.h diff --git a/CPP/7zip/FileManager/StringUtils.cpp b/CPP/7zip/UI/FileManager/StringUtils.cpp index 63eebdba..63eebdba 100755 --- a/CPP/7zip/FileManager/StringUtils.cpp +++ b/CPP/7zip/UI/FileManager/StringUtils.cpp diff --git a/CPP/7zip/FileManager/StringUtils.h b/CPP/7zip/UI/FileManager/StringUtils.h index 7f72b764..7f72b764 100755 --- a/CPP/7zip/FileManager/StringUtils.h +++ b/CPP/7zip/UI/FileManager/StringUtils.h diff --git a/CPP/7zip/FileManager/SysIconUtils.cpp b/CPP/7zip/UI/FileManager/SysIconUtils.cpp index 0d337550..0d337550 100755 --- a/CPP/7zip/FileManager/SysIconUtils.cpp +++ b/CPP/7zip/UI/FileManager/SysIconUtils.cpp diff --git a/CPP/7zip/FileManager/SysIconUtils.h b/CPP/7zip/UI/FileManager/SysIconUtils.h index 3b6c6c2e..3b6c6c2e 100755 --- a/CPP/7zip/FileManager/SysIconUtils.h +++ b/CPP/7zip/UI/FileManager/SysIconUtils.h diff --git a/CPP/7zip/FileManager/Resource/SystemPage/SystemPage.cpp b/CPP/7zip/UI/FileManager/SystemPage.cpp index 80bed2c3..40da5cb3 100755 --- a/CPP/7zip/FileManager/Resource/SystemPage/SystemPage.cpp +++ b/CPP/7zip/UI/FileManager/SystemPage.cpp @@ -1,7 +1,7 @@ -// SystemDialog.cpp +// SystemPage.cpp #include "StdAfx.h" -#include "resource.h" +#include "SystemPageRes.h" #include "SystemPage.h" #include "Common/StringConvert.h" @@ -11,14 +11,15 @@ #include "Windows/Control/ListView.h" #include "Windows/FileFind.h" -#include "../../IFolder.h" -#include "../../HelpUtils.h" -#include "../../LangUtils.h" -#include "../../PluginLoader.h" -#include "../../ProgramLocation.h" -#include "../../StringUtils.h" +#include "IFolder.h" +#include "HelpUtils.h" +#include "LangUtils.h" +#include "PluginLoader.h" +#include "ProgramLocation.h" +#include "StringUtils.h" -#include "../PropertyName/resource.h" +#include "PropertyNameRes.h" +#include "../Agent/Agent.h" using namespace NRegistryAssociations; @@ -135,7 +136,9 @@ static UString GetIconPath(const UString &filePath, CPluginLibrary library; CMyComPtr<IFolderManager> folderManager; CMyComPtr<IFolderFolder> folder; - if (library.LoadAndCreateManager(filePath, clsID, &folderManager) != S_OK) + if (filePath.IsEmpty()) + folderManager = new CArchiveFolderManager; + else if (library.LoadAndCreateManager(filePath, clsID, &folderManager) != S_OK) return UString(); CMyComBSTR extBSTR; if (folderManager->GetExtensions(&extBSTR) != S_OK) diff --git a/CPP/7zip/FileManager/Resource/SystemPage/SystemPage.h b/CPP/7zip/UI/FileManager/SystemPage.h index 3798f640..1b5891f6 100755 --- a/CPP/7zip/FileManager/Resource/SystemPage/SystemPage.h +++ b/CPP/7zip/UI/FileManager/SystemPage.h @@ -6,7 +6,7 @@ #include "Windows/Control/PropertyPage.h" #include "Windows/Control/ListView.h" -#include "../../FilePlugins.h" +#include "FilePlugins.h" class CSystemPage: public NWindows::NControl::CPropertyPage { diff --git a/CPP/7zip/FileManager/Resource/SystemPage/resource.rc b/CPP/7zip/UI/FileManager/SystemPage.rc index caa9fcbb..f881f612 100755 --- a/CPP/7zip/FileManager/Resource/SystemPage/resource.rc +++ b/CPP/7zip/UI/FileManager/SystemPage.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "SystemPageRes.h" +#include "../../GuiCommon.rc" #define xSize2 238 #define ySize2 214 diff --git a/CPP/7zip/FileManager/Resource/SystemPage/resource.h b/CPP/7zip/UI/FileManager/SystemPageRes.h index 8dce778b..8dce778b 100755 --- a/CPP/7zip/FileManager/Resource/SystemPage/resource.h +++ b/CPP/7zip/UI/FileManager/SystemPageRes.h diff --git a/CPP/7zip/FileManager/Test.bmp b/CPP/7zip/UI/FileManager/Test.bmp Binary files differindex ef85ba23..ef85ba23 100755 --- a/CPP/7zip/FileManager/Test.bmp +++ b/CPP/7zip/UI/FileManager/Test.bmp diff --git a/CPP/7zip/FileManager/Test2.bmp b/CPP/7zip/UI/FileManager/Test2.bmp Binary files differindex 99b7dbf0..99b7dbf0 100755 --- a/CPP/7zip/FileManager/Test2.bmp +++ b/CPP/7zip/UI/FileManager/Test2.bmp diff --git a/CPP/7zip/FileManager/TextPairs.cpp b/CPP/7zip/UI/FileManager/TextPairs.cpp index 76c97b8c..76c97b8c 100755 --- a/CPP/7zip/FileManager/TextPairs.cpp +++ b/CPP/7zip/UI/FileManager/TextPairs.cpp diff --git a/CPP/7zip/FileManager/TextPairs.h b/CPP/7zip/UI/FileManager/TextPairs.h index b75d9c72..b75d9c72 100755 --- a/CPP/7zip/FileManager/TextPairs.h +++ b/CPP/7zip/UI/FileManager/TextPairs.h diff --git a/CPP/7zip/FileManager/UpdateCallback100.cpp b/CPP/7zip/UI/FileManager/UpdateCallback100.cpp index ddd2e55d..927d3cd5 100755 --- a/CPP/7zip/FileManager/UpdateCallback100.cpp +++ b/CPP/7zip/UI/FileManager/UpdateCallback100.cpp @@ -7,7 +7,7 @@ #include "UpdateCallback100.h" // #include "Windows/ProcessMessages.h" // #include "Resource/PasswordDialog/PasswordDialog.h" -#include "Resource/MessagesDialog/MessagesDialog.h" +#include "MessagesDialog.h" #include "Common/Defs.h" @@ -28,13 +28,19 @@ void CUpdateCallback100Imp::AddErrorMessage(LPCWSTR message) Messages.Add(message); } -STDMETHODIMP CUpdateCallback100Imp::SetTotal(UINT64 size) +STDMETHODIMP CUpdateCallback100Imp::SetNumFiles(UInt64 numFiles) +{ + ProgressDialog.ProgressSynch.SetNumFilesTotal(numFiles); + return S_OK; +} + +STDMETHODIMP CUpdateCallback100Imp::SetTotal(UInt64 size) { ProgressDialog.ProgressSynch.SetProgress(size, 0); return S_OK; } -STDMETHODIMP CUpdateCallback100Imp::SetCompleted(const UINT64 *completeValue) +STDMETHODIMP CUpdateCallback100Imp::SetCompleted(const UInt64 *completeValue) { for (;;) { @@ -49,6 +55,12 @@ STDMETHODIMP CUpdateCallback100Imp::SetCompleted(const UINT64 *completeValue) return S_OK; } +STDMETHODIMP CUpdateCallback100Imp::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize) +{ + ProgressDialog.ProgressSynch.SetRatioInfo(inSize, outSize); + return S_OK; +} + STDMETHODIMP CUpdateCallback100Imp::CompressOperation(const wchar_t *name) { ProgressDialog.ProgressSynch.SetCurrentFileName(name); @@ -60,8 +72,10 @@ STDMETHODIMP CUpdateCallback100Imp::DeleteOperation(const wchar_t * /* name */) return S_OK; } -STDMETHODIMP CUpdateCallback100Imp::OperationResult(INT32 /* operationResult */) +STDMETHODIMP CUpdateCallback100Imp::OperationResult(Int32 /* operationResult */) { + NumFiles++; + ProgressDialog.ProgressSynch.SetNumFilesCur(NumFiles); return S_OK; } @@ -71,7 +85,7 @@ STDMETHODIMP CUpdateCallback100Imp::UpdateErrorMessage(const wchar_t *message) return S_OK; } -STDMETHODIMP CUpdateCallback100Imp::CryptoGetTextPassword2(INT32 *passwordIsDefined, BSTR *password) +STDMETHODIMP CUpdateCallback100Imp::CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password) { *passwordIsDefined = BoolToInt(_passwordIsDefined); if (!_passwordIsDefined) diff --git a/CPP/7zip/FileManager/UpdateCallback100.h b/CPP/7zip/UI/FileManager/UpdateCallback100.h index 0163010b..fd75bf2f 100755 --- a/CPP/7zip/FileManager/UpdateCallback100.h +++ b/CPP/7zip/UI/FileManager/UpdateCallback100.h @@ -6,9 +6,9 @@ #include "Common/MyCom.h" #include "Common/MyString.h" -#include "../UI/Agent/IFolderArchive.h" -#include "Resource/ProgressDialog2/ProgressDialog.h" -#include "../IPassword.h" +#include "../Agent/IFolderArchive.h" +#include "ProgressDialog2.h" +#include "../../IPassword.h" #ifdef LANG #include "LangUtils.h" @@ -17,25 +17,29 @@ class CUpdateCallback100Imp: public IFolderArchiveUpdateCallback, public ICryptoGetTextPassword2, + public ICompressProgressInfo, public CMyUnknownImp { public: - MY_UNKNOWN_IMP2( + MY_UNKNOWN_IMP3( IFolderArchiveUpdateCallback, - ICryptoGetTextPassword2) + ICryptoGetTextPassword2, + ICompressProgressInfo) // IProgress - STDMETHOD(SetTotal)(UINT64 size); - STDMETHOD(SetCompleted)(const UINT64 *completeValue); + STDMETHOD(SetTotal)(UInt64 size); + STDMETHOD(SetCompleted)(const UInt64 *completeValue); + STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize); // IUpdateCallBack STDMETHOD(CompressOperation)(const wchar_t *name); STDMETHOD(DeleteOperation)(const wchar_t *name); - STDMETHOD(OperationResult)(INT32 operationResult); + STDMETHOD(OperationResult)(Int32 operationResult); STDMETHOD(UpdateErrorMessage)(const wchar_t *message); + STDMETHOD(SetNumFiles)(UInt64 numFiles); - STDMETHOD(CryptoGetTextPassword2)(INT32 *passwordIsDefined, BSTR *password); + STDMETHOD(CryptoGetTextPassword2)(Int32 *passwordIsDefined, BSTR *password); private: bool _passwordIsDefined; UString _password; @@ -49,6 +53,8 @@ public: CProgressDialog ProgressDialog; HWND _parentWindow; UStringVector Messages; + UInt64 NumFolders; + UInt64 NumFiles; void Init(HWND parentWindow, bool passwordIsDefined, const UString &password) @@ -56,6 +62,7 @@ public: _passwordIsDefined = passwordIsDefined; _password = password; _parentWindow = parentWindow; + NumFolders = NumFiles = 0; } void StartProgressDialog(const UString &title) { diff --git a/CPP/7zip/FileManager/ViewSettings.cpp b/CPP/7zip/UI/FileManager/ViewSettings.cpp index 9102cc4e..9102cc4e 100755 --- a/CPP/7zip/FileManager/ViewSettings.cpp +++ b/CPP/7zip/UI/FileManager/ViewSettings.cpp diff --git a/CPP/7zip/FileManager/ViewSettings.h b/CPP/7zip/UI/FileManager/ViewSettings.h index 4af0b991..4af0b991 100755 --- a/CPP/7zip/FileManager/ViewSettings.h +++ b/CPP/7zip/UI/FileManager/ViewSettings.h diff --git a/CPP/7zip/FileManager/makefile b/CPP/7zip/UI/FileManager/makefile index 3a561121..68723921 100755 --- a/CPP/7zip/FileManager/makefile +++ b/CPP/7zip/UI/FileManager/makefile @@ -1,8 +1,10 @@ PROG = 7zFM.exe LIBS = $(LIBS) user32.lib oleaut32.lib advapi32.lib shell32.lib ole32.lib comctl32.lib htmlhelp.lib Mpr.lib Gdi32.lib comdlg32.lib -CFLAGS = $(CFLAGS) -I../../ \ +CFLAGS = $(CFLAGS) -I ../../../ \ -DLANG \ -DWIN_LONG_PATH \ + -DNEW_FOLDER_INTERFACE \ + -DEXTERNAL_CODECS \ FM_OBJS = \ $O\App.obj \ @@ -49,6 +51,20 @@ FM_OBJS = \ $O\TextPairs.obj \ $O\UpdateCallback100.obj \ $O\ViewSettings.obj \ + $O\AboutDialog.obj \ + $O\ComboDialog.obj \ + $O\CopyDialog.obj \ + $O\EditPage.obj \ + $O\LangPage.obj \ + $O\ListViewDialog.obj \ + $O\MessagesDialog.obj \ + $O\OverwriteDialog.obj \ + $O\PasswordDialog.obj \ + $O\PluginsPage.obj \ + $O\ProgressDialog2.obj \ + $O\SettingsPage.obj \ + $O\SplitDialog.obj \ + $O\SystemPage.obj \ COMMON_OBJS = \ $O\CRC.obj \ @@ -100,19 +116,44 @@ WIN_CTRL_OBJS = \ 7ZIP_COMMON_OBJS = \ $O\FilePathAutoRename.obj \ $O\FileStreams.obj \ + $O\ProgressUtils.obj \ $O\StreamObjects.obj \ + $O\StreamUtils.obj \ UI_COMMON_OBJS = \ + $O\ArchiveExtractCallback.obj \ $O\ArchiveName.obj \ + $O\ArchiveOpenCallback.obj \ $O\CompressCall.obj \ + $O\DefaultName.obj \ + $O\EnumDirItems.obj \ + $O\ExtractingFilePath.obj \ + $O\LoadCodecs.obj \ + $O\OpenArchive.obj \ $O\PropIDUtils.obj \ + $O\SortUtils.obj \ + $O\UpdateAction.obj \ + $O\UpdateCallback.obj \ + $O\UpdatePair.obj \ + $O\UpdateProduce.obj \ + $O\WorkDir.obj \ + $O\ZipRegistry.obj \ + +AGENT_OBJS = \ + $O\Agent.obj \ + $O\AgentOut.obj \ + $O\AgentProxy.obj \ + $O\ArchiveFolder.obj \ + $O\ArchiveFolderOpen.obj \ + $O\ArchiveFolderOut.obj \ + $O\UpdateCallbackAgent.obj \ C_OBJS = \ $O\Alloc.obj \ $O\Sort.obj \ $O\Threads.obj \ -!include "../Crc2.mak" +!include "../../Crc2.mak" OBJS = \ $O\StdAfx.obj \ @@ -122,84 +163,32 @@ OBJS = \ $(WIN_CTRL_OBJS) \ $(7ZIP_COMMON_OBJS) \ $(UI_COMMON_OBJS) \ - $O\AboutDialog.obj \ - $O\ComboDialog.obj \ - $O\CopyDialog.obj \ - $O\EditPage.obj \ - $O\LangPage.obj \ - $O\ListViewDialog.obj \ - $O\MessagesDialog.obj \ - $O\OverwriteDialog.obj \ - $O\PasswordDialog.obj \ - $O\PluginsPage.obj \ - $O\ProgressDialog.obj \ - $O\SettingsPage.obj \ - $O\SplitDialog.obj \ - $O\SystemPage.obj \ + $(AGENT_OBJS) \ + $O\CopyCoder.obj \ $(CRC_OBJS) \ $(C_OBJS) \ $O\resource.res \ -!include "../../Build.mak" +!include "../../../Build.mak" $(FM_OBJS): $(*B).cpp $(COMPL) -$(COMMON_OBJS): ../../Common/$(*B).cpp - $(COMPL) -$(WIN_OBJS): ../../Windows/$(*B).cpp - $(COMPL) -$(WIN_CTRL_OBJS): ../../Windows/Control/$(*B).cpp - $(COMPL) -$(7ZIP_COMMON_OBJS): ../Common/$(*B).cpp - $(COMPL) -$(UI_COMMON_OBJS): ../UI/Common/$(*B).cpp - $(COMPL) - -$O\AboutDialog.obj: Resource/AboutDialog/AboutDialog.cpp - $(COMPL) -$O\ComboDialog.obj: Resource/ComboDialog/ComboDialog.cpp - $(COMPL) -$O\CopyDialog.obj: Resource/CopyDialog/CopyDialog.cpp +$(COMMON_OBJS): ../../../Common/$(*B).cpp $(COMPL) -$O\EditPage.obj: Resource/EditPage/EditPage.cpp +$(WIN_OBJS): ../../../Windows/$(*B).cpp $(COMPL) -$O\LangPage.obj: Resource/LangPage/LangPage.cpp +$(WIN_CTRL_OBJS): ../../../Windows/Control/$(*B).cpp $(COMPL) -$O\ListViewDialog.obj: Resource/ListViewDialog/ListViewDialog.cpp +$(7ZIP_COMMON_OBJS): ../../Common/$(*B).cpp $(COMPL) -$O\MessagesDialog.obj: Resource/MessagesDialog/MessagesDialog.cpp +$(UI_COMMON_OBJS): ../Common/$(*B).cpp $(COMPL) -$O\OverwriteDialog.obj: Resource/OverwriteDialog/OverwriteDialog.cpp +$(AGENT_OBJS): ../Agent/$(*B).cpp $(COMPL) -$O\PasswordDialog.obj: Resource/PasswordDialog/PasswordDialog.cpp - $(COMPL) -$O\PluginsPage.obj: Resource/PluginsPage/PluginsPage.cpp - $(COMPL) -$O\ProgressDialog.obj: Resource/ProgressDialog2/ProgressDialog.cpp - $(COMPL) -$O\SettingsPage.obj: Resource/SettingsPage/SettingsPage.cpp - $(COMPL) -$O\SplitDialog.obj: Resource/SplitDialog/SplitDialog.cpp - $(COMPL) -$O\SystemPage.obj: Resource/SystemPage/SystemPage.cpp - $(COMPL) -$(C_OBJS): ../../../C/$(*B).c - $(COMPL_O2) - -!IF "$(CPU)" != "IA64" -!IF "$(CPU)" != "AMD64" -$O\7zCrcT8U.obj: ../../../Asm/x86/$(*B).asm - $(COMPL_ASM) -!ELSE -$O\7zCrcT8U.obj: ../../../Asm/x64/$(*B).asm - $(COMPL_ASM) -!ENDIF -$O\7zCrcT8.obj: ../../../C/$(*B).c - $(COMPL_O2) -!ELSE -$(CRC_OBJS): ../../../C/$(*B).c +$O\CopyCoder.obj: ../../Compress/Copy/$(*B).cpp + $(COMPL) +$(C_OBJS): ../../../../C/$(*B).c $(COMPL_O2) -!ENDIF - +!include "../../Crc.mak" diff --git a/CPP/7zip/FileManager/resource.h b/CPP/7zip/UI/FileManager/resource.h index bc809306..864c066b 100755 --- a/CPP/7zip/FileManager/resource.h +++ b/CPP/7zip/UI/FileManager/resource.h @@ -152,3 +152,8 @@ #define IDS_CHECKSUM_CRC_DATA_NAMES 4043 #define IDS_SCANNING 4050 +#define IDS_PROPERTIES 4060 + +#define IDS_PROGRESS_TESTING 4100 +#define IDS_MESSAGE_NO_ERRORS 4200 + diff --git a/CPP/7zip/FileManager/resource.rc b/CPP/7zip/UI/FileManager/resource.rc index 43494581..b8664cbe 100755 --- a/CPP/7zip/FileManager/resource.rc +++ b/CPP/7zip/UI/FileManager/resource.rc @@ -1,5 +1,5 @@ -#include "../MyVersionInfo.rc" -#include "../GuiCommon.rc" +#include "../../MyVersionInfo.rc" +#include "../../GuiCommon.rc" #include "resource.h" MY_VERSION_INFO_APP("7-Zip File Manager", "7zFM") @@ -153,6 +153,8 @@ BEGIN IDS_SCANNING "Scanning..." + IDS_PROPERTIES "Properties" + IDS_OPERATION_IS_NOT_SUPPORTED "Operation is not supported." IDS_CONFIRM_FILE_DELETE "Confirm File Delete" @@ -210,22 +212,26 @@ BEGIN IDS_BOOKMARK "Bookmark" IDS_COMPUTER "Computer" IDS_NETWORK "Network" + + IDS_PROGRESS_TESTING "Testing" + IDS_MESSAGE_NO_ERRORS "There are no errors" END -#include "Resource/ComboDialog/resource.rc" -#include "Resource/CopyDialog/resource.rc" -#include "Resource/ListViewDialog/resource.rc" -#include "Resource/PropertyName/resource.rc" -#include "Resource/MessagesDialog/resource.rc" -#include "Resource/OverwriteDialog/resource.rc" -#include "Resource/PasswordDialog/resource.rc" -#include "Resource/SplitDialog/resource.rc" -#include "Resource/ProgressDialog2/resource.rc" -#include "Resource/AboutDialog/resource.rc" -#include "Resource/LangPage/resource.rc" -#include "Resource/PluginsPage/resource.rc" -#include "Resource/SystemPage/resource.rc" -#include "Resource/EditPage/resource.rc" -#include "Resource/SettingsPage/resource.rc" -#include "../UI/Resource/Extract/resource.rc" +#include "ComboDialog.rc" +#include "CopyDialog.rc" +#include "ListViewDialog.rc" +#include "PropertyName.rc" +#include "MessagesDialog.rc" +#include "OverwriteDialog.rc" +#include "PasswordDialog.rc" +#include "SplitDialog.rc" +#include "ProgressDialog2.rc" +#include "AboutDialog.rc" +#include "LangPage.rc" +#include "PluginsPage.rc" +#include "SystemPage.rc" +#include "EditPage.rc" +#include "SettingsPage.rc" +#include "../GUI/ExtractDialog.rc" +#include "../GUI/Extract.rc" diff --git a/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/BenchmarkDialog.cpp b/CPP/7zip/UI/GUI/BenchmarkDialog.cpp index f9a78472..3177bb06 100755 --- a/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/BenchmarkDialog.cpp +++ b/CPP/7zip/UI/GUI/BenchmarkDialog.cpp @@ -8,8 +8,8 @@ #include "Windows/Thread.h" #include "Windows/Error.h" #include "Windows/System.h" -#include "../../../../FileManager/HelpUtils.h" -#include "resource.h" +#include "../FileManager/HelpUtils.h" +// #include "BenchmarkDialogRes.h" #include "BenchmarkDialog.h" using namespace NWindows; @@ -22,7 +22,7 @@ static const UINT_PTR kTimerID = 4; static const UINT kTimerElapse = 1000; #ifdef LANG -#include "../../../../FileManager/LangUtils.h" +#include "../FileManager/LangUtils.h" #endif using namespace NWindows; diff --git a/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/BenchmarkDialog.h b/CPP/7zip/UI/GUI/BenchmarkDialog.h index 9474c5b8..2ba4a9a5 100755 --- a/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/BenchmarkDialog.h +++ b/CPP/7zip/UI/GUI/BenchmarkDialog.h @@ -3,15 +3,15 @@ #ifndef __BENCHMARKDIALOG_H #define __BENCHMARKDIALOG_H -#include "resource.h" +#include "BenchmarkDialogRes.h" #include "Windows/Control/Dialog.h" #include "Windows/Control/ComboBox.h" #include "Windows/Synchronization.h" -#include "../../../../Compress/LZMA_Alone/LzmaBench.h" +#include "../../Compress/LZMA_Alone/LzmaBench.h" #ifdef EXTERNAL_LZMA -#include "../../../../UI/Common/LoadCodecs.h" +#include "../Common/LoadCodecs.h" #endif struct CBenchInfo2 : public CBenchInfo diff --git a/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/resource.rc b/CPP/7zip/UI/GUI/BenchmarkDialog.rc index 43b59be8..58f2ab62 100755 --- a/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/resource.rc +++ b/CPP/7zip/UI/GUI/BenchmarkDialog.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../../GuiCommon.rc" +#include "BenchmarkDialogRes.h" +#include "../../GuiCommon.rc" #define xSize2 330 #define ySize2 228 diff --git a/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/resource.h b/CPP/7zip/UI/GUI/BenchmarkDialogRes.h index 6ef52188..6ef52188 100755 --- a/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/resource.h +++ b/CPP/7zip/UI/GUI/BenchmarkDialogRes.h diff --git a/CPP/7zip/UI/GUI/CompressDialog.cpp b/CPP/7zip/UI/GUI/CompressDialog.cpp index 99ac831d..6836f724 100755 --- a/CPP/7zip/UI/GUI/CompressDialog.cpp +++ b/CPP/7zip/UI/GUI/CompressDialog.cpp @@ -12,9 +12,9 @@ #include "Windows/ResourceString.h" #include "Windows/System.h" -#include "../../FileManager/HelpUtils.h" -#include "../../FileManager/SplitUtils.h" -#include "../../FileManager/FormatUtils.h" +#include "../FileManager/HelpUtils.h" +#include "../FileManager/SplitUtils.h" +#include "../FileManager/FormatUtils.h" #include "../Explorer/MyMessages.h" @@ -27,10 +27,10 @@ extern bool g_IsNT; #endif #ifdef LANG -#include "../../FileManager/LangUtils.h" +#include "../FileManager/LangUtils.h" #endif -#include "../Resource/CompressDialog/resource.h" +#include "CompressDialogRes.h" #define MY_SIZE_OF_ARRAY(x) (sizeof(x) / sizeof(x[0])) @@ -536,7 +536,7 @@ void CCompressDialog::OnOK() UInt32 solidLogSize = GetBlockSizeSpec(); Info.SolidBlockSize = 0; - if (solidLogSize > 0) + if (solidLogSize > 0 && solidLogSize != (UInt32)-1) Info.SolidBlockSize = (solidLogSize >= 64) ? (UInt64)(Int64)-1 : ((UInt64)1 << solidLogSize); Info.Method = GetMethodSpec(); @@ -1176,6 +1176,10 @@ void CCompressDialog::SetSolidBlockSize() if (!fi.Solid) return; + UInt32 level = GetLevel2(); + if (level == 0) + return; + UInt32 dictionary = GetDictionarySpec(); if (dictionary == UInt32(-1)) dictionary = 1; diff --git a/CPP/7zip/UI/GUI/CompressDialog.h b/CPP/7zip/UI/GUI/CompressDialog.h index a23605d4..0b9e38c2 100755 --- a/CPP/7zip/UI/GUI/CompressDialog.h +++ b/CPP/7zip/UI/GUI/CompressDialog.h @@ -5,7 +5,7 @@ #include "../Common/ZipRegistry.h" #include "../Common/LoadCodecs.h" -#include "../Resource/CompressDialog/resource.h" +#include "CompressDialogRes.h" #include "Windows/Control/Dialog.h" #include "Windows/Control/Edit.h" diff --git a/CPP/7zip/UI/Resource/CompressDialog/resource.rc b/CPP/7zip/UI/GUI/CompressDialog.rc index 0c31d37d..d2a14104 100755 --- a/CPP/7zip/UI/Resource/CompressDialog/resource.rc +++ b/CPP/7zip/UI/GUI/CompressDialog.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "CompressDialogRes.h" +#include "../../GuiCommon.rc" #define xSize2 400 #define ySize2 305 diff --git a/CPP/7zip/UI/Resource/CompressDialog/resource.h b/CPP/7zip/UI/GUI/CompressDialogRes.h index beedde4e..beedde4e 100755 --- a/CPP/7zip/UI/Resource/CompressDialog/resource.h +++ b/CPP/7zip/UI/GUI/CompressDialogRes.h diff --git a/CPP/7zip/UI/Resource/Extract/resource.rc b/CPP/7zip/UI/GUI/Extract.rc index d3fd1df9..4f2a520c 100755 --- a/CPP/7zip/UI/Resource/Extract/resource.rc +++ b/CPP/7zip/UI/GUI/Extract.rc @@ -1,4 +1,4 @@ -#include "resource.h" +#include "ExtractRes.h" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US diff --git a/CPP/7zip/UI/GUI/ExtractDialog.cpp b/CPP/7zip/UI/GUI/ExtractDialog.cpp index 3345b7df..876fbbba 100755 --- a/CPP/7zip/UI/GUI/ExtractDialog.cpp +++ b/CPP/7zip/UI/GUI/ExtractDialog.cpp @@ -13,15 +13,15 @@ #include "Windows/ResourceString.h" #ifndef NO_REGISTRY -#include "../../FileManager/HelpUtils.h" +#include "../FileManager/HelpUtils.h" #endif #include "../Common/ZipRegistry.h" -#include "../../FileManager/LangUtils.h" +#include "../FileManager/LangUtils.h" -#include "../Resource/Extract/resource.h" -#include "../Resource/ExtractDialog/resource.h" +#include "ExtractRes.h" +#include "ExtractDialogRes.h" // #include "Help/Context/Extract.h" diff --git a/CPP/7zip/UI/GUI/ExtractDialog.h b/CPP/7zip/UI/GUI/ExtractDialog.h index 0020c693..6ac82f74 100755 --- a/CPP/7zip/UI/GUI/ExtractDialog.h +++ b/CPP/7zip/UI/GUI/ExtractDialog.h @@ -3,7 +3,7 @@ #ifndef __EXTRACTDIALOG_H #define __EXTRACTDIALOG_H -#include "resource.h" +#include "ExtractDialogRes.h" #include "Windows/Control/Dialog.h" #include "Windows/Control/Edit.h" diff --git a/CPP/7zip/UI/Resource/ExtractDialog/resource.rc b/CPP/7zip/UI/GUI/ExtractDialog.rc index 05cf5ea6..f1d50317 100755 --- a/CPP/7zip/UI/Resource/ExtractDialog/resource.rc +++ b/CPP/7zip/UI/GUI/ExtractDialog.rc @@ -1,5 +1,5 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" +#include "ExtractDialogRes.h" +#include "../../GuiCommon.rc" #define xSize2 285 #define ySize2 204 diff --git a/CPP/7zip/UI/Resource/ExtractDialog/resource.h b/CPP/7zip/UI/GUI/ExtractDialogRes.h index 338a2561..bc45ed23 100755 --- a/CPP/7zip/UI/Resource/ExtractDialog/resource.h +++ b/CPP/7zip/UI/GUI/ExtractDialogRes.h @@ -1,3 +1,5 @@ +#define IDD_DIALOG_EXTRACT 137 + #define IDC_STATIC_EXTRACT_EXTRACT_TO 1020 #define IDC_EXTRACT_COMBO_PATH 1021 #define IDC_EXTRACT_BUTTON_SET_PATH 1022 diff --git a/CPP/7zip/UI/GUI/ExtractGUI.cpp b/CPP/7zip/UI/GUI/ExtractGUI.cpp index b73f9870..7936fa86 100755 --- a/CPP/7zip/UI/GUI/ExtractGUI.cpp +++ b/CPP/7zip/UI/GUI/ExtractGUI.cpp @@ -5,19 +5,21 @@ #include "ExtractGUI.h" #include "Common/StringConvert.h" +#include "Common/IntToString.h" #include "Windows/FileDir.h" #include "Windows/Error.h" #include "Windows/FileFind.h" #include "Windows/Thread.h" -#include "../../FileManager/FormatUtils.h" -#include "../../FileManager/ExtractCallback.h" -#include "../../FileManager/LangUtils.h" +#include "../FileManager/FormatUtils.h" +#include "../FileManager/ExtractCallback.h" +#include "../FileManager/LangUtils.h" #include "../Common/ArchiveExtractCallback.h" #include "../Explorer/MyMessages.h" -#include "../Resource/Extract/resource.h" +#include "resource.h" +#include "ExtractRes.h" #include "OpenCallbackGUI.h" #include "ExtractDialog.h" @@ -36,7 +38,7 @@ struct CThreadExtracting const CExtractOptions *Options; COpenCallbackGUI *OpenCallback; CMyComPtr<IExtractCallbackUI> ExtractCallback; - + CDecompressStat Stat; UString ErrorMessage; HRESULT Result; @@ -48,7 +50,7 @@ struct CThreadExtracting Result = DecompressArchives( codecs, *ArchivePaths, *ArchivePathsFull, - *WildcardCensor, *Options, OpenCallback, ExtractCallback, ErrorMessage); + *WildcardCensor, *Options, OpenCallback, ExtractCallback, ErrorMessage, Stat); } catch(const UString &s) { @@ -78,6 +80,34 @@ struct CThreadExtracting } }; +#ifndef _SFX + +static void AddValuePair(UINT resourceID, UInt32 langID, UInt64 value, UString &s) +{ + wchar_t sz[32]; + s += LangString(resourceID, langID); + s += L" "; + ConvertUInt64ToString(value, sz); + s += sz; + s += L"\n"; +} + +static void AddSizePair(UINT resourceID, UInt32 langID, UInt64 value, UString &s) +{ + wchar_t sz[32]; + s += LangString(resourceID, langID); + s += L" "; + ConvertUInt64ToString(value, sz); + s += sz; + ConvertUInt64ToString(value >> 20, sz); + s += L" ("; + s += sz; + s += L" MB)"; + s += L"\n"; +} + +#endif + HRESULT ExtractGUI( CCodecs *codecs, UStringVector &archivePaths, @@ -162,8 +192,16 @@ HRESULT ExtractGUI( extracter.ExtractCallbackSpec->NumArchiveErrors == 0) { #ifndef _SFX - MessageBoxW(0, LangString(IDS_MESSAGE_NO_ERRORS, 0x02000608), - LangString(IDS_PROGRESS_TESTING, 0x02000F90), 0); + UString s; + AddValuePair(IDS_ARCHIVES_COLON, 0x02000324, extracter.Stat.NumArchives, s); + AddValuePair(IDS_FOLDERS_COLON, 0x02000321, extracter.Stat.NumFolders, s); + AddValuePair(IDS_FILES_COLON, 0x02000320, extracter.Stat.NumFiles, s); + AddSizePair(IDS_SIZE_COLON, 0x02000322, extracter.Stat.UnpackSize, s); + AddSizePair(IDS_COMPRESSED_COLON, 0x02000323, extracter.Stat.PackSize, s); + s += L"\n"; + s += LangString(IDS_MESSAGE_NO_ERRORS, 0x02000608); + + MessageBoxW(0, s, LangString(IDS_PROGRESS_TESTING, 0x02000F90), 0); #endif } if (extracter.Result != S_OK) diff --git a/CPP/7zip/UI/GUI/ExtractGUI.h b/CPP/7zip/UI/GUI/ExtractGUI.h index 281fcc43..dfc59945 100755 --- a/CPP/7zip/UI/GUI/ExtractGUI.h +++ b/CPP/7zip/UI/GUI/ExtractGUI.h @@ -6,7 +6,7 @@ #include "../Common/Extract.h" #include "OpenCallbackGUI.h" -#include "../../FileManager/ExtractCallback.h" +#include "../FileManager/ExtractCallback.h" HRESULT ExtractGUI( CCodecs *codecs, diff --git a/CPP/7zip/UI/Resource/Extract/resource.h b/CPP/7zip/UI/GUI/ExtractRes.h index 917c0a34..917c0a34 100755 --- a/CPP/7zip/UI/Resource/Extract/resource.h +++ b/CPP/7zip/UI/GUI/ExtractRes.h diff --git a/CPP/7zip/UI/GUI/GUI.cpp b/CPP/7zip/UI/GUI/GUI.cpp index 4f06ff93..65b7fafa 100755 --- a/CPP/7zip/UI/GUI/GUI.cpp +++ b/CPP/7zip/UI/GUI/GUI.cpp @@ -27,17 +27,17 @@ extern "C" #include "../../IStream.h" #include "../../IPassword.h" -#include "../../FileManager/StringUtils.h" +#include "../FileManager/StringUtils.h" #include "../Common/ExitCode.h" #include "../Common/ArchiveCommandLine.h" -#include "../Resource/Extract/resource.h" +#include "ExtractRes.h" #include "../Explorer/MyMessages.h" #include "ExtractGUI.h" #include "UpdateGUI.h" -#include "Resource/BenchmarkDialog/BenchmarkDialog.h" +#include "BenchmarkDialog.h" using namespace NWindows; @@ -110,6 +110,7 @@ int Main2() { CExtractCallbackImp *ecs = new CExtractCallbackImp; CMyComPtr<IFolderArchiveExtractCallback> extractCallback = ecs; + ecs->ProgressDialog.CompressingMode = false; ecs->PasswordIsDefined = options.PasswordEnabled; ecs->Password = options.Password; ecs->Init(); diff --git a/CPP/7zip/UI/GUI/GUI.dsp b/CPP/7zip/UI/GUI/GUI.dsp index 54e70732..4a5ad512 100755 --- a/CPP/7zip/UI/GUI/GUI.dsp +++ b/CPP/7zip/UI/GUI/GUI.dsp @@ -384,11 +384,11 @@ SOURCE=..\Explorer\MyMessages.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\FileManager\Resource\ProgressDialog2\ProgressDialog.cpp +SOURCE=..\FileManager\ProgressDialog2.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\Resource\ProgressDialog2\ProgressDialog.h +SOURCE=..\FileManager\ProgressDialog2.h # End Source File # End Group # Begin Group "Messages" @@ -396,11 +396,11 @@ SOURCE=..\..\FileManager\Resource\ProgressDialog2\ProgressDialog.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\FileManager\Resource\MessagesDialog\MessagesDialog.cpp +SOURCE=..\FileManager\MessagesDialog.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\Resource\MessagesDialog\MessagesDialog.h +SOURCE=..\FileManager\MessagesDialog.h # End Source File # End Group # Begin Group "Overwtite" @@ -408,11 +408,11 @@ SOURCE=..\..\FileManager\Resource\MessagesDialog\MessagesDialog.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\FileManager\Resource\OverwriteDialog\OverwriteDialog.cpp +SOURCE=..\FileManager\OverwriteDialog.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\Resource\OverwriteDialog\OverwriteDialog.h +SOURCE=..\FileManager\OverwriteDialog.h # End Source File # End Group # Begin Group "Password" @@ -420,11 +420,11 @@ SOURCE=..\..\FileManager\Resource\OverwriteDialog\OverwriteDialog.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\FileManager\Resource\PasswordDialog\PasswordDialog.cpp +SOURCE=..\FileManager\PasswordDialog.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\Resource\PasswordDialog\PasswordDialog.h +SOURCE=..\FileManager\PasswordDialog.h # End Source File # End Group # Begin Group "Compress Dialog" @@ -456,11 +456,11 @@ SOURCE=.\ExtractDialog.h # PROP Default_Filter "" # Begin Source File -SOURCE=.\Resource\BenchmarkDialog\BenchmarkDialog.cpp +SOURCE=.\BenchmarkDialog.cpp # End Source File # Begin Source File -SOURCE=.\Resource\BenchmarkDialog\BenchmarkDialog.h +SOURCE=.\BenchmarkDialog.h # End Source File # End Group # End Group @@ -469,87 +469,79 @@ SOURCE=.\Resource\BenchmarkDialog\BenchmarkDialog.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\FileManager\ExtractCallback.cpp +SOURCE=..\FileManager\ExtractCallback.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\ExtractCallback.h +SOURCE=..\FileManager\ExtractCallback.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\FolderInterface.h +SOURCE=..\FileManager\FolderInterface.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\FormatUtils.cpp +SOURCE=..\FileManager\FormatUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\FormatUtils.h +SOURCE=..\FileManager\FormatUtils.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\HelpUtils.cpp +SOURCE=..\FileManager\HelpUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\HelpUtils.h +SOURCE=..\FileManager\HelpUtils.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\LangUtils.cpp +SOURCE=..\FileManager\LangUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\LangUtils.h +SOURCE=..\FileManager\LangUtils.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\OpenCallback.cpp +SOURCE=..\FileManager\OpenCallback.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\OpenCallback.h +SOURCE=..\FileManager\OpenCallback.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\ProgramLocation.cpp +SOURCE=..\FileManager\ProgramLocation.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\ProgramLocation.h +SOURCE=..\FileManager\ProgramLocation.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\RegistryUtils.cpp +SOURCE=..\FileManager\RegistryUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\RegistryUtils.h +SOURCE=..\FileManager\RegistryUtils.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\SplitUtils.cpp +SOURCE=..\FileManager\SplitUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\SplitUtils.h +SOURCE=..\FileManager\SplitUtils.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\StringUtils.cpp +SOURCE=..\FileManager\StringUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\StringUtils.h -# End Source File -# Begin Source File - -SOURCE=..\..\FileManager\UpdateCallback100.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\FileManager\UpdateCallback100.h +SOURCE=..\FileManager\StringUtils.h # End Source File # End Group # Begin Group "Engine" @@ -613,6 +605,14 @@ SOURCE=..\..\Common\FileStreams.h # End Source File # Begin Source File +SOURCE=..\..\Common\ProgressUtils.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\ProgressUtils.h +# End Source File +# Begin Source File + SOURCE=..\..\Common\StreamUtils.cpp # End Source File # Begin Source File diff --git a/CPP/7zip/UI/GUI/OpenCallbackGUI.cpp b/CPP/7zip/UI/GUI/OpenCallbackGUI.cpp index bc6cf393..ae204d17 100755 --- a/CPP/7zip/UI/GUI/OpenCallbackGUI.cpp +++ b/CPP/7zip/UI/GUI/OpenCallbackGUI.cpp @@ -9,7 +9,7 @@ #include "Common/StringConvert.h" #ifndef _NO_CRYPTO -#include "../../FileManager/Resource/PasswordDialog/PasswordDialog.h" +#include "../FileManager/PasswordDialog.h" #endif HRESULT COpenCallbackGUI::CheckBreak() diff --git a/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/StdAfx.h b/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/StdAfx.h deleted file mode 100755 index a444ca31..00000000 --- a/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/StdAfx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h - -#ifndef __STDAFX_H -#define __STDAFX_H - -#define _WIN32_WINNT 0x0400 - -// it's for Windows NT supporting (MENUITEMINFOW) -#define WINVER 0x0400 - -#include <windows.h> -#include <commctrl.h> - -#include "Common/NewHandler.h" - -#endif diff --git a/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp b/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp index eff29953..a17f0cac 100755 --- a/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp +++ b/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp @@ -10,8 +10,8 @@ #include "Windows/PropVariant.h" #include "Windows/Error.h" -#include "../../FileManager/Resource/MessagesDialog/MessagesDialog.h" -#include "../../FileManager/Resource/PasswordDialog/PasswordDialog.h" +#include "../FileManager/MessagesDialog.h" +#include "../FileManager/PasswordDialog.h" using namespace NWindows; @@ -30,6 +30,7 @@ void CUpdateCallbackGUI::Init() FailedFiles.Clear(); Messages.Clear(); NumArchiveErrors = 0; + NumFiles = 0; } void CUpdateCallbackGUI::AddErrorMessage(LPCWSTR message) @@ -102,6 +103,12 @@ HRESULT CUpdateCallbackGUI::Finilize() return S_OK; } +HRESULT CUpdateCallbackGUI::SetNumFiles(UInt64 numFiles) +{ + ProgressDialog.ProgressSynch.SetNumFilesTotal(numFiles); + return S_OK; +} + HRESULT CUpdateCallbackGUI::SetTotal(UInt64 total) { ProgressDialog.ProgressSynch.SetProgress(total, 0); @@ -116,6 +123,13 @@ HRESULT CUpdateCallbackGUI::SetCompleted(const UInt64 *completeValue) return S_OK; } +HRESULT CUpdateCallbackGUI::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize) +{ + RINOK(CheckBreak()); + ProgressDialog.ProgressSynch.SetRatioInfo(inSize, outSize); + return S_OK; +} + HRESULT CUpdateCallbackGUI::GetStream(const wchar_t *name, bool /* isAnti */) { ProgressDialog.ProgressSynch.SetCurrentFileName(name); @@ -135,6 +149,8 @@ HRESULT CUpdateCallbackGUI::OpenFileError(const wchar_t *name, DWORD systemError HRESULT CUpdateCallbackGUI::SetOperationResult(Int32 /* operationResult */) { + NumFiles++; + ProgressDialog.ProgressSynch.SetNumFilesCur(NumFiles); return S_OK; } diff --git a/CPP/7zip/UI/GUI/UpdateCallbackGUI.h b/CPP/7zip/UI/GUI/UpdateCallbackGUI.h index 16f0220c..dc370638 100755 --- a/CPP/7zip/UI/GUI/UpdateCallbackGUI.h +++ b/CPP/7zip/UI/GUI/UpdateCallbackGUI.h @@ -4,7 +4,7 @@ #define __UPDATE_CALLBACK_GUI_H #include "../Common/Update.h" -#include "../../FileManager/Resource/ProgressDialog2/ProgressDialog.h" +#include "../FileManager/ProgressDialog2.h" class CUpdateCallbackGUI: public IUpdateCallbackUI2 { @@ -13,6 +13,7 @@ public: bool PasswordIsDefined; UString Password; bool AskPassword; + UInt64 NumFiles; CUpdateCallbackGUI(): PasswordIsDefined(false), @@ -24,24 +25,7 @@ public: ~CUpdateCallbackGUI(); void Init(); - HRESULT OpenResult(const wchar_t *name, HRESULT result); - - HRESULT StartScanning(); - HRESULT CanNotFindError(const wchar_t *name, DWORD systemError); - HRESULT FinishScanning(); - - HRESULT StartArchive(const wchar_t *name, bool updating); - HRESULT FinishArchive(); - - HRESULT CheckBreak(); - HRESULT Finilize(); - HRESULT SetTotal(UInt64 total); - HRESULT SetCompleted(const UInt64 *completeValue); - - HRESULT GetStream(const wchar_t *name, bool isAnti); - HRESULT OpenFileError(const wchar_t *name, DWORD systemError); - HRESULT SetOperationResult(Int32 operationResult); - HRESULT CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password); + INTERFACE_IUpdateCallbackUI2(;) // HRESULT CloseProgress(); diff --git a/CPP/7zip/UI/GUI/UpdateGUI.cpp b/CPP/7zip/UI/GUI/UpdateGUI.cpp index b446b4c5..ca89c7c9 100755 --- a/CPP/7zip/UI/GUI/UpdateGUI.cpp +++ b/CPP/7zip/UI/GUI/UpdateGUI.cpp @@ -14,14 +14,14 @@ #include "Windows/FileFind.h" #include "Windows/Thread.h" -#include "../../FileManager/FormatUtils.h" -#include "../../FileManager/ExtractCallback.h" -#include "../../FileManager/StringUtils.h" +#include "../FileManager/FormatUtils.h" +#include "../FileManager/ExtractCallback.h" +#include "../FileManager/StringUtils.h" #include "../Common/ArchiveExtractCallback.h" #include "../Common/WorkDir.h" #include "../Explorer/MyMessages.h" -#include "../Resource/Extract/resource.h" +#include "ExtractRes.h" #include "OpenCallbackGUI.h" #include "CompressDialog.h" diff --git a/CPP/7zip/UI/GUI/UpdateGUI.h b/CPP/7zip/UI/GUI/UpdateGUI.h index 0d9d7bcd..db58877b 100755 --- a/CPP/7zip/UI/GUI/UpdateGUI.h +++ b/CPP/7zip/UI/GUI/UpdateGUI.h @@ -7,7 +7,7 @@ #include "OpenCallbackGUI.h" #include "UpdateCallbackGUI.h" -#include "../../FileManager/UpdateCallback100.h" +#include "../FileManager/UpdateCallback100.h" HRESULT UpdateGUI( CCodecs *codecs, diff --git a/CPP/7zip/UI/GUI/makefile b/CPP/7zip/UI/GUI/makefile index cc672b46..f321e560 100755 --- a/CPP/7zip/UI/GUI/makefile +++ b/CPP/7zip/UI/GUI/makefile @@ -10,6 +10,7 @@ CFLAGS = $(CFLAGS) -I ../../../ \ -D_7ZIP_LARGE_PAGES \ GUI_OBJS = \ + $O\BenchmarkDialog.obj \ $O\CompressDialog.obj \ $O\ExtractDialog.obj \ $O\ExtractGUI.obj \ @@ -60,6 +61,7 @@ WIN_CTRL_OBJS = \ 7ZIP_COMMON_OBJS = \ $O\FilePathAutoRename.obj \ $O\FileStreams.obj \ + $O\ProgressUtils.obj \ $O\StreamUtils.obj \ UI_COMMON_OBJS = \ @@ -97,7 +99,10 @@ FM_OBJS = \ $O\RegistryUtils.obj \ $O\SplitUtils.obj \ $O\StringUtils.obj \ - $O\UpdateCallback100.obj \ + $O\MessagesDialog.obj \ + $O\OverwriteDialog.obj \ + $O\PasswordDialog.obj \ + $O\ProgressDialog2.obj \ C_OBJS = \ $O\Alloc.obj \ @@ -115,11 +120,6 @@ OBJS = \ $(UI_COMMON_OBJS) \ $(FM_OBJS)\ $O\MyMessages.obj \ - $O\MessagesDialog.obj \ - $O\OverwriteDialog.obj \ - $O\PasswordDialog.obj \ - $O\ProgressDialog.obj \ - $O\BenchmarkDialog.obj \ $O\CopyCoder.obj \ $(LZMA_BENCH_OBJS) \ $(C_OBJS) \ @@ -140,20 +140,10 @@ $(7ZIP_COMMON_OBJS): ../../Common/$(*B).cpp $(COMPL) $(UI_COMMON_OBJS): ../Common/$(*B).cpp $(COMPL) -$(FM_OBJS): ../../FileManager/$(*B).cpp +$(FM_OBJS): ../FileManager/$(*B).cpp $(COMPL) $O\MyMessages.obj: ../Explorer/MyMessages.cpp $(COMPL) -$O\MessagesDialog.obj: ../../FileManager/Resource/MessagesDialog/$(*B).cpp - $(COMPL) -$O\OverwriteDialog.obj: ../../FileManager/Resource/OverwriteDialog./$(*B).cpp - $(COMPL) -$O\PasswordDialog.obj: ../../FileManager/Resource/PasswordDialog/$(*B).cpp - $(COMPL) -$O\ProgressDialog.obj: ../../FileManager/Resource/ProgressDialog2/$(*B).cpp - $(COMPL) -$O\BenchmarkDialog.obj: Resource/BenchmarkDialog/$(*B).cpp - $(COMPL) $O\CopyCoder.obj: ../../Compress/Copy/$(*B).cpp diff --git a/CPP/7zip/UI/GUI/resource.h b/CPP/7zip/UI/GUI/resource.h index d505afe0..08517dec 100755 --- a/CPP/7zip/UI/GUI/resource.h +++ b/CPP/7zip/UI/GUI/resource.h @@ -41,7 +41,12 @@ #define IDS_PASSWORD_PASSWORDS_DO_NOT_MATCH 111 #define IDS_PASSWORD_IS_TOO_LONG 112 -#define IDD_DIALOG_EXTRACT 137 +#define IDS_FILES_COLON 2274 +#define IDS_FOLDERS_COLON 2275 +#define IDS_SIZE_COLON 2276 +#define IDS_COMPRESSED_COLON 2277 +#define IDS_ARCHIVES_COLON 2278 + #define IDB_DELETE 149 #define IDC_LIST1 1067 #define IDC_COLUMN_EDIT_WIDTH 1068 diff --git a/CPP/7zip/UI/GUI/resource.rc b/CPP/7zip/UI/GUI/resource.rc index ba93ac43..7782e178 100755 --- a/CPP/7zip/UI/GUI/resource.rc +++ b/CPP/7zip/UI/GUI/resource.rc @@ -48,14 +48,21 @@ BEGIN IDS_ERROR "Error" IDS_MESSAGE_NO_ERRORS "There are no errors" IDS_CONFIG_DIALOG_CAPTION "7-Zip Options" + + IDS_FILES_COLON "Files:" + IDS_FOLDERS_COLON "Folders:" + IDS_SIZE_COLON "Size:" + IDS_COMPRESSED_COLON "Compressed size:" + IDS_ARCHIVES_COLON "Archives:" + END -#include "../../FileManager/Resource/PropertyName/resource.rc" -#include "../../FileManager/Resource/OverwriteDialog/resource.rc" -#include "../../FileManager/Resource/PasswordDialog/resource.rc" -#include "../../FileManager/Resource/MessagesDialog/resource.rc" -#include "../../FileManager/Resource/ProgressDialog2/resource.rc" -#include "../Resource/Extract/resource.rc" -#include "../Resource/ExtractDialog/resource.rc" -#include "../Resource/CompressDialog/resource.rc" -#include "Resource/BenchmarkDialog/resource.rc" +#include "../FileManager/PropertyName.rc" +#include "../FileManager/OverwriteDialog.rc" +#include "../FileManager/PasswordDialog.rc" +#include "../FileManager/MessagesDialog.rc" +#include "../FileManager/ProgressDialog2.rc" +#include "Extract.rc" +#include "ExtractDialog.rc" +#include "CompressDialog.rc" +#include "BenchmarkDialog.rc" diff --git a/CPP/7zip/UI/makefile b/CPP/7zip/UI/makefile index 942beaa0..d6de40a8 100755 --- a/CPP/7zip/UI/makefile +++ b/CPP/7zip/UI/makefile @@ -2,6 +2,7 @@ DIRS = \ Client7z\~ \ Console\~ \ Explorer\~ \ + FileManager\~ \ GUI\~ \ all: $(DIRS) diff --git a/CPP/7zip/makefile b/CPP/7zip/makefile index 500c779a..dcdabb5d 100755 --- a/CPP/7zip/makefile +++ b/CPP/7zip/makefile @@ -2,12 +2,10 @@ DIRS = \ UI\~ \ Bundles\~ \ -all: $(DIRS) FileManager\~ +all: $(DIRS) $(DIRS): cd $(@D) $(MAKE) -nologo cd .. -FileManager\~: -!include "SubBuild.mak" |