1baa3858d3f5d128a5c8466b700098109edcad5f2repo sync// UpdateCallbackConsole.cpp
2baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
3baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#include "StdAfx.h"
4baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
5baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#include "UpdateCallbackConsole.h"
6baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
7baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#include "Windows/Error.h"
8baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#ifndef _7ZIP_ST
9baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#include "Windows/Synchronization.h"
10baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#endif
11baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
12baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#include "ConsoleClose.h"
13baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#include "UserInputUtils.h"
14baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
15baa3858d3f5d128a5c8466b700098109edcad5f2repo syncusing namespace NWindows;
16baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
17baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#ifndef _7ZIP_ST
18baa3858d3f5d128a5c8466b700098109edcad5f2repo syncstatic NSynchronization::CCriticalSection g_CriticalSection;
19baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#define MT_LOCK NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
20baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#else
21baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#define MT_LOCK
22baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#endif
23baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
24baa3858d3f5d128a5c8466b700098109edcad5f2repo syncstatic const wchar_t *kEmptyFileAlias = L"[Content]";
25baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
26baa3858d3f5d128a5c8466b700098109edcad5f2repo syncstatic const char *kCreatingArchiveMessage = "Creating archive ";
27baa3858d3f5d128a5c8466b700098109edcad5f2repo syncstatic const char *kUpdatingArchiveMessage = "Updating archive ";
28baa3858d3f5d128a5c8466b700098109edcad5f2repo syncstatic const char *kScanningMessage = "Scanning";
29baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
30baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
31baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::OpenResult(const wchar_t *name, HRESULT result)
32baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
33baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  (*OutStream) << endl;
34baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (result != S_OK)
35baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    (*OutStream) << "Error: " << name << " is not supported archive" << endl;
36baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return S_OK;
37baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
38baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
39baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::StartScanning()
40baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
41baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  (*OutStream) << kScanningMessage;
42baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return S_OK;
43baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
44baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
45baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::ScanProgress(UInt64 /* numFolders */, UInt64 /* numFiles */, const wchar_t * /* path */)
46baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
47baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return CheckBreak();
48baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
49baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
50baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::CanNotFindError(const wchar_t *name, DWORD systemError)
51baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
52baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  CantFindFiles.Add(name);
53baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  CantFindCodes.Add(systemError);
54baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  // m_PercentPrinter.ClosePrint();
55baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (!m_WarningsMode)
56baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  {
57baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    (*OutStream) << endl << endl;
58baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    m_PercentPrinter.PrintNewLine();
59baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    m_WarningsMode = true;
60baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  }
61baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  m_PercentPrinter.PrintString(name);
62baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  m_PercentPrinter.PrintString(":  WARNING: ");
63baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  m_PercentPrinter.PrintString(NError::MyFormatMessageW(systemError));
64baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  m_PercentPrinter.PrintNewLine();
65baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return S_OK;
66baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
67baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
68baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::FinishScanning()
69baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
70baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  (*OutStream) << endl << endl;
71baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return S_OK;
72baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
73baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
74baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::StartArchive(const wchar_t *name, bool updating)
75baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
76baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if(updating)
77baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    (*OutStream) << kUpdatingArchiveMessage;
78baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  else
79baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    (*OutStream) << kCreatingArchiveMessage;
80baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (name != 0)
81baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    (*OutStream) << name;
82baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  else
83baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    (*OutStream) << "StdOut";
84baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  (*OutStream) << endl << endl;
85baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return S_OK;
86baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
87baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
88baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::FinishArchive()
89baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
90baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  (*OutStream) << endl;
91baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return S_OK;
92baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
93baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
94baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::CheckBreak()
95baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
96baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (NConsoleClose::TestBreakSignal())
97baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    return E_ABORT;
98baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return S_OK;
99baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
100baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
101baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::Finilize()
102baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
103baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  MT_LOCK
104baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (m_NeedBeClosed)
105baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  {
106baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    if (EnablePercents)
107baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    {
108baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      m_PercentPrinter.ClosePrint();
109baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    }
110baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    if (!StdOutMode && m_NeedNewLine)
111baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    {
112baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      m_PercentPrinter.PrintNewLine();
113baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      m_NeedNewLine = false;
114baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    }
115baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    m_NeedBeClosed = false;
116baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  }
117baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return S_OK;
118baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
119baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
120baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::SetNumFiles(UInt64 /* numFiles */)
121baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
122baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return S_OK;
123baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
124baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
125baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::SetTotal(UInt64 size)
126baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
127baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  MT_LOCK
128baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (EnablePercents)
129baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    m_PercentPrinter.SetTotal(size);
130baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return S_OK;
131baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
132baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
133baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::SetCompleted(const UInt64 *completeValue)
134baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
135baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  MT_LOCK
136baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (completeValue != NULL)
137baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  {
138baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    if (EnablePercents)
139baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    {
140baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      m_PercentPrinter.SetRatio(*completeValue);
141baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      m_PercentPrinter.PrintRatio();
142baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      m_NeedBeClosed = true;
143baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    }
144baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  }
145baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (NConsoleClose::TestBreakSignal())
146baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    return E_ABORT;
147baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return S_OK;
148baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
149baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
150baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::SetRatioInfo(const UInt64 * /* inSize */, const UInt64 * /* outSize */)
151baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
152baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (NConsoleClose::TestBreakSignal())
153baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    return E_ABORT;
154baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return S_OK;
155baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
156baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
157baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::GetStream(const wchar_t *name, bool isAnti)
158baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
159baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  MT_LOCK
160baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (StdOutMode)
161baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    return S_OK;
162baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if(isAnti)
163baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    m_PercentPrinter.PrintString("Anti item    ");
164baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  else
165baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    m_PercentPrinter.PrintString("Compressing  ");
166baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (name[0] == 0)
167baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    name = kEmptyFileAlias;
168baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  m_PercentPrinter.PrintString(name);
169baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (EnablePercents)
170baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    m_PercentPrinter.RePrintRatio();
171baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return S_OK;
172baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
173baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
174baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::OpenFileError(const wchar_t *name, DWORD systemError)
175baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
176baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  MT_LOCK
177baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  FailedCodes.Add(systemError);
178baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  FailedFiles.Add(name);
179baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  // if (systemError == ERROR_SHARING_VIOLATION)
180baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  {
181baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    m_PercentPrinter.ClosePrint();
182baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    m_PercentPrinter.PrintNewLine();
183baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    m_PercentPrinter.PrintString("WARNING: ");
184baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    m_PercentPrinter.PrintString(NError::MyFormatMessageW(systemError));
185baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    return S_FALSE;
186baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  }
187baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  // return systemError;
188baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
189baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
190baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::SetOperationResult(Int32 )
191baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
192baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  m_NeedBeClosed = true;
193baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  m_NeedNewLine = true;
194baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return S_OK;
195baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
196baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
197baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password)
198baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
199baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  *password = NULL;
200baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
201baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  #ifdef _NO_CRYPTO
202baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
203baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  *passwordIsDefined = false;
204baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return S_OK;
205baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
206baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  #else
207baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
208baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (!PasswordIsDefined)
209baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  {
210baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    if (AskPassword)
211baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    {
212baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      Password = GetPassword(OutStream);
213baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      PasswordIsDefined = true;
214baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    }
215baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  }
216baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  *passwordIsDefined = BoolToInt(PasswordIsDefined);
217baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return StringToBstr(Password, password);
218baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
219baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  #endif
220baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
221baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
222baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::CryptoGetTextPassword(BSTR *password)
223baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
224baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  *password = NULL;
225baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
226baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  #ifdef _NO_CRYPTO
227baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
228baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return E_NOTIMPL;
229baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
230baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  #else
231baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
232baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (!PasswordIsDefined)
233baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  {
234baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    {
235baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      Password = GetPassword(OutStream);
236baa3858d3f5d128a5c8466b700098109edcad5f2repo sync      PasswordIsDefined = true;
237baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    }
238baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  }
239baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return StringToBstr(Password, password);
240baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
241baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  #endif
242baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
243baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
244baa3858d3f5d128a5c8466b700098109edcad5f2repo sync/*
245baa3858d3f5d128a5c8466b700098109edcad5f2repo syncHRESULT CUpdateCallbackConsole::ShowDeleteFile(const wchar_t *name)
246baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
247baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  // MT_LOCK
248baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (StdOutMode)
249baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    return S_OK;
250baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  RINOK(Finilize());
251baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  m_PercentPrinter.PrintString("Deleting  ");
252baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (name[0] == 0)
253baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    name = kEmptyFileAlias;
254baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  m_PercentPrinter.PrintString(name);
255baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  if (EnablePercents)
256baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    m_PercentPrinter.RePrintRatio();
257baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  m_NeedBeClosed = true;
258baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  m_NeedNewLine = true;
259baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  return S_OK;
260baa3858d3f5d128a5c8466b700098109edcad5f2repo sync}
261baa3858d3f5d128a5c8466b700098109edcad5f2repo sync*/
262