ReactOS 0.4.15-dev-7674-gc0b4db1
debugging.c File Reference
#include <stdio.h>
#include "windows.h"
#include "ole2.h"
#include "corerror.h"
#include "mscoree.h"
#include "corhdr.h"
#include "wine/test.h"
#include "initguid.h"
#include "cordebug.h"
Include dependency graph for debugging.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define check_process_enum(core, e)   _check_process_enum(__LINE__, core, e)
 

Functions

static HRESULT (WINAPI *pCreateDebuggingInterfaceFromVersion)(int
 
static const chardebugstr_guid (REFIID riid)
 
static HRESULT WINAPI ManagedCallback2_QueryInterface (ICorDebugManagedCallback2 *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ManagedCallback2_AddRef (ICorDebugManagedCallback2 *iface)
 
static ULONG WINAPI ManagedCallback2_Release (ICorDebugManagedCallback2 *iface)
 
static HRESULT WINAPI ManagedCallback2_FunctionRemapOpportunity (ICorDebugManagedCallback2 *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, ICorDebugFunction *pOldFunction, ICorDebugFunction *pNewFunction, ULONG32 oldILOffset)
 
static HRESULT WINAPI ManagedCallback2_CreateConnection (ICorDebugManagedCallback2 *iface, ICorDebugProcess *pProcess, CONNID dwConnectionId, WCHAR *pConnName)
 
static HRESULT WINAPI ManagedCallback2_ChangeConnection (ICorDebugManagedCallback2 *iface, ICorDebugProcess *pProcess, CONNID dwConnectionId)
 
static HRESULT WINAPI ManagedCallback2_DestroyConnection (ICorDebugManagedCallback2 *iface, ICorDebugProcess *pProcess, CONNID dwConnectionId)
 
static HRESULT WINAPI ManagedCallback2_Exception (ICorDebugManagedCallback2 *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, ICorDebugFrame *pFrame, ULONG32 nOffset, CorDebugExceptionCallbackType dwEventType, DWORD dwFlags)
 
static HRESULT WINAPI ManagedCallback2_ExceptionUnwind (ICorDebugManagedCallback2 *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, CorDebugExceptionUnwindCallbackType dwEventType, DWORD dwFlags)
 
static HRESULT WINAPI ManagedCallback2_FunctionRemapComplete (ICorDebugManagedCallback2 *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, ICorDebugFunction *pFunction)
 
static HRESULT WINAPI ManagedCallback2_MDANotification (ICorDebugManagedCallback2 *iface, ICorDebugController *pController, ICorDebugThread *pThread, ICorDebugMDA *pMDA)
 
static HRESULT WINAPI ManagedCallback_QueryInterface (ICorDebugManagedCallback *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ManagedCallback_AddRef (ICorDebugManagedCallback *iface)
 
static ULONG WINAPI ManagedCallback_Release (ICorDebugManagedCallback *iface)
 
static HRESULT WINAPI ManagedCallback_Breakpoint (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, ICorDebugBreakpoint *pBreakpoint)
 
static HRESULT WINAPI ManagedCallback_StepComplete (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, ICorDebugStepper *pStepper, CorDebugStepReason reason)
 
static HRESULT WINAPI ManagedCallback_Break (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *thread)
 
static HRESULT WINAPI ManagedCallback_Exception (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, BOOL unhandled)
 
static HRESULT WINAPI ManagedCallback_EvalComplete (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, ICorDebugEval *pEval)
 
static HRESULT WINAPI ManagedCallback_EvalException (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, ICorDebugEval *pEval)
 
static HRESULT WINAPI ManagedCallback_CreateProcess (ICorDebugManagedCallback *iface, ICorDebugProcess *pProcess)
 
static HRESULT WINAPI ManagedCallback_ExitProcess (ICorDebugManagedCallback *iface, ICorDebugProcess *pProcess)
 
static HRESULT WINAPI ManagedCallback_CreateThread (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *thread)
 
static HRESULT WINAPI ManagedCallback_ExitThread (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *thread)
 
static HRESULT WINAPI ManagedCallback_LoadModule (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugModule *pModule)
 
static HRESULT WINAPI ManagedCallback_UnloadModule (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugModule *pModule)
 
static HRESULT WINAPI ManagedCallback_LoadClass (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugClass *c)
 
static HRESULT WINAPI ManagedCallback_UnloadClass (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugClass *c)
 
static HRESULT WINAPI ManagedCallback_DebuggerError (ICorDebugManagedCallback *iface, ICorDebugProcess *pProcess, HRESULT errorHR, DWORD errorCode)
 
static HRESULT WINAPI ManagedCallback_LogMessage (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, LONG lLevel, WCHAR *pLogSwitchName, WCHAR *pMessage)
 
static HRESULT WINAPI ManagedCallback_LogSwitch (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, LONG lLevel, ULONG ulReason, WCHAR *pLogSwitchName, WCHAR *pParentName)
 
static HRESULT WINAPI ManagedCallback_CreateAppDomain (ICorDebugManagedCallback *iface, ICorDebugProcess *pProcess, ICorDebugAppDomain *pAppDomain)
 
static HRESULT WINAPI ManagedCallback_ExitAppDomain (ICorDebugManagedCallback *iface, ICorDebugProcess *pProcess, ICorDebugAppDomain *pAppDomain)
 
static HRESULT WINAPI ManagedCallback_LoadAssembly (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugAssembly *pAssembly)
 
static HRESULT WINAPI ManagedCallback_UnloadAssembly (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugAssembly *pAssembly)
 
static HRESULT WINAPI ManagedCallback_ControlCTrap (ICorDebugManagedCallback *iface, ICorDebugProcess *pProcess)
 
static HRESULT WINAPI ManagedCallback_NameChange (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread)
 
static HRESULT WINAPI ManagedCallback_UpdateModuleSymbols (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugModule *pModule, IStream *pSymbolStream)
 
static HRESULT WINAPI ManagedCallback_EditAndContinueRemap (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, ICorDebugFunction *pFunction, BOOL fAccurate)
 
static HRESULT WINAPI ManagedCallback_BreakpointSetError (ICorDebugManagedCallback *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, ICorDebugBreakpoint *pBreakpoint, DWORD dwError)
 
static BOOL init_functionpointers (void)
 
static void _check_process_enum (unsigned line, ICorDebug *pCorDebug, ULONG nExpected)
 
static void test_createDebugger (void)
 
 START_TEST (debugging)
 

Variables

static HMODULE hmscoree
 
static LPCWSTR
 
static IUnknown **const WCHAR v2_0 [] = {'v','2','.','0','.','5','0','7','2','7',0}
 
static struct ICorDebugManagedCallback2Vtbl managedCallback2Vtbl
 
static ICorDebugManagedCallback2 ManagedCallback2 = { &managedCallback2Vtbl }
 
static ICorDebugManagedCallbackVtbl managedCallbackVtbl
 
static ICorDebugManagedCallback ManagedCallback = { &managedCallbackVtbl }
 

Macro Definition Documentation

◆ check_process_enum

#define check_process_enum (   core,
  e 
)    _check_process_enum(__LINE__, core, e)

Definition at line 421 of file debugging.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file debugging.c.

Function Documentation

◆ _check_process_enum()

static void _check_process_enum ( unsigned  line,
ICorDebug pCorDebug,
ULONG  nExpected 
)
static

Definition at line 422 of file debugging.c.

423{
424 HRESULT hr;
425 ICorDebugProcessEnum *pProcessEnum = NULL;
426
427 hr = ICorDebug_EnumerateProcesses(pCorDebug, NULL);
428 ok_(__FILE__,line) (hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr);
429
430 hr = ICorDebug_EnumerateProcesses(pCorDebug, &pProcessEnum);
431 ok_(__FILE__,line) (hr == S_OK, "expected S_OK got %08x\n", hr);
432 if(hr == S_OK)
433 {
434 ULONG cnt;
435
436 hr = ICorDebugProcessEnum_GetCount(pProcessEnum, &cnt);
437 ok_(__FILE__,line) (hr == S_OK, "expected S_OK got %08x\n", hr);
438 ok_(__FILE__,line) (cnt == nExpected, "expected %d got %d\n", nExpected, cnt);
439
440 ICorDebugProcessEnum_Release(pProcessEnum);
441 }
442}
#define ok_(x1, x2)
Definition: atltest.h:61
#define E_INVALIDARG
Definition: ddrawi.h:101
#define NULL
Definition: types.h:112
#define S_OK
Definition: intsafe.h:52
HRESULT hr
Definition: shlfolder.c:183
Definition: parser.c:49
uint32_t ULONG
Definition: typedefs.h:59

◆ debugstr_guid()

static const char * debugstr_guid ( REFIID  riid)
static

Definition at line 39 of file debugging.c.

40{
41 static char buf[50];
42
43 if(!riid)
44 return "(null)";
45
46 sprintf(buf, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
47 riid->Data1, riid->Data2, riid->Data3, riid->Data4[0],
48 riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4],
49 riid->Data4[5], riid->Data4[6], riid->Data4[7]);
50
51 return buf;
52}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
REFIID riid
Definition: atlbase.h:39
#define sprintf(buf, format,...)
Definition: sprintf.c:55

◆ HRESULT()

static HRESULT ( WINAPI pCreateDebuggingInterfaceFromVersion)
static

◆ init_functionpointers()

static BOOL init_functionpointers ( void  )
static

Definition at line 399 of file debugging.c.

400{
401 hmscoree = LoadLibraryA("mscoree.dll");
402
403 if (!hmscoree)
404 {
405 win_skip("mscoree.dll not available\n");
406 return FALSE;
407 }
408
409 pCreateDebuggingInterfaceFromVersion = (void *)GetProcAddress(hmscoree, "CreateDebuggingInterfaceFromVersion");
410
411 if (!pCreateDebuggingInterfaceFromVersion)
412 {
413 win_skip("functions not available\n");
415 return FALSE;
416 }
417
418 return TRUE;
419}
static HMODULE hmscoree
Definition: debugging.c:33
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
#define win_skip
Definition: test.h:160

Referenced by START_TEST().

◆ ManagedCallback2_AddRef()

static ULONG WINAPI ManagedCallback2_AddRef ( ICorDebugManagedCallback2 iface)
static

Definition at line 68 of file debugging.c.

69{
70 return 2;
71}

◆ ManagedCallback2_ChangeConnection()

static HRESULT WINAPI ManagedCallback2_ChangeConnection ( ICorDebugManagedCallback2 iface,
ICorDebugProcess pProcess,
CONNID  dwConnectionId 
)
static

Definition at line 94 of file debugging.c.

96{
97 ok(0, "unexpected call\n");
98 return E_NOTIMPL;
99}
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ManagedCallback2_CreateConnection()

static HRESULT WINAPI ManagedCallback2_CreateConnection ( ICorDebugManagedCallback2 iface,
ICorDebugProcess pProcess,
CONNID  dwConnectionId,
WCHAR pConnName 
)
static

Definition at line 87 of file debugging.c.

89{
90 ok(0, "unexpected call\n");
91 return E_NOTIMPL;
92}

◆ ManagedCallback2_DestroyConnection()

static HRESULT WINAPI ManagedCallback2_DestroyConnection ( ICorDebugManagedCallback2 iface,
ICorDebugProcess pProcess,
CONNID  dwConnectionId 
)
static

Definition at line 101 of file debugging.c.

103{
104 ok(0, "unexpected call\n");
105 return E_NOTIMPL;
106}

◆ ManagedCallback2_Exception()

static HRESULT WINAPI ManagedCallback2_Exception ( ICorDebugManagedCallback2 iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread pThread,
ICorDebugFrame pFrame,
ULONG32  nOffset,
CorDebugExceptionCallbackType  dwEventType,
DWORD  dwFlags 
)
static

Definition at line 108 of file debugging.c.

112{
113 ok(0, "unexpected call\n");
114 return E_NOTIMPL;
115}

◆ ManagedCallback2_ExceptionUnwind()

static HRESULT WINAPI ManagedCallback2_ExceptionUnwind ( ICorDebugManagedCallback2 iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread pThread,
CorDebugExceptionUnwindCallbackType  dwEventType,
DWORD  dwFlags 
)
static

Definition at line 117 of file debugging.c.

120{
121 ok(0, "unexpected call\n");
122 return E_NOTIMPL;
123}

◆ ManagedCallback2_FunctionRemapComplete()

static HRESULT WINAPI ManagedCallback2_FunctionRemapComplete ( ICorDebugManagedCallback2 iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread pThread,
ICorDebugFunction pFunction 
)
static

Definition at line 125 of file debugging.c.

128{
129 ok(0, "unexpected call\n");
130 return E_NOTIMPL;
131}

◆ ManagedCallback2_FunctionRemapOpportunity()

static HRESULT WINAPI ManagedCallback2_FunctionRemapOpportunity ( ICorDebugManagedCallback2 iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread pThread,
ICorDebugFunction pOldFunction,
ICorDebugFunction pNewFunction,
ULONG32  oldILOffset 
)
static

Definition at line 78 of file debugging.c.

82{
83 ok(0, "unexpected call\n");
84 return E_NOTIMPL;
85}

◆ ManagedCallback2_MDANotification()

static HRESULT WINAPI ManagedCallback2_MDANotification ( ICorDebugManagedCallback2 iface,
ICorDebugController pController,
ICorDebugThread pThread,
ICorDebugMDA pMDA 
)
static

Definition at line 133 of file debugging.c.

136{
137 ok(0, "unexpected call\n");
138 return E_NOTIMPL;
139}

◆ ManagedCallback2_QueryInterface()

static HRESULT WINAPI ManagedCallback2_QueryInterface ( ICorDebugManagedCallback2 iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 54 of file debugging.c.

55{
56 if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_ICorDebugManagedCallback2, riid))
57 {
58 *ppv = iface;
59 return S_OK;
60 }
61
62 ok(0, "unexpected riid (%s)\n", debugstr_guid(riid));
63
64 *ppv = NULL;
65 return E_NOINTERFACE;
66}
const GUID IID_IUnknown
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ ManagedCallback2_Release()

static ULONG WINAPI ManagedCallback2_Release ( ICorDebugManagedCallback2 iface)
static

Definition at line 73 of file debugging.c.

74{
75 return 1;
76}

◆ ManagedCallback_AddRef()

static ULONG WINAPI ManagedCallback_AddRef ( ICorDebugManagedCallback iface)
static

Definition at line 175 of file debugging.c.

176{
177 return 2;
178}

◆ ManagedCallback_Break()

static HRESULT WINAPI ManagedCallback_Break ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread thread 
)
static

Definition at line 199 of file debugging.c.

201{
202 ok(0, "unexpected call\n");
203 return E_NOTIMPL;
204}

◆ ManagedCallback_Breakpoint()

static HRESULT WINAPI ManagedCallback_Breakpoint ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread pThread,
ICorDebugBreakpoint pBreakpoint 
)
static

Definition at line 185 of file debugging.c.

187{
188 ok(0, "unexpected call\n");
189 return E_NOTIMPL;
190}

◆ ManagedCallback_BreakpointSetError()

static HRESULT WINAPI ManagedCallback_BreakpointSetError ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread pThread,
ICorDebugBreakpoint pBreakpoint,
DWORD  dwError 
)
static

Definition at line 358 of file debugging.c.

360{
361 ok(0, "unexpected call\n");
362 return E_NOTIMPL;
363}

◆ ManagedCallback_ControlCTrap()

static HRESULT WINAPI ManagedCallback_ControlCTrap ( ICorDebugManagedCallback iface,
ICorDebugProcess pProcess 
)
static

Definition at line 331 of file debugging.c.

332{
333 ok(0, "unexpected call\n");
334 return E_NOTIMPL;
335}

◆ ManagedCallback_CreateAppDomain()

static HRESULT WINAPI ManagedCallback_CreateAppDomain ( ICorDebugManagedCallback iface,
ICorDebugProcess pProcess,
ICorDebugAppDomain pAppDomain 
)
static

Definition at line 303 of file debugging.c.

305{
306 ok(0, "unexpected call\n");
307 return E_NOTIMPL;
308}

◆ ManagedCallback_CreateProcess()

static HRESULT WINAPI ManagedCallback_CreateProcess ( ICorDebugManagedCallback iface,
ICorDebugProcess pProcess 
)
static

Definition at line 227 of file debugging.c.

228{
229 ok(0, "unexpected call\n");
230 return E_NOTIMPL;
231}

◆ ManagedCallback_CreateThread()

static HRESULT WINAPI ManagedCallback_CreateThread ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread thread 
)
static

Definition at line 239 of file debugging.c.

241{
242 ok(0, "unexpected call\n");
243 return E_NOTIMPL;
244}

◆ ManagedCallback_DebuggerError()

static HRESULT WINAPI ManagedCallback_DebuggerError ( ICorDebugManagedCallback iface,
ICorDebugProcess pProcess,
HRESULT  errorHR,
DWORD  errorCode 
)
static

Definition at line 281 of file debugging.c.

283{
284 ok(0, "unexpected call\n");
285 return E_NOTIMPL;
286}

◆ ManagedCallback_EditAndContinueRemap()

static HRESULT WINAPI ManagedCallback_EditAndContinueRemap ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread pThread,
ICorDebugFunction pFunction,
BOOL  fAccurate 
)
static

Definition at line 351 of file debugging.c.

353{
354 ok(0, "unexpected call\n");
355 return E_NOTIMPL;
356}

◆ ManagedCallback_EvalComplete()

static HRESULT WINAPI ManagedCallback_EvalComplete ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread pThread,
ICorDebugEval pEval 
)
static

Definition at line 213 of file debugging.c.

215{
216 ok(0, "unexpected call\n");
217 return E_NOTIMPL;
218}

◆ ManagedCallback_EvalException()

static HRESULT WINAPI ManagedCallback_EvalException ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread pThread,
ICorDebugEval pEval 
)
static

Definition at line 220 of file debugging.c.

222{
223 ok(0, "unexpected call\n");
224 return E_NOTIMPL;
225}

◆ ManagedCallback_Exception()

static HRESULT WINAPI ManagedCallback_Exception ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread pThread,
BOOL  unhandled 
)
static

Definition at line 206 of file debugging.c.

208{
209 ok(0, "unexpected call\n");
210 return E_NOTIMPL;
211}

◆ ManagedCallback_ExitAppDomain()

static HRESULT WINAPI ManagedCallback_ExitAppDomain ( ICorDebugManagedCallback iface,
ICorDebugProcess pProcess,
ICorDebugAppDomain pAppDomain 
)
static

Definition at line 310 of file debugging.c.

312{
313 ok(0, "unexpected call\n");
314 return E_NOTIMPL;
315}

◆ ManagedCallback_ExitProcess()

static HRESULT WINAPI ManagedCallback_ExitProcess ( ICorDebugManagedCallback iface,
ICorDebugProcess pProcess 
)
static

Definition at line 233 of file debugging.c.

234{
235 ok(0, "unexpected call\n");
236 return E_NOTIMPL;
237}

◆ ManagedCallback_ExitThread()

static HRESULT WINAPI ManagedCallback_ExitThread ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread thread 
)
static

Definition at line 246 of file debugging.c.

248{
249 ok(0, "unexpected call\n");
250 return E_NOTIMPL;
251}

◆ ManagedCallback_LoadAssembly()

static HRESULT WINAPI ManagedCallback_LoadAssembly ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugAssembly pAssembly 
)
static

Definition at line 317 of file debugging.c.

319{
320 ok(0, "unexpected call\n");
321 return E_NOTIMPL;
322}

◆ ManagedCallback_LoadClass()

static HRESULT WINAPI ManagedCallback_LoadClass ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugClass c 
)
static

Definition at line 267 of file debugging.c.

269{
270 ok(0, "unexpected call\n");
271 return E_NOTIMPL;
272}

◆ ManagedCallback_LoadModule()

static HRESULT WINAPI ManagedCallback_LoadModule ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugModule pModule 
)
static

Definition at line 253 of file debugging.c.

255{
256 ok(0, "unexpected call\n");
257 return E_NOTIMPL;
258}

◆ ManagedCallback_LogMessage()

static HRESULT WINAPI ManagedCallback_LogMessage ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread pThread,
LONG  lLevel,
WCHAR pLogSwitchName,
WCHAR pMessage 
)
static

Definition at line 288 of file debugging.c.

290{
291 ok(0, "unexpected call\n");
292 return E_NOTIMPL;
293}

◆ ManagedCallback_LogSwitch()

static HRESULT WINAPI ManagedCallback_LogSwitch ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread pThread,
LONG  lLevel,
ULONG  ulReason,
WCHAR pLogSwitchName,
WCHAR pParentName 
)
static

Definition at line 295 of file debugging.c.

298{
299 ok(0, "unexpected call\n");
300 return E_NOTIMPL;
301}

◆ ManagedCallback_NameChange()

static HRESULT WINAPI ManagedCallback_NameChange ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread pThread 
)
static

Definition at line 337 of file debugging.c.

339{
340 ok(0, "unexpected call\n");
341 return E_NOTIMPL;
342}

◆ ManagedCallback_QueryInterface()

static HRESULT WINAPI ManagedCallback_QueryInterface ( ICorDebugManagedCallback iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 157 of file debugging.c.

158{
159 if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_ICorDebugManagedCallback, riid))
160 {
161 *ppv = iface;
162 return S_OK;
163 }
164 else if(IsEqualGUID(&IID_ICorDebugManagedCallback2, riid))
165 {
166 *ppv = (void**)&ManagedCallback2;
167 return S_OK;
168 }
169
170 ok(0, "unexpected riid (%s)\n", debugstr_guid(riid));
171 *ppv = NULL;
172 return E_NOINTERFACE;
173}
static ICorDebugManagedCallback2 ManagedCallback2
Definition: debugging.c:155

◆ ManagedCallback_Release()

static ULONG WINAPI ManagedCallback_Release ( ICorDebugManagedCallback iface)
static

Definition at line 180 of file debugging.c.

181{
182 return 1;
183}

◆ ManagedCallback_StepComplete()

static HRESULT WINAPI ManagedCallback_StepComplete ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugThread pThread,
ICorDebugStepper pStepper,
CorDebugStepReason  reason 
)
static

Definition at line 192 of file debugging.c.

194{
195 ok(0, "unexpected call\n");
196 return E_NOTIMPL;
197}

◆ ManagedCallback_UnloadAssembly()

static HRESULT WINAPI ManagedCallback_UnloadAssembly ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugAssembly pAssembly 
)
static

Definition at line 324 of file debugging.c.

326{
327 ok(0, "unexpected call\n");
328 return E_NOTIMPL;
329}

◆ ManagedCallback_UnloadClass()

static HRESULT WINAPI ManagedCallback_UnloadClass ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugClass c 
)
static

Definition at line 274 of file debugging.c.

276{
277 ok(0, "unexpected call\n");
278 return E_NOTIMPL;
279}

◆ ManagedCallback_UnloadModule()

static HRESULT WINAPI ManagedCallback_UnloadModule ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugModule pModule 
)
static

Definition at line 260 of file debugging.c.

262{
263 ok(0, "unexpected call\n");
264 return E_NOTIMPL;
265}

◆ ManagedCallback_UpdateModuleSymbols()

static HRESULT WINAPI ManagedCallback_UpdateModuleSymbols ( ICorDebugManagedCallback iface,
ICorDebugAppDomain pAppDomain,
ICorDebugModule pModule,
IStream pSymbolStream 
)
static

Definition at line 344 of file debugging.c.

346{
347 ok(0, "unexpected call\n");
348 return E_NOTIMPL;
349}

◆ START_TEST()

START_TEST ( debugging  )

Definition at line 496 of file debugging.c.

497{
499
501 return;
502
504
507}
static BOOL init_functionpointers(void)
Definition: debugging.c:399
static void test_createDebugger(void)
Definition: debugging.c:444
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067

◆ test_createDebugger()

static void test_createDebugger ( void  )
static

Definition at line 444 of file debugging.c.

445{
446 HRESULT hr;
447 IUnknown *pUnk;
448 ICorDebug *pCorDebug;
449
450 hr = pCreateDebuggingInterfaceFromVersion(0, v2_0, &pUnk);
451 ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08x\n", hr);
452
453 hr = pCreateDebuggingInterfaceFromVersion(1, v2_0, &pUnk);
454 ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08x\n", hr);
455
456 hr = pCreateDebuggingInterfaceFromVersion(2, v2_0, &pUnk);
457 ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08x\n", hr);
458
459 hr = pCreateDebuggingInterfaceFromVersion(4, v2_0, &pUnk);
460 ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08x\n", hr);
461
462 hr = pCreateDebuggingInterfaceFromVersion(3, v2_0, NULL);
463 ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08x\n", hr);
464
465 hr = pCreateDebuggingInterfaceFromVersion(3, v2_0, &pUnk);
466 if(hr == S_OK)
467 {
468 hr = IUnknown_QueryInterface(pUnk, &IID_ICorDebug, (void**)&pCorDebug);
469 ok(hr == S_OK, "expected S_OK got %08x\n", hr);
470 if(hr == S_OK)
471 {
472 hr = ICorDebug_Initialize(pCorDebug);
473 ok(hr == S_OK, "expected S_OK got %08x\n", hr);
474 if(hr == S_OK)
475 {
476 hr = ICorDebug_SetManagedHandler(pCorDebug, NULL);
477 ok(hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr);
478
479 hr = ICorDebug_SetManagedHandler(pCorDebug, &ManagedCallback);
480 ok(hr == S_OK, "expected S_OK got %08x\n", hr);
481
482 /* We should have no processes */
483 check_process_enum(pCorDebug, 0);
484 }
485
486 ICorDebug_Release(pCorDebug);
487 }
488 IUnknown_Release(pUnk);
489 }
490 else
491 {
492 skip(".NET 2.0 or mono not installed.\n");
493 }
494}
#define skip(...)
Definition: atltest.h:64
static IUnknown **const WCHAR v2_0[]
Definition: debugging.c:37
#define check_process_enum(core, e)
Definition: debugging.c:421
static ICorDebugManagedCallback ManagedCallback
Definition: debugging.c:397
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30

Referenced by START_TEST().

Variable Documentation

◆ hmscoree

HMODULE hmscoree
static

Definition at line 33 of file debugging.c.

Referenced by init_functionpointers(), and START_TEST().

◆ LPCWSTR

Definition at line 35 of file debugging.c.

◆ ManagedCallback

ICorDebugManagedCallback ManagedCallback = { &managedCallbackVtbl }
static

Definition at line 397 of file debugging.c.

Referenced by test_createDebugger().

◆ ManagedCallback2

ICorDebugManagedCallback2 ManagedCallback2 = { &managedCallback2Vtbl }
static

Definition at line 155 of file debugging.c.

Referenced by ManagedCallback_QueryInterface().

◆ managedCallback2Vtbl

struct ICorDebugManagedCallback2Vtbl managedCallback2Vtbl
static
Initial value:
= {
}
static HRESULT WINAPI ManagedCallback2_QueryInterface(ICorDebugManagedCallback2 *iface, REFIID riid, void **ppv)
Definition: debugging.c:54
static ULONG WINAPI ManagedCallback2_AddRef(ICorDebugManagedCallback2 *iface)
Definition: debugging.c:68
static ULONG WINAPI ManagedCallback2_Release(ICorDebugManagedCallback2 *iface)
Definition: debugging.c:73
static HRESULT WINAPI ManagedCallback2_Exception(ICorDebugManagedCallback2 *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, ICorDebugFrame *pFrame, ULONG32 nOffset, CorDebugExceptionCallbackType dwEventType, DWORD dwFlags)
Definition: debugging.c:108
static HRESULT WINAPI ManagedCallback2_FunctionRemapComplete(ICorDebugManagedCallback2 *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, ICorDebugFunction *pFunction)
Definition: debugging.c:125
static HRESULT WINAPI ManagedCallback2_FunctionRemapOpportunity(ICorDebugManagedCallback2 *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, ICorDebugFunction *pOldFunction, ICorDebugFunction *pNewFunction, ULONG32 oldILOffset)
Definition: debugging.c:78
static HRESULT WINAPI ManagedCallback2_ChangeConnection(ICorDebugManagedCallback2 *iface, ICorDebugProcess *pProcess, CONNID dwConnectionId)
Definition: debugging.c:94
static HRESULT WINAPI ManagedCallback2_MDANotification(ICorDebugManagedCallback2 *iface, ICorDebugController *pController, ICorDebugThread *pThread, ICorDebugMDA *pMDA)
Definition: debugging.c:133
static HRESULT WINAPI ManagedCallback2_DestroyConnection(ICorDebugManagedCallback2 *iface, ICorDebugProcess *pProcess, CONNID dwConnectionId)
Definition: debugging.c:101
static HRESULT WINAPI ManagedCallback2_ExceptionUnwind(ICorDebugManagedCallback2 *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, CorDebugExceptionUnwindCallbackType dwEventType, DWORD dwFlags)
Definition: debugging.c:117
static HRESULT WINAPI ManagedCallback2_CreateConnection(ICorDebugManagedCallback2 *iface, ICorDebugProcess *pProcess, CONNID dwConnectionId, WCHAR *pConnName)
Definition: debugging.c:87

Definition at line 141 of file debugging.c.

◆ managedCallbackVtbl

ICorDebugManagedCallbackVtbl managedCallbackVtbl
static

Definition at line 365 of file debugging.c.

◆ v2_0

IUnknown** const WCHAR v2_0[] = {'v','2','.','0','.','5','0','7','2','7',0}