mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 09:15:00 -06:00
18.06
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user