ReactOS 0.4.16-dev-1946-g52006dd
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 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 406 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 407 of file debugging.c.

408{
409 HRESULT hr;
410 ICorDebugProcessEnum *pProcessEnum = NULL;
411
412 hr = ICorDebug_EnumerateProcesses(pCorDebug, NULL);
413 ok_(__FILE__,line) (hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr);
414
415 hr = ICorDebug_EnumerateProcesses(pCorDebug, &pProcessEnum);
416 ok_(__FILE__,line) (hr == S_OK, "expected S_OK got %08x\n", hr);
417 if(hr == S_OK)
418 {
419 ULONG cnt;
420
421 hr = ICorDebugProcessEnum_GetCount(pProcessEnum, &cnt);
422 ok_(__FILE__,line) (hr == S_OK, "expected S_OK got %08x\n", hr);
423 ok_(__FILE__,line) (cnt == nExpected, "expected %d got %d\n", nExpected, cnt);
424
425 ICorDebugProcessEnum_Release(pProcessEnum);
426 }
427}
#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
_In_ size_t cnt
Definition: wcstombs.cpp:43

◆ HRESULT()

static HRESULT ( WINAPI pCreateDebuggingInterfaceFromVersion)
static

◆ init_functionpointers()

static BOOL init_functionpointers ( void  )
static

Definition at line 384 of file debugging.c.

385{
386 hmscoree = LoadLibraryA("mscoree.dll");
387
388 if (!hmscoree)
389 {
390 win_skip("mscoree.dll not available\n");
391 return FALSE;
392 }
393
394 pCreateDebuggingInterfaceFromVersion = (void *)GetProcAddress(hmscoree, "CreateDebuggingInterfaceFromVersion");
395
396 if (!pCreateDebuggingInterfaceFromVersion)
397 {
398 win_skip("functions not available\n");
400 return FALSE;
401 }
402
403 return TRUE;
404}
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: minitest.h:67

Referenced by START_TEST().

◆ ManagedCallback2_AddRef()

static ULONG WINAPI ManagedCallback2_AddRef ( ICorDebugManagedCallback2 iface)
static

Definition at line 53 of file debugging.c.

54{
55 return 2;
56}

◆ ManagedCallback2_ChangeConnection()

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

Definition at line 79 of file debugging.c.

81{
82 ok(0, "unexpected call\n");
83 return E_NOTIMPL;
84}
#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 72 of file debugging.c.

74{
75 ok(0, "unexpected call\n");
76 return E_NOTIMPL;
77}

◆ ManagedCallback2_DestroyConnection()

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

Definition at line 86 of file debugging.c.

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

◆ 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 93 of file debugging.c.

97{
98 ok(0, "unexpected call\n");
99 return E_NOTIMPL;
100}

◆ ManagedCallback2_ExceptionUnwind()

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

Definition at line 102 of file debugging.c.

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

◆ ManagedCallback2_FunctionRemapComplete()

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

Definition at line 110 of file debugging.c.

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

◆ ManagedCallback2_FunctionRemapOpportunity()

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

Definition at line 63 of file debugging.c.

67{
68 ok(0, "unexpected call\n");
69 return E_NOTIMPL;
70}

◆ ManagedCallback2_MDANotification()

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

Definition at line 118 of file debugging.c.

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

◆ ManagedCallback2_QueryInterface()

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

Definition at line 39 of file debugging.c.

40{
41 if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_ICorDebugManagedCallback2, riid))
42 {
43 *ppv = iface;
44 return S_OK;
45 }
46
47 ok(0, "unexpected riid (%s)\n", debugstr_guid(riid));
48
49 *ppv = NULL;
50 return E_NOINTERFACE;
51}
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
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:3479

◆ ManagedCallback2_Release()

static ULONG WINAPI ManagedCallback2_Release ( ICorDebugManagedCallback2 iface)
static

Definition at line 58 of file debugging.c.

59{
60 return 1;
61}

◆ ManagedCallback_AddRef()

static ULONG WINAPI ManagedCallback_AddRef ( ICorDebugManagedCallback iface)
static

Definition at line 160 of file debugging.c.

161{
162 return 2;
163}

◆ ManagedCallback_Break()

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

Definition at line 184 of file debugging.c.

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

◆ ManagedCallback_Breakpoint()

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

Definition at line 170 of file debugging.c.

172{
173 ok(0, "unexpected call\n");
174 return E_NOTIMPL;
175}

◆ ManagedCallback_BreakpointSetError()

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

Definition at line 343 of file debugging.c.

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

◆ ManagedCallback_ControlCTrap()

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

Definition at line 316 of file debugging.c.

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

◆ ManagedCallback_CreateAppDomain()

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

Definition at line 288 of file debugging.c.

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

◆ ManagedCallback_CreateProcess()

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

Definition at line 212 of file debugging.c.

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

◆ ManagedCallback_CreateThread()

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

Definition at line 224 of file debugging.c.

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

◆ ManagedCallback_DebuggerError()

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

Definition at line 266 of file debugging.c.

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

◆ ManagedCallback_EditAndContinueRemap()

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

Definition at line 336 of file debugging.c.

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

◆ ManagedCallback_EvalComplete()

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

Definition at line 198 of file debugging.c.

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

◆ ManagedCallback_EvalException()

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

Definition at line 205 of file debugging.c.

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

◆ ManagedCallback_Exception()

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

Definition at line 191 of file debugging.c.

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

◆ ManagedCallback_ExitAppDomain()

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

Definition at line 295 of file debugging.c.

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

◆ ManagedCallback_ExitProcess()

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

Definition at line 218 of file debugging.c.

219{
220 ok(0, "unexpected call\n");
221 return E_NOTIMPL;
222}

◆ ManagedCallback_ExitThread()

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

Definition at line 231 of file debugging.c.

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

◆ ManagedCallback_LoadAssembly()

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

Definition at line 302 of file debugging.c.

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

◆ ManagedCallback_LoadClass()

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

Definition at line 252 of file debugging.c.

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

◆ ManagedCallback_LoadModule()

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

Definition at line 238 of file debugging.c.

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

◆ ManagedCallback_LogMessage()

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

Definition at line 273 of file debugging.c.

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

◆ 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 280 of file debugging.c.

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

◆ ManagedCallback_NameChange()

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

Definition at line 322 of file debugging.c.

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

◆ ManagedCallback_QueryInterface()

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

Definition at line 142 of file debugging.c.

143{
144 if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_ICorDebugManagedCallback, riid))
145 {
146 *ppv = iface;
147 return S_OK;
148 }
149 else if(IsEqualGUID(&IID_ICorDebugManagedCallback2, riid))
150 {
151 *ppv = (void**)&ManagedCallback2;
152 return S_OK;
153 }
154
155 ok(0, "unexpected riid (%s)\n", debugstr_guid(riid));
156 *ppv = NULL;
157 return E_NOINTERFACE;
158}
static ICorDebugManagedCallback2 ManagedCallback2
Definition: debugging.c:140

◆ ManagedCallback_Release()

static ULONG WINAPI ManagedCallback_Release ( ICorDebugManagedCallback iface)
static

Definition at line 165 of file debugging.c.

166{
167 return 1;
168}

◆ ManagedCallback_StepComplete()

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

Definition at line 177 of file debugging.c.

179{
180 ok(0, "unexpected call\n");
181 return E_NOTIMPL;
182}

◆ ManagedCallback_UnloadAssembly()

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

Definition at line 309 of file debugging.c.

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

◆ ManagedCallback_UnloadClass()

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

Definition at line 259 of file debugging.c.

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

◆ ManagedCallback_UnloadModule()

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

Definition at line 245 of file debugging.c.

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

◆ ManagedCallback_UpdateModuleSymbols()

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

Definition at line 329 of file debugging.c.

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

◆ START_TEST()

START_TEST ( debugging  )

Definition at line 481 of file debugging.c.

482{
484
486 return;
487
489
492}
static BOOL init_functionpointers(void)
Definition: debugging.c:384
static void test_createDebugger(void)
Definition: debugging.c:429
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 429 of file debugging.c.

430{
431 HRESULT hr;
432 IUnknown *pUnk;
433 ICorDebug *pCorDebug;
434
435 hr = pCreateDebuggingInterfaceFromVersion(0, v2_0, &pUnk);
436 ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08x\n", hr);
437
438 hr = pCreateDebuggingInterfaceFromVersion(1, v2_0, &pUnk);
439 ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08x\n", hr);
440
441 hr = pCreateDebuggingInterfaceFromVersion(2, v2_0, &pUnk);
442 ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08x\n", hr);
443
444 hr = pCreateDebuggingInterfaceFromVersion(4, v2_0, &pUnk);
445 ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08x\n", hr);
446
447 hr = pCreateDebuggingInterfaceFromVersion(3, v2_0, NULL);
448 ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08x\n", hr);
449
450 hr = pCreateDebuggingInterfaceFromVersion(3, v2_0, &pUnk);
451 if(hr == S_OK)
452 {
453 hr = IUnknown_QueryInterface(pUnk, &IID_ICorDebug, (void**)&pCorDebug);
454 ok(hr == S_OK, "expected S_OK got %08x\n", hr);
455 if(hr == S_OK)
456 {
457 hr = ICorDebug_Initialize(pCorDebug);
458 ok(hr == S_OK, "expected S_OK got %08x\n", hr);
459 if(hr == S_OK)
460 {
461 hr = ICorDebug_SetManagedHandler(pCorDebug, NULL);
462 ok(hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr);
463
464 hr = ICorDebug_SetManagedHandler(pCorDebug, &ManagedCallback);
465 ok(hr == S_OK, "expected S_OK got %08x\n", hr);
466
467 /* We should have no processes */
468 check_process_enum(pCorDebug, 0);
469 }
470
471 ICorDebug_Release(pCorDebug);
472 }
473 IUnknown_Release(pUnk);
474 }
475 else
476 {
477 skip(".NET 2.0 or mono not installed.\n");
478 }
479}
#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:406
static ICorDebugManagedCallback ManagedCallback
Definition: debugging.c:382
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 382 of file debugging.c.

Referenced by test_createDebugger().

◆ ManagedCallback2

ICorDebugManagedCallback2 ManagedCallback2 = { &managedCallback2Vtbl }
static

Definition at line 140 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:39
static ULONG WINAPI ManagedCallback2_AddRef(ICorDebugManagedCallback2 *iface)
Definition: debugging.c:53
static ULONG WINAPI ManagedCallback2_Release(ICorDebugManagedCallback2 *iface)
Definition: debugging.c:58
static HRESULT WINAPI ManagedCallback2_Exception(ICorDebugManagedCallback2 *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, ICorDebugFrame *pFrame, ULONG32 nOffset, CorDebugExceptionCallbackType dwEventType, DWORD dwFlags)
Definition: debugging.c:93
static HRESULT WINAPI ManagedCallback2_FunctionRemapComplete(ICorDebugManagedCallback2 *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, ICorDebugFunction *pFunction)
Definition: debugging.c:110
static HRESULT WINAPI ManagedCallback2_FunctionRemapOpportunity(ICorDebugManagedCallback2 *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, ICorDebugFunction *pOldFunction, ICorDebugFunction *pNewFunction, ULONG32 oldILOffset)
Definition: debugging.c:63
static HRESULT WINAPI ManagedCallback2_ChangeConnection(ICorDebugManagedCallback2 *iface, ICorDebugProcess *pProcess, CONNID dwConnectionId)
Definition: debugging.c:79
static HRESULT WINAPI ManagedCallback2_MDANotification(ICorDebugManagedCallback2 *iface, ICorDebugController *pController, ICorDebugThread *pThread, ICorDebugMDA *pMDA)
Definition: debugging.c:118
static HRESULT WINAPI ManagedCallback2_DestroyConnection(ICorDebugManagedCallback2 *iface, ICorDebugProcess *pProcess, CONNID dwConnectionId)
Definition: debugging.c:86
static HRESULT WINAPI ManagedCallback2_ExceptionUnwind(ICorDebugManagedCallback2 *iface, ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, CorDebugExceptionUnwindCallbackType dwEventType, DWORD dwFlags)
Definition: debugging.c:102
static HRESULT WINAPI ManagedCallback2_CreateConnection(ICorDebugManagedCallback2 *iface, ICorDebugProcess *pProcess, CONNID dwConnectionId, WCHAR *pConnName)
Definition: debugging.c:72

Definition at line 126 of file debugging.c.

◆ managedCallbackVtbl

ICorDebugManagedCallbackVtbl managedCallbackVtbl
static

Definition at line 350 of file debugging.c.

◆ v2_0

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