// ShutdownSite.cpp: implementation of the CShutdownSite class. // ////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "ShutdownSite.h" _COM_SMARTPTR_TYPEDEF(INightSecErrorFix, __uuidof(INightSecErrorFix)); ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CShutdownSite::CShutdownSite() { } CShutdownSite::~CShutdownSite() { } void CShutdownSite::SetSite() { IUnknown* pUnk = NULL; IObjectWithSitePtr pWithSite; IUnknown* pUnkMe = GetUnknown(); for(int nCnt = 0; nCnt < g_aComponents.size(); nCnt++) { if(SUCCEEDED(pUnk = g_aComponents[nCnt]->GetUnknown()) && pUnk != NULL) { pWithSite = pUnk; if(pWithSite != NULL) pWithSite->SetSite(pUnkMe); pUnk->Release(); } } } void CShutdownSite::ClearSite() { IUnknown* pUnk = NULL; IObjectWithSitePtr pWithSite; for(int nCnt = 0; nCnt < g_aComponents.size(); nCnt++) { if(SUCCEEDED(pUnk = g_aComponents[nCnt]->GetUnknown()) && pUnk != NULL) { pWithSite = pUnk; if(pWithSite != NULL) pWithSite->SetSite(NULL); pUnk->Release(); } } } STDMETHODIMP CShutdownSite::AddError(/*[in]*/ IUnknown* pUnk) { INightSecErrorPtr pErr = pUnk; if(pErr) return m_log.AddItem(pErr) ? S_OK : E_FAIL; return E_NOINTERFACE; } STDMETHODIMP CShutdownSite::HasErrors(/*[out, retval]*/ BOOL* pbRet) { *pbRet = m_log.HasErrors() ? TRUE : FALSE; return S_OK; }