summaryrefslogtreecommitdiff
path: root/Shutdown/ShutdownSite.cpp
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2003-09-17 19:07:23 +0000
committerStef Walter <stef@thewalter.net>2003-09-17 19:07:23 +0000
commit3f95d417d9e623ac0c74df8ef11d7a01846392dd (patch)
tree45ec73f2dc07eafd7f41a6f62a8cdfbaa279469f /Shutdown/ShutdownSite.cpp
Initial ImportHEADmaster
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;
+}