3 * Copyright 2011 Alistair Leslie-Hughes
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "mscoree_private.h"
22 typedef struct DebugProcess
24 ICorDebugProcess ICorDebugProcess_iface
;
35 static inline CorDebug
*impl_from_ICorDebug( ICorDebug
*iface
)
37 return CONTAINING_RECORD(iface
, CorDebug
, ICorDebug_iface
);
40 static inline CorDebug
*impl_from_ICorDebugProcessEnum( ICorDebugProcessEnum
*iface
)
42 return CONTAINING_RECORD(iface
, CorDebug
, ICorDebugProcessEnum_iface
);
45 static inline DebugProcess
*impl_from_ICorDebugProcess( ICorDebugProcess
*iface
)
47 return CONTAINING_RECORD(iface
, DebugProcess
, ICorDebugProcess_iface
);
50 /* ICorDebugProcess Interface */
51 static HRESULT WINAPI
cordebugprocess_QueryInterface(ICorDebugProcess
*iface
,
52 REFIID riid
, void **ppvObject
)
54 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
56 TRACE("%p %s %p\n", This
, debugstr_guid(riid
), ppvObject
);
58 if ( IsEqualGUID( riid
, &IID_ICorDebugProcess
) ||
59 IsEqualGUID( riid
, &IID_ICorDebugController
) ||
60 IsEqualGUID( riid
, &IID_IUnknown
) )
62 *ppvObject
= &This
->ICorDebugProcess_iface
;
66 FIXME("Unsupported interface %s\n", debugstr_guid(riid
));
70 ICorDebug_AddRef(iface
);
75 static ULONG WINAPI
cordebugprocess_AddRef(ICorDebugProcess
*iface
)
77 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
78 ULONG ref
= InterlockedIncrement(&This
->ref
);
80 TRACE("%p ref=%u\n", This
, ref
);
85 static ULONG WINAPI
cordebugprocess_Release(ICorDebugProcess
*iface
)
87 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
88 ULONG ref
= InterlockedDecrement(&This
->ref
);
90 TRACE("%p ref=%u\n", This
, ref
);
95 CloseHandle(This
->handle
);
98 CloseHandle(This
->thread
);
101 ICorDebug_Release(&This
->cordebug
->ICorDebug_iface
);
103 HeapFree(GetProcessHeap(), 0, This
);
109 static HRESULT WINAPI
cordebugprocess_Stop(ICorDebugProcess
*iface
, DWORD dwTimeoutIgnored
)
111 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
112 FIXME("stub %p\n", This
);
116 static HRESULT WINAPI
cordebugprocess_Continue(ICorDebugProcess
*iface
, BOOL fIsOutOfBand
)
118 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
122 ResumeThread(This
->thread
);
127 static HRESULT WINAPI
cordebugprocess_IsRunning(ICorDebugProcess
*iface
, BOOL
*pbRunning
)
129 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
130 FIXME("stub %p\n", This
);
134 static HRESULT WINAPI
cordebugprocess_HasQueuedCallbacks(ICorDebugProcess
*iface
,
135 ICorDebugThread
*pThread
, BOOL
*pbQueued
)
137 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
138 FIXME("stub %p\n", This
);
142 static HRESULT WINAPI
cordebugprocess_EnumerateThreads(ICorDebugProcess
*iface
,
143 ICorDebugThreadEnum
**ppThreads
)
145 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
146 FIXME("stub %p\n", This
);
150 static HRESULT WINAPI
cordebugprocess_SetAllThreadsDebugState(ICorDebugProcess
*iface
,
151 CorDebugThreadState state
, ICorDebugThread
*pExceptThisThread
)
153 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
154 FIXME("stub %p\n", This
);
158 static HRESULT WINAPI
cordebugprocess_Detach(ICorDebugProcess
*iface
)
160 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
161 FIXME("stub %p\n", This
);
165 static HRESULT WINAPI
cordebugprocess_Terminate(ICorDebugProcess
*iface
, UINT exitCode
)
167 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
174 ret
= TerminateProcess(This
->handle
, exitCode
);
175 CloseHandle(This
->handle
);
178 return ret
? S_OK
: E_FAIL
;
181 static HRESULT WINAPI
cordebugprocess_CanCommitChanges(ICorDebugProcess
*iface
,
182 ULONG cSnapshots
, ICorDebugEditAndContinueSnapshot
* pSnapshots
[],
183 ICorDebugErrorInfoEnum
**pError
)
185 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
186 FIXME("stub %p\n", This
);
190 static HRESULT WINAPI
cordebugprocess_CommitChanges(ICorDebugProcess
*iface
,
191 ULONG cSnapshots
, ICorDebugEditAndContinueSnapshot
* pSnapshots
[],
192 ICorDebugErrorInfoEnum
**pError
)
194 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
195 FIXME("stub %p\n", This
);
199 static HRESULT WINAPI
cordebugprocess_GetID(ICorDebugProcess
*iface
, DWORD
*pdwProcessId
)
201 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
207 *pdwProcessId
= This
->dwProcessID
;
212 static HRESULT WINAPI
cordebugprocess_GetHandle(ICorDebugProcess
*iface
, HPROCESS
*phProcessHandle
)
214 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
220 *phProcessHandle
= This
->handle
;
225 static HRESULT WINAPI
cordebugprocess_GetThread(ICorDebugProcess
*iface
, DWORD dwThreadId
,
226 ICorDebugThread
**ppThread
)
228 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
229 FIXME("stub %p\n", This
);
233 static HRESULT WINAPI
cordebugprocess_EnumerateObjects(ICorDebugProcess
*iface
,
234 ICorDebugObjectEnum
**ppObjects
)
236 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
237 FIXME("stub %p\n", This
);
241 static HRESULT WINAPI
cordebugprocess_IsTransitionStub(ICorDebugProcess
*iface
,
242 CORDB_ADDRESS address
, BOOL
*pbTransitionStub
)
244 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
245 FIXME("stub %p\n", This
);
249 static HRESULT WINAPI
cordebugprocess_IsOSSuspended(ICorDebugProcess
*iface
,
250 DWORD threadID
, BOOL
*pbSuspended
)
252 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
253 FIXME("stub %p\n", This
);
257 static HRESULT WINAPI
cordebugprocess_GetThreadContext(ICorDebugProcess
*iface
,
258 DWORD threadID
, ULONG32 contextSize
, BYTE context
[])
260 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
261 FIXME("stub %p\n", This
);
265 static HRESULT WINAPI
cordebugprocess_SetThreadContext(ICorDebugProcess
*iface
,
266 DWORD threadID
, ULONG32 contextSize
, BYTE context
[])
268 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
269 FIXME("stub %p\n", This
);
273 static HRESULT WINAPI
cordebugprocess_ReadMemory(ICorDebugProcess
*iface
,
274 CORDB_ADDRESS address
, DWORD size
, BYTE buffer
[],
277 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
278 FIXME("stub %p\n", This
);
282 static HRESULT WINAPI
cordebugprocess_WriteMemory(ICorDebugProcess
*iface
,
283 CORDB_ADDRESS address
, DWORD size
, BYTE buffer
[],
286 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
287 FIXME("stub %p\n", This
);
291 static HRESULT WINAPI
cordebugprocess_ClearCurrentException(ICorDebugProcess
*iface
,
294 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
295 FIXME("stub %p\n", This
);
299 static HRESULT WINAPI
cordebugprocess_EnableLogMessages(ICorDebugProcess
*iface
,
302 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
303 FIXME("stub %p\n", This
);
307 static HRESULT WINAPI
cordebugprocess_ModifyLogSwitch(ICorDebugProcess
*iface
,
308 WCHAR
*pLogSwitchName
, LONG lLevel
)
310 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
311 FIXME("stub %p\n", This
);
315 static HRESULT WINAPI
cordebugprocess_EnumerateAppDomains(ICorDebugProcess
*iface
,
316 ICorDebugAppDomainEnum
**ppAppDomains
)
318 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
319 FIXME("stub %p\n", This
);
323 static HRESULT WINAPI
cordebugprocess_GetObject(ICorDebugProcess
*iface
,
324 ICorDebugValue
**ppObject
)
326 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
327 FIXME("stub %p\n", This
);
331 static HRESULT WINAPI
cordebugprocess_ThreadForFiberCookie(ICorDebugProcess
*iface
,
332 DWORD fiberCookie
, ICorDebugThread
**ppThread
)
334 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
335 FIXME("stub %p\n", This
);
339 static HRESULT WINAPI
cordebugprocess_GetHelperThreadID(ICorDebugProcess
*iface
,
342 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
343 FIXME("stub %p\n", This
);
348 /***************************************/
349 static const ICorDebugProcessVtbl cordebugprocessVtbl
= {
350 cordebugprocess_QueryInterface
,
351 cordebugprocess_AddRef
,
352 cordebugprocess_Release
,
353 cordebugprocess_Stop
,
354 cordebugprocess_Continue
,
355 cordebugprocess_IsRunning
,
356 cordebugprocess_HasQueuedCallbacks
,
357 cordebugprocess_EnumerateThreads
,
358 cordebugprocess_SetAllThreadsDebugState
,
359 cordebugprocess_Detach
,
360 cordebugprocess_Terminate
,
361 cordebugprocess_CanCommitChanges
,
362 cordebugprocess_CommitChanges
,
363 cordebugprocess_GetID
,
364 cordebugprocess_GetHandle
,
365 cordebugprocess_GetThread
,
366 cordebugprocess_EnumerateObjects
,
367 cordebugprocess_IsTransitionStub
,
368 cordebugprocess_IsOSSuspended
,
369 cordebugprocess_GetThreadContext
,
370 cordebugprocess_SetThreadContext
,
371 cordebugprocess_ReadMemory
,
372 cordebugprocess_WriteMemory
,
373 cordebugprocess_ClearCurrentException
,
374 cordebugprocess_EnableLogMessages
,
375 cordebugprocess_ModifyLogSwitch
,
376 cordebugprocess_EnumerateAppDomains
,
377 cordebugprocess_GetObject
,
378 cordebugprocess_ThreadForFiberCookie
,
379 cordebugprocess_GetHelperThreadID
383 static HRESULT
CorDebugProcess_Create(CorDebug
*cordebug
, IUnknown
** ppUnk
, LPPROCESS_INFORMATION lpProcessInformation
)
387 This
= HeapAlloc( GetProcessHeap(), 0, sizeof *This
);
389 return E_OUTOFMEMORY
;
391 if(!DuplicateHandle(GetCurrentProcess(), lpProcessInformation
->hProcess
,
392 GetCurrentProcess(), &This
->handle
, 0, FALSE
, DUPLICATE_SAME_ACCESS
))
394 ERR("Failed to duplicate process handle\n");
395 HeapFree(GetProcessHeap(), 0, This
);
398 if(!DuplicateHandle(GetCurrentProcess(), lpProcessInformation
->hThread
,
399 GetCurrentProcess(), &This
->thread
, 0, FALSE
, DUPLICATE_SAME_ACCESS
))
401 CloseHandle(This
->handle
);
403 ERR("Failed to duplicate thread handle\n");
404 HeapFree(GetProcessHeap(), 0, This
);
408 This
->ICorDebugProcess_iface
.lpVtbl
= &cordebugprocessVtbl
;
410 This
->cordebug
= cordebug
;
411 This
->dwProcessID
= lpProcessInformation
->dwProcessId
;
414 ICorDebug_AddRef(&This
->cordebug
->ICorDebug_iface
);
416 *ppUnk
= (IUnknown
*)This
;
421 /* ICorDebugProcessEnum Interface */
422 static HRESULT WINAPI
process_enum_QueryInterface(ICorDebugProcessEnum
*iface
, REFIID riid
, void **ppvObject
)
424 CorDebug
*This
= impl_from_ICorDebugProcessEnum(iface
);
426 TRACE("%p %s %p\n", This
, debugstr_guid(riid
), ppvObject
);
428 if ( IsEqualGUID( riid
, &IID_ICorDebugProcessEnum
) ||
429 IsEqualGUID( riid
, &IID_ICorDebugEnum
) ||
430 IsEqualGUID( riid
, &IID_IUnknown
) )
432 *ppvObject
= &This
->ICorDebugProcessEnum_iface
;
436 FIXME("Unsupported interface %s\n", debugstr_guid(riid
));
437 return E_NOINTERFACE
;
440 ICorDebug_AddRef(iface
);
445 static ULONG WINAPI
process_enum_AddRef(ICorDebugProcessEnum
*iface
)
447 CorDebug
*This
= impl_from_ICorDebugProcessEnum(iface
);
448 TRACE("%p ref=%u\n", This
, This
->ref
);
450 return ICorDebug_AddRef(&This
->ICorDebug_iface
);
453 static ULONG WINAPI
process_enum_Release(ICorDebugProcessEnum
*iface
)
455 CorDebug
*This
= impl_from_ICorDebugProcessEnum(iface
);
456 TRACE("%p ref=%u\n", This
, This
->ref
);
458 return ICorDebug_Release(&This
->ICorDebug_iface
);
461 static HRESULT WINAPI
process_enum_Skip(ICorDebugProcessEnum
*iface
, ULONG celt
)
463 CorDebug
*This
= impl_from_ICorDebugProcessEnum(iface
);
464 FIXME("stub %p\n", This
);
468 static HRESULT WINAPI
process_enum_Reset(ICorDebugProcessEnum
*iface
)
470 CorDebug
*This
= impl_from_ICorDebugProcessEnum(iface
);
471 FIXME("stub %p\n", This
);
475 static HRESULT WINAPI
process_enum_Clone(ICorDebugProcessEnum
*iface
, ICorDebugEnum
**ppEnum
)
477 CorDebug
*This
= impl_from_ICorDebugProcessEnum(iface
);
478 FIXME("stub %p %p\n", This
, ppEnum
);
482 static HRESULT WINAPI
process_enum_GetCount(ICorDebugProcessEnum
*iface
, ULONG
*pcelt
)
484 CorDebug
*This
= impl_from_ICorDebugProcessEnum(iface
);
485 TRACE("stub %p %p\n", This
, pcelt
);
490 *pcelt
= list_count(&This
->processes
);
495 static HRESULT WINAPI
process_enum_Next(ICorDebugProcessEnum
*iface
, ULONG celt
,
496 ICorDebugProcess
* processes
[], ULONG
*pceltFetched
)
498 CorDebug
*This
= impl_from_ICorDebugProcessEnum(iface
);
499 FIXME("stub %p %d %p %p\n", This
, celt
, processes
, pceltFetched
);
503 static const struct ICorDebugProcessEnumVtbl processenum_vtbl
=
505 process_enum_QueryInterface
,
507 process_enum_Release
,
511 process_enum_GetCount
,
515 /*** IUnknown methods ***/
516 static HRESULT WINAPI
CorDebug_QueryInterface(ICorDebug
*iface
, REFIID riid
, void **ppvObject
)
518 CorDebug
*This
= impl_from_ICorDebug( iface
);
520 TRACE("%p %s %p\n", This
, debugstr_guid(riid
), ppvObject
);
522 if ( IsEqualGUID( riid
, &IID_ICorDebug
) ||
523 IsEqualGUID( riid
, &IID_IUnknown
) )
525 *ppvObject
= &This
->ICorDebug_iface
;
529 FIXME("Unsupported interface %s\n", debugstr_guid(riid
));
530 return E_NOINTERFACE
;
533 ICorDebug_AddRef( iface
);
538 static ULONG WINAPI
CorDebug_AddRef(ICorDebug
*iface
)
540 CorDebug
*This
= impl_from_ICorDebug( iface
);
541 ULONG ref
= InterlockedIncrement(&This
->ref
);
543 TRACE("%p ref=%u\n", This
, ref
);
548 static ULONG WINAPI
CorDebug_Release(ICorDebug
*iface
)
550 CorDebug
*This
= impl_from_ICorDebug( iface
);
551 ULONG ref
= InterlockedDecrement(&This
->ref
);
553 TRACE("%p ref=%u\n", This
, ref
);
557 if(!list_empty(&This
->processes
))
558 ERR("Processes haven't been removed Correctly\n");
560 if(This
->runtimehost
)
561 ICLRRuntimeHost_Release(This
->runtimehost
);
564 ICorDebugManagedCallback2_Release(This
->pCallback2
);
567 ICorDebugManagedCallback_Release(This
->pCallback
);
569 HeapFree(GetProcessHeap(), 0, This
);
575 /*** ICorDebug methods ***/
576 static HRESULT WINAPI
CorDebug_Initialize(ICorDebug
*iface
)
578 CorDebug
*This
= impl_from_ICorDebug( iface
);
579 FIXME("stub %p\n", This
);
583 static HRESULT WINAPI
CorDebug_Terminate(ICorDebug
*iface
)
585 struct CorProcess
*cursor
, *cursor2
;
586 CorDebug
*This
= impl_from_ICorDebug( iface
);
587 TRACE("stub %p\n", This
);
589 LIST_FOR_EACH_ENTRY_SAFE(cursor
, cursor2
, &This
->processes
, struct CorProcess
, entry
)
593 ICorDebugProcess_Terminate(cursor
->pProcess
, 0);
594 ICorDebugProcess_Release(cursor
->pProcess
);
597 list_remove(&cursor
->entry
);
598 HeapFree(GetProcessHeap(), 0, cursor
);
604 static HRESULT WINAPI
CorDebug_SetManagedHandler(ICorDebug
*iface
, ICorDebugManagedCallback
*pCallback
)
606 CorDebug
*This
= impl_from_ICorDebug( iface
);
608 ICorDebugManagedCallback2
*pCallback2
;
610 TRACE("%p (%p)\n", This
, pCallback
);
615 hr
= ICorDebugManagedCallback_QueryInterface(pCallback
, &IID_ICorDebugManagedCallback2
, (void**)&pCallback2
);
619 ICorDebugManagedCallback2_Release(This
->pCallback2
);
622 ICorDebugManagedCallback_Release(This
->pCallback
);
624 This
->pCallback
= pCallback
;
625 This
->pCallback2
= pCallback2
;
627 ICorDebugManagedCallback_AddRef(This
->pCallback
);
631 WARN("Debugging without interface ICorDebugManagedCallback2 is currently not supported.\n");
637 static HRESULT WINAPI
CorDebug_SetUnmanagedHandler(ICorDebug
*iface
, ICorDebugUnmanagedCallback
*pCallback
)
639 CorDebug
*This
= impl_from_ICorDebug( iface
);
640 FIXME("stub %p %p\n", This
, pCallback
);
644 static HRESULT WINAPI
CorDebug_CreateProcess(ICorDebug
*iface
, LPCWSTR lpApplicationName
,
645 LPWSTR lpCommandLine
, LPSECURITY_ATTRIBUTES lpProcessAttributes
,
646 LPSECURITY_ATTRIBUTES lpThreadAttributes
, BOOL bInheritHandles
,
647 DWORD dwCreationFlags
, PVOID lpEnvironment
,LPCWSTR lpCurrentDirectory
,
648 LPSTARTUPINFOW lpStartupInfo
, LPPROCESS_INFORMATION lpProcessInformation
,
649 CorDebugCreateProcessFlags debuggingFlags
, ICorDebugProcess
**ppProcess
)
651 CorDebug
*This
= impl_from_ICorDebug( iface
);
652 ICorDebugProcess
*pDebugProcess
;
655 TRACE("stub %p %s %s %p %p %d %d %p %s %p %p %d %p\n", This
, debugstr_w(lpApplicationName
),
656 debugstr_w(lpCommandLine
), lpProcessAttributes
, lpThreadAttributes
,
657 bInheritHandles
, dwCreationFlags
, lpEnvironment
, debugstr_w(lpCurrentDirectory
),
658 lpStartupInfo
, lpProcessInformation
, debuggingFlags
, ppProcess
);
660 if(CreateProcessW(lpApplicationName
, lpCommandLine
, lpProcessAttributes
, lpThreadAttributes
,
661 bInheritHandles
, dwCreationFlags
| CREATE_SUSPENDED
, lpEnvironment
, lpCurrentDirectory
,
662 lpStartupInfo
, lpProcessInformation
))
664 hr
= CorDebugProcess_Create(This
, (IUnknown
**)&pDebugProcess
, lpProcessInformation
);
667 struct CorProcess
*new_process
= HeapAlloc( GetProcessHeap(), 0, sizeof(CorProcess
) );
669 new_process
->pProcess
= pDebugProcess
;
670 list_add_tail(&This
->processes
, &new_process
->entry
);
672 ICorDebugProcess_AddRef(pDebugProcess
);
673 *ppProcess
= pDebugProcess
;
676 ICorDebugManagedCallback_CreateProcess(This
->pCallback
, pDebugProcess
);
680 TerminateProcess(lpProcessInformation
->hProcess
, 0);
689 static HRESULT WINAPI
CorDebug_DebugActiveProcess(ICorDebug
*iface
, DWORD id
, BOOL win32Attach
,
690 ICorDebugProcess
**ppProcess
)
692 CorDebug
*This
= impl_from_ICorDebug( iface
);
693 FIXME("stub %p %d %d %p\n", This
, id
, win32Attach
, ppProcess
);
697 static HRESULT WINAPI
CorDebug_EnumerateProcesses( ICorDebug
*iface
, ICorDebugProcessEnum
**ppProcess
)
699 CorDebug
*This
= impl_from_ICorDebug( iface
);
700 TRACE("stub %p %p\n", This
, ppProcess
);
705 *ppProcess
= &This
->ICorDebugProcessEnum_iface
;
706 ICorDebugProcessEnum_AddRef(*ppProcess
);
711 static HRESULT WINAPI
CorDebug_GetProcess(ICorDebug
*iface
, DWORD dwProcessId
, ICorDebugProcess
**ppProcess
)
713 CorDebug
*This
= impl_from_ICorDebug( iface
);
714 FIXME("stub %p %d %p\n", This
, dwProcessId
, ppProcess
);
718 static HRESULT WINAPI
CorDebug_CanLaunchOrAttach(ICorDebug
*iface
, DWORD dwProcessId
,
719 BOOL win32DebuggingEnabled
)
721 CorDebug
*This
= impl_from_ICorDebug( iface
);
722 FIXME("stub %p %d %d\n", This
, dwProcessId
, win32DebuggingEnabled
);
726 static const struct ICorDebugVtbl cordebug_vtbl
=
728 CorDebug_QueryInterface
,
733 CorDebug_SetManagedHandler
,
734 CorDebug_SetUnmanagedHandler
,
735 CorDebug_CreateProcess
,
736 CorDebug_DebugActiveProcess
,
737 CorDebug_EnumerateProcesses
,
739 CorDebug_CanLaunchOrAttach
742 HRESULT
CorDebug_Create(ICLRRuntimeHost
*runtimehost
, IUnknown
** ppUnk
)
746 This
= HeapAlloc( GetProcessHeap(), 0, sizeof *This
);
748 return E_OUTOFMEMORY
;
750 This
->ICorDebug_iface
.lpVtbl
= &cordebug_vtbl
;
751 This
->ICorDebugProcessEnum_iface
.lpVtbl
= &processenum_vtbl
;
753 This
->pCallback
= NULL
;
754 This
->pCallback2
= NULL
;
755 This
->runtimehost
= runtimehost
;
757 list_init(&This
->processes
);
759 if(This
->runtimehost
)
760 ICLRRuntimeHost_AddRef(This
->runtimehost
);
762 *ppUnk
= (IUnknown
*)This
;