// Copyright (c) 2010 Martin Knafve / hMailServer.com. // http://www.hmailserver.com #include "stdafx.h" #include "COMError.h" #include "InterfaceGlobalObjects.h" #include "InterfaceDeliveryQueue.h" #include "InterfaceLanguages.h" #include "COMAuthentication.h" STDMETHODIMP InterfaceGlobalObjects::InterfaceSupportsErrorInfo(REFIID riid) { static const IID* arr[] = { &IID_IInterfaceGlobalObjects, }; for (int i=0;i pAuthentication) { authentication_ = pAuthentication; } STDMETHODIMP InterfaceGlobalObjects::get_DeliveryQueue(IInterfaceDeliveryQueue **pVal) { try { if (!authentication_) return GetAccessDenied(); if (!authentication_->GetIsServerAdmin()) return authentication_->GetAccessDenied(); CComObject* pInterfaceDeliveryQueue = new CComObject; pInterfaceDeliveryQueue->SetAuthentication(authentication_); pInterfaceDeliveryQueue->AddRef(); *pVal = pInterfaceDeliveryQueue; return S_OK; } catch (...) { return COMError::GenerateGenericMessage(); } } STDMETHODIMP InterfaceGlobalObjects::get_Languages(IInterfaceLanguages **pVal) { try { if (!authentication_) return GetAccessDenied(); CComObject* pLanguageInt = new CComObject(); pLanguageInt->AddRef(); *pVal = pLanguageInt; return S_OK; } catch (...) { return COMError::GenerateGenericMessage(); } }