OSDN Git Service

Patch [1152341] Merge7z update (DllBuild_Merge7z_10)
authorJochen Tucht <jtuc@users.sourceforge.net>
Tue, 1 Mar 2005 06:34:21 +0000 (06:34 +0000)
committerJochen Tucht <jtuc@users.sourceforge.net>
Tue, 1 Mar 2005 06:34:21 +0000 (06:34 +0000)
20 files changed:
ArchiveSupport/Merge7z/Merge7z.h
ArchiveSupport/Merge7z/Merge7z311.cpp
ArchiveSupport/Merge7z/Merge7z311.dsp
ArchiveSupport/Merge7z/Merge7z312.dsp
ArchiveSupport/Merge7z/Merge7z313.dsp
ArchiveSupport/Merge7z/Merge7z407.dsp
ArchiveSupport/Merge7z/Merge7z408.dsp
ArchiveSupport/Merge7z/Merge7z409.cpp
ArchiveSupport/Merge7z/Merge7z409.dsp
ArchiveSupport/Merge7z/Merge7z410.dsp
ArchiveSupport/Merge7z/Merge7z411.dsp
ArchiveSupport/Merge7z/Merge7z412.dsp
ArchiveSupport/Merge7z/Merge7z413.dsp
ArchiveSupport/Merge7z/Merge7z414.dsp
ArchiveSupport/Merge7z/Merge7z415.dsp [new file with mode: 0755]
ArchiveSupport/Merge7z/Merge7zCommon.cpp
ArchiveSupport/Merge7z/Merge7zCommon.h
ArchiveSupport/Merge7z/revision.txt
ArchiveSupport/Merge7z/tools.cpp
ArchiveSupport/Merge7z/tools.h

index 0a63b4b..61d59e4 100755 (executable)
@@ -8,10 +8,18 @@
 #define DllBuild_Merge7z_9 private
 #endif
 
+#if DllBuild_Merge7z >= 10
+#define DllBuild_Merge7z_10 public
+#else
+#define DllBuild_Merge7z_10 private
+#define DLLPSTUB /##/
+#endif
+
 interface Merge7z
 {
        struct Proxy
        {
+               DLLPSTUB stub;
                LPCSTR Merge7z[2];
                HMODULE handle;
                interface Merge7z *operator->();
@@ -78,6 +86,8 @@ interface Merge7z
                        virtual BSTR GetExtension(UINT32) = 0;
                        virtual VARIANT_BOOL IsFolder(UINT32) = 0;
                        virtual FILETIME LastWriteTime(UINT32) = 0;
+               DllBuild_Merge7z_10:
+                       virtual BSTR GetDefaultName() = 0;
                };
                virtual Inspector *Open(HWND, LPCTSTR) = 0;
                interface Updater
@@ -87,6 +97,15 @@ interface Merge7z
                        virtual HRESULT Commit(HWND) = 0;
                };
                virtual Updater *Update(HWND, LPCTSTR) = 0;
+       DllBuild_Merge7z_10:
+               virtual HRESULT GetHandlerProperty(HWND, PROPID, PROPVARIANT *, VARTYPE) = 0;
+               virtual BSTR GetHandlerName(HWND) = 0;
+               virtual BSTR GetHandlerClassID(HWND) = 0;
+               virtual BSTR GetHandlerExtension(HWND) = 0;
+               virtual BSTR GetHandlerAddExtension(HWND) = 0;
+               virtual VARIANT_BOOL GetHandlerUpdate(HWND) = 0;
+               virtual VARIANT_BOOL GetHandlerKeepName(HWND) = 0;
+               virtual BSTR GetDefaultName(HWND, LPCTSTR) = 0;
        };
        Merge7z();
        Format &Format7z;
index 1aad58f..3ff4f8d 100755 (executable)
@@ -30,6 +30,7 @@ DATE:         BY:                                     DESCRIPTION:
 2004/10/17     Jochen Tucht            Leave decision whether to recurse into folders
                                                                to enumerator (Mask.Recurse)
 2005/01/15     Jochen Tucht            Changed as explained in revision.txt
+2005/02/26     Jochen Tucht            Changed as explained in revision.txt
 */
 
 #include "stdafx.h"
@@ -89,7 +90,7 @@ public:
                result = E_FAIL;
                if COMPLAIN(!Create(Process, this))
                {
-                       Complain(_T("Failed to create extraction thread"));
+                       Complain(GetLastError(), NULL);
                }
                ExtractCallbackSpec->StartProgressDialog(GetUnicodeString(title));
        }
@@ -98,35 +99,36 @@ public:
 /**
  * @brief Construct Inspector
  */
-Format7zDLL::Interface::Inspector::Inspector(Format7zDLL::Interface *format, HWND hwndParent, LPCTSTR path)
-: archive(0), file(0), callback(0), path(path)
+Format7zDLL::Interface::Inspector::Inspector(Format7zDLL::Interface *format, LPCTSTR path)
+: format(format), archive(0), file(0), callback(0), path(path), ustrDefaultName(GetUnicodeString(path))
 {
-       COpenArchiveCallback *callbackImpl = new COpenArchiveCallback;
-       (archive = format->GetInArchive()) -> AddRef();
-       (file = new CInFileStream) -> AddRef();
-       (callback = callbackImpl) -> AddRef();
-       callbackImpl->_passwordIsDefined = false;
-       callbackImpl->_parentWindow = hwndParent;
 }
 
 /**
  * @brief Initialize Inspector
  */
-void Format7zDLL::Interface::Inspector::Init()
+void Format7zDLL::Interface::Inspector::Init(HWND hwndParent)
 {
+       format->GetDefaultName(hwndParent, ustrDefaultName);
+       COpenArchiveCallback *callbackImpl = new COpenArchiveCallback;
+       (archive = format->GetInArchive()) -> AddRef();
+       (file = new CInFileStream) -> AddRef();
+       (callback = callbackImpl) -> AddRef();
+       callbackImpl->_passwordIsDefined = false;
+       callbackImpl->_parentWindow = hwndParent;
        /*CMyComBSTR password;
        callback->CryptoGetTextPassword(&password);*/
-       if COMPLAIN(!file->Open(path))
+       if COMPLAIN(!NFile::NFind::FindFile(path, fileInfo))
        {
-               ComplainCantOpen(path);
+               Complain(ERROR_FILE_NOT_FOUND, path);
        }
-       if COMPLAIN(archive->Open(file, 0, callback) != S_OK)
+       if COMPLAIN(!file->Open(path))
        {
-               ComplainCantOpen(path);
+               Complain(ERROR_OPEN_FAILED, path);
        }
-       if COMPLAIN(!NFile::NFind::FindFile(path, fileInfo))
+       if COMPLAIN(archive->Open(file, 0, callback) != S_OK)
        {
-               ComplainCantOpen(path);
+               Complain(ERROR_CANT_ACCESS_FILE, path);
        }
 }
 
@@ -147,27 +149,6 @@ HRESULT Format7zDLL::Interface::Inspector::Extract(HWND hwndParent, LPCTSTR fold
                                Complain(_T("Can not create output directory"));
                        }
                }
-               //      if path is whatever.tar.bz2, default to whatever.tar:
-               UString ustrDefaultName = GetUnicodeString(path);
-               int dot = ustrDefaultName.ReverseFind('.');
-               int slash = ustrDefaultName.ReverseFind('\\');
-               if (dot > slash)
-               {
-                       if (StrChrW(L"Tt", ustrDefaultName[dot + 1]))
-                       {
-                               ustrDefaultName.ReleaseBuffer(dot + 2);
-                               ustrDefaultName += L"ar";
-                       }
-                       else
-                       {
-                               ustrDefaultName.ReleaseBuffer(dot);
-                       }
-                       ustrDefaultName.Delete(0, slash + 1);
-               }
-               else
-               {
-                       ustrDefaultName = L"noname";
-               }
 
                (extractCallbackSpec2 = new CExtractCallbackImp) -> AddRef();
 
@@ -208,7 +189,13 @@ HRESULT Format7zDLL::Interface::Inspector::Extract(HWND hwndParent, LPCTSTR fold
 
                if COMPLAIN(extractCallbackSpec->_numErrors)
                {
-                       Complain(_T("%I64u error(s)"), extractCallbackSpec->_numErrors);
+                       //      There is no canned system message for this one, so it won't
+                       //      localize. I can't help it.
+                       Complain(_T("%s:\n%I64u error(s)"), path, extractCallbackSpec->_numErrors);
+               }
+               if COMPLAIN(result != S_OK)
+               {
+                       Complain(E_FAIL, path);
                }
        }
        catch (Complain *complain)
@@ -262,7 +249,7 @@ public:
                result = E_FAIL;
                if COMPLAIN(!Create(Process, this))
                {
-                       Complain(_T("Failed to create extraction thread"));
+                       Complain(GetLastError(), NULL);
                }
                updateCallback100->StartProgressDialog(GetUnicodeString(title));
        }
@@ -271,21 +258,21 @@ public:
 /**
  * @brief Construct Updater
  */
-Format7zDLL::Interface::Updater::Updater(Format7zDLL::Interface *format, HWND hwndParent, LPCTSTR path)
-: outArchive(0), file(0), path(path)
+Format7zDLL::Interface::Updater::Updater(Format7zDLL::Interface *format, LPCTSTR path)
+: format(format), outArchive(0), file(0), path(path)
 {
-       (outArchive = format->GetOutArchive()) -> AddRef();
-       (file = new COutFileStream) -> AddRef();
 }
 
 /**
  * @brief Initialize Updater
  */
-void Format7zDLL::Interface::Updater::Init()
+void Format7zDLL::Interface::Updater::Init(HWND hwndParent)
 {
+       (outArchive = format->GetOutArchive()) -> AddRef();
+       (file = new COutFileStream) -> AddRef();
        if COMPLAIN(!file->Open(path))
        {
-               ComplainCantOpen(path);
+               Complain(ERROR_CANNOT_MAKE, path);
        }
 }
 
@@ -346,7 +333,7 @@ HRESULT Format7zDLL::Interface::Updater::Commit(HWND hwndParent)
                //result = outArchive->UpdateItems(file, operationChain.Size(), updateCallbackSpec);
                if COMPLAIN(result != S_OK)
                {
-                       ComplainCantOpen(path);
+                       Complain(E_FAIL, path);
                }
        }
        catch (Complain *complain)
index 5110105..0d2ac01 100755 (executable)
@@ -45,7 +45,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z311" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z311_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z311" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z311_EXPORTS" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
@@ -127,7 +127,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z311" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z311" /D "MERGE7Z311_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z311" /D "MERGE7Z311_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
index ad7ef8f..654eba3 100755 (executable)
@@ -45,7 +45,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z312" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7z312_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z312" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7z312_EXPORTS" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
@@ -127,7 +127,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z312" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z312" /D "MERGE7z312_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z312" /D "MERGE7z312_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
index 9a48519..abf2f53 100755 (executable)
@@ -45,7 +45,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z313" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7z313_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z313" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7z313_EXPORTS" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
@@ -127,7 +127,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z313" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z313" /D "MERGE7z313_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z313" /D "MERGE7z313_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
index 9d535ed..644106f 100755 (executable)
@@ -45,7 +45,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z407" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7z407_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z407" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7z407_EXPORTS" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
@@ -127,7 +127,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z407" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z407" /D "MERGE7z407_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z407" /D "MERGE7z407_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
index 596c1a0..24ba820 100755 (executable)
@@ -45,7 +45,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z408" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7z408_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z408" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7z408_EXPORTS" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
@@ -127,7 +127,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z408" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z408" /D "MERGE7z408_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z408" /D "MERGE7z408_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
index 935a301..e9c592e 100755 (executable)
@@ -31,6 +31,7 @@ DATE:         BY:                                     DESCRIPTION:
 2004/10/17     Jochen Tucht            Leave decision whether to recurse into folders
                                                                to enumerator (Mask.Recurse)
 2005/01/15     Jochen Tucht            Changed as explained in revision.txt
+2005/02/26     Jochen Tucht            Changed as explained in revision.txt
 */
 
 #include "stdafx.h"
@@ -89,7 +90,7 @@ public:
                result = E_FAIL;
                if COMPLAIN(!Create(Process, this))
                {
-                       Complain(_T("Failed to create extraction thread"));
+                       Complain(GetLastError(), NULL);
                }
                ExtractCallbackSpec->StartProgressDialog(GetUnicodeString(title));
        }
@@ -98,35 +99,37 @@ public:
 /**
  * @brief Initialize Inspector
  */
-Format7zDLL::Interface::Inspector::Inspector(Format7zDLL::Interface *format, HWND hwndParent, LPCTSTR path)
-: archive(0), file(0), callback(0), path(path)
+Format7zDLL::Interface::Inspector::Inspector(Format7zDLL::Interface *format, LPCTSTR path)
+: format(format), archive(0), file(0), callback(0), path(path), ustrDefaultName(GetUnicodeString(path))
 {
-       COpenArchiveCallback *callbackImpl = new COpenArchiveCallback;
-       (archive = format->GetInArchive()) -> AddRef();
-       (file = new CInFileStream) -> AddRef();
-       (callback = callbackImpl) -> AddRef();
-       callbackImpl->PasswordIsDefined = false;
-       callbackImpl->ParentWindow = hwndParent;
 }
 
 /**
  * @brief Initialize Inspector
  */
-void Format7zDLL::Interface::Inspector::Init()
+void Format7zDLL::Interface::Inspector::Init(HWND hwndParent)
 {
+       format->GetDefaultName(hwndParent, ustrDefaultName);
+       COpenArchiveCallback *callbackImpl = new COpenArchiveCallback;
+       //COpenCallbackImp *callbackImpl = new COpenCallbackImp;
+       (archive = format->GetInArchive()) -> AddRef();
+       (file = new CInFileStream) -> AddRef();
+       (callback = callbackImpl) -> AddRef();
+       callbackImpl->PasswordIsDefined = false;
+       callbackImpl->ParentWindow = hwndParent;
        /*CMyComBSTR password;
        callback->CryptoGetTextPassword(&password);*/
-       if COMPLAIN(!file->Open(path))
+       if COMPLAIN(!NFile::NFind::FindFile(path, fileInfo))
        {
-               ComplainCantOpen(path);
+               Complain(ERROR_FILE_NOT_FOUND, path);
        }
-       if COMPLAIN(archive->Open(file, 0, callback) != S_OK)
+       if COMPLAIN(!file->Open(path))
        {
-               ComplainCantOpen(path);
+               Complain(ERROR_OPEN_FAILED, path);
        }
-       if COMPLAIN(!NFile::NFind::FindFile(path, fileInfo))
+       if COMPLAIN(archive->Open(file, 0, callback) != S_OK)
        {
-               ComplainCantOpen(path);
+               Complain(ERROR_CANT_ACCESS_FILE, path);
        }
 }
 
@@ -144,29 +147,8 @@ HRESULT Format7zDLL::Interface::Inspector::Extract(HWND hwndParent, LPCTSTR fold
                {
                        if COMPLAIN(!NFile::NDirectory::CreateComplexDirectory(folder))
                        {
-                               Complain(_T("Can not create output directory"));
-                       }
-               }
-               //      if path is whatever.tar.bz2, default to whatever.tar:
-               UString ustrDefaultName = GetUnicodeString(path);
-               int dot = ustrDefaultName.ReverseFind('.');
-               int slash = ustrDefaultName.ReverseFind('\\');
-               if (dot > slash)
-               {
-                       if (StrChrW(L"Tt", ustrDefaultName[dot + 1]))
-                       {
-                               ustrDefaultName.ReleaseBuffer(dot + 2);
-                               ustrDefaultName += L"ar";
-                       }
-                       else
-                       {
-                               ustrDefaultName.ReleaseBuffer(dot);
+                               Complain(ERROR_CANNOT_MAKE, folder);
                        }
-                       ustrDefaultName.Delete(0, slash + 1);
-               }
-               else
-               {
-                       ustrDefaultName = L"noname";
                }
 
                (extractCallbackSpec2 = new CExtractCallbackImp) -> AddRef();
@@ -188,7 +170,7 @@ HRESULT Format7zDLL::Interface::Inspector::Extract(HWND hwndParent, LPCTSTR fold
                        NExtract::NPathMode::kFullPathnames, 
                        NExtract::NOverwriteMode::kWithoutPrompt,
                        UStringVector(),
-                       ustrDefaultName, 
+                       ustrDefaultName,
                        fileInfo.LastWriteTime,
                        fileInfo.Attributes
                );
@@ -205,7 +187,13 @@ HRESULT Format7zDLL::Interface::Inspector::Extract(HWND hwndParent, LPCTSTR fold
 
                if COMPLAIN(extractCallbackSpec->_numErrors)
                {
-                       Complain(_T("%I64u error(s)"), extractCallbackSpec->_numErrors);
+                       //      There is no canned system message for this one, so it won't
+                       //      localize. I can't help it.
+                       Complain(_T("%s:\n%I64u error(s)"), path, extractCallbackSpec->_numErrors);
+               }
+               if COMPLAIN(result != S_OK)
+               {
+                       Complain(E_FAIL, path);
                }
        }
        catch (Complain *complain)
@@ -259,7 +247,7 @@ public:
                result = E_FAIL;
                if COMPLAIN(!Create(Process, this))
                {
-                       Complain(_T("Failed to create extraction thread"));
+                       Complain(GetLastError(), NULL);
                }
                updateCallbackGUI->StartProgressDialog(GetUnicodeString(title));
        }
@@ -268,21 +256,21 @@ public:
 /**
  * @brief Construct Updater
  */
-Format7zDLL::Interface::Updater::Updater(Format7zDLL::Interface *format, HWND hwndParent, LPCTSTR path)
-: outArchive(0), file(0), path(path)
+Format7zDLL::Interface::Updater::Updater(Format7zDLL::Interface *format, LPCTSTR path)
+: format(format), outArchive(0), file(0), path(path)
 {
-       (outArchive = format->GetOutArchive()) -> AddRef();
-       (file = new COutFileStream) -> AddRef();
 }
 
 /**
  * @brief Initialize Updater
  */
-void Format7zDLL::Interface::Updater::Init()
+void Format7zDLL::Interface::Updater::Init(HWND hwndParent)
 {
+       (outArchive = format->GetOutArchive()) -> AddRef();
+       (file = new COutFileStream) -> AddRef();
        if COMPLAIN(!file->Create(path, true))
        {
-               ComplainCantOpen(path);
+               Complain(ERROR_CANNOT_MAKE, path);
        }
 }
 
@@ -349,7 +337,7 @@ HRESULT Format7zDLL::Interface::Updater::Commit(HWND hwndParent)
                //result = outArchive->UpdateItems(file, operationChain.Size(), updateCallbackSpec);
                if COMPLAIN(result != S_OK)
                {
-                       ComplainCantOpen(path);
+                       Complain(E_FAIL, path);
                }
        }
        catch (Complain *complain)
index 89f198a..393fcf6 100755 (executable)
@@ -45,7 +45,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z409" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7z409_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z409" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7z409_EXPORTS" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
@@ -127,7 +127,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z409" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z409" /D "MERGE7z409_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z409" /D "MERGE7z409_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
index 3d1b771..2da17a9 100755 (executable)
@@ -45,7 +45,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z410" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7z410_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z410" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7z410_EXPORTS" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
@@ -127,7 +127,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z410" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z410" /D "MERGE7z410_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z410" /D "MERGE7z410_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
index d457b78..0d3a3b1 100755 (executable)
@@ -45,7 +45,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z411" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7z411_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z411" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7z411_EXPORTS" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
@@ -127,7 +127,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z411" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z411" /D "MERGE7z411_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z411" /D "MERGE7z411_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
index 93c2fb4..2e27732 100755 (executable)
@@ -45,7 +45,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z412" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7z412_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z412" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7z412_EXPORTS" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
@@ -127,7 +127,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z412" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z412" /D "MERGE7z412_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z412" /D "MERGE7z412_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
index 60fb31e..e84508d 100755 (executable)
@@ -45,7 +45,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z413" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "Merge7z413_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z413" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "Merge7z413_EXPORTS" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
@@ -127,7 +127,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z413" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z413" /D "Merge7z413_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z413" /D "Merge7z413_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
index f6dca44..997f8f7 100755 (executable)
@@ -45,7 +45,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z414" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "Merge7z414_EXPORTS" /FR /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z414" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "Merge7z414_EXPORTS" /FR /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
@@ -127,7 +127,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z414" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z414" /D "Merge7z414_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z414" /D "Merge7z414_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
diff --git a/ArchiveSupport/Merge7z/Merge7z415.dsp b/ArchiveSupport/Merge7z/Merge7z415.dsp
new file mode 100755 (executable)
index 0000000..1a8cd87
--- /dev/null
@@ -0,0 +1,565 @@
+# Microsoft Developer Studio Project File - Name="Merge7z415" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** NICHT BEARBEITEN **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=Merge7z415 - Win32 UnicodeDebug
+!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
+!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
+!MESSAGE 
+!MESSAGE NMAKE /f "Merge7z415.mak".
+!MESSAGE 
+!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
+!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
+!MESSAGE 
+!MESSAGE NMAKE /f "Merge7z415.mak" CFG="Merge7z415 - Win32 UnicodeDebug"
+!MESSAGE 
+!MESSAGE Für die Konfiguration stehen zur Auswahl:
+!MESSAGE 
+!MESSAGE "Merge7z415 - Win32 Release" (basierend auf  "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "Merge7z415 - Win32 Debug" (basierend auf  "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "Merge7z415 - Win32 UnicodeDebug" (basierend auf  "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "Merge7z415 - Win32 UnicodeRelease" (basierend auf  "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "Merge7z415 - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\BuildTmp\Merge7z415___Win32_Release"
+# PROP Intermediate_Dir "..\BuildTmp\Merge7z415___Win32_Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z415" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "Merge7z415_EXPORTS" /FR /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x407 /d "NDEBUG"
+# ADD RSC /l 0x407 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# 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 /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shlwapi.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /pdb:none /machine:I386 /out:"../Build/MergeRelease/Merge7z415.dll"
+
+!ELSEIF  "$(CFG)" == "Merge7z415 - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\BuildTmp\Merge7z415___Win32_Debug"
+# PROP Intermediate_Dir "..\BuildTmp\Merge7z415___Win32_Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /vd0 /GX /Z7 /Od /I "..\..\..\7z415" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "Merge7z415_EXPORTS" /FR /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 0x407 /d "_DEBUG"
+# ADD RSC /l 0x407 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# 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 /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shlwapi.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /pdb:"../Build/MergeDebug/Merge7z415.pdb" /debug /machine:I386 /out:"../Build/MergeDebug/Merge7z415.dll"
+# SUBTRACT LINK32 /pdb:none /map
+
+!ELSEIF  "$(CFG)" == "Merge7z415 - Win32 UnicodeDebug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "..\BuildTmp\Merge7z415___Win32_UnicodeDebug"
+# PROP BASE Intermediate_Dir "..\BuildTmp\Merge7z415___Win32_UnicodeDebug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\BuildTmp\Merge7z415___Win32_UnicodeDebug"
+# PROP Intermediate_Dir "..\BuildTmp\Merge7z415___Win32_UnicodeDebug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /vd0 /GX /Z7 /Od /I "..\..\..\7z415" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /FR /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /vd0 /GX /Z7 /Od /I "..\..\..\7z415" /D "Merge7z415_EXPORTS" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /FR /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 0x407 /d "_DEBUG"
+# ADD RSC /l 0x407 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shlwapi.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /pdb:none /map /debug /machine:I386 /out:"../Build/MergeDebug/Merge7z415.dll"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shlwapi.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /pdb:"../Build/MergeUnicodeDebug/Merge7z415U.pdb" /debug /machine:I386 /out:"../Build/MergeUnicodeDebug/Merge7z415U.dll"
+# SUBTRACT LINK32 /pdb:none /map
+
+!ELSEIF  "$(CFG)" == "Merge7z415 - Win32 UnicodeRelease"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "..\BuildTmp\Merge7z415___Win32_UnicodeRelease"
+# PROP BASE Intermediate_Dir "..\BuildTmp\Merge7z415___Win32_UnicodeRelease"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\BuildTmp\Merge7z415___Win32_UnicodeRelease"
+# PROP Intermediate_Dir "..\BuildTmp\Merge7z415___Win32_UnicodeRelease"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\7z415" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MERGE7Z310_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O1 /I "..\..\..\7z415" /D "Merge7z415_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "UNICODE" /D "_UNICODE" /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x407 /d "NDEBUG"
+# ADD RSC /l 0x407 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shlwapi.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /pdb:none /machine:I386 /out:"../Build/MergeRelease/Merge7z415.dll"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shlwapi.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /pdb:none /machine:I386 /out:"../Build/MergeUnicodeRelease/Merge7z415U.dll"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "Merge7z415 - Win32 Release"
+# Name "Merge7z415 - Win32 Debug"
+# Name "Merge7z415 - Win32 UnicodeDebug"
+# Name "Merge7z415 - Win32 UnicodeRelease"
+# Begin Group "Quellcodedateien"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\Merge7z.def
+# End Source File
+# Begin Source File
+
+SOURCE=.\Merge7z.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Merge7z409.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Merge7zCommon.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Merge7zCommon.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\tools.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\tools.h
+# End Source File
+# End Group
+# Begin Group "Header-Dateien"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Ressourcendateien"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\Ui\Gui\FM.ico
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\UI\GUI\resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\Ui\Gui\resource.rc
+# End Source File
+# End Group
+# Begin Group "Windows"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\DLL.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\DLL.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\Error.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\Error.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\FileIO.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\FileIO.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\PropVariant.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\PropVariant.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\PropVariantConversions.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\PropVariantConversions.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\ResourceString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\ResourceString.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\Synchronization.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\Synchronization.h
+# End Source File
+# End Group
+# Begin Group "Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\IntToString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\IntToString.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\Lang.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\Lang.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\StdInStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\StdInStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\String.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\String.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\StringConvert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\StringConvert.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\TextConfig.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\TextConfig.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\UTFConvert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\UTFConvert.h
+# End Source File
+# End Group
+# Begin Group "7zip Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\Ui\Common\ArchiveExtractCallback.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\UI\Common\ArchiveExtractCallback.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\UI\Common\ArchiveOpenCallback.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\UI\Common\ArchiveOpenCallback.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\UI\Common\ArchiverInfo.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\UI\Common\ArchiverInfo.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\UI\Common\DefaultName.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\UI\Common\DefaultName.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\Control\Dialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\Control\Dialog.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\ExtractCallback.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\ExtractCallback.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\Common\FileStreams.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\Common\FileStreams.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\FormatUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\FormatUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\LangUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\LangUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\Resource\MessagesDialog\MessagesDialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\UI\Common\OpenArchive.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\UI\Common\OpenArchive.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\OpenCallback.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\OpenCallback.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\Resource\OverwriteDialog\OverwriteDialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\Resource\PasswordDialog\PasswordDialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\Resource\PasswordDialog\PasswordDialog.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\ProgramLocation.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\ProgramLocation.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\Resource\ProgressDialog2\ProgressDialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\Resource\ProgressDialog2\ProgressDialog.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\Registry.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\Registry.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\RegistryUtils.cpp
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\FileManager\RegistryUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\UI\Common\UpdateCallback.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\UI\Common\UpdateCallback.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\UI\GUI\UpdateCallbackGUI.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\UI\GUI\UpdateCallbackGUI.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\Window.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\Window.h
+# End Source File
+# End Group
+# Begin Group "Extract"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\Ui\Common\ExtractingFilePath.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\UI\Common\ExtractingFilePath.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\FileDir.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\FileDir.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\FileFind.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\FileFind.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\FileName.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Windows\FileName.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\Common\FilePathAutoRename.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\Common\FilePathAutoRename.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\Vector.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\Vector.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\Wildcard.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\7z415\Common\Wildcard.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=..\..\..\7z415\7zip\Ui\Gui\7zG.exe.manifest
+# End Source File
+# Begin Source File
+
+SOURCE=.\revision.txt
+# End Source File
+# End Target
+# End Project
index be1fae4..3acfa41 100755 (executable)
@@ -27,6 +27,7 @@ DATE:         BY:                                     DESCRIPTION:
 2004/03/18     Jochen Tucht            Experimental DllGetVersion() based on rcsid.
 2004/10/10     Jochen Tucht            DllGetVersion() based on new REVISION.TXT
 2005/01/15     Jochen Tucht            Changed as explained in revision.txt
+2005/02/26     Jochen Tucht            Changed as explained in revision.txt
 */
 
 #include "stdafx.h"
@@ -51,37 +52,53 @@ BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD, LPVOID)
 /**
  * @brief Load a dll and import a number of functions.
  */
-static HMODULE DllProxyHelper(LPCSTR *export, ...)
+static HMODULE DllProxyHelper(LPCSTR *proxy, ...)
 {
-       HMODULE handle = 0;
-       if (LPCSTR format = *export)
+       HMODULE handle = NULL;
+       if (LPCSTR name = *proxy)
        {
-               char path[MAX_PATH];
-               FormatMessageA
-               (
-                       FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY,
-                       format,
-                       0,
-                       0,
-                       path,
-                       sizeof path,
-                       (va_list *)(&export + 1)
-               );
-               handle = LoadLibraryA(path);
-               if COMPLAIN(handle == 0)
+               if (proxy[1] && proxy[1] != name)
                {
-                       ComplainNotFound(GetSystemString(path));
+                       char path[MAX_PATH];
+                       FormatMessageA
+                       (
+                               FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY,
+                               name,
+                               0,
+                               0,
+                               path,
+                               sizeof path,
+                               (va_list *)(&proxy + 1)
+                       );
+                       handle = LoadLibraryA(path);
+                       if (handle)
+                       {
+                               LPCSTR *export = proxy;
+                               *proxy = NULL;
+                               while ((name = *++export) != NULL)
+                               {
+                                       *export = (LPCSTR)GetProcAddress(handle, name);
+                                       if (*export == NULL)
+                                       {
+                                               *proxy = proxy[1] = name;
+                                               export = proxy + 2;
+                                               break;
+                                       }
+                               }
+                               *export = (LPCSTR)handle;
+                       }
                }
-               *export = 0;
-               while (LPCSTR name = *++export)
+               if ((name = *proxy) != NULL)
                {
-                       *export = (LPCSTR)GetProcAddress(handle, name);
-                       if COMPLAIN(*export == 0)
+                       DWORD dwError = ERROR_MOD_NOT_FOUND;
+                       HMODULE hContext = NULL;
+                       if (proxy[1] == name)
                        {
-                               ComplainNotFound(GetSystemString(name));
+                               dwError = ERROR_PROC_NOT_FOUND;
+                               hContext = (HMODULE)proxy[2];
                        }
+                       Complain(dwError, GetSystemString(name), hContext);
                }
-               *export = (LPCSTR)handle;
        }
        return handle;
 }
@@ -103,7 +120,7 @@ IInArchive *Format7zDLL::Interface::GetInArchive()
        void *pv;
        if COMPLAIN(proxy->CreateObject(proxy.clsid, &IID_IInArchive, &pv) != S_OK)
        {
-               ComplainCreateObject(proxy.handle, _T("IInArchive"));
+               Complain(RPC_S_INTERFACE_NOT_FOUND, _T("IInArchive"), proxy.handle);
        }
        return static_cast<IInArchive *>(pv);
 }
@@ -116,7 +133,7 @@ IOutArchive *Format7zDLL::Interface::GetOutArchive()
        void *pv;
        if COMPLAIN(proxy->CreateObject(proxy.clsid, &IID_IOutArchive, &pv) != S_OK)
        {
-               ComplainCreateObject(proxy.handle, _T("IOutArchive"));
+               Complain(RPC_S_INTERFACE_NOT_FOUND, _T("IOutArchive"), proxy.handle);
        }
        return static_cast<IOutArchive *>(pv);
 }
@@ -126,9 +143,23 @@ IOutArchive *Format7zDLL::Interface::GetOutArchive()
  */
 HRESULT Format7zDLL::Interface::DeCompressArchive(HWND hwndParent, LPCTSTR path, LPCTSTR folder)
 {
-       Merge7z::Format::Inspector *inspector = Open(hwndParent, path);
-       HRESULT result = inspector->Extract(hwndParent, folder);
-       inspector->Free();
+       HRESULT result = E_FAIL;
+       if (Merge7z::Format::Inspector *inspector = Open(hwndParent, path))
+       {
+               if (CMyComBSTR(GetHandlerAddExtension(hwndParent)).Length())
+               {
+                       //Most handlers seem to be happy with missing index array, but rpm
+                       //handler doesn't know how to "extract all" and needs index array
+                       //even for the one and only file inside (which is .cpio.gz).
+                       static const UINT32 indices[1] = {0};
+                       result = inspector->Extract(hwndParent, folder, indices, 1);
+               }
+               else
+               {
+                       result = inspector->Extract(hwndParent, folder);
+               }
+               inspector->Free();
+       }
        return result;
 }
 
@@ -137,10 +168,10 @@ HRESULT Format7zDLL::Interface::DeCompressArchive(HWND hwndParent, LPCTSTR path,
  */
 Merge7z::Format::Inspector *Format7zDLL::Interface::Open(HWND hwndParent, LPCTSTR path)
 {
-       Inspector *inspector = new Inspector(this, hwndParent, path);
+       Inspector *inspector = new Inspector(this, path);
        try
        {
-               inspector->Init();
+               inspector->Init(hwndParent);
        }
        catch (Complain *complain)
        {
@@ -215,15 +246,66 @@ FILETIME Format7zDLL::Interface::Inspector::LastWriteTime(UINT32 index)
        return SUCCEEDED(GetProperty(index, kpidLastWriteTime, &value, VT_FILETIME)) ? value.filetime : invalid;
 }
 
+void Format7zDLL::Interface::GetDefaultName(HWND hwndParent, UString &ustrDefaultName)
+{
+       int dot = ustrDefaultName.ReverseFind('.');
+       int slash = ustrDefaultName.ReverseFind('\\');
+       if (dot > slash)
+       {
+               LPCWSTR pchExtension = ustrDefaultName;
+               pchExtension += dot + 1;
+               static const OLECHAR wBlank[] = L" ";
+               CMyComBSTR bstrHandlerExtension = GetHandlerExtension(hwndParent);
+               CMyComBSTR bstrHandlerAddExtension = GetHandlerAddExtension(hwndParent);
+               LPWSTR pchHandlerExtension = bstrHandlerExtension.m_str;
+               LPWSTR pchHandlerAddExtension = bstrHandlerAddExtension.m_str;
+               while (int cchHandlerAddExtension = StrCSpnW(pchHandlerAddExtension += StrSpnW(pchHandlerAddExtension, wBlank), wBlank))
+               {
+                       int cchHandlerExtension = StrCSpnW(pchHandlerExtension += StrSpnW(pchHandlerExtension, wBlank), wBlank);
+                       if (StrIsIntlEqualW(FALSE, pchExtension, pchHandlerExtension, cchHandlerExtension) && pchExtension[cchHandlerExtension] == 0)
+                       {
+                               pchHandlerAddExtension[cchHandlerAddExtension] = '\0'; // will also stop iteration
+                               ustrDefaultName.ReleaseBuffer(dot);
+                               if (*pchHandlerAddExtension == '.') // consider != '*'
+                               {
+                                       ustrDefaultName += pchHandlerAddExtension;
+                                       dot += cchHandlerAddExtension; // make ReleaseBuffer(dot) below a NOP
+                               }
+                       }
+                       pchHandlerExtension += cchHandlerExtension;
+                       pchHandlerAddExtension += cchHandlerAddExtension;
+               }
+               ustrDefaultName.ReleaseBuffer(dot);
+               ustrDefaultName.Delete(0, slash + 1);
+       }
+       else
+       {
+               ustrDefaultName = L"noname";
+       }
+}
+
+BSTR Format7zDLL::Interface::GetDefaultName(HWND hwndParent, LPCTSTR path)
+{
+       UString ustrDefaultName = GetUnicodeString(path);
+       GetDefaultName(hwndParent, ustrDefaultName);
+       return SysAllocString(ustrDefaultName);
+}
+
+BSTR Format7zDLL::Interface::Inspector::GetDefaultName()
+{
+       //UString ustrDefaultName = GetUnicodeString(path);
+       return SysAllocString(ustrDefaultName);
+}
+
 /**
  * @brief Open archive for update.
  */
 Merge7z::Format::Updater *Format7zDLL::Interface::Update(HWND hwndParent, LPCTSTR path)
 {
-       Updater *updater = new Updater(this, hwndParent, path);
+       Updater *updater = new Updater(this, path);
        try
        {
-               updater->Init();
+               updater->Init(hwndParent);
        }
        catch (Complain *complain)
        {
@@ -312,25 +394,105 @@ void Format7zDLL::Interface::Updater::Free()
  */
 HRESULT Format7zDLL::Interface::CompressArchive(HWND hwndParent, LPCTSTR path, Merge7z::DirItemEnumerator *etor)
 {
-       Merge7z::Format::Updater *updater = Update(hwndParent, path);
-       UINT count = etor->Open();
-       while (count--)
+       HRESULT result = E_FAIL;
+       if (Merge7z::Format::Updater *updater = Update(hwndParent, path))
+       {
+               UINT count = etor->Open();
+               while (count--)
+               {
+                       Merge7z::DirItemEnumerator::Item etorItem;
+                       etorItem.Mask.Item = 0;
+                       Merge7z::Envelope *envelope = etor->Enum(etorItem);
+                       updater->Add(etorItem);
+                       if (envelope)
+                       {
+                               envelope->Free();
+                       }
+               }
+               result = updater->Commit(hwndParent);
+               updater->Free();
+       }
+       return result;
+}
+
+/**
+ * @brief get handler property identified by given propID
+ */
+HRESULT Format7zDLL::Interface::GetHandlerProperty(HWND hwndParent, PROPID propID, PROPVARIANT *value, VARTYPE vt)
+{
+       VariantInit((VARIANT *)value);
+       HRESULT result = DISP_E_EXCEPTION;
+       try
        {
-               Merge7z::DirItemEnumerator::Item etorItem;
-               etorItem.Mask.Item = 0;
-               Merge7z::Envelope *envelope = etor->Enum(etorItem);
-               updater->Add(etorItem);
-               if (envelope)
+               result = proxy->GetHandlerProperty(propID, value);
+               if (SUCCEEDED(result) && value->vt != vt)
                {
-                       envelope->Free();
+                       VariantClear((VARIANT *)value);
+                       result = DISP_E_TYPEMISMATCH;
                }
        }
-       HRESULT result = updater->Commit(hwndParent);
-       updater->Free();
+       catch (Complain *complain)
+       {
+               complain->Alert(hwndParent);
+       }
        return result;
 }
 
 /**
+ * @brief get Name handler property
+ */
+BSTR Format7zDLL::Interface::GetHandlerName(HWND hwndParent)
+{
+       PROPVARIANT value;
+       return SUCCEEDED(GetHandlerProperty(hwndParent, NArchive::kName, &value, VT_BSTR)) ? value.bstrVal : 0;
+}
+
+/**
+ * @brief get ClassID handler property
+ */
+BSTR Format7zDLL::Interface::GetHandlerClassID(HWND hwndParent)
+{
+       PROPVARIANT value;
+       return SUCCEEDED(GetHandlerProperty(hwndParent, NArchive::kClassID, &value, VT_BSTR)) ? value.bstrVal : 0;
+}
+
+/**
+ * @brief get Extension handler property
+ */
+BSTR Format7zDLL::Interface::GetHandlerExtension(HWND hwndParent)
+{
+       PROPVARIANT value;
+       return SUCCEEDED(GetHandlerProperty(hwndParent, NArchive::kExtension, &value, VT_BSTR)) ? value.bstrVal : 0;
+}
+
+/**
+ * @brief get AddExtension handler property
+ */
+BSTR Format7zDLL::Interface::GetHandlerAddExtension(HWND hwndParent)
+{
+       PROPVARIANT value;
+       return SUCCEEDED(GetHandlerProperty(hwndParent, NArchive::kAddExtension, &value, VT_BSTR)) ? value.bstrVal : 0;
+}
+
+/**
+ * @brief get Update handler property
+ */
+VARIANT_BOOL Format7zDLL::Interface::GetHandlerUpdate(HWND hwndParent)
+{
+       PROPVARIANT value;
+       return SUCCEEDED(GetHandlerProperty(hwndParent, NArchive::kUpdate, &value, VT_BOOL)) ? value.boolVal : 0;
+}
+
+/**
+ * @brief get KeepName handler property
+ */
+VARIANT_BOOL Format7zDLL::Interface::GetHandlerKeepName(HWND hwndParent)
+{
+       PROPVARIANT value;
+       return SUCCEEDED(GetHandlerProperty(hwndParent, NArchive::kKeepName, &value, VT_BOOL)) ? value.boolVal : 0;
+}
+
+/**
  * @brief Initialize the library.
  */
 int Merge7z::Initialize(DWORD dwFlags)
@@ -351,13 +513,17 @@ int Merge7z::Initialize(DWORD dwFlags)
        return 0;
 }
 
+static const char aCreateObject[] = "CreateObject";
+static const char aGetHandlerProperty[] = "GetHandlerProperty";
+
 #define        DEFINE_FORMAT(name, dll, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
                EXTERN_C const GUID CLSID_##name \
                                = { l, w1, w2, { b1, b2,  b3,  b4,  b5,  b6,  b7,  b8 } }; \
                Format7zDLL::Proxy PROXY_##name = \
                { \
                        "%1Formats\\" dll, \
-                       "CreateObject", \
+                       aCreateObject, \
+                       aGetHandlerProperty, \
                        (HMODULE)0, \
                        &CLSID_##name \
                }; \
@@ -371,6 +537,7 @@ Format7zDLL::Proxy PROXY_CFormat7z =
 {
        "%1Formats\\7Z.DLL",
        "CreateObject",
+       "GetHandlerProperty",
        (HMODULE)0,
        &CLSID_CFormat7z
 };
@@ -401,6 +568,8 @@ DEFINE_FORMAT(CTarHandler, "TAR.DLL",
        0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x10, 0x04, 0x00, 0x00);
 DEFINE_FORMAT(CZipHandler, "ZIP.DLL",
        0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x10, 0x01, 0x00, 0x00);
+DEFINE_FORMAT(CZHandler, "Z.DLL",
+       0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x10, 0x0D, 0x00, 0x00);
 
 /**
  * @brief Construct Merge7z interface.
@@ -425,6 +594,7 @@ Merge7z::Format *Merge7z::GuessFormat(LPCTSTR path)
        (
                EnumList,
                _ENUM(7Z)
+               ENUM(Z)
                ENUM(ZIP)
                ENUM(JAR)
                ENUM(XPI)
@@ -446,6 +616,9 @@ Merge7z::Format *Merge7z::GuessFormat(LPCTSTR path)
        case EnumList::_7Z:
                pFormat = &CFormat7z;
                break;
+       case EnumList::Z:
+               pFormat = &CZHandler;
+               break;
        case EnumList::ZIP:
        case EnumList::JAR:
        case EnumList::XPI:
@@ -507,7 +680,16 @@ LPCTSTR Merge7z::LoadLang(LPCTSTR langFile)
        }
        if (minus > slash && !PathFileExists(g_LangPath))
        {
+               // 2nd chance: filename == language code
+               CSysString Region = g_LangPath.Mid(minus, dot - minus);
+               Region.Replace('-', '\\');
                g_LangPath.Delete(minus, dot - minus);
+               if (!PathFileExists(g_LangPath))
+               {
+                       // 3rd chance: filename == region code (Norwegian)
+                       g_LangPath.Delete(slash, minus - slash);
+                       g_LangPath.Insert(slash, Region);
+               }
        }
        ReloadLang();
        return g_LangPath;
@@ -541,6 +723,7 @@ EXTERN_C HRESULT CALLBACK DllGetVersion(DLLVERSIONINFO *pdvi)
 #              include "revision.txt"
 #              undef VERSION
        );
+       C_ASSERT(dwBuild == DllBuild_Merge7z);
        // Compute dwVersion from revision.txt
        static const DWORD dwVersion =
        (
index ac4680a..bad0f76 100755 (executable)
@@ -10,7 +10,8 @@
 #include "7zip/Common/FileStreams.h"
 // Merge7z includes
 #include "tools.h"
-#define DllBuild_Merge7z 9
+#define DllBuild_Merge7z 10
+#define DLLPSTUB /##/
 #include "Merge7z.h"
 
 using namespace NWindows;
@@ -20,14 +21,18 @@ extern DWORD g_dwFlags;
 extern CHAR g_cPath7z[MAX_PATH];
 
 typedef UINT32 (WINAPI * CreateObjectFunc)(
-    const GUID *clsID, 
-    const GUID *interfaceID, 
-    void **outObject);
+       const GUID *clsID, 
+       const GUID *interfaceID, 
+       void **outObject);
+
+typedef UINT32 (WINAPI * GetHandlerPropertyFunc)(
+       PROPID propID, PROPVARIANT *value);
 
 struct Format7zDLL
 {
        HMODULE origin;
        CreateObjectFunc CreateObject;
+       GetHandlerPropertyFunc GetHandlerProperty;
        HMODULE handle;
        const CLSID *clsid;
        struct Proxy;
@@ -52,6 +57,7 @@ interface Format7zDLL::Interface : Merge7z::Format
        Interface(Proxy &proxy):proxy(proxy)
        {
        }
+       void GetDefaultName(HWND, UString &);
        virtual IInArchive *GetInArchive();
        virtual HRESULT DeCompressArchive(HWND, LPCTSTR path, LPCTSTR folder);
        virtual IOutArchive *GetOutArchive();
@@ -67,13 +73,16 @@ interface Format7zDLL::Interface : Merge7z::Format
                virtual BSTR GetExtension(UINT32);
                virtual VARIANT_BOOL IsFolder(UINT32);
                virtual FILETIME LastWriteTime(UINT32);
+               virtual BSTR GetDefaultName();
+               Format7zDLL::Interface *const format;
                IInArchive *archive;
                CInFileStream *file;
                IArchiveOpenCallback *callback;
-               CSysString path;
+               CSysString const path;
+               UString ustrDefaultName;
                NFile::NFind::CFileInfo fileInfo;
-               Inspector(Format7zDLL::Interface *, HWND, LPCTSTR);
-               void Init();
+               Inspector(Format7zDLL::Interface *, LPCTSTR);
+               void Init(HWND);
        };
        virtual Merge7z::Format::Inspector *Open(HWND, LPCTSTR);
        interface Updater : Merge7z::Format::Updater
@@ -81,13 +90,22 @@ interface Format7zDLL::Interface : Merge7z::Format
                virtual void Free();
                virtual UINT32 Add(Merge7z::DirItemEnumerator::Item &);
                virtual HRESULT Commit(HWND);
+               Format7zDLL::Interface *const format;
                IOutArchive *outArchive;
                COutFileStream *file;
-               CSysString path;
+               CSysString const path;
                CObjectVector<CDirItem> dirItems;
                CObjectVector<CArchiveItem> archiveItems;
-               Updater(Format7zDLL::Interface *, HWND, LPCTSTR);
-               void Init();
+               Updater(Format7zDLL::Interface *, LPCTSTR);
+               void Init(HWND);
        };
        virtual Merge7z::Format::Updater *Update(HWND, LPCTSTR);
+       virtual HRESULT GetHandlerProperty(HWND, PROPID, PROPVARIANT *, VARTYPE);
+       virtual BSTR GetHandlerName(HWND);
+       virtual BSTR GetHandlerClassID(HWND);
+       virtual BSTR GetHandlerExtension(HWND);
+       virtual BSTR GetHandlerAddExtension(HWND);
+       virtual VARIANT_BOOL GetHandlerUpdate(HWND);
+       virtual VARIANT_BOOL GetHandlerKeepName(HWND);
+       virtual BSTR GetDefaultName(HWND, LPCTSTR);
 };
index 050baba..7d4c87c 100755 (executable)
@@ -25,3 +25,11 @@ VERSION(2,2)
 "*"//2005/01/15 Jochen Tucht   New interface Merge7z::Format::Inspector
 //                                                             New interface Merge7z::Format::Updater
 //                                                             New method Merge7z::LoadLang() to set UI language
+
+"*"//2005/02/26 Jochen Tucht   Fix extensions when unwrapping tgz, rpm, ...
+//                                                             Expose some handler properties
+//                                                             Fix crash on failure to open archive
+//                                                             Use canned system messages wherever possible
+//                                                             Fix Merge7z::LoadLang() for no.txt (Norwegian)
+//                                                             Use DLLPSTUB if DllBuild_Merge7z >= 10
+//                                                             Optimize release builds for size
index 8cb1ac7..71344cd 100755 (executable)
@@ -1,14 +1,5 @@
-/* File:       tools.cpp
- * Author:     Jochen Tucht 2003/12/09
- *                     Copyright (C) Jochen Tucht
- *
- * Purpose:    supplementary classes and functions for Merge7z
- *
- * Remarks:    
- *
- *     *** SECURITY ALERT ***
- *     Be aware of 2. a) of the GNU General Public License. Please log your changes
- *     at the end of this comment.
+/* tools.cpp: Supplementary classes and functions for Merge7z
+ * Copyright (c) 2003 Jochen Tucht
  *
  * License:    This program is free software; you can redistribute it and/or modify
  *                     it under the terms of the GNU General Public License as published by
  *                     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
 
+Please mind 2. a) of the GNU General Public License, and log your changes below.
+
 DATE:          BY:                                     DESCRIPTION:
 ==========     ==================      ================================================
-
+2003/12/09     Jochen Tucht            Created
+2005/02/26     Jochen Tucht            Changed as explained in revision.txt
 */
 
 #include "stdafx.h"
@@ -51,6 +45,34 @@ Complain::Complain(LPCTSTR format, ...)
        throw this;
 }
 
+Complain::Complain(DWORD dwError, LPCTSTR pszContext, HMODULE hContext)
+{
+       LPTSTR pszMessage = msg;
+       if (pszContext)
+       {
+               pszMessage += wsprintf(pszMessage, _T("%.500s"), pszContext);
+               if (hContext)
+               {
+                       *pszMessage++ = '@';
+                       int cch = ::GetModuleFileName(hContext, pszMessage, 500);
+                       if (cch == 0)
+                       {
+                               cch = wsprintf(pszMessage, _T("%08lX"), hContext);
+                       }
+                       pszMessage += cch;
+               }
+               *pszMessage++ = ':';
+               *pszMessage++ = '\n';
+       }
+       FormatMessage
+       (
+               FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwError,
+               MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+               pszMessage, 500, NULL
+       );
+       throw this;
+}
+
 /**
  * @brief Report error to user. To be called from within catch block.
  */
@@ -64,28 +86,13 @@ int Complain::Alert(HWND hwndParent, UINT flags)
  */
 void ComplainCreateObject(HMODULE handle, LPCTSTR name)
 {
-       TCHAR module[MAX_PATH];
-       ::GetModuleFileName(handle, module, sizeof module);
-       Complain(_T("%.300s Failed to create %.300s"), module, name);
+       TCHAR szContext[800];
+       LPTSTR pszContext = szContext + wsprintf(szContext, _T("%.100s@"), name);
+       ::GetModuleFileName(handle, pszContext, 500);
+       Complain(RPC_S_INTERFACE_NOT_FOUND, szContext);
 } 
 
 /**
- * @brief Complain that something could not be found.
- */
-void ComplainNotFound(LPCTSTR name)
-{
-       Complain(_T("Not found: %.300s"), name);
-}
-
-/**
- * @brief Complain that something could not be opened.
- */
-void ComplainCantOpen(LPCTSTR name)
-{
-       Complain(_T("Can't open: %.300s"), name);
-}
-
-/**
  * @brief Release interface until ref count reaches 0.
  *
  * Very bad practice in general, but helps avoiding resource leaks
index bb188e8..8b0443c 100755 (executable)
@@ -12,13 +12,10 @@ class Complain
 public:
        TCHAR msg[1024];
        Complain(LPCTSTR, ...);
+       Complain(DWORD, LPCTSTR, HMODULE = 0);
        int Alert(HWND, UINT = MB_ICONSTOP|MB_TASKMODAL);
 };
 
-void ComplainCreateObject(HMODULE, LPCTSTR);
-void ComplainNotFound(LPCTSTR);
-void ComplainCantOpen(LPCTSTR);
-
 void NTAPI Release(IUnknown *);
 
 struct EnumList