ReactOS 0.4.16-dev-2359-g4b75ec5
cordebug.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winnls.h"
#include "winreg.h"
#include "ole2.h"
#include "shellapi.h"
#include "mscoree.h"
#include "corhdr.h"
#include "metahost.h"
#include "cordebug.h"
#include "wine/list.h"
#include "mscoree_private.h"
#include "wine/debug.h"
Include dependency graph for cordebug.c:

Go to the source code of this file.

Classes

struct  DebugProcess
 

Macros

#define COBJMACROS
 

Typedefs

typedef struct DebugProcess DebugProcess
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (mscoree)
 
static CorDebugimpl_from_ICorDebug (ICorDebug *iface)
 
static CorDebugimpl_from_ICorDebugProcessEnum (ICorDebugProcessEnum *iface)
 
static DebugProcessimpl_from_ICorDebugProcess (ICorDebugProcess *iface)
 
static HRESULT WINAPI cordebugprocess_QueryInterface (ICorDebugProcess *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI cordebugprocess_AddRef (ICorDebugProcess *iface)
 
static ULONG WINAPI cordebugprocess_Release (ICorDebugProcess *iface)
 
static HRESULT WINAPI cordebugprocess_Stop (ICorDebugProcess *iface, DWORD dwTimeoutIgnored)
 
static HRESULT WINAPI cordebugprocess_Continue (ICorDebugProcess *iface, BOOL fIsOutOfBand)
 
static HRESULT WINAPI cordebugprocess_IsRunning (ICorDebugProcess *iface, BOOL *pbRunning)
 
static HRESULT WINAPI cordebugprocess_HasQueuedCallbacks (ICorDebugProcess *iface, ICorDebugThread *pThread, BOOL *pbQueued)
 
static HRESULT WINAPI cordebugprocess_EnumerateThreads (ICorDebugProcess *iface, ICorDebugThreadEnum **ppThreads)
 
static HRESULT WINAPI cordebugprocess_SetAllThreadsDebugState (ICorDebugProcess *iface, CorDebugThreadState state, ICorDebugThread *pExceptThisThread)
 
static HRESULT WINAPI cordebugprocess_Detach (ICorDebugProcess *iface)
 
static HRESULT WINAPI cordebugprocess_Terminate (ICorDebugProcess *iface, UINT exitCode)
 
static HRESULT WINAPI cordebugprocess_CanCommitChanges (ICorDebugProcess *iface, ULONG cSnapshots, ICorDebugEditAndContinueSnapshot *pSnapshots[], ICorDebugErrorInfoEnum **pError)
 
static HRESULT WINAPI cordebugprocess_CommitChanges (ICorDebugProcess *iface, ULONG cSnapshots, ICorDebugEditAndContinueSnapshot *pSnapshots[], ICorDebugErrorInfoEnum **pError)
 
static HRESULT WINAPI cordebugprocess_GetID (ICorDebugProcess *iface, DWORD *pdwProcessId)
 
static HRESULT WINAPI cordebugprocess_GetHandle (ICorDebugProcess *iface, HPROCESS *phProcessHandle)
 
static HRESULT WINAPI cordebugprocess_GetThread (ICorDebugProcess *iface, DWORD dwThreadId, ICorDebugThread **ppThread)
 
static HRESULT WINAPI cordebugprocess_EnumerateObjects (ICorDebugProcess *iface, ICorDebugObjectEnum **ppObjects)
 
static HRESULT WINAPI cordebugprocess_IsTransitionStub (ICorDebugProcess *iface, CORDB_ADDRESS address, BOOL *pbTransitionStub)
 
static HRESULT WINAPI cordebugprocess_IsOSSuspended (ICorDebugProcess *iface, DWORD threadID, BOOL *pbSuspended)
 
static HRESULT WINAPI cordebugprocess_GetThreadContext (ICorDebugProcess *iface, DWORD threadID, ULONG32 contextSize, BYTE context[])
 
static HRESULT WINAPI cordebugprocess_SetThreadContext (ICorDebugProcess *iface, DWORD threadID, ULONG32 contextSize, BYTE context[])
 
static HRESULT WINAPI cordebugprocess_ReadMemory (ICorDebugProcess *iface, CORDB_ADDRESS address, DWORD size, BYTE buffer[], SIZE_T *read)
 
static HRESULT WINAPI cordebugprocess_WriteMemory (ICorDebugProcess *iface, CORDB_ADDRESS address, DWORD size, BYTE buffer[], SIZE_T *written)
 
static HRESULT WINAPI cordebugprocess_ClearCurrentException (ICorDebugProcess *iface, DWORD threadID)
 
static HRESULT WINAPI cordebugprocess_EnableLogMessages (ICorDebugProcess *iface, BOOL fOnOff)
 
static HRESULT WINAPI cordebugprocess_ModifyLogSwitch (ICorDebugProcess *iface, WCHAR *pLogSwitchName, LONG lLevel)
 
static HRESULT WINAPI cordebugprocess_EnumerateAppDomains (ICorDebugProcess *iface, ICorDebugAppDomainEnum **ppAppDomains)
 
static HRESULT WINAPI cordebugprocess_GetObject (ICorDebugProcess *iface, ICorDebugValue **ppObject)
 
static HRESULT WINAPI cordebugprocess_ThreadForFiberCookie (ICorDebugProcess *iface, DWORD fiberCookie, ICorDebugThread **ppThread)
 
static HRESULT WINAPI cordebugprocess_GetHelperThreadID (ICorDebugProcess *iface, DWORD *pThreadID)
 
static HRESULT CorDebugProcess_Create (CorDebug *cordebug, IUnknown **ppUnk, LPPROCESS_INFORMATION lpProcessInformation)
 
static HRESULT WINAPI process_enum_QueryInterface (ICorDebugProcessEnum *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI process_enum_AddRef (ICorDebugProcessEnum *iface)
 
static ULONG WINAPI process_enum_Release (ICorDebugProcessEnum *iface)
 
static HRESULT WINAPI process_enum_Skip (ICorDebugProcessEnum *iface, ULONG celt)
 
static HRESULT WINAPI process_enum_Reset (ICorDebugProcessEnum *iface)
 
static HRESULT WINAPI process_enum_Clone (ICorDebugProcessEnum *iface, ICorDebugEnum **ppEnum)
 
static HRESULT WINAPI process_enum_GetCount (ICorDebugProcessEnum *iface, ULONG *pcelt)
 
static HRESULT WINAPI process_enum_Next (ICorDebugProcessEnum *iface, ULONG celt, ICorDebugProcess *processes[], ULONG *pceltFetched)
 
static HRESULT WINAPI CorDebug_QueryInterface (ICorDebug *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI CorDebug_AddRef (ICorDebug *iface)
 
static ULONG WINAPI CorDebug_Release (ICorDebug *iface)
 
static HRESULT WINAPI CorDebug_Initialize (ICorDebug *iface)
 
static HRESULT WINAPI CorDebug_Terminate (ICorDebug *iface)
 
static HRESULT WINAPI CorDebug_SetManagedHandler (ICorDebug *iface, ICorDebugManagedCallback *pCallback)
 
static HRESULT WINAPI CorDebug_SetUnmanagedHandler (ICorDebug *iface, ICorDebugUnmanagedCallback *pCallback)
 
static HRESULT WINAPI CorDebug_CreateProcess (ICorDebug *iface, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, PVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation, CorDebugCreateProcessFlags debuggingFlags, ICorDebugProcess **ppProcess)
 
static HRESULT WINAPI CorDebug_DebugActiveProcess (ICorDebug *iface, DWORD id, BOOL win32Attach, ICorDebugProcess **ppProcess)
 
static HRESULT WINAPI CorDebug_EnumerateProcesses (ICorDebug *iface, ICorDebugProcessEnum **ppProcess)
 
static HRESULT WINAPI CorDebug_GetProcess (ICorDebug *iface, DWORD dwProcessId, ICorDebugProcess **ppProcess)
 
static HRESULT WINAPI CorDebug_CanLaunchOrAttach (ICorDebug *iface, DWORD dwProcessId, BOOL win32DebuggingEnabled)
 
HRESULT CorDebug_Create (ICLRRuntimeHost *runtimehost, IUnknown **ppUnk)
 

Variables

static const ICorDebugProcessVtbl cordebugprocessVtbl
 
static const struct ICorDebugProcessEnumVtbl processenum_vtbl
 
static const struct ICorDebugVtbl cordebug_vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 20 of file cordebug.c.

Typedef Documentation

◆ DebugProcess

Function Documentation

◆ CorDebug_AddRef()

static ULONG WINAPI CorDebug_AddRef ( ICorDebug iface)
static

Definition at line 559 of file cordebug.c.

560{
563
564 TRACE("%p ref=%lu\n", This, ref);
565
566 return ref;
567}
#define InterlockedIncrement
Definition: armddk.h:53
static CorDebug * impl_from_ICorDebug(ICorDebug *iface)
Definition: cordebug.c:56
#define TRACE(s)
Definition: solgame.cpp:4
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ CorDebug_CanLaunchOrAttach()

static HRESULT WINAPI CorDebug_CanLaunchOrAttach ( ICorDebug iface,
DWORD  dwProcessId,
BOOL  win32DebuggingEnabled 
)
static

Definition at line 739 of file cordebug.c.

741{
743 FIXME("stub %p %ld %d\n", This, dwProcessId, win32DebuggingEnabled);
744 return S_OK;
745}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define S_OK
Definition: intsafe.h:52
_In_ DWORD dwProcessId
Definition: shlwapi.h:193

◆ CorDebug_Create()

HRESULT CorDebug_Create ( ICLRRuntimeHost runtimehost,
IUnknown **  ppUnk 
)

Definition at line 763 of file cordebug.c.

764{
765 CorDebug *This;
766
767 This = malloc(sizeof *This);
768 if ( !This )
769 return E_OUTOFMEMORY;
770
771 This->ICorDebug_iface.lpVtbl = &cordebug_vtbl;
772 This->ICorDebugProcessEnum_iface.lpVtbl = &processenum_vtbl;
773 This->ref = 1;
774 This->pCallback = NULL;
775 This->pCallback2 = NULL;
776 This->runtimehost = runtimehost;
777
778 list_init(&This->processes);
779
780 if(This->runtimehost)
781 ICLRRuntimeHost_AddRef(This->runtimehost);
782
783 *ppUnk = (IUnknown*)&This->ICorDebug_iface;
784
785 return S_OK;
786}
static void list_init(struct list_entry *head)
Definition: list.h:51
static const struct ICorDebugProcessEnumVtbl processenum_vtbl
Definition: cordebug.c:524
static const struct ICorDebugVtbl cordebug_vtbl
Definition: cordebug.c:747
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112

Referenced by RuntimeHost_GetInterface().

◆ CorDebug_CreateProcess()

static HRESULT WINAPI CorDebug_CreateProcess ( ICorDebug iface,
LPCWSTR  lpApplicationName,
LPWSTR  lpCommandLine,
LPSECURITY_ATTRIBUTES  lpProcessAttributes,
LPSECURITY_ATTRIBUTES  lpThreadAttributes,
BOOL  bInheritHandles,
DWORD  dwCreationFlags,
PVOID  lpEnvironment,
LPCWSTR  lpCurrentDirectory,
LPSTARTUPINFOW  lpStartupInfo,
LPPROCESS_INFORMATION  lpProcessInformation,
CorDebugCreateProcessFlags  debuggingFlags,
ICorDebugProcess **  ppProcess 
)
static

Definition at line 665 of file cordebug.c.

671{
673 ICorDebugProcess *pDebugProcess;
674 HRESULT hr;
675
676 TRACE("stub %p %s %s %p %p %d %ld %p %s %p %p %d %p\n", This, debugstr_w(lpApplicationName),
677 debugstr_w(lpCommandLine), lpProcessAttributes, lpThreadAttributes,
678 bInheritHandles, dwCreationFlags, lpEnvironment, debugstr_w(lpCurrentDirectory),
679 lpStartupInfo, lpProcessInformation, debuggingFlags, ppProcess);
680
681 if(CreateProcessW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes,
682 bInheritHandles, dwCreationFlags | CREATE_SUSPENDED, lpEnvironment, lpCurrentDirectory,
683 lpStartupInfo, lpProcessInformation))
684 {
685 hr = CorDebugProcess_Create(This, (IUnknown**)&pDebugProcess, lpProcessInformation);
686 if(hr == S_OK)
687 {
688 struct CorProcess *new_process = malloc(sizeof(CorProcess));
689
690 new_process->pProcess = pDebugProcess;
691 list_add_tail(&This->processes, &new_process->entry);
692
693 ICorDebugProcess_AddRef(pDebugProcess);
694 *ppProcess = pDebugProcess;
695
696 if(This->pCallback)
697 ICorDebugManagedCallback_CreateProcess(This->pCallback, pDebugProcess);
698 }
699 else
700 {
701 TerminateProcess(lpProcessInformation->hProcess, 0);
702 }
703 }
704 else
705 hr = E_FAIL;
706
707 return hr;
708}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static HRESULT CorDebugProcess_Create(CorDebug *cordebug, IUnknown **ppUnk, LPPROCESS_INFORMATION lpProcessInformation)
Definition: cordebug.c:404
#define E_FAIL
Definition: ddrawi.h:102
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4442
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1376
#define debugstr_w
Definition: kernel32.h:32
HRESULT hr
Definition: shlfolder.c:183
struct list entry
ICorDebugProcess * pProcess
#define CREATE_SUSPENDED
Definition: winbase.h:182

◆ CorDebug_DebugActiveProcess()

static HRESULT WINAPI CorDebug_DebugActiveProcess ( ICorDebug iface,
DWORD  id,
BOOL  win32Attach,
ICorDebugProcess **  ppProcess 
)
static

Definition at line 710 of file cordebug.c.

712{
714 FIXME("stub %p %ld %d %p\n", This, id, win32Attach, ppProcess);
715 return E_NOTIMPL;
716}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ CorDebug_EnumerateProcesses()

static HRESULT WINAPI CorDebug_EnumerateProcesses ( ICorDebug iface,
ICorDebugProcessEnum **  ppProcess 
)
static

Definition at line 718 of file cordebug.c.

719{
721 TRACE("stub %p %p\n", This, ppProcess);
722
723 if(!ppProcess)
724 return E_INVALIDARG;
725
726 *ppProcess = &This->ICorDebugProcessEnum_iface;
727 ICorDebugProcessEnum_AddRef(*ppProcess);
728
729 return S_OK;
730}
#define E_INVALIDARG
Definition: ddrawi.h:101

◆ CorDebug_GetProcess()

static HRESULT WINAPI CorDebug_GetProcess ( ICorDebug iface,
DWORD  dwProcessId,
ICorDebugProcess **  ppProcess 
)
static

Definition at line 732 of file cordebug.c.

733{
735 FIXME("stub %p %ld %p\n", This, dwProcessId, ppProcess);
736 return E_NOTIMPL;
737}

◆ CorDebug_Initialize()

static HRESULT WINAPI CorDebug_Initialize ( ICorDebug iface)
static

Definition at line 597 of file cordebug.c.

598{
600 FIXME("stub %p\n", This);
601 return S_OK;
602}

◆ CorDebug_QueryInterface()

static HRESULT WINAPI CorDebug_QueryInterface ( ICorDebug iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 537 of file cordebug.c.

538{
540
541 TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
542
543 if ( IsEqualGUID( riid, &IID_ICorDebug ) ||
545 {
546 *ppvObject = &This->ICorDebug_iface;
547 }
548 else
549 {
550 FIXME("Unsupported interface %s\n", debugstr_guid(riid));
551 return E_NOINTERFACE;
552 }
553
554 ICorDebug_AddRef( iface );
555
556 return S_OK;
557}
const GUID IID_IUnknown
REFIID riid
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

◆ CorDebug_Release()

static ULONG WINAPI CorDebug_Release ( ICorDebug iface)
static

Definition at line 569 of file cordebug.c.

570{
573
574 TRACE("%p ref=%lu\n", This, ref);
575
576 if (ref == 0)
577 {
578 if(!list_empty(&This->processes))
579 ERR("Processes haven't been removed Correctly\n");
580
581 if(This->runtimehost)
582 ICLRRuntimeHost_Release(This->runtimehost);
583
584 if(This->pCallback2)
585 ICorDebugManagedCallback2_Release(This->pCallback2);
586
587 if(This->pCallback)
588 ICorDebugManagedCallback_Release(This->pCallback);
589
590 free(This);
591 }
592
593 return ref;
594}
#define InterlockedDecrement
Definition: armddk.h:52
static int list_empty(struct list_entry *head)
Definition: list.h:58
#define ERR(fmt,...)
Definition: precomp.h:57
#define free
Definition: debug_ros.c:5

◆ CorDebug_SetManagedHandler()

static HRESULT WINAPI CorDebug_SetManagedHandler ( ICorDebug iface,
ICorDebugManagedCallback pCallback 
)
static

Definition at line 625 of file cordebug.c.

626{
628 HRESULT hr;
629 ICorDebugManagedCallback2 *pCallback2;
630
631 TRACE("%p (%p)\n", This, pCallback);
632
633 if(!pCallback)
634 return E_INVALIDARG;
635
636 hr = ICorDebugManagedCallback_QueryInterface(pCallback, &IID_ICorDebugManagedCallback2, (void**)&pCallback2);
637 if(hr == S_OK)
638 {
639 if(This->pCallback2)
640 ICorDebugManagedCallback2_Release(This->pCallback2);
641
642 if(This->pCallback)
643 ICorDebugManagedCallback_Release(This->pCallback);
644
645 This->pCallback = pCallback;
646 This->pCallback2 = pCallback2;
647
648 ICorDebugManagedCallback_AddRef(This->pCallback);
649 }
650 else
651 {
652 WARN("Debugging without interface ICorDebugManagedCallback2 is currently not supported.\n");
653 }
654
655 return hr;
656}
#define WARN(fmt,...)
Definition: precomp.h:61
FxPnpStateCallbackInfo * pCallback

◆ CorDebug_SetUnmanagedHandler()

static HRESULT WINAPI CorDebug_SetUnmanagedHandler ( ICorDebug iface,
ICorDebugUnmanagedCallback pCallback 
)
static

Definition at line 658 of file cordebug.c.

659{
661 FIXME("stub %p %p\n", This, pCallback);
662 return E_NOTIMPL;
663}

◆ CorDebug_Terminate()

static HRESULT WINAPI CorDebug_Terminate ( ICorDebug iface)
static

Definition at line 604 of file cordebug.c.

605{
606 struct CorProcess *cursor, *cursor2;
608 TRACE("stub %p\n", This);
609
610 LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, &This->processes, struct CorProcess, entry)
611 {
612 if(cursor->pProcess)
613 {
614 ICorDebugProcess_Terminate(cursor->pProcess, 0);
615 ICorDebugProcess_Release(cursor->pProcess);
616 }
617
618 list_remove(&cursor->entry);
619 free(cursor);
620 }
621
622 return S_OK;
623}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
const char cursor[]
Definition: icontest.c:13
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204

◆ cordebugprocess_AddRef()

static ULONG WINAPI cordebugprocess_AddRef ( ICorDebugProcess iface)
static

Definition at line 96 of file cordebug.c.

97{
100
101 TRACE("%p ref=%lu\n", This, ref);
102
103 return ref;
104}
static DebugProcess * impl_from_ICorDebugProcess(ICorDebugProcess *iface)
Definition: cordebug.c:66

◆ cordebugprocess_CanCommitChanges()

static HRESULT WINAPI cordebugprocess_CanCommitChanges ( ICorDebugProcess iface,
ULONG  cSnapshots,
ICorDebugEditAndContinueSnapshot pSnapshots[],
ICorDebugErrorInfoEnum **  pError 
)
static

Definition at line 202 of file cordebug.c.

205{
207 FIXME("stub %p\n", This);
208 return E_NOTIMPL;
209}

◆ cordebugprocess_ClearCurrentException()

static HRESULT WINAPI cordebugprocess_ClearCurrentException ( ICorDebugProcess iface,
DWORD  threadID 
)
static

Definition at line 312 of file cordebug.c.

314{
316 FIXME("stub %p\n", This);
317 return E_NOTIMPL;
318}

◆ cordebugprocess_CommitChanges()

static HRESULT WINAPI cordebugprocess_CommitChanges ( ICorDebugProcess iface,
ULONG  cSnapshots,
ICorDebugEditAndContinueSnapshot pSnapshots[],
ICorDebugErrorInfoEnum **  pError 
)
static

Definition at line 211 of file cordebug.c.

214{
216 FIXME("stub %p\n", This);
217 return E_NOTIMPL;
218}

◆ cordebugprocess_Continue()

static HRESULT WINAPI cordebugprocess_Continue ( ICorDebugProcess iface,
BOOL  fIsOutOfBand 
)
static

Definition at line 137 of file cordebug.c.

138{
140 TRACE("%p\n", This);
141
142 if(This->thread)
143 ResumeThread(This->thread);
144
145 return S_OK;
146}
DWORD WINAPI ResumeThread(IN HANDLE hThread)
Definition: thread.c:567

◆ CorDebugProcess_Create()

static HRESULT CorDebugProcess_Create ( CorDebug cordebug,
IUnknown **  ppUnk,
LPPROCESS_INFORMATION  lpProcessInformation 
)
static

Definition at line 404 of file cordebug.c.

405{
407
408 This = malloc(sizeof *This);
409 if ( !This )
410 return E_OUTOFMEMORY;
411
412 if(!DuplicateHandle(GetCurrentProcess(), lpProcessInformation->hProcess,
414 {
415 ERR("Failed to duplicate process handle\n");
416 free(This);
417 return E_FAIL;
418 }
419 if(!DuplicateHandle(GetCurrentProcess(), lpProcessInformation->hThread,
421 {
422 CloseHandle(This->handle);
423
424 ERR("Failed to duplicate thread handle\n");
425 free(This);
426 return E_FAIL;
427 }
428
429 This->ICorDebugProcess_iface.lpVtbl = &cordebugprocessVtbl;
430 This->ref = 1;
431 This->cordebug = cordebug;
432 This->dwProcessID = lpProcessInformation->dwProcessId;
433
434 if(This->cordebug)
435 ICorDebug_AddRef(&This->cordebug->ICorDebug_iface);
436
437 *ppUnk = (IUnknown*)&This->ICorDebugProcess_iface;
438
439 return S_OK;
440}
static const ICorDebugProcessVtbl cordebugprocessVtbl
Definition: cordebug.c:370
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define GetCurrentProcess()
Definition: compat.h:759
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
Definition: handle.c:149
#define DUPLICATE_SAME_ACCESS

Referenced by CorDebug_CreateProcess().

◆ cordebugprocess_Detach()

static HRESULT WINAPI cordebugprocess_Detach ( ICorDebugProcess iface)
static

Definition at line 179 of file cordebug.c.

180{
182 FIXME("stub %p\n", This);
183 return E_NOTIMPL;
184}

◆ cordebugprocess_EnableLogMessages()

static HRESULT WINAPI cordebugprocess_EnableLogMessages ( ICorDebugProcess iface,
BOOL  fOnOff 
)
static

Definition at line 320 of file cordebug.c.

322{
324 FIXME("stub %p\n", This);
325 return E_NOTIMPL;
326}

◆ cordebugprocess_EnumerateAppDomains()

static HRESULT WINAPI cordebugprocess_EnumerateAppDomains ( ICorDebugProcess iface,
ICorDebugAppDomainEnum **  ppAppDomains 
)
static

Definition at line 336 of file cordebug.c.

338{
340 FIXME("stub %p\n", This);
341 return E_NOTIMPL;
342}

◆ cordebugprocess_EnumerateObjects()

static HRESULT WINAPI cordebugprocess_EnumerateObjects ( ICorDebugProcess iface,
ICorDebugObjectEnum **  ppObjects 
)
static

Definition at line 254 of file cordebug.c.

256{
258 FIXME("stub %p\n", This);
259 return E_NOTIMPL;
260}

◆ cordebugprocess_EnumerateThreads()

static HRESULT WINAPI cordebugprocess_EnumerateThreads ( ICorDebugProcess iface,
ICorDebugThreadEnum **  ppThreads 
)
static

Definition at line 163 of file cordebug.c.

165{
167 FIXME("stub %p\n", This);
168 return E_NOTIMPL;
169}

◆ cordebugprocess_GetHandle()

static HRESULT WINAPI cordebugprocess_GetHandle ( ICorDebugProcess iface,
HPROCESS phProcessHandle 
)
static

Definition at line 233 of file cordebug.c.

234{
236 TRACE("%p\n", This);
237
238 if(!phProcessHandle)
239 return E_INVALIDARG;
240
241 *phProcessHandle = This->handle;
242
243 return S_OK;
244}

◆ cordebugprocess_GetHelperThreadID()

static HRESULT WINAPI cordebugprocess_GetHelperThreadID ( ICorDebugProcess iface,
DWORD pThreadID 
)
static

Definition at line 360 of file cordebug.c.

362{
364 FIXME("stub %p\n", This);
365 return E_NOTIMPL;
366}

◆ cordebugprocess_GetID()

static HRESULT WINAPI cordebugprocess_GetID ( ICorDebugProcess iface,
DWORD pdwProcessId 
)
static

Definition at line 220 of file cordebug.c.

221{
223 TRACE("%p\n", This);
224
225 if(!pdwProcessId)
226 return E_INVALIDARG;
227
228 *pdwProcessId = This->dwProcessID;
229
230 return S_OK;
231}

◆ cordebugprocess_GetObject()

static HRESULT WINAPI cordebugprocess_GetObject ( ICorDebugProcess iface,
ICorDebugValue **  ppObject 
)
static

Definition at line 344 of file cordebug.c.

346{
348 FIXME("stub %p\n", This);
349 return E_NOTIMPL;
350}

◆ cordebugprocess_GetThread()

static HRESULT WINAPI cordebugprocess_GetThread ( ICorDebugProcess iface,
DWORD  dwThreadId,
ICorDebugThread **  ppThread 
)
static

Definition at line 246 of file cordebug.c.

248{
250 FIXME("stub %p\n", This);
251 return E_NOTIMPL;
252}

◆ cordebugprocess_GetThreadContext()

static HRESULT WINAPI cordebugprocess_GetThreadContext ( ICorDebugProcess iface,
DWORD  threadID,
ULONG32  contextSize,
BYTE  context[] 
)
static

Definition at line 278 of file cordebug.c.

280{
282 FIXME("stub %p\n", This);
283 return E_NOTIMPL;
284}

◆ cordebugprocess_HasQueuedCallbacks()

static HRESULT WINAPI cordebugprocess_HasQueuedCallbacks ( ICorDebugProcess iface,
ICorDebugThread pThread,
BOOL pbQueued 
)
static

Definition at line 155 of file cordebug.c.

157{
159 FIXME("stub %p\n", This);
160 return E_NOTIMPL;
161}

◆ cordebugprocess_IsOSSuspended()

static HRESULT WINAPI cordebugprocess_IsOSSuspended ( ICorDebugProcess iface,
DWORD  threadID,
BOOL pbSuspended 
)
static

Definition at line 270 of file cordebug.c.

272{
274 FIXME("stub %p\n", This);
275 return E_NOTIMPL;
276}

◆ cordebugprocess_IsRunning()

static HRESULT WINAPI cordebugprocess_IsRunning ( ICorDebugProcess iface,
BOOL pbRunning 
)
static

Definition at line 148 of file cordebug.c.

149{
151 FIXME("stub %p\n", This);
152 return E_NOTIMPL;
153}

◆ cordebugprocess_IsTransitionStub()

static HRESULT WINAPI cordebugprocess_IsTransitionStub ( ICorDebugProcess iface,
CORDB_ADDRESS  address,
BOOL pbTransitionStub 
)
static

Definition at line 262 of file cordebug.c.

264{
266 FIXME("stub %p\n", This);
267 return E_NOTIMPL;
268}

◆ cordebugprocess_ModifyLogSwitch()

static HRESULT WINAPI cordebugprocess_ModifyLogSwitch ( ICorDebugProcess iface,
WCHAR pLogSwitchName,
LONG  lLevel 
)
static

Definition at line 328 of file cordebug.c.

330{
332 FIXME("stub %p\n", This);
333 return E_NOTIMPL;
334}

◆ cordebugprocess_QueryInterface()

static HRESULT WINAPI cordebugprocess_QueryInterface ( ICorDebugProcess iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 72 of file cordebug.c.

74{
76
77 TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
78
79 if ( IsEqualGUID( riid, &IID_ICorDebugProcess ) ||
80 IsEqualGUID( riid, &IID_ICorDebugController ) ||
82 {
83 *ppvObject = &This->ICorDebugProcess_iface;
84 }
85 else
86 {
87 FIXME("Unsupported interface %s\n", debugstr_guid(riid));
88 return E_NOINTERFACE;
89 }
90
91 ICorDebugProcess_AddRef(iface);
92
93 return S_OK;
94}

◆ cordebugprocess_ReadMemory()

static HRESULT WINAPI cordebugprocess_ReadMemory ( ICorDebugProcess iface,
CORDB_ADDRESS  address,
DWORD  size,
BYTE  buffer[],
SIZE_T read 
)
static

Definition at line 294 of file cordebug.c.

297{
299 FIXME("stub %p\n", This);
300 return E_NOTIMPL;
301}

◆ cordebugprocess_Release()

static ULONG WINAPI cordebugprocess_Release ( ICorDebugProcess iface)
static

Definition at line 106 of file cordebug.c.

107{
110
111 TRACE("%p ref=%lu\n", This, ref);
112
113 if (ref == 0)
114 {
115 if(This->handle)
116 CloseHandle(This->handle);
117
118 if(This->thread)
119 CloseHandle(This->thread);
120
121 if(This->cordebug)
122 ICorDebug_Release(&This->cordebug->ICorDebug_iface);
123
124 free(This);
125 }
126
127 return ref;
128}

◆ cordebugprocess_SetAllThreadsDebugState()

static HRESULT WINAPI cordebugprocess_SetAllThreadsDebugState ( ICorDebugProcess iface,
CorDebugThreadState  state,
ICorDebugThread pExceptThisThread 
)
static

Definition at line 171 of file cordebug.c.

173{
175 FIXME("stub %p\n", This);
176 return E_NOTIMPL;
177}

◆ cordebugprocess_SetThreadContext()

static HRESULT WINAPI cordebugprocess_SetThreadContext ( ICorDebugProcess iface,
DWORD  threadID,
ULONG32  contextSize,
BYTE  context[] 
)
static

Definition at line 286 of file cordebug.c.

288{
290 FIXME("stub %p\n", This);
291 return E_NOTIMPL;
292}

◆ cordebugprocess_Stop()

static HRESULT WINAPI cordebugprocess_Stop ( ICorDebugProcess iface,
DWORD  dwTimeoutIgnored 
)
static

Definition at line 130 of file cordebug.c.

131{
133 FIXME("stub %p\n", This);
134 return E_NOTIMPL;
135}

◆ cordebugprocess_Terminate()

static HRESULT WINAPI cordebugprocess_Terminate ( ICorDebugProcess iface,
UINT  exitCode 
)
static

Definition at line 186 of file cordebug.c.

187{
189 BOOL ret = TRUE;
190
191 TRACE("%p\n", This);
192
193 if(This->handle)
194 {
195 ret = TerminateProcess(This->handle, exitCode);
196 CloseHandle(This->handle);
197 This->handle = NULL;
198 }
199 return ret ? S_OK : E_FAIL;
200}
#define TRUE
Definition: types.h:120
return ret
Definition: mutex.c:146
unsigned int BOOL
Definition: ntddk_ex.h:94

◆ cordebugprocess_ThreadForFiberCookie()

static HRESULT WINAPI cordebugprocess_ThreadForFiberCookie ( ICorDebugProcess iface,
DWORD  fiberCookie,
ICorDebugThread **  ppThread 
)
static

Definition at line 352 of file cordebug.c.

354{
356 FIXME("stub %p\n", This);
357 return E_NOTIMPL;
358}

◆ cordebugprocess_WriteMemory()

static HRESULT WINAPI cordebugprocess_WriteMemory ( ICorDebugProcess iface,
CORDB_ADDRESS  address,
DWORD  size,
BYTE  buffer[],
SIZE_T written 
)
static

Definition at line 303 of file cordebug.c.

306{
308 FIXME("stub %p\n", This);
309 return E_NOTIMPL;
310}

◆ impl_from_ICorDebug()

◆ impl_from_ICorDebugProcess()

◆ impl_from_ICorDebugProcessEnum()

static CorDebug * impl_from_ICorDebugProcessEnum ( ICorDebugProcessEnum iface)
inlinestatic

◆ process_enum_AddRef()

static ULONG WINAPI process_enum_AddRef ( ICorDebugProcessEnum iface)
static

Definition at line 466 of file cordebug.c.

467{
469 TRACE("%p ref=%lu\n", This, This->ref);
470
471 return ICorDebug_AddRef(&This->ICorDebug_iface);
472}
static CorDebug * impl_from_ICorDebugProcessEnum(ICorDebugProcessEnum *iface)
Definition: cordebug.c:61

◆ process_enum_Clone()

static HRESULT WINAPI process_enum_Clone ( ICorDebugProcessEnum iface,
ICorDebugEnum **  ppEnum 
)
static

Definition at line 496 of file cordebug.c.

497{
499 FIXME("stub %p %p\n", This, ppEnum);
500 return E_NOTIMPL;
501}

◆ process_enum_GetCount()

static HRESULT WINAPI process_enum_GetCount ( ICorDebugProcessEnum iface,
ULONG pcelt 
)
static

Definition at line 503 of file cordebug.c.

504{
506 TRACE("stub %p %p\n", This, pcelt);
507
508 if(!pcelt)
509 return E_INVALIDARG;
510
511 *pcelt = list_count(&This->processes);
512
513 return S_OK;
514}
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
Definition: list.h:155

◆ process_enum_Next()

static HRESULT WINAPI process_enum_Next ( ICorDebugProcessEnum iface,
ULONG  celt,
ICorDebugProcess processes[],
ULONG pceltFetched 
)
static

Definition at line 516 of file cordebug.c.

518{
520 FIXME("stub %p %ld %p %p\n", This, celt, processes, pceltFetched);
521 return E_NOTIMPL;
522}

◆ process_enum_QueryInterface()

static HRESULT WINAPI process_enum_QueryInterface ( ICorDebugProcessEnum iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 443 of file cordebug.c.

444{
446
447 TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
448
449 if ( IsEqualGUID( riid, &IID_ICorDebugProcessEnum ) ||
450 IsEqualGUID( riid, &IID_ICorDebugEnum ) ||
452 {
453 *ppvObject = &This->ICorDebugProcessEnum_iface;
454 }
455 else
456 {
457 FIXME("Unsupported interface %s\n", debugstr_guid(riid));
458 return E_NOINTERFACE;
459 }
460
461 ICorDebugProcessEnum_AddRef(iface);
462
463 return S_OK;
464}

◆ process_enum_Release()

static ULONG WINAPI process_enum_Release ( ICorDebugProcessEnum iface)
static

Definition at line 474 of file cordebug.c.

475{
477 TRACE("%p ref=%lu\n", This, This->ref);
478
479 return ICorDebug_Release(&This->ICorDebug_iface);
480}

◆ process_enum_Reset()

static HRESULT WINAPI process_enum_Reset ( ICorDebugProcessEnum iface)
static

Definition at line 489 of file cordebug.c.

490{
492 FIXME("stub %p\n", This);
493 return E_NOTIMPL;
494}

◆ process_enum_Skip()

static HRESULT WINAPI process_enum_Skip ( ICorDebugProcessEnum iface,
ULONG  celt 
)
static

Definition at line 482 of file cordebug.c.

483{
485 FIXME("stub %p\n", This);
486 return E_NOTIMPL;
487}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( mscoree  )

Variable Documentation

◆ cordebug_vtbl

const struct ICorDebugVtbl cordebug_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI CorDebug_CreateProcess(ICorDebug *iface, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, PVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation, CorDebugCreateProcessFlags debuggingFlags, ICorDebugProcess **ppProcess)
Definition: cordebug.c:665
static HRESULT WINAPI CorDebug_SetManagedHandler(ICorDebug *iface, ICorDebugManagedCallback *pCallback)
Definition: cordebug.c:625
static HRESULT WINAPI CorDebug_Initialize(ICorDebug *iface)
Definition: cordebug.c:597
static HRESULT WINAPI CorDebug_DebugActiveProcess(ICorDebug *iface, DWORD id, BOOL win32Attach, ICorDebugProcess **ppProcess)
Definition: cordebug.c:710
static HRESULT WINAPI CorDebug_CanLaunchOrAttach(ICorDebug *iface, DWORD dwProcessId, BOOL win32DebuggingEnabled)
Definition: cordebug.c:739
static ULONG WINAPI CorDebug_AddRef(ICorDebug *iface)
Definition: cordebug.c:559
static HRESULT WINAPI CorDebug_SetUnmanagedHandler(ICorDebug *iface, ICorDebugUnmanagedCallback *pCallback)
Definition: cordebug.c:658
static HRESULT WINAPI CorDebug_GetProcess(ICorDebug *iface, DWORD dwProcessId, ICorDebugProcess **ppProcess)
Definition: cordebug.c:732
static HRESULT WINAPI CorDebug_EnumerateProcesses(ICorDebug *iface, ICorDebugProcessEnum **ppProcess)
Definition: cordebug.c:718
static HRESULT WINAPI CorDebug_QueryInterface(ICorDebug *iface, REFIID riid, void **ppvObject)
Definition: cordebug.c:537
static ULONG WINAPI CorDebug_Release(ICorDebug *iface)
Definition: cordebug.c:569
static HRESULT WINAPI CorDebug_Terminate(ICorDebug *iface)
Definition: cordebug.c:604

Definition at line 747 of file cordebug.c.

Referenced by CorDebug_Create().

◆ cordebugprocessVtbl

const ICorDebugProcessVtbl cordebugprocessVtbl
static

Definition at line 370 of file cordebug.c.

Referenced by CorDebugProcess_Create().

◆ processenum_vtbl

const struct ICorDebugProcessEnumVtbl processenum_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI process_enum_GetCount(ICorDebugProcessEnum *iface, ULONG *pcelt)
Definition: cordebug.c:503
static HRESULT WINAPI process_enum_Clone(ICorDebugProcessEnum *iface, ICorDebugEnum **ppEnum)
Definition: cordebug.c:496
static HRESULT WINAPI process_enum_QueryInterface(ICorDebugProcessEnum *iface, REFIID riid, void **ppvObject)
Definition: cordebug.c:443
static ULONG WINAPI process_enum_AddRef(ICorDebugProcessEnum *iface)
Definition: cordebug.c:466
static HRESULT WINAPI process_enum_Reset(ICorDebugProcessEnum *iface)
Definition: cordebug.c:489
static HRESULT WINAPI process_enum_Skip(ICorDebugProcessEnum *iface, ULONG celt)
Definition: cordebug.c:482
static HRESULT WINAPI process_enum_Next(ICorDebugProcessEnum *iface, ULONG celt, ICorDebugProcess *processes[], ULONG *pceltFetched)
Definition: cordebug.c:516
static ULONG WINAPI process_enum_Release(ICorDebugProcessEnum *iface)
Definition: cordebug.c:474

Definition at line 524 of file cordebug.c.

Referenced by CorDebug_Create().