Initial revision of the cdbdebugger playground.

This commit is contained in:
Banana Joe
2009-02-09 10:55:46 +01:00
parent 6672f89ff5
commit d0865ed2a2
13 changed files with 1299 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
#include <stdio.h>
#include <windows.h>
#include <dbgeng.h>
#include "outputcallback.h"
WinDbgOutputCallback g_outputCallbacks;
STDMETHODIMP
WinDbgOutputCallback::QueryInterface(
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;
}
}
STDMETHODIMP_(ULONG)
WinDbgOutputCallback::AddRef(
THIS
)
{
// This class is designed to be static so
// there's no true refcount.
return 1;
}
STDMETHODIMP_(ULONG)
WinDbgOutputCallback::Release(
THIS
)
{
// This class is designed to be static so
// there's no true refcount.
return 0;
}
STDMETHODIMP
WinDbgOutputCallback::Output(
THIS_
IN ULONG Mask,
IN PCSTR Text
)
{
UNREFERENCED_PARAMETER(Mask);
fputs(Text, stdout);
return S_OK;
}