Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pavlov <ipavlov@users.sourceforge.net>2018-12-30 17:01:47 +0300
committerKornel <kornel@geekhood.net>2018-12-30 17:01:47 +0300
commit5b2a99c548a6c9c90d4cc63cddca29af009c2479 (patch)
treefb4af843548b762bdb6cc8dc2ec65457a9fdf7da /CPP/7zip/UI/Far
parent18dc2b41613055f0daf7f6a1d4311368798ea12a (diff)
18.0618.06
Diffstat (limited to 'CPP/7zip/UI/Far')
-rw-r--r--CPP/7zip/UI/Far/Far.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/CPP/7zip/UI/Far/Far.cpp b/CPP/7zip/UI/Far/Far.cpp
index cec4af52..5d92bc40 100644
--- a/CPP/7zip/UI/Far/Far.cpp
+++ b/CPP/7zip/UI/Far/Far.cpp
@@ -327,7 +327,7 @@ HRESULT OpenArchive(const CSysString &fileName,
}
*/
-static HANDLE MyOpenFilePluginW(const wchar_t *name)
+static HANDLE MyOpenFilePluginW(const wchar_t *name, bool isAbortCodeSupported)
{
FString normalizedName = us2fs(name);
normalizedName.Trim();
@@ -373,7 +373,12 @@ static HANDLE MyOpenFilePluginW(const wchar_t *name)
archiverInfoResult, defaultName, openArchiveCallback);
*/
if (result == E_ABORT)
- return (HANDLE)-2;
+ {
+ // fixed 18.06:
+ // OpenFilePlugin() is allowed to return (HANDLE)-2 as abort code
+ // OpenPlugin() is not allowed to return (HANDLE)-2.
+ return isAbortCodeSupported ? (HANDLE)-2 : INVALID_HANDLE_VALUE;
+ }
UString errorMessage = agent->GetErrorMessage();
if (!errorMessage.IsEmpty())
@@ -403,7 +408,7 @@ static HANDLE MyOpenFilePluginW(const wchar_t *name)
return (HANDLE)(plugin);
}
-static HANDLE MyOpenFilePlugin(const char *name)
+static HANDLE MyOpenFilePlugin(const char *name, bool isAbortCodeSupported)
{
UINT codePage =
#ifdef UNDER_CE
@@ -411,7 +416,7 @@ static HANDLE MyOpenFilePlugin(const char *name)
#else
::AreFileApisANSI() ? CP_ACP : CP_OEMCP;
#endif
- return MyOpenFilePluginW(GetUnicodeString(name, codePage));
+ return MyOpenFilePluginW(GetUnicodeString(name, codePage), isAbortCodeSupported);
}
EXTERN_C HANDLE WINAPI OpenFilePlugin(char *name, const unsigned char * /* data */, int /* dataSize */)
@@ -423,7 +428,7 @@ EXTERN_C HANDLE WINAPI OpenFilePlugin(char *name, const unsigned char * /* data
// if (!Opt.ProcessShiftF1)
return(INVALID_HANDLE_VALUE);
}
- return MyOpenFilePlugin(name);
+ return MyOpenFilePlugin(name, true); // isAbortCodeSupported
MY_TRY_END2("OpenFilePlugin", INVALID_HANDLE_VALUE);
}
@@ -458,7 +463,7 @@ EXTERN_C HANDLE WINAPI OpenPlugin(int openFrom, INT_PTR item)
fileName.DeleteBack();
fileName.DeleteFrontal(1);
}
- return MyOpenFilePlugin(fileName);
+ return MyOpenFilePlugin(fileName, false); // isAbortCodeSupported
}
if (openFrom == OPEN_PLUGINSMENU)
@@ -470,7 +475,7 @@ EXTERN_C HANDLE WINAPI OpenPlugin(int openFrom, INT_PTR item)
PluginPanelItem pluginPanelItem;
if (!g_StartupInfo.ControlGetActivePanelCurrentItemInfo(pluginPanelItem))
throw 142134;
- return MyOpenFilePlugin(pluginPanelItem.FindData.cFileName);
+ return MyOpenFilePlugin(pluginPanelItem.FindData.cFileName, false); // isAbortCodeSupported
}
case 1: