1370b324cSopenharmony_ci// ArchiveOpenCallback.cpp
2370b324cSopenharmony_ci
3370b324cSopenharmony_ci#include "StdAfx.h"
4370b324cSopenharmony_ci
5370b324cSopenharmony_ci#include "../../../Common/ComTry.h"
6370b324cSopenharmony_ci
7370b324cSopenharmony_ci#include "../../../Windows/FileName.h"
8370b324cSopenharmony_ci#include "../../../Windows/PropVariant.h"
9370b324cSopenharmony_ci#include "../../../Windows/System.h"
10370b324cSopenharmony_ci
11370b324cSopenharmony_ci#include "../../Common/StreamUtils.h"
12370b324cSopenharmony_ci
13370b324cSopenharmony_ci#include "ArchiveOpenCallback.h"
14370b324cSopenharmony_ci
15370b324cSopenharmony_ci// #define DEBUG_VOLUMES
16370b324cSopenharmony_ci
17370b324cSopenharmony_ci#ifdef DEBUG_VOLUMES
18370b324cSopenharmony_ci#include <stdio.h>
19370b324cSopenharmony_ci#endif
20370b324cSopenharmony_ci
21370b324cSopenharmony_ci
22370b324cSopenharmony_ci#ifdef DEBUG_VOLUMES
23370b324cSopenharmony_ci  #define PRF(x) x
24370b324cSopenharmony_ci#else
25370b324cSopenharmony_ci  #define PRF(x)
26370b324cSopenharmony_ci#endif
27370b324cSopenharmony_ci
28370b324cSopenharmony_ciusing namespace NWindows;
29370b324cSopenharmony_ci
30370b324cSopenharmony_ciHRESULT COpenCallbackImp::Init2(const FString &folderPrefix, const FString &fileName)
31370b324cSopenharmony_ci{
32370b324cSopenharmony_ci  Volumes.Init();
33370b324cSopenharmony_ci  FileNames.Clear();
34370b324cSopenharmony_ci  FileNames_WasUsed.Clear();
35370b324cSopenharmony_ci  FileSizes.Clear();
36370b324cSopenharmony_ci  _subArchiveMode = false;
37370b324cSopenharmony_ci  // TotalSize = 0;
38370b324cSopenharmony_ci  PasswordWasAsked = false;
39370b324cSopenharmony_ci  _folderPrefix = folderPrefix;
40370b324cSopenharmony_ci  if (!_fileInfo.Find_FollowLink(_folderPrefix + fileName))
41370b324cSopenharmony_ci  {
42370b324cSopenharmony_ci    // throw 20121118;
43370b324cSopenharmony_ci    return GetLastError_noZero_HRESULT();
44370b324cSopenharmony_ci  }
45370b324cSopenharmony_ci  return S_OK;
46370b324cSopenharmony_ci}
47370b324cSopenharmony_ci
48370b324cSopenharmony_ciZ7_COM7F_IMF(COpenCallbackImp::SetSubArchiveName(const wchar_t *name))
49370b324cSopenharmony_ci{
50370b324cSopenharmony_ci  _subArchiveMode = true;
51370b324cSopenharmony_ci  _subArchiveName = name;
52370b324cSopenharmony_ci  // TotalSize = 0;
53370b324cSopenharmony_ci  return S_OK;
54370b324cSopenharmony_ci}
55370b324cSopenharmony_ci
56370b324cSopenharmony_ciZ7_COM7F_IMF(COpenCallbackImp::SetTotal(const UInt64 *files, const UInt64 *bytes))
57370b324cSopenharmony_ci{
58370b324cSopenharmony_ci  COM_TRY_BEGIN
59370b324cSopenharmony_ci  if (ReOpenCallback)
60370b324cSopenharmony_ci    return ReOpenCallback->SetTotal(files, bytes);
61370b324cSopenharmony_ci  if (!Callback)
62370b324cSopenharmony_ci    return S_OK;
63370b324cSopenharmony_ci  return Callback->Open_SetTotal(files, bytes);
64370b324cSopenharmony_ci  COM_TRY_END
65370b324cSopenharmony_ci}
66370b324cSopenharmony_ci
67370b324cSopenharmony_ciZ7_COM7F_IMF(COpenCallbackImp::SetCompleted(const UInt64 *files, const UInt64 *bytes))
68370b324cSopenharmony_ci{
69370b324cSopenharmony_ci  COM_TRY_BEGIN
70370b324cSopenharmony_ci  if (ReOpenCallback)
71370b324cSopenharmony_ci    return ReOpenCallback->SetCompleted(files, bytes);
72370b324cSopenharmony_ci  if (!Callback)
73370b324cSopenharmony_ci    return S_OK;
74370b324cSopenharmony_ci  return Callback->Open_SetCompleted(files, bytes);
75370b324cSopenharmony_ci  COM_TRY_END
76370b324cSopenharmony_ci}
77370b324cSopenharmony_ci
78370b324cSopenharmony_ci
79370b324cSopenharmony_ciZ7_COM7F_IMF(COpenCallbackImp::GetProperty(PROPID propID, PROPVARIANT *value))
80370b324cSopenharmony_ci{
81370b324cSopenharmony_ci  COM_TRY_BEGIN
82370b324cSopenharmony_ci  NCOM::CPropVariant prop;
83370b324cSopenharmony_ci  if (_subArchiveMode)
84370b324cSopenharmony_ci    switch (propID)
85370b324cSopenharmony_ci    {
86370b324cSopenharmony_ci      case kpidName: prop = _subArchiveName; break;
87370b324cSopenharmony_ci      // case kpidSize:  prop = _subArchiveSize; break; // we don't use it now
88370b324cSopenharmony_ci    }
89370b324cSopenharmony_ci  else
90370b324cSopenharmony_ci    switch (propID)
91370b324cSopenharmony_ci    {
92370b324cSopenharmony_ci      case kpidName:  prop = fs2us(_fileInfo.Name); break;
93370b324cSopenharmony_ci      case kpidIsDir:  prop = _fileInfo.IsDir(); break;
94370b324cSopenharmony_ci      case kpidSize:  prop = _fileInfo.Size; break;
95370b324cSopenharmony_ci      case kpidAttrib:  prop = (UInt32)_fileInfo.GetWinAttrib(); break;
96370b324cSopenharmony_ci      case kpidPosixAttrib:  prop = (UInt32)_fileInfo.GetPosixAttrib(); break;
97370b324cSopenharmony_ci      case kpidCTime:  PropVariant_SetFrom_FiTime(prop, _fileInfo.CTime); break;
98370b324cSopenharmony_ci      case kpidATime:  PropVariant_SetFrom_FiTime(prop, _fileInfo.ATime); break;
99370b324cSopenharmony_ci      case kpidMTime:  PropVariant_SetFrom_FiTime(prop, _fileInfo.MTime); break;
100370b324cSopenharmony_ci    }
101370b324cSopenharmony_ci  prop.Detach(value);
102370b324cSopenharmony_ci  return S_OK;
103370b324cSopenharmony_ci  COM_TRY_END
104370b324cSopenharmony_ci}
105370b324cSopenharmony_ci
106370b324cSopenharmony_ci
107370b324cSopenharmony_ci// ---------- CInFileStreamVol ----------
108370b324cSopenharmony_ci
109370b324cSopenharmony_ciZ7_CLASS_IMP_COM_2(
110370b324cSopenharmony_ci  CInFileStreamVol
111370b324cSopenharmony_ci  , IInStream
112370b324cSopenharmony_ci  , IStreamGetSize
113370b324cSopenharmony_ci)
114370b324cSopenharmony_ci  Z7_IFACE_COM7_IMP(ISequentialInStream)
115370b324cSopenharmony_cipublic:
116370b324cSopenharmony_ci  unsigned FileIndex;
117370b324cSopenharmony_ci  COpenCallbackImp *OpenCallbackImp;
118370b324cSopenharmony_ci  CMyComPtr<IArchiveOpenCallback> OpenCallbackRef;
119370b324cSopenharmony_ci
120370b324cSopenharmony_ci  HRESULT EnsureOpen()
121370b324cSopenharmony_ci  {
122370b324cSopenharmony_ci    return OpenCallbackImp->Volumes.EnsureOpen(FileIndex);
123370b324cSopenharmony_ci  }
124370b324cSopenharmony_ci
125370b324cSopenharmony_ci  ~CInFileStreamVol()
126370b324cSopenharmony_ci  {
127370b324cSopenharmony_ci    if (OpenCallbackRef)
128370b324cSopenharmony_ci      OpenCallbackImp->AtCloseFile(FileIndex);
129370b324cSopenharmony_ci  }
130370b324cSopenharmony_ci};
131370b324cSopenharmony_ci
132370b324cSopenharmony_ci
133370b324cSopenharmony_civoid CMultiStreams::InsertToList(unsigned index)
134370b324cSopenharmony_ci{
135370b324cSopenharmony_ci  {
136370b324cSopenharmony_ci    CSubStream &s = Streams[index];
137370b324cSopenharmony_ci    s.Next = Head;
138370b324cSopenharmony_ci    s.Prev = -1;
139370b324cSopenharmony_ci  }
140370b324cSopenharmony_ci  if (Head != -1)
141370b324cSopenharmony_ci    Streams[(unsigned)Head].Prev = (int)index;
142370b324cSopenharmony_ci  else
143370b324cSopenharmony_ci  {
144370b324cSopenharmony_ci    // if (Tail != -1) throw 1;
145370b324cSopenharmony_ci    Tail = (int)index;
146370b324cSopenharmony_ci  }
147370b324cSopenharmony_ci  Head = (int)index;
148370b324cSopenharmony_ci  NumListItems++;
149370b324cSopenharmony_ci}
150370b324cSopenharmony_ci
151370b324cSopenharmony_ci// s must bee in List
152370b324cSopenharmony_civoid CMultiStreams::RemoveFromList(CSubStream &s)
153370b324cSopenharmony_ci{
154370b324cSopenharmony_ci  if (s.Next != -1) Streams[(unsigned)s.Next].Prev = s.Prev; else Tail = s.Prev;
155370b324cSopenharmony_ci  if (s.Prev != -1) Streams[(unsigned)s.Prev].Next = s.Next; else Head = s.Next;
156370b324cSopenharmony_ci  s.Next = -1; // optional
157370b324cSopenharmony_ci  s.Prev = -1; // optional
158370b324cSopenharmony_ci  NumListItems--;
159370b324cSopenharmony_ci}
160370b324cSopenharmony_ci
161370b324cSopenharmony_civoid CMultiStreams::CloseFile(unsigned index)
162370b324cSopenharmony_ci{
163370b324cSopenharmony_ci  CSubStream &s = Streams[index];
164370b324cSopenharmony_ci  if (s.Stream)
165370b324cSopenharmony_ci  {
166370b324cSopenharmony_ci    s.Stream.Release();
167370b324cSopenharmony_ci    RemoveFromList(s);
168370b324cSopenharmony_ci    // s.InFile->Close();
169370b324cSopenharmony_ci    // s.IsOpen = false;
170370b324cSopenharmony_ci   #ifdef DEBUG_VOLUMES
171370b324cSopenharmony_ci    static int numClosing = 0;
172370b324cSopenharmony_ci    numClosing++;
173370b324cSopenharmony_ci    printf("\nCloseFile %u, total_closes = %u, num_open_files = %u\n", index, numClosing, NumListItems);
174370b324cSopenharmony_ci   #endif
175370b324cSopenharmony_ci  }
176370b324cSopenharmony_ci}
177370b324cSopenharmony_ci
178370b324cSopenharmony_civoid CMultiStreams::Init()
179370b324cSopenharmony_ci{
180370b324cSopenharmony_ci  Head = -1;
181370b324cSopenharmony_ci  Tail = -1;
182370b324cSopenharmony_ci  NumListItems = 0;
183370b324cSopenharmony_ci  Streams.Clear();
184370b324cSopenharmony_ci}
185370b324cSopenharmony_ci
186370b324cSopenharmony_ciCMultiStreams::CMultiStreams():
187370b324cSopenharmony_ci    Head(-1),
188370b324cSopenharmony_ci    Tail(-1),
189370b324cSopenharmony_ci    NumListItems(0)
190370b324cSopenharmony_ci{
191370b324cSopenharmony_ci  NumOpenFiles_AllowedMax = NSystem::Get_File_OPEN_MAX_Reduced_for_3_tasks();
192370b324cSopenharmony_ci  PRF(printf("\nNumOpenFiles_Limit = %u\n", NumOpenFiles_AllowedMax));
193370b324cSopenharmony_ci}
194370b324cSopenharmony_ci
195370b324cSopenharmony_ci
196370b324cSopenharmony_ciHRESULT CMultiStreams::PrepareToOpenNew()
197370b324cSopenharmony_ci{
198370b324cSopenharmony_ci  if (NumListItems < NumOpenFiles_AllowedMax)
199370b324cSopenharmony_ci    return S_OK;
200370b324cSopenharmony_ci  if (Tail == -1)
201370b324cSopenharmony_ci    return E_FAIL;
202370b324cSopenharmony_ci  CMultiStreams::CSubStream &tailStream = Streams[(unsigned)Tail];
203370b324cSopenharmony_ci  RINOK(InStream_GetPos(tailStream.Stream, tailStream.LocalPos))
204370b324cSopenharmony_ci  CloseFile((unsigned)Tail);
205370b324cSopenharmony_ci  return S_OK;
206370b324cSopenharmony_ci}
207370b324cSopenharmony_ci
208370b324cSopenharmony_ci
209370b324cSopenharmony_ciHRESULT CMultiStreams::EnsureOpen(unsigned index)
210370b324cSopenharmony_ci{
211370b324cSopenharmony_ci  CMultiStreams::CSubStream &s = Streams[index];
212370b324cSopenharmony_ci  if (s.Stream)
213370b324cSopenharmony_ci  {
214370b324cSopenharmony_ci    if ((int)index != Head)
215370b324cSopenharmony_ci    {
216370b324cSopenharmony_ci      RemoveFromList(s);
217370b324cSopenharmony_ci      InsertToList(index);
218370b324cSopenharmony_ci    }
219370b324cSopenharmony_ci  }
220370b324cSopenharmony_ci  else
221370b324cSopenharmony_ci  {
222370b324cSopenharmony_ci    RINOK(PrepareToOpenNew())
223370b324cSopenharmony_ci    {
224370b324cSopenharmony_ci      CInFileStream *inFile = new CInFileStream;
225370b324cSopenharmony_ci      CMyComPtr<IInStream> inStreamTemp = inFile;
226370b324cSopenharmony_ci      if (!inFile->Open(s.Path))
227370b324cSopenharmony_ci        return GetLastError_noZero_HRESULT();
228370b324cSopenharmony_ci      s.FileSpec = inFile;
229370b324cSopenharmony_ci      s.Stream = s.FileSpec;
230370b324cSopenharmony_ci      InsertToList(index);
231370b324cSopenharmony_ci    }
232370b324cSopenharmony_ci    // s.IsOpen = true;
233370b324cSopenharmony_ci    if (s.LocalPos != 0)
234370b324cSopenharmony_ci    {
235370b324cSopenharmony_ci      RINOK(s.Stream->Seek((Int64)s.LocalPos, STREAM_SEEK_SET, &s.LocalPos))
236370b324cSopenharmony_ci    }
237370b324cSopenharmony_ci   #ifdef DEBUG_VOLUMES
238370b324cSopenharmony_ci    static int numOpens = 0;
239370b324cSopenharmony_ci    numOpens++;
240370b324cSopenharmony_ci    printf("\n-- %u, ReOpen, total_reopens = %u, num_open_files = %u\n", index, numOpens, NumListItems);
241370b324cSopenharmony_ci   #endif
242370b324cSopenharmony_ci  }
243370b324cSopenharmony_ci  return S_OK;
244370b324cSopenharmony_ci}
245370b324cSopenharmony_ci
246370b324cSopenharmony_ci
247370b324cSopenharmony_ciZ7_COM7F_IMF(CInFileStreamVol::Read(void *data, UInt32 size, UInt32 *processedSize))
248370b324cSopenharmony_ci{
249370b324cSopenharmony_ci  if (processedSize)
250370b324cSopenharmony_ci    *processedSize = 0;
251370b324cSopenharmony_ci  if (size == 0)
252370b324cSopenharmony_ci    return S_OK;
253370b324cSopenharmony_ci  RINOK(EnsureOpen())
254370b324cSopenharmony_ci  CMultiStreams::CSubStream &s = OpenCallbackImp->Volumes.Streams[FileIndex];
255370b324cSopenharmony_ci  PRF(printf("\n== %u, Read =%u \n", FileIndex, size));
256370b324cSopenharmony_ci  return s.Stream->Read(data, size, processedSize);
257370b324cSopenharmony_ci}
258370b324cSopenharmony_ci
259370b324cSopenharmony_ciZ7_COM7F_IMF(CInFileStreamVol::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition))
260370b324cSopenharmony_ci{
261370b324cSopenharmony_ci  // if (seekOrigin >= 3) return STG_E_INVALIDFUNCTION;
262370b324cSopenharmony_ci  RINOK(EnsureOpen())
263370b324cSopenharmony_ci  CMultiStreams::CSubStream &s = OpenCallbackImp->Volumes.Streams[FileIndex];
264370b324cSopenharmony_ci  PRF(printf("\n-- %u, Seek seekOrigin=%u Seek =%u\n", FileIndex, seekOrigin, (unsigned)offset));
265370b324cSopenharmony_ci  return s.Stream->Seek(offset, seekOrigin, newPosition);
266370b324cSopenharmony_ci}
267370b324cSopenharmony_ci
268370b324cSopenharmony_ciZ7_COM7F_IMF(CInFileStreamVol::GetSize(UInt64 *size))
269370b324cSopenharmony_ci{
270370b324cSopenharmony_ci  RINOK(EnsureOpen())
271370b324cSopenharmony_ci  CMultiStreams::CSubStream &s = OpenCallbackImp->Volumes.Streams[FileIndex];
272370b324cSopenharmony_ci  return s.FileSpec->GetSize(size);
273370b324cSopenharmony_ci}
274370b324cSopenharmony_ci
275370b324cSopenharmony_ci
276370b324cSopenharmony_ci// from ArchiveExtractCallback.cpp
277370b324cSopenharmony_cibool IsSafePath(const UString &path);
278370b324cSopenharmony_ci
279370b324cSopenharmony_ciZ7_COM7F_IMF(COpenCallbackImp::GetStream(const wchar_t *name, IInStream **inStream))
280370b324cSopenharmony_ci{
281370b324cSopenharmony_ci  COM_TRY_BEGIN
282370b324cSopenharmony_ci  *inStream = NULL;
283370b324cSopenharmony_ci
284370b324cSopenharmony_ci  if (_subArchiveMode)
285370b324cSopenharmony_ci    return S_FALSE;
286370b324cSopenharmony_ci  if (Callback)
287370b324cSopenharmony_ci  {
288370b324cSopenharmony_ci    RINOK(Callback->Open_CheckBreak())
289370b324cSopenharmony_ci  }
290370b324cSopenharmony_ci
291370b324cSopenharmony_ci  UString name2 = name;
292370b324cSopenharmony_ci
293370b324cSopenharmony_ci
294370b324cSopenharmony_ci  #ifndef Z7_SFX
295370b324cSopenharmony_ci
296370b324cSopenharmony_ci  #ifdef _WIN32
297370b324cSopenharmony_ci  name2.Replace(L'/', WCHAR_PATH_SEPARATOR);
298370b324cSopenharmony_ci  #endif
299370b324cSopenharmony_ci
300370b324cSopenharmony_ci  // if (!allowAbsVolPaths)
301370b324cSopenharmony_ci  if (!IsSafePath(name2))
302370b324cSopenharmony_ci    return S_FALSE;
303370b324cSopenharmony_ci
304370b324cSopenharmony_ci  #ifdef _WIN32
305370b324cSopenharmony_ci  /* WIN32 allows wildcards in Find() function
306370b324cSopenharmony_ci     and doesn't allow wildcard in File.Open()
307370b324cSopenharmony_ci     so we can work without the following wildcard check here */
308370b324cSopenharmony_ci  if (name2.Find(L'*') >= 0)
309370b324cSopenharmony_ci    return S_FALSE;
310370b324cSopenharmony_ci  {
311370b324cSopenharmony_ci    unsigned startPos = 0;
312370b324cSopenharmony_ci    if (name2.IsPrefixedBy_Ascii_NoCase("\\\\?\\"))
313370b324cSopenharmony_ci      startPos = 3;
314370b324cSopenharmony_ci    if (name2.Find(L'?', startPos) >= 0)
315370b324cSopenharmony_ci      return S_FALSE;
316370b324cSopenharmony_ci  }
317370b324cSopenharmony_ci  #endif
318370b324cSopenharmony_ci
319370b324cSopenharmony_ci  #endif
320370b324cSopenharmony_ci
321370b324cSopenharmony_ci
322370b324cSopenharmony_ci  FString fullPath;
323370b324cSopenharmony_ci  if (!NFile::NName::GetFullPath(_folderPrefix, us2fs(name2), fullPath))
324370b324cSopenharmony_ci    return S_FALSE;
325370b324cSopenharmony_ci  if (!_fileInfo.Find_FollowLink(fullPath))
326370b324cSopenharmony_ci    return S_FALSE;
327370b324cSopenharmony_ci  if (_fileInfo.IsDir())
328370b324cSopenharmony_ci    return S_FALSE;
329370b324cSopenharmony_ci
330370b324cSopenharmony_ci  CMultiStreams::CSubStream s;
331370b324cSopenharmony_ci
332370b324cSopenharmony_ci  {
333370b324cSopenharmony_ci    CInFileStream *inFile = new CInFileStream;
334370b324cSopenharmony_ci    CMyComPtr<IInStream> inStreamTemp = inFile;
335370b324cSopenharmony_ci    if (!inFile->Open(fullPath))
336370b324cSopenharmony_ci      return GetLastError_noZero_HRESULT();
337370b324cSopenharmony_ci    RINOK(Volumes.PrepareToOpenNew())
338370b324cSopenharmony_ci    s.FileSpec = inFile;
339370b324cSopenharmony_ci    s.Stream = s.FileSpec;
340370b324cSopenharmony_ci    s.Path = fullPath;
341370b324cSopenharmony_ci    // s.Size = _fileInfo.Size;
342370b324cSopenharmony_ci    // s.IsOpen = true;
343370b324cSopenharmony_ci  }
344370b324cSopenharmony_ci
345370b324cSopenharmony_ci  const unsigned fileIndex = Volumes.Streams.Add(s);
346370b324cSopenharmony_ci  Volumes.InsertToList(fileIndex);
347370b324cSopenharmony_ci
348370b324cSopenharmony_ci  FileSizes.Add(_fileInfo.Size);
349370b324cSopenharmony_ci  FileNames.Add(name2);
350370b324cSopenharmony_ci  FileNames_WasUsed.Add(true);
351370b324cSopenharmony_ci
352370b324cSopenharmony_ci  CInFileStreamVol *inFile = new CInFileStreamVol;
353370b324cSopenharmony_ci  CMyComPtr<IInStream> inStreamTemp = inFile;
354370b324cSopenharmony_ci  inFile->FileIndex = fileIndex;
355370b324cSopenharmony_ci  inFile->OpenCallbackImp = this;
356370b324cSopenharmony_ci  inFile->OpenCallbackRef = this;
357370b324cSopenharmony_ci  // TotalSize += _fileInfo.Size;
358370b324cSopenharmony_ci  *inStream = inStreamTemp.Detach();
359370b324cSopenharmony_ci  return S_OK;
360370b324cSopenharmony_ci  COM_TRY_END
361370b324cSopenharmony_ci}
362370b324cSopenharmony_ci
363370b324cSopenharmony_ci
364370b324cSopenharmony_ci#ifndef Z7_NO_CRYPTO
365370b324cSopenharmony_ciZ7_COM7F_IMF(COpenCallbackImp::CryptoGetTextPassword(BSTR *password))
366370b324cSopenharmony_ci{
367370b324cSopenharmony_ci  COM_TRY_BEGIN
368370b324cSopenharmony_ci  if (ReOpenCallback)
369370b324cSopenharmony_ci  {
370370b324cSopenharmony_ci    Z7_DECL_CMyComPtr_QI_FROM(
371370b324cSopenharmony_ci        ICryptoGetTextPassword,
372370b324cSopenharmony_ci        getTextPassword, ReOpenCallback)
373370b324cSopenharmony_ci    if (getTextPassword)
374370b324cSopenharmony_ci      return getTextPassword->CryptoGetTextPassword(password);
375370b324cSopenharmony_ci  }
376370b324cSopenharmony_ci  if (!Callback)
377370b324cSopenharmony_ci    return E_NOTIMPL;
378370b324cSopenharmony_ci  PasswordWasAsked = true;
379370b324cSopenharmony_ci  return Callback->Open_CryptoGetTextPassword(password);
380370b324cSopenharmony_ci  COM_TRY_END
381370b324cSopenharmony_ci}
382370b324cSopenharmony_ci#endif
383370b324cSopenharmony_ci
384370b324cSopenharmony_ci// IProgress
385370b324cSopenharmony_ciZ7_COM7F_IMF(COpenCallbackImp::SetTotal(const UInt64 /* total */))
386370b324cSopenharmony_ci{
387370b324cSopenharmony_ci  return S_OK;
388370b324cSopenharmony_ci}
389370b324cSopenharmony_ci
390370b324cSopenharmony_ciZ7_COM7F_IMF(COpenCallbackImp::SetCompleted(const UInt64 * /* completed */))
391370b324cSopenharmony_ci{
392370b324cSopenharmony_ci  return S_OK;
393370b324cSopenharmony_ci}
394