summaryrefslogtreecommitdiff
path: root/Shutdown/ShutdownSite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Shutdown/ShutdownSite.cpp')
-rw-r--r--Shutdown/ShutdownSite.cpp78
1 files changed, 78 insertions, 0 deletions
diff --git a/Shutdown/ShutdownSite.cpp b/Shutdown/ShutdownSite.cpp
new file mode 100644
index 0000000..45dcdd9
--- /dev/null
+++ b/Shutdown/ShutdownSite.cpp
@@ -0,0 +1,78 @@
+// 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;
+}