Back

// PSLSystem.cpp : Implementation of CPSLSystem

#include "stdafx.h"
#include "PSLSystem.h"

CPSLSystem::CPSLSystem()
{
}

HRESULT CPSLSystem::FinalConstruct()
{
   return S_OK;
}

void CPSLSystem::FinalRelease()
{
}

////////////////////////////////////////////////////////////////////////
// Interface Implementation;
////////////////////////////////////////////////////////////////////////

STDMETHODIMP CPSLSystem::get_Hardware(IPSLHardware ** ppValue)
{
   PSL_BEGIN

   *ppValue = m_Hardware;

   PSL_END
}

STDMETHODIMP CPSLSystem::get_Software(IPSLSoftware ** ppValue)
{
   PSL_BEGIN

   *ppValue = m_Software;

   PSL_END
}

STDMETHODIMP CPSLSystem::get_Network(IPSLNetwork ** ppValue)
{
   PSL_BEGIN

   *ppValue = m_Network;

   PSL_END
}

STDMETHODIMP CPSLSystem::get_Process(IPSLCurrentProcess ** ppValue)
{
   PSL_BEGIN

   *ppValue = m_Process;

   PSL_END
}

STDMETHODIMP CPSLSystem::get_Security(IPSLSecurity ** ppValue)
{
   PSL_BEGIN

   *ppValue = m_Security;

   PSL_END
}

STDMETHODIMP CPSLSystem::get_Tools(IPSLTools ** ppValue)
{
   PSL_BEGIN

   *ppValue = m_Tools;

   PSL_END
}

/*
.NET clients should use type COMException when handling the
exception, because it contains ErrorCode that's missing in
type Exception. That ErrorCode is the one to be passed into
this method for translation.
*/
STDMETHODIMP CPSLSystem::DecodeException(HRESULT ErrorCode, PSLException * pValue)
{
   PSL_BEGIN

   long lError = HRESULT_CODE(ErrorCode) - COM_ERROR_BASE;
   if(lError >= EX_MIN && lError <= EX_MAX)
      *pValue = static_cast<PSLException>(lError);
   else
      *pValue = exceptionUnknown;

   PSL_END
}

Top