// EmptyTempFolder.cpp : Implementation of CEmptyTempFolder #include "stdafx.h" #include "NSCmpts.h" #include "EmptyTempFolder.h" #include "..\common\defines.h" #include "ProgressDlg.h" #include "TempWarnDlg.h" #include "TempActions.h" #include ///////////////////////////////////////////////////////////////////////////// // CEmptyTempFolder STDMETHODIMP CEmptyTempFolder::InterfaceSupportsErrorInfo(REFIID riid) { static const IID* arr[] = { &IID_ISecureShutdownWin, }; for (int i=0;iInitialize(sWindowsTempPath); m_Engine.Add(pAction); // Create the update_monitor m_Engine.SetUpdates(dlgProgress, dlgProgress); // start the backup HANDLE hThread = m_Engine.StartThread(); WaitForAndIdle(1, &hThread, INFINITE); HRESULT hr = S_OK; GetExitCodeThread(hThread, (LPDWORD)&hr); dlgProgress.DestroyWindow(); return hr; } // XError: We should be using file_path here /*string CEmptyTempFolder::CleanSlashes(const string& sPath) { string sTemp; if(sPath.at(sPath.length() - 1) == _T('\\')) sTemp = sPath.substr(0, sPath.length() - 1); else sTemp = sPath; int nPos; while((nPos = sTemp.find(_T("\\\\"), 2)) != string::npos) sTemp.erase(nPos, 1); return sTemp; } */ STDMETHODIMP CEmptyTempFolder::get_Info(NightSecInfo nsItem, VARIANT* pvVal) { ::VariantClear(pvVal); CComBSTR bsRetVal; switch(nsItem) { case nsName: pvVal->vt = VT_BSTR; bsRetVal.LoadString(IDS_TEMPNAME); pvVal->bstrVal = bsRetVal.Detach(); return S_OK; case nsHelpText: pvVal->vt = VT_BSTR; bsRetVal.LoadString(IDS_TEMPDESC); pvVal->bstrVal = bsRetVal.Detach(); return S_OK; case nsCmdLine: pvVal->vt = VT_BSTR; bsRetVal.LoadString(IDS_TEMPPARAM); pvVal->bstrVal = bsRetVal.Detach(); return S_OK; } ::VariantClear(pvVal); return S_FALSE; } STDMETHODIMP CEmptyTempFolder::SetData(IUnknown* pUnk) { return m_Data.Initialize(pUnk); }