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 e30d86c4d0
commit 866e48d73a
6 changed files with 22 additions and 3 deletions

View File

@@ -23,7 +23,7 @@ STDMETHODIMP CAgentFolder::SetZoneIdMode(NExtract::NZoneIdMode::EEnum zoneMode)
} }
STDMETHODIMP CAgentFolder::CopyTo(Int32 moveMode, const UInt32 *indices, UInt32 numItems, STDMETHODIMP CAgentFolder::CopyTo(Int32 moveMode, const UInt32 *indices, UInt32 numItems,
Int32 includeAltStreams, Int32 replaceAltStreamCharsMode, Int64 soleFolderIndex, Int32 includeAltStreams, Int32 replaceAltStreamCharsMode,
const wchar_t *path, IFolderOperationsExtractCallback *callback) const wchar_t *path, IFolderOperationsExtractCallback *callback)
{ {
if (moveMode) if (moveMode)
@@ -42,6 +42,9 @@ STDMETHODIMP CAgentFolder::CopyTo(Int32 moveMode, const UInt32 *indices, UInt32
NExtract::NPathMode::kNoPathsAlt : NExtract::NPathMode::kNoPathsAlt :
NExtract::NPathMode::kNoPaths; NExtract::NPathMode::kNoPaths;
Int64 soleFolderIndex;
extractCallback2->GetSoleFolderIndex(&soleFolderIndex);
return Extract(indices, numItems, return Extract(indices, numItems,
includeAltStreams, replaceAltStreamCharsMode, includeAltStreams, replaceAltStreamCharsMode,
soleFolderIndex, soleFolderIndex,

View File

@@ -28,7 +28,6 @@ IArchiveFolder is used by:
STDMETHOD(Extract)(const UInt32 *indices, UInt32 numItems, \ STDMETHOD(Extract)(const UInt32 *indices, UInt32 numItems, \
Int32 includeAltStreams, \ Int32 includeAltStreams, \
Int32 replaceAltStreamCharsMode, \ Int32 replaceAltStreamCharsMode, \
Int64 soleFolderIndex, \
NExtract::NPathMode::EEnum pathMode, \ NExtract::NPathMode::EEnum pathMode, \
NExtract::NOverwriteMode::EEnum overwriteMode, \ NExtract::NOverwriteMode::EEnum overwriteMode, \
const wchar_t *path, Int32 testMode, \ const wchar_t *path, Int32 testMode, \

View File

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

View File

@@ -272,6 +272,8 @@ public:
bool ThereAreMessageErrors; bool ThereAreMessageErrors;
NExtract::NOverwriteMode::EEnum OverwriteMode; NExtract::NOverwriteMode::EEnum OverwriteMode;
Int64 SoleFolderIndex;
#ifndef _NO_CRYPTO #ifndef _NO_CRYPTO
bool PasswordIsDefined; bool PasswordIsDefined;
bool PasswordWasAsked; bool PasswordWasAsked;
@@ -296,6 +298,7 @@ public:
ProcessAltStreams(true), ProcessAltStreams(true),
StreamMode(false), StreamMode(false),
OverwriteMode(NExtract::NOverwriteMode::kAsk), OverwriteMode(NExtract::NOverwriteMode::kAsk),
SoleFolderIndex(-1),
#ifndef _NO_CRYPTO #ifndef _NO_CRYPTO
PasswordIsDefined(false), PasswordIsDefined(false),
PasswordWasAsked(false), PasswordWasAsked(false),

View File

@@ -69,6 +69,8 @@ FOLDER_INTERFACE_SUB(IFolderOperationsExtractCallback, IProgress, 0x0B)
BSTR *destPathResult, BSTR *destPathResult,
Int32 *writeAnswer) PURE; Int32 *writeAnswer) PURE;
STDMETHOD(ShowMessage)(const wchar_t *message) PURE; STDMETHOD(ShowMessage)(const wchar_t *message) PURE;
STDMETHOD(SetSoleFolderIndex)(Int64 soleFolderIndex) PURE;
STDMETHOD(GetSoleFolderIndex)(Int64 *pSoleFolderIndex) PURE;
STDMETHOD(SetCurrentFilePath)(const wchar_t *filePath) PURE; STDMETHOD(SetCurrentFilePath)(const wchar_t *filePath) PURE;
STDMETHOD(SetNumFiles)(UInt64 numFiles) PURE; STDMETHOD(SetNumFiles)(UInt64 numFiles) PURE;
}; };

View File

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