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 #define WIN32_NO_STATUS
22 #define COM_NO_WINDOWS_H
31 //#include "winuser.h"
35 //#include "shellapi.h"
36 //#include "mscoree.h"
40 #include <wine/list.h>
41 #include "mscoree_private.h"
42 #include <wine/debug.h>
45 WINE_DEFAULT_DEBUG_CHANNEL( mscoree
);
47 typedef struct DebugProcess
49 ICorDebugProcess ICorDebugProcess_iface
;
60 static inline CorDebug
*impl_from_ICorDebug( ICorDebug
*iface
)
62 return CONTAINING_RECORD(iface
, CorDebug
, ICorDebug_iface
);
65 static inline CorDebug
*impl_from_ICorDebugProcessEnum( ICorDebugProcessEnum
*iface
)
67 return CONTAINING_RECORD(iface
, CorDebug
, ICorDebugProcessEnum_iface
);
70 static inline DebugProcess
*impl_from_ICorDebugProcess( ICorDebugProcess
*iface
)
72 return CONTAINING_RECORD(iface
, DebugProcess
, ICorDebugProcess_iface
);
75 /* ICorDebugProcess Interface */
76 static HRESULT WINAPI
cordebugprocess_QueryInterface(ICorDebugProcess
*iface
,
77 REFIID riid
, void **ppvObject
)
79 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
81 TRACE("%p %s %p\n", This
, debugstr_guid(riid
), ppvObject
);
83 if ( IsEqualGUID( riid
, &IID_ICorDebugProcess
) ||
84 IsEqualGUID( riid
, &IID_ICorDebugController
) ||
85 IsEqualGUID( riid
, &IID_IUnknown
) )
87 *ppvObject
= &This
->ICorDebugProcess_iface
;
91 FIXME("Unsupported interface %s\n", debugstr_guid(riid
));
95 ICorDebug_AddRef(iface
);
100 static ULONG WINAPI
cordebugprocess_AddRef(ICorDebugProcess
*iface
)
102 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
103 ULONG ref
= InterlockedIncrement(&This
->ref
);
105 TRACE("%p ref=%u\n", This
, ref
);
110 static ULONG WINAPI
cordebugprocess_Release(ICorDebugProcess
*iface
)
112 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
113 ULONG ref
= InterlockedDecrement(&This
->ref
);
115 TRACE("%p ref=%u\n", This
, ref
);
120 CloseHandle(This
->handle
);
123 CloseHandle(This
->thread
);
126 ICorDebug_Release(&This
->cordebug
->ICorDebug_iface
);
128 HeapFree(GetProcessHeap(), 0, This
);
134 static HRESULT WINAPI
cordebugprocess_Stop(ICorDebugProcess
*iface
, DWORD dwTimeoutIgnored
)
136 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
137 FIXME("stub %p\n", This
);
141 static HRESULT WINAPI
cordebugprocess_Continue(ICorDebugProcess
*iface
, BOOL fIsOutOfBand
)
143 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
147 ResumeThread(This
->thread
);
152 static HRESULT WINAPI
cordebugprocess_IsRunning(ICorDebugProcess
*iface
, BOOL
*pbRunning
)
154 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
155 FIXME("stub %p\n", This
);
159 static HRESULT WINAPI
cordebugprocess_HasQueuedCallbacks(ICorDebugProcess
*iface
,
160 ICorDebugThread
*pThread
, BOOL
*pbQueued
)
162 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
163 FIXME("stub %p\n", This
);
167 static HRESULT WINAPI
cordebugprocess_EnumerateThreads(ICorDebugProcess
*iface
,
168 ICorDebugThreadEnum
**ppThreads
)
170 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
171 FIXME("stub %p\n", This
);
175 static HRESULT WINAPI
cordebugprocess_SetAllThreadsDebugState(ICorDebugProcess
*iface
,
176 CorDebugThreadState state
, ICorDebugThread
*pExceptThisThread
)
178 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
179 FIXME("stub %p\n", This
);
183 static HRESULT WINAPI
cordebugprocess_Detach(ICorDebugProcess
*iface
)
185 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
186 FIXME("stub %p\n", This
);
190 static HRESULT WINAPI
cordebugprocess_Terminate(ICorDebugProcess
*iface
, UINT exitCode
)
192 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
199 ret
= TerminateProcess(This
->handle
, exitCode
);
200 CloseHandle(This
->handle
);
203 return ret
? S_OK
: E_FAIL
;
206 static HRESULT WINAPI
cordebugprocess_CanCommitChanges(ICorDebugProcess
*iface
,
207 ULONG cSnapshots
, ICorDebugEditAndContinueSnapshot
* pSnapshots
[],
208 ICorDebugErrorInfoEnum
**pError
)
210 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
211 FIXME("stub %p\n", This
);
215 static HRESULT WINAPI
cordebugprocess_CommitChanges(ICorDebugProcess
*iface
,
216 ULONG cSnapshots
, ICorDebugEditAndContinueSnapshot
* pSnapshots
[],
217 ICorDebugErrorInfoEnum
**pError
)
219 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
220 FIXME("stub %p\n", This
);
224 static HRESULT WINAPI
cordebugprocess_GetID(ICorDebugProcess
*iface
, DWORD
*pdwProcessId
)
226 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
232 *pdwProcessId
= This
->dwProcessID
;
237 static HRESULT WINAPI
cordebugprocess_GetHandle(ICorDebugProcess
*iface
, HPROCESS
*phProcessHandle
)
239 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
245 *phProcessHandle
= This
->handle
;
250 static HRESULT WINAPI
cordebugprocess_GetThread(ICorDebugProcess
*iface
, DWORD dwThreadId
,
251 ICorDebugThread
**ppThread
)
253 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
254 FIXME("stub %p\n", This
);
258 static HRESULT WINAPI
cordebugprocess_EnumerateObjects(ICorDebugProcess
*iface
,
259 ICorDebugObjectEnum
**ppObjects
)
261 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
262 FIXME("stub %p\n", This
);
266 static HRESULT WINAPI
cordebugprocess_IsTransitionStub(ICorDebugProcess
*iface
,
267 CORDB_ADDRESS address
, BOOL
*pbTransitionStub
)
269 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
270 FIXME("stub %p\n", This
);
274 static HRESULT WINAPI
cordebugprocess_IsOSSuspended(ICorDebugProcess
*iface
,
275 DWORD threadID
, BOOL
*pbSuspended
)
277 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
278 FIXME("stub %p\n", This
);
282 static HRESULT WINAPI
cordebugprocess_GetThreadContext(ICorDebugProcess
*iface
,
283 DWORD threadID
, ULONG32 contextSize
, BYTE context
[])
285 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
286 FIXME("stub %p\n", This
);
290 static HRESULT WINAPI
cordebugprocess_SetThreadContext(ICorDebugProcess
*iface
,
291 DWORD threadID
, ULONG32 contextSize
, BYTE context
[])
293 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
294 FIXME("stub %p\n", This
);
298 static HRESULT WINAPI
cordebugprocess_ReadMemory(ICorDebugProcess
*iface
,
299 CORDB_ADDRESS address
, DWORD size
, BYTE buffer
[],
302 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
303 FIXME("stub %p\n", This
);
307 static HRESULT WINAPI
cordebugprocess_WriteMemory(ICorDebugProcess
*iface
,
308 CORDB_ADDRESS address
, DWORD size
, BYTE buffer
[],
311 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
312 FIXME("stub %p\n", This
);
316 static HRESULT WINAPI
cordebugprocess_ClearCurrentException(ICorDebugProcess
*iface
,
319 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
320 FIXME("stub %p\n", This
);
324 static HRESULT WINAPI
cordebugprocess_EnableLogMessages(ICorDebugProcess
*iface
,
327 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
328 FIXME("stub %p\n", This
);
332 static HRESULT WINAPI
cordebugprocess_ModifyLogSwitch(ICorDebugProcess
*iface
,
333 WCHAR
*pLogSwitchName
, LONG lLevel
)
335 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
336 FIXME("stub %p\n", This
);
340 static HRESULT WINAPI
cordebugprocess_EnumerateAppDomains(ICorDebugProcess
*iface
,
341 ICorDebugAppDomainEnum
**ppAppDomains
)
343 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
344 FIXME("stub %p\n", This
);
348 static HRESULT WINAPI
cordebugprocess_GetObject(ICorDebugProcess
*iface
,
349 ICorDebugValue
**ppObject
)
351 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
352 FIXME("stub %p\n", This
);
356 static HRESULT WINAPI
cordebugprocess_ThreadForFiberCookie(ICorDebugProcess
*iface
,
357 DWORD fiberCookie
, ICorDebugThread
**ppThread
)
359 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
360 FIXME("stub %p\n", This
);
364 static HRESULT WINAPI
cordebugprocess_GetHelperThreadID(ICorDebugProcess
*iface
,
367 DebugProcess
*This
= impl_from_ICorDebugProcess(iface
);
368 FIXME("stub %p\n", This
);
373 /***************************************/
374 static const ICorDebugProcessVtbl cordebugprocessVtbl
= {
375 cordebugprocess_QueryInterface
,
376 cordebugprocess_AddRef
,
377 cordebugprocess_Release
,
378 cordebugprocess_Stop
,
379 cordebugprocess_Continue
,
380 cordebugprocess_IsRunning
,
381 cordebugprocess_HasQueuedCallbacks
,
382 cordebugprocess_EnumerateThreads
,
383 cordebugprocess_SetAllThreadsDebugState
,
384 cordebugprocess_Detach
,
385 cordebugprocess_Terminate
,
386 cordebugprocess_CanCommitChanges
,
387 cordebugprocess_CommitChanges
,
388 cordebugprocess_GetID
,
389 cordebugprocess_GetHandle
,
390 cordebugprocess_GetThread
,
391 cordebugprocess_EnumerateObjects
,
392 cordebugprocess_IsTransitionStub
,
393 cordebugprocess_IsOSSuspended
,
394 cordebugprocess_GetThreadContext
,
395 cordebugprocess_SetThreadContext
,
396 cordebugprocess_ReadMemory
,
397 cordebugprocess_WriteMemory
,
398 cordebugprocess_ClearCurrentException
,
399 cordebugprocess_EnableLogMessages
,
400 cordebugprocess_ModifyLogSwitch
,
401 cordebugprocess_EnumerateAppDomains
,
402 cordebugprocess_GetObject
,
403 cordebugprocess_ThreadForFiberCookie
,
404 cordebugprocess_GetHelperThreadID
408 static HRESULT
CorDebugProcess_Create(CorDebug
*cordebug
, IUnknown
** ppUnk
, LPPROCESS_INFORMATION lpProcessInformation
)
412 This
= HeapAlloc( GetProcessHeap(), 0, sizeof *This
);
414 return E_OUTOFMEMORY
;
416 if(!DuplicateHandle(GetCurrentProcess(), lpProcessInformation
->hProcess
,
417 GetCurrentProcess(), &This
->handle
, 0, FALSE
, DUPLICATE_SAME_ACCESS
))
419 ERR("Failed to duplicate process handle\n");
420 HeapFree(GetProcessHeap(), 0, This
);
423 if(!DuplicateHandle(GetCurrentProcess(), lpProcessInformation
->hThread
,
424 GetCurrentProcess(), &This
->thread
, 0, FALSE
, DUPLICATE_SAME_ACCESS
))
426 CloseHandle(This
->handle
);
428 ERR("Failed to duplicate thread handle\n");
429 HeapFree(GetProcessHeap(), 0, This
);
433 This
->ICorDebugProcess_iface
.lpVtbl
= &cordebugprocessVtbl
;
435 This
->cordebug
= cordebug
;
436 This
->dwProcessID
= lpProcessInformation
->dwProcessId
;
439 ICorDebug_AddRef(&This
->cordebug
->ICorDebug_iface
);
441 *ppUnk
= (IUnknown
*)This
;
446 /* ICorDebugProcessEnum Interface */
447 static HRESULT WINAPI
process_enum_QueryInterface(ICorDebugProcessEnum
*iface
, REFIID riid
, void **ppvObject
)
449 CorDebug
*This
= impl_from_ICorDebugProcessEnum(iface
);
451 TRACE("%p %s %p\n", This
, debugstr_guid(riid
), ppvObject
);
453 if ( IsEqualGUID( riid
, &IID_ICorDebugProcessEnum
) ||
454 IsEqualGUID( riid
, &IID_ICorDebugEnum
) ||
455 IsEqualGUID( riid
, &IID_IUnknown
) )
457 *ppvObject
= &This
->ICorDebugProcessEnum_iface
;
461 FIXME("Unsupported interface %s\n", debugstr_guid(riid
));
462 return E_NOINTERFACE
;
465 ICorDebug_AddRef(iface
);
470 static ULONG WINAPI
process_enum_AddRef(ICorDebugProcessEnum
*iface
)
472 CorDebug
*This
= impl_from_ICorDebugProcessEnum(iface
);
473 TRACE("%p ref=%u\n", This
, This
->ref
);
475 return ICorDebug_AddRef(&This
->ICorDebug_iface
);
478 static ULONG WINAPI
process_enum_Release(ICorDebugProcessEnum
*iface
)
480 CorDebug
*This
= impl_from_ICorDebugProcessEnum(iface
);
481 TRACE("%p ref=%u\n", This
, This
->ref
);
483 return ICorDebug_Release(&This
->ICorDebug_iface
);
486 static HRESULT WINAPI
process_enum_Skip(ICorDebugProcessEnum
*iface
, ULONG celt
)
488 CorDebug
*This
= impl_from_ICorDebugProcessEnum(iface
);
489 FIXME("stub %p\n", This
);
493 static HRESULT WINAPI
process_enum_Reset(ICorDebugProcessEnum
*iface
)
495 CorDebug
*This
= impl_from_ICorDebugProcessEnum(iface
);
496 FIXME("stub %p\n", This
);
500 static HRESULT WINAPI
process_enum_Clone(ICorDebugProcessEnum
*iface
, ICorDebugEnum
**ppEnum
)
502 CorDebug
*This
= impl_from_ICorDebugProcessEnum(iface
);
503 FIXME("stub %p %p\n", This
, ppEnum
);
507 static HRESULT WINAPI
process_enum_GetCount(ICorDebugProcessEnum
*iface
, ULONG
*pcelt
)
509 CorDebug
*This
= impl_from_ICorDebugProcessEnum(iface
);
510 TRACE("stub %p %p\n", This
, pcelt
);
515 *pcelt
= list_count(&This
->processes
);
520 static HRESULT WINAPI
process_enum_Next(ICorDebugProcessEnum
*iface
, ULONG celt
,
521 ICorDebugProcess
* processes
[], ULONG
*pceltFetched
)
523 CorDebug
*This
= impl_from_ICorDebugProcessEnum(iface
);
524 FIXME("stub %p %d %p %p\n", This
, celt
, processes
, pceltFetched
);
528 static const struct ICorDebugProcessEnumVtbl processenum_vtbl
=
530 process_enum_QueryInterface
,
532 process_enum_Release
,
536 process_enum_GetCount
,
540 /*** IUnknown methods ***/
541 static HRESULT WINAPI
CorDebug_QueryInterface(ICorDebug
*iface
, REFIID riid
, void **ppvObject
)
543 CorDebug
*This
= impl_from_ICorDebug( iface
);
545 TRACE("%p %s %p\n", This
, debugstr_guid(riid
), ppvObject
);
547 if ( IsEqualGUID( riid
, &IID_ICorDebug
) ||
548 IsEqualGUID( riid
, &IID_IUnknown
) )
550 *ppvObject
= &This
->ICorDebug_iface
;
554 FIXME("Unsupported interface %s\n", debugstr_guid(riid
));
555 return E_NOINTERFACE
;
558 ICorDebug_AddRef( iface
);
563 static ULONG WINAPI
CorDebug_AddRef(ICorDebug
*iface
)
565 CorDebug
*This
= impl_from_ICorDebug( iface
);
566 ULONG ref
= InterlockedIncrement(&This
->ref
);
568 TRACE("%p ref=%u\n", This
, ref
);
573 static ULONG WINAPI
CorDebug_Release(ICorDebug
*iface
)
575 CorDebug
*This
= impl_from_ICorDebug( iface
);
576 ULONG ref
= InterlockedDecrement(&This
->ref
);
578 TRACE("%p ref=%u\n", This
, ref
);
582 if(!list_empty(&This
->processes
))
583 ERR("Processes haven't been removed Correctly\n");
585 if(This
->runtimehost
)
586 ICLRRuntimeHost_Release(This
->runtimehost
);
589 ICorDebugManagedCallback2_Release(This
->pCallback2
);
592 ICorDebugManagedCallback_Release(This
->pCallback
);
594 HeapFree(GetProcessHeap(), 0, This
);
600 /*** ICorDebug methods ***/
601 static HRESULT WINAPI
CorDebug_Initialize(ICorDebug
*iface
)
603 CorDebug
*This
= impl_from_ICorDebug( iface
);
604 FIXME("stub %p\n", This
);
608 static HRESULT WINAPI
CorDebug_Terminate(ICorDebug
*iface
)
610 struct CorProcess
*cursor
, *cursor2
;
611 CorDebug
*This
= impl_from_ICorDebug( iface
);
612 TRACE("stub %p\n", This
);
614 LIST_FOR_EACH_ENTRY_SAFE(cursor
, cursor2
, &This
->processes
, struct CorProcess
, entry
)
618 ICorDebugProcess_Terminate(cursor
->pProcess
, 0);
619 ICorDebugProcess_Release(cursor
->pProcess
);
622 list_remove(&cursor
->entry
);
623 HeapFree(GetProcessHeap(), 0, cursor
);
629 static HRESULT WINAPI
CorDebug_SetManagedHandler(ICorDebug
*iface
, ICorDebugManagedCallback
*pCallback
)
631 CorDebug
*This
= impl_from_ICorDebug( iface
);
633 ICorDebugManagedCallback2
*pCallback2
;
635 TRACE("%p (%p)\n", This
, pCallback
);
640 hr
= ICorDebugManagedCallback_QueryInterface(pCallback
, &IID_ICorDebugManagedCallback2
, (void**)&pCallback2
);
644 ICorDebugManagedCallback2_Release(This
->pCallback2
);
647 ICorDebugManagedCallback_Release(This
->pCallback
);
649 This
->pCallback
= pCallback
;
650 This
->pCallback2
= pCallback2
;
652 ICorDebugManagedCallback_AddRef(This
->pCallback
);
656 WARN("Debugging without interface ICorDebugManagedCallback2 is currently not supported.\n");
662 static HRESULT WINAPI
CorDebug_SetUnmanagedHandler(ICorDebug
*iface
, ICorDebugUnmanagedCallback
*pCallback
)
664 CorDebug
*This
= impl_from_ICorDebug( iface
);
665 FIXME("stub %p %p\n", This
, pCallback
);
669 static HRESULT WINAPI
CorDebug_CreateProcess(ICorDebug
*iface
, LPCWSTR lpApplicationName
,
670 LPWSTR lpCommandLine
, LPSECURITY_ATTRIBUTES lpProcessAttributes
,
671 LPSECURITY_ATTRIBUTES lpThreadAttributes
, BOOL bInheritHandles
,
672 DWORD dwCreationFlags
, PVOID lpEnvironment
,LPCWSTR lpCurrentDirectory
,
673 LPSTARTUPINFOW lpStartupInfo
, LPPROCESS_INFORMATION lpProcessInformation
,
674 CorDebugCreateProcessFlags debuggingFlags
, ICorDebugProcess
**ppProcess
)
676 CorDebug
*This
= impl_from_ICorDebug( iface
);
677 ICorDebugProcess
*pDebugProcess
;
680 TRACE("stub %p %s %s %p %p %d %d %p %s %p %p %d %p\n", This
, debugstr_w(lpApplicationName
),
681 debugstr_w(lpCommandLine
), lpProcessAttributes
, lpThreadAttributes
,
682 bInheritHandles
, dwCreationFlags
, lpEnvironment
, debugstr_w(lpCurrentDirectory
),
683 lpStartupInfo
, lpProcessInformation
, debuggingFlags
, ppProcess
);
685 if(CreateProcessW(lpApplicationName
, lpCommandLine
, lpProcessAttributes
, lpThreadAttributes
,
686 bInheritHandles
, dwCreationFlags
| CREATE_SUSPENDED
, lpEnvironment
, lpCurrentDirectory
,
687 lpStartupInfo
, lpProcessInformation
))
689 hr
= CorDebugProcess_Create(This
, (IUnknown
**)&pDebugProcess
, lpProcessInformation
);
692 struct CorProcess
*new_process
= HeapAlloc( GetProcessHeap(), 0, sizeof(CorProcess
) );
694 new_process
->pProcess
= pDebugProcess
;
695 list_add_tail(&This
->processes
, &new_process
->entry
);
697 ICorDebugProcess_AddRef(pDebugProcess
);
698 *ppProcess
= pDebugProcess
;
701 ICorDebugManagedCallback_CreateProcess(This
->pCallback
, pDebugProcess
);
705 TerminateProcess(lpProcessInformation
->hProcess
, 0);
714 static HRESULT WINAPI
CorDebug_DebugActiveProcess(ICorDebug
*iface
, DWORD id
, BOOL win32Attach
,
715 ICorDebugProcess
**ppProcess
)
717 CorDebug
*This
= impl_from_ICorDebug( iface
);
718 FIXME("stub %p %d %d %p\n", This
, id
, win32Attach
, ppProcess
);
722 static HRESULT WINAPI
CorDebug_EnumerateProcesses( ICorDebug
*iface
, ICorDebugProcessEnum
**ppProcess
)
724 CorDebug
*This
= impl_from_ICorDebug( iface
);
725 TRACE("stub %p %p\n", This
, ppProcess
);
730 *ppProcess
= &This
->ICorDebugProcessEnum_iface
;
731 ICorDebugProcessEnum_AddRef(*ppProcess
);
736 static HRESULT WINAPI
CorDebug_GetProcess(ICorDebug
*iface
, DWORD dwProcessId
, ICorDebugProcess
**ppProcess
)
738 CorDebug
*This
= impl_from_ICorDebug( iface
);
739 FIXME("stub %p %d %p\n", This
, dwProcessId
, ppProcess
);
743 static HRESULT WINAPI
CorDebug_CanLaunchOrAttach(ICorDebug
*iface
, DWORD dwProcessId
,
744 BOOL win32DebuggingEnabled
)
746 CorDebug
*This
= impl_from_ICorDebug( iface
);
747 FIXME("stub %p %d %d\n", This
, dwProcessId
, win32DebuggingEnabled
);
751 static const struct ICorDebugVtbl cordebug_vtbl
=
753 CorDebug_QueryInterface
,
758 CorDebug_SetManagedHandler
,
759 CorDebug_SetUnmanagedHandler
,
760 CorDebug_CreateProcess
,
761 CorDebug_DebugActiveProcess
,
762 CorDebug_EnumerateProcesses
,
764 CorDebug_CanLaunchOrAttach
767 HRESULT
CorDebug_Create(ICLRRuntimeHost
*runtimehost
, IUnknown
** ppUnk
)
771 This
= HeapAlloc( GetProcessHeap(), 0, sizeof *This
);
773 return E_OUTOFMEMORY
;
775 This
->ICorDebug_iface
.lpVtbl
= &cordebug_vtbl
;
776 This
->ICorDebugProcessEnum_iface
.lpVtbl
= &processenum_vtbl
;
778 This
->pCallback
= NULL
;
779 This
->pCallback2
= NULL
;
780 This
->runtimehost
= runtimehost
;
782 list_init(&This
->processes
);
784 if(This
->runtimehost
)
785 ICLRRuntimeHost_AddRef(This
->runtimehost
);
787 *ppUnk
= (IUnknown
*)This
;