fix: compile error, using another way to pass down SoleFolderIndex

This commit is contained in:
shunf4
2024-05-10 19:22:11 +08:00
parent fa9ded58f1
commit ffffba9e20
6 changed files with 22 additions and 3 deletions

View File

@@ -692,6 +692,16 @@ Z7_COM7F_IMF(CExtractCallbackImp::CryptoGetTextPassword(BSTR *password))
#ifndef Z7_SFX
Z7_COM7F_IMF(CExtractCallbackImp::SetSoleFolderIndex(Int64 soleFolderIndex))
{
this->SoleFolderIndex = soleFolderIndex;
}
Z7_COM7F_IMF(CExtractCallbackImp::GetSoleFolderIndex(Int64 *pSoleFolderIndex))
{
(*pSoleFolderIndex) = this->SoleFolderIndex;
}
Z7_COM7F_IMF(CExtractCallbackImp::AskWrite(
const wchar_t *srcPath, Int32 srcIsFolder,
const FILETIME *srcTime, const UInt64 *srcSize,

View File

@@ -255,6 +255,8 @@ public:
bool ThereAreMessageErrors;
NExtract::NOverwriteMode::EEnum OverwriteMode;
Int64 SoleFolderIndex;
#ifndef Z7_NO_CRYPTO
bool PasswordIsDefined;
bool PasswordWasAsked;
@@ -279,6 +281,7 @@ public:
ProcessAltStreams(true),
StreamMode(false),
OverwriteMode(NExtract::NOverwriteMode::kAsk),
SoleFolderIndex(-1),
#ifndef Z7_NO_CRYPTO
PasswordIsDefined(false),
PasswordWasAsked(false),

View File

@@ -67,6 +67,8 @@ Z7_IFACE_CONSTR_FOLDER(IFolderWasChanged, 0x04)
BSTR *destPathResult, \
Int32 *writeAnswer)) \
x(ShowMessage(const wchar_t *message)) \
x(SetSoleFolderIndex(Int64 soleFolderIndex)) \
x(GetSoleFolderIndex(Int64 *pSoleFolderIndex)) \
x(SetCurrentFilePath(const wchar_t *filePath)) \
x(SetNumFiles(UInt64 numFiles)) \

View File

@@ -109,12 +109,14 @@ HRESULT CPanelCopyThread::ProcessVirt()
options->folder, BoolToInt(true), extractCallback2);
}
else
CMyComPtr<IFolderArchiveExtractCallback> extractCallback2;
RINOK(ExtractCallback.QueryInterface(IID_IFolderArchiveExtractCallback, &extractCallback2))
extractCallback2->SetSoleFolderIndex(options->soleFolderIndex);
result2 = FolderOperations->CopyTo(
BoolToInt(options->moveMode),
&Indices.Front(), Indices.Size(),
BoolToInt(options->includeAltStreams),
BoolToInt(options->replaceAltStreamChars),
options->soleFolderIndex,
options->folder, ExtractCallback);
if (result2 == S_OK && !ExtractCallbackSpec->ThereAreMessageErrors)