2009-02-09 11:35:43 +01:00
|
|
|
#include <windows.h>
|
|
|
|
|
#include <dbgeng.h>
|
|
|
|
|
|
2009-02-09 13:07:38 +01:00
|
|
|
#include "cdbdebugoutput.h"
|
|
|
|
|
#include "cdbdebugengine.h"
|
2009-02-09 11:35:43 +01:00
|
|
|
|
|
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2009-02-09 13:07:38 +01:00
|
|
|
STDMETHODIMP MSVCDebugOutput::QueryInterface(
|
2009-02-09 11:35:43 +01:00
|
|
|
THIS_
|
|
|
|
|
IN REFIID InterfaceId,
|
|
|
|
|
OUT PVOID* Interface
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
*Interface = NULL;
|
|
|
|
|
|
|
|
|
|
if (IsEqualIID(InterfaceId, __uuidof(IUnknown)) ||
|
|
|
|
|
IsEqualIID(InterfaceId, __uuidof(IDebugOutputCallbacks)))
|
|
|
|
|
{
|
|
|
|
|
*Interface = (IDebugOutputCallbacks *)this;
|
|
|
|
|
AddRef();
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-02-09 13:07:38 +01:00
|
|
|
STDMETHODIMP_(ULONG) MSVCDebugOutput::AddRef(THIS)
|
2009-02-09 11:35:43 +01:00
|
|
|
{
|
|
|
|
|
// This class is designed to be static so
|
|
|
|
|
// there's no true refcount.
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2009-02-09 13:07:38 +01:00
|
|
|
STDMETHODIMP_(ULONG) MSVCDebugOutput::Release(THIS)
|
2009-02-09 11:35:43 +01:00
|
|
|
{
|
|
|
|
|
// This class is designed to be static so
|
|
|
|
|
// there's no true refcount.
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2009-02-09 13:07:38 +01:00
|
|
|
STDMETHODIMP MSVCDebugOutput::Output(
|
2009-02-09 11:35:43 +01:00
|
|
|
THIS_
|
|
|
|
|
IN ULONG mask,
|
|
|
|
|
IN PCSTR text
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
UNREFERENCED_PARAMETER(mask);
|
|
|
|
|
m_pEngine->handleDebugOutput(text);
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|