HRESULT CArchiveLink::Open2(CCodecs *codecs, const CIntVector &formatIndices, bool stdInMode, IInStream *stream, const UString &filePath, IOpenCallbackUI *callbackUI) { VolumesSize = 0; COpenCallbackImp *openCallbackSpec = new COpenCallbackImp; CMyComPtr<IArchiveOpenCallback> callback = openCallbackSpec; openCallbackSpec->Callback = callbackUI; UString fullName, prefix, name; if (!stream && !stdInMode) { int fileNamePartStartIndex; if (!NFile::NDirectory::MyGetFullPathName(filePath, fullName, fileNamePartStartIndex)) return GetLastError(); prefix = fullName.Left(fileNamePartStartIndex); name = fullName.Mid(fileNamePartStartIndex); openCallbackSpec->Init(prefix, name); } else { openCallbackSpec->SetSubArchiveName(filePath); } RINOK(Open(codecs, formatIndices, stdInMode, stream, filePath, callback)); VolumePaths.Add(prefix + name); for (int i = 0; i < openCallbackSpec->FileNames.Size(); i++) VolumePaths.Add(prefix + openCallbackSpec->FileNames[i]); VolumesSize = openCallbackSpec->TotalSize; return S_OK; }