home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / cordebug.idl < prev    next >
Encoding:
Text File  |  2000-06-23  |  99.5 KB  |  3,333 lines

  1. /*****************************************************************************
  2.  **                                                                         **
  3.  ** Cordebug.idl - COM+ Runtime Debugging interfaces.                       **
  4.  **                                                                         **
  5.  ** Copyright (c) 1996-2000 Microsoft Corporation.  All Rights Reserved.    **
  6.  **                                                                         **
  7.  *****************************************************************************/
  8.  
  9.  
  10. /* ************ In-Process Notes: ********************************************
  11.  *
  12.  * Note that anything marked "Not Implemented In-Proc" should return 
  13.  * CORDBG_E_INPROC_NOT_IMPL if you do try and invoke it.  Any interface marked
  14.  * "Not Implemented In-Proc" should be inaccessible (ie, you shouldn't be able
  15.  * to get one), and if you do, invoking methods on it are undefined.
  16.  *
  17.  * @todo Note that if you do a stack trace from within a
  18.  * NotifyJitCompilation, you'll be told that there is an active chain,
  19.  * of type CHAIN_CLASS_INIT, with no frames in it. This is wrong, and
  20.  * should be ignored.
  21.  *
  22.  * Please read the InProcess Only comment next to EnumerateChains for a note on
  23.  * stack tracing and cache refreshing.
  24.  */
  25.  
  26. /* ------------------------------------------------------------------------- *
  27.  * Imported types
  28.  * ------------------------------------------------------------------------- */
  29.  
  30. #if !DUMMY_DEFINITIONS_BECAUSE_I_CANT_FIGURE_OUT_HOW_TO_IMPORT_THESE
  31.  
  32. cpp_quote("#define CorDB_CONTROL_REMOTE_DEBUGGING   \"Cor_Enable_Remote_Debugging\"")
  33. cpp_quote("#define CorDB_CONTROL_REMOTE_DEBUGGINGL L\"Cor_Enable_Remote_Debugging\"")
  34.  
  35. cpp_quote("#if 0")
  36.  
  37. #ifdef _WIN64
  38. import "unknwn.idl";
  39. #else
  40. #include "basetsd.h"
  41. #endif
  42.  
  43. typedef UINT32 mdToken;
  44. typedef mdToken mdModule;
  45. typedef mdToken mdScope;
  46. typedef mdToken mdTypeDef;
  47. typedef mdToken mdSourceFile;
  48. typedef mdToken mdMemberRef;
  49. typedef mdToken mdMethodDef;
  50. typedef mdToken mdFieldDef;
  51. typedef mdToken mdSignature;
  52. typedef ULONG CorElementType;
  53. typedef SIZE_T PCCOR_SIGNATURE;
  54.  
  55. typedef SIZE_T LPDEBUG_EVENT;
  56.  
  57. typedef SIZE_T LPSTARTUPINFOW;
  58. typedef SIZE_T LPPROCESS_INFORMATION;
  59.  
  60. cpp_quote("#endif")
  61.  
  62. typedef [wire_marshal(unsigned long)] void *HPROCESS;
  63. typedef [wire_marshal(unsigned long)] void *HTHREAD;
  64.  
  65. #endif
  66.  
  67. cpp_quote("#ifndef _COR_IL_MAP")
  68. cpp_quote("#define _COR_IL_MAP")
  69.  
  70. // Note that this structure is also defined in CorProf.idl - PROPOGATE CHANGES
  71. // BOTH WAYS, or this'll become a really insidious bug some day.
  72. typedef struct _COR_IL_MAP
  73. {
  74.     ULONG32 oldOffset;        // Old IL offset relative to beginning of function
  75.     ULONG32 newOffset;        // New IL offset relative to beginning of function
  76. } COR_IL_MAP;
  77.  
  78. cpp_quote("#endif //_COR_IL_MAP")
  79.  
  80. cpp_quote("#define REMOTE_DEBUGGING_DLL_ENTRY L\"Software\\\\Microsoft\\\\COMPlus\\\\Debugger\\\\ActivateRemoteDebugging\"")
  81.  
  82. /* ------------------------------------------------------------------------- *
  83.  * Forward declarations
  84.  * ------------------------------------------------------------------------- */
  85.  
  86. interface ICorDebug;
  87.  
  88. interface ICorDebugController;
  89. interface ICorDebugProcess;
  90. interface ICorDebugAppDomain;
  91. interface ICorDebugAssembly;
  92. interface ICorDebugBreakpoint;
  93. interface ICorDebugFunctionBreakpoint;
  94. interface ICorDebugModuleBreakpoint;
  95. interface ICorDebugValueBreakpoint;
  96. interface ICorDebugStepper;
  97. interface ICorDebugEval;
  98. interface ICorDebugThread;
  99. interface ICorDebugChain;
  100. interface ICorDebugFrame;
  101. interface ICorDebugILFrame;
  102. interface ICorDebugNativeFrame;
  103. interface ICorDebugContext;
  104. interface ICorDebugModule;
  105. interface ICorDebugFunction;
  106. interface ICorDebugCode;
  107. interface ICorDebugClass;
  108.  
  109. interface ICorDebugValue;
  110. interface ICorDebugGenericValue;
  111. interface ICorDebugReferenceValue;
  112. interface ICorDebugHeapValue;
  113. interface ICorDebugObjectValue;
  114. interface ICorDebugStringValue;
  115. interface ICorDebugArrayValue;
  116.  
  117. interface ICorDebugEnum;
  118. interface ICorDebugObjectEnum;
  119. interface ICorDebugProcessEnum;
  120. interface ICorDebugBreakpointEnum;
  121. interface ICorDebugStepperEnum;
  122. interface ICorDebugModuleEnum;
  123. interface ICorDebugThreadEnum;
  124. interface ICorDebugChainEnum;
  125. interface ICorDebugFrameEnum;
  126. interface ICorDebugValueEnum;
  127. interface ICorDebugAppDomainEnum;
  128. interface ICorDebugAssemblyEnum;
  129.  
  130. interface ICorDebugEditAndContinueSnapshot;
  131. interface ICorDebugErrorInfoEnum;
  132.  
  133. typedef ULONG64 CORDB_ADDRESS;
  134. typedef ULONG64 CORDB_REGISTER;
  135.  
  136. /* ------------------------------------------------------------------------- *
  137.  * Library definition
  138.  * ------------------------------------------------------------------------- */
  139.  
  140. [
  141.     uuid(53D13620-F417-11d1-9762-A63826A4F255),
  142.     version(1.0),
  143.     helpstring("Com+ Runtime Debugging 1.0 Type Library")
  144. ]
  145. library CORDBLib
  146. {
  147.     importlib("stdole32.tlb");
  148.  
  149.     [
  150.         uuid(6fef44d0-39e7-4c77-be8e-c9f8cf988630)
  151.     ]
  152.     coclass CorDebug
  153.     {
  154.         [default] interface ICorDebug;
  155.     };
  156. };
  157.  
  158.  
  159. /* ------------------------------------------------------------------------- *
  160.  * User Callback interface
  161.  * ------------------------------------------------------------------------- */
  162.  
  163.  
  164.  
  165. /* 
  166.  * ICorDebugManagedCallback is implemented by the user of the
  167.  * ICorDebug interfaces in order to respond to events in managed code
  168.  * in the debuggee process.  
  169.  */
  170.  
  171. [
  172.     object,
  173.     uuid(3d6f5f60-7538-11d3-8d5b-00104b35e7ef),
  174.     pointer_default(unique)
  175. ]
  176. interface ICorDebugManagedCallback : IUnknown
  177. {
  178.     /*
  179.      * All callbacks are called with the process in the synchronized state
  180.      * All callbacks are serialized, and are called in in the same thread.
  181.      * Each callback implementor must call Continue in a callback to 
  182.      *        resume execution.
  183.      * If Continue is not called before returning, the process will 
  184.      * remain stopped. Continue must later be called before any more 
  185.      * event callbacks will happen.
  186.      *
  187.      * Not Implemented In-Proc : The inproc doesn't call back to anything
  188.      */
  189.  
  190.     /*
  191.      * Breakpoint is called when a breakpoint is hit.
  192.      */
  193.  
  194.     HRESULT Breakpoint([in] ICorDebugAppDomain *pAppDomain,
  195.                        [in] ICorDebugThread *pThread, 
  196.                        [in] ICorDebugBreakpoint *pBreakpoint);
  197.  
  198.     /*
  199.      * StepComplete is called when a step has completed.  The stepper
  200.      * may be used to continue stepping if desired (except for TERMINATE 
  201.      * reasons.)
  202.      *
  203.      * STEP_NORMAL means that stepping completed normally, in the same
  204.      *        function.
  205.      *
  206.      * STEP_RETURN means that stepping continued normally, after the function
  207.      *        returned.
  208.      *
  209.      * STEP_CALL means that stepping continued normally, at the start of 
  210.      *        a newly called function.
  211.      *
  212.      * STEP_EXCEPTION_FILTER means that control passed to an exception filter
  213.      *        after an exception was thrown.
  214.      * 
  215.      * STEP_EXCEPTION_HANDLED means that control passed to an exception handler
  216.      *        after an exception was thrown.
  217.      *
  218.      * STEP_INTERCEPT means that control passed to an interceptor.
  219.      * 
  220.      * STEP_EXIT means that the thread exited before the step completed.
  221.      *        No more stepping can be performed with the stepper.
  222.      */
  223.  
  224.     typedef enum CorDebugStepReason
  225.     {
  226.         STEP_NORMAL,
  227.         STEP_RETURN,
  228.         STEP_CALL,
  229.         STEP_EXCEPTION_FILTER,
  230.         STEP_EXCEPTION_HANDLE,
  231.         STEP_INTERCEPT,
  232.         STEP_EXIT
  233.     } CorDebugStepReason;
  234.  
  235.     HRESULT StepComplete([in] ICorDebugAppDomain *pAppDomain,
  236.                          [in] ICorDebugThread *pThread,
  237.                          [in] ICorDebugStepper *pStepper,
  238.                          [in] CorDebugStepReason reason);
  239.  
  240.     /* 
  241.      * Break is called when a break opcode in the code stream is
  242.      * executed.
  243.      */
  244.  
  245.     HRESULT Break([in] ICorDebugAppDomain *pAppDomain,
  246.                   [in] ICorDebugThread *thread);
  247.  
  248.     /*
  249.      * Exception is called when an exception is thrown from managed
  250.      * code, The specific exception can be retrieved from the thread object.
  251.      *
  252.      * If unhandled is FALSE, this is a "first chance" exception that
  253.      * hasn't had a chance to be processed by the application.  If
  254.      * unhandled is TRUE, this is an unhandled exception which will
  255.      * terminate the process.
  256.      */
  257.  
  258.     HRESULT Exception([in] ICorDebugAppDomain *pAppDomain,
  259.                       [in] ICorDebugThread *pThread,
  260.                       [in] BOOL unhandled);
  261.  
  262.     /*
  263.      * EvalComplete is called when an evaluation is completed. 
  264.      */
  265.  
  266.     HRESULT EvalComplete([in] ICorDebugAppDomain *pAppDomain,
  267.                          [in] ICorDebugThread *pThread,
  268.                          [in] ICorDebugEval *pEval);
  269.  
  270.     /*
  271.      * EvalException is called when an evaluation terminates with
  272.      * an unhandled exception. 
  273.      */
  274.  
  275.     HRESULT EvalException([in] ICorDebugAppDomain *pAppDomain,
  276.                           [in] ICorDebugThread *pThread,
  277.                           [in] ICorDebugEval *pEval);
  278.  
  279.     /*
  280.      * CreateProcess is called when a process is first attached to or 
  281.      * started.  
  282.      * 
  283.      * This entry point won't be called until the EE is initialized.
  284.      */
  285.  
  286.     HRESULT CreateProcess([in] ICorDebugProcess *pProcess);
  287.  
  288.     /*
  289.      * ExitProcess is called when a process exits.
  290.      *
  291.      * Note: you don't Continue from an ExitProcess event, and this
  292.      * event may fire asynchronously to other events, while the
  293.      * process appears to be stopped. This can occur if the process
  294.      * dies while stopped, usually due to some external force.
  295.      */
  296.  
  297.     HRESULT ExitProcess([in] ICorDebugProcess *pProcess);
  298.  
  299.     /*
  300.      * CreateThread is called when a thread first begins executing managed
  301.      * code. The thread will be positioned immediately at the first 
  302.      * managed code to be executed.
  303.      */
  304.  
  305.     HRESULT CreateThread([in] ICorDebugAppDomain *pAppDomain,
  306.                          [in] ICorDebugThread *thread);
  307.  
  308.  
  309.     /*
  310.      * ExitThread is called when a thread which has run managed code 
  311.      * exits.
  312.      */
  313.  
  314.     HRESULT ExitThread([in] ICorDebugAppDomain *pAppDomain,
  315.                        [in] ICorDebugThread *thread);
  316.  
  317.     /*
  318.      * LoadModule is called when a COM+ module is successfully
  319.      * loaded. This is an appropriate time to examine metadata for the
  320.      * module, enable or disable jit debugging, or enable or disable
  321.      * class loading callbacks for the module.
  322.      */
  323.  
  324.     HRESULT LoadModule([in] ICorDebugAppDomain *pAppDomain,
  325.                        [in] ICorDebugModule *pModule);
  326.  
  327.     /*
  328.      * UnloadModule is called when a COM+ module (DLL) is unloaded. The module 
  329.      * should not be used after this point.
  330.      */
  331.  
  332.     HRESULT UnloadModule([in] ICorDebugAppDomain *pAppDomain,
  333.                          [in] ICorDebugModule *pModule);
  334.  
  335.     /*
  336.      * LoadClass is called when a class finishes loading.  This callback only 
  337.      * occurs if ClassLoading has been enabled for the class's module.
  338.      */
  339.  
  340.     HRESULT LoadClass([in] ICorDebugAppDomain *pAppDomain,
  341.                       [in] ICorDebugClass *c);
  342.  
  343.     /*
  344.      * UnloadClass is called immediately before a class is unloaded. The class 
  345.      * should not be referenced after this point. This callback only occurs if 
  346.      * ClassLoading has been enabled for the class's module.
  347.      */
  348.  
  349.     HRESULT UnloadClass([in] ICorDebugAppDomain *pAppDomain,
  350.                         [in] ICorDebugClass *c);
  351.  
  352.     /*
  353.      * DebuggerError is called when an error occurs while attempting to
  354.      * handle an event from the COM+ Runtime. The process is placed into
  355.      * pass thru mode, possible permantely, depending on the nature of the
  356.      * error.
  357.      */
  358.  
  359.     HRESULT DebuggerError([in] ICorDebugProcess *pProcess,
  360.                           [in] HRESULT errorHR,
  361.                           [in] DWORD errorCode);
  362.  
  363.  
  364.     /*
  365.      * Enum defining log message LoggingLevels
  366.      */
  367.     typedef enum LoggingLevelEnum
  368.     {
  369.         LTraceLevel0 = 0,
  370.         LTraceLevel1,
  371.         LTraceLevel2,
  372.         LTraceLevel3,
  373.         LTraceLevel4,
  374.         LStatusLevel0 = 20,
  375.         LStatusLevel1,
  376.         LStatusLevel2,
  377.         LStatusLevel3,
  378.         LStatusLevel4,
  379.         LWarningLevel = 40,
  380.         LErrorLevel = 50,
  381.         LPanicLevel = 100
  382.     } LoggingLevelEnum;
  383.  
  384.  
  385.     typedef enum LogSwitchCallReason
  386.     {
  387.         SWITCH_CREATE,
  388.         SWITCH_MODIFY,
  389.         SWITCH_DELETE
  390.     } LogSwitchCallReason;
  391.  
  392.  
  393.     /*
  394.      * LogMessage is called when a COM+ managed thread calls the Log
  395.      * class in the System.Diagnostics package to log an event.
  396.      */    
  397.     HRESULT LogMessage([in] ICorDebugAppDomain *pAppDomain,
  398.                        [in] ICorDebugThread *pThread,
  399.                        [in] LONG lLevel,
  400.                        [in] WCHAR *pLogSwitchName,
  401.                        [in] WCHAR *pMessage);
  402.  
  403.     /*
  404.      * LogSwitch is called when a COM+ managed thread calls the LogSwitch
  405.      * class in the System.Diagnostics package to create/modify a LogSwitch.
  406.      */
  407.     HRESULT LogSwitch([in] ICorDebugAppDomain *pAppDomain,
  408.                       [in] ICorDebugThread *pThread,
  409.                       [in] LONG lLevel,
  410.                       [in] ULONG ulReason,
  411.                       [in] WCHAR *pLogSwitchName,
  412.                       [in] WCHAR *pParentName);
  413.  
  414.     /*
  415.      * CreateAppDomain is called when an app domain is created.
  416.      */
  417.     HRESULT CreateAppDomain([in] ICorDebugProcess *pProcess,
  418.                             [in] ICorDebugAppDomain *pAppDomain); 
  419.  
  420.     /*
  421.      * ExitAppDomain is called when an app domain exits.
  422.      */
  423.     HRESULT ExitAppDomain([in] ICorDebugProcess *pProcess,
  424.                           [in] ICorDebugAppDomain *pAppDomain); 
  425.  
  426.  
  427.     /*
  428.      * LoadAssembly is called when a COM+ module is successfully
  429.      * loaded. 
  430.      */
  431.     HRESULT LoadAssembly([in] ICorDebugAppDomain *pAppDomain,
  432.                          [in] ICorDebugAssembly *pAssembly);
  433.  
  434.     /*
  435.      * UnloadAssembly is called when a COM+ module (DLL) is unloaded. The module 
  436.      * should not be used after this point.
  437.      */
  438.     HRESULT UnloadAssembly([in] ICorDebugAppDomain *pAppDomain,
  439.                            [in] ICorDebugAssembly *pAssembly);
  440.  
  441.     /*
  442.      * ControlCTrap is called if a CTRL-C is trapped in the process being
  443.      * debugger. All appdomains within the process are stopped for
  444.      * this callback.
  445.      * Return values: 
  446.      *      S_OK    : Debugger will handle the ControlC Trap
  447.      *      S_FALSE : Debugger won't handle the ControlC Trap 
  448.      */
  449.     HRESULT ControlCTrap([in] ICorDebugProcess *pProcess);
  450.  
  451.     /*
  452.      * NameChange() is called if either an AppDomain's or
  453.      * Thread's name changes.
  454.      */
  455.      HRESULT NameChange([in] ICorDebugAppDomain *pAppDomain,
  456.                        [in] ICorDebugThread *pThread);
  457.  
  458.     /*
  459.      * UpdateModuleSymbols is called when a COM+ module's symbols have
  460.      * changed. This is a debugger's chance to update its view of a
  461.      * module's symbols, typically by calling
  462.      * ISymUnmanagedReader::UpdateSymbolStore or
  463.      * ISymUnmanagedReader::ReplaceSymbolStore.
  464.      */
  465.     HRESULT UpdateModuleSymbols([in] ICorDebugAppDomain *pAppDomain,
  466.                                 [in] ICorDebugModule *pModule,
  467.                                 [in] IStream *pSymbolStream);
  468.  
  469. };
  470.  
  471. [
  472.     object,
  473.     uuid(5263E909-8CB5-11d3-BD2F-0000F80849BD),
  474.     pointer_default(unique)
  475. ]
  476. interface ICorDebugUnmanagedCallback : IUnknown
  477. {
  478.     /* 
  479.      * DebugEvent is called when a DEBUG_EVENT is received which is
  480.      * not directly related to the COM+ runtime.
  481.      *
  482.      * This callback is an exception to the rules about callbacks.
  483.      * When this callback is called, the process will be in the "raw"
  484.      * OS debug stopped state. The process will not be synchronized.
  485.      * The process will automatically enter the synchronized state when
  486.      * necessary to satifsy certian requests for information about
  487.      * managed code. (Note that this may result in other nested
  488.      * DebugEvent callbacks.)
  489.      *
  490.      * Call ClearCurrentException on the process to ignore an
  491.      * exception event before continuing the process. (Causes
  492.      * DBG_CONTINUE to be sent on continue rather than
  493.      * DBG_EXCEPTION_NOT_HANDLED)
  494.      *
  495.      * fOutOfBand will be FALSE if the debugging services support
  496.      * interaction with the process's managed state while the process
  497.      * is stopped due to this event. fOutOfBand will be TRUE if
  498.      * interaction with the process's managed state is impossible until
  499.      * the unmanaged event is continued from.
  500.      *
  501.      * Not Implemented In-Proc : The inproc doesn't call back to anything
  502.      */
  503.  
  504.     HRESULT DebugEvent([in] LPDEBUG_EVENT pDebugEvent,
  505.                        [in] BOOL fOutOfBand);
  506. };
  507.  
  508. /* ------------------------------------------------------------------------- *
  509.  * Debugger interface
  510.  * ------------------------------------------------------------------------- */
  511.  
  512.  
  513. typedef enum CorDebugCreateProcessFlags
  514. {
  515.     DEBUG_NO_SPECIAL_OPTIONS        = 0x0000,
  516.     DEBUG_ENABLE_EDIT_AND_CONTINUE  = 0x0001,
  517. } CorDebugCreateProcessFlags;
  518.  
  519. /*
  520.  * ICorDebug represents an event processing loop for a debugger process.
  521.  */
  522.  
  523. [
  524.     object,
  525.     local,
  526.     uuid(3d6f5f61-7538-11d3-8d5b-00104b35e7ef),
  527.     pointer_default(unique)
  528. ]
  529. interface ICorDebug : IUnknown
  530. {
  531.     /*
  532.      * Initialize must be called at creation time before any other method on
  533.      * ICorDebug is called.
  534.      */
  535.  
  536.     HRESULT Initialize();
  537.     
  538.     /*
  539.      * Terminate must be called when the ICorDebug is no longer needed.
  540.      *
  541.      * Not Implemented In-Proc 
  542.      */
  543.  
  544.     HRESULT Terminate();
  545.     
  546.     /*
  547.      * SetManagedHandler should be called at creation time to specify the 
  548.      * event handler object for managed events.
  549.      *
  550.      * Not Implemented In-Proc
  551.      */
  552.  
  553.     HRESULT SetManagedHandler([in] ICorDebugManagedCallback *pCallback);
  554.  
  555.     /*
  556.      * SetUnmanagedHandler should be called at creation time to specify the 
  557.      * event handler object for managed events.
  558.      *
  559.      * Not Implemented In-Proc
  560.      */
  561.  
  562.     HRESULT SetUnmanagedHandler([in] ICorDebugUnmanagedCallback *pCallback);
  563.  
  564.     /*
  565.      * CreateProcess launches a process under the control of the debugger
  566.      * All parameters are the same as the win32 CreateProcess call.
  567.      * 
  568.      * Note that the DEBUG_PROCESS flag (passed in dwCreationFlags), if
  569.      * set, will enable unmanaged debugging.  If only managed debugging
  570.      * is desired, do not set this flag. (Note that unmanaged debugging can
  571.      * also be enabled later by the EnableUnmanagedDebugging entry point
  572.      * on the process.)
  573.      *
  574.      * Not Implemented In-Proc
  575.      *
  576.      * Note that if debuggingFlags is set to DEBUG_ENABLE_EDIT_AND_CONTINUE,
  577.      * then E&C will be allowed for the process.  Otherwise, the argument
  578.      * should be zero'd out, and no E&C will be allowed.  E&C is not allowed
  579.      * when JIT attaching to a process.
  580.      */
  581.  
  582.     HRESULT CreateProcess([in] LPCWSTR lpApplicationName,
  583.                           [in] LPWSTR lpCommandLine,
  584.                           [in] LPSECURITY_ATTRIBUTES lpProcessAttributes,
  585.                           [in] LPSECURITY_ATTRIBUTES lpThreadAttributes,
  586.                           [in] BOOL bInheritHandles,
  587.                           [in] DWORD dwCreationFlags,
  588.                           [in] PVOID lpEnvironment,
  589.                           [in] LPCWSTR lpCurrentDirectory,
  590.                           [in] LPSTARTUPINFOW lpStartupInfo,
  591.                           [in] LPPROCESS_INFORMATION lpProcessInformation,
  592.                           [in] CorDebugCreateProcessFlags debuggingFlags,
  593.                           [out] ICorDebugProcess **ppProcess);
  594.     
  595.     /*
  596.      * DebugActiveProcess is used to attach to an existing process.
  597.      *
  598.      * If win32Attach is TRUE, then the debugger becomes the Win32
  599.      * debugger for the process and will begin dispatching the
  600.      * unmanaged callbacks.
  601.      *
  602.      * Not Implemented In-Proc
  603.      */
  604.  
  605.     HRESULT DebugActiveProcess([in] DWORD id,
  606.                                [in] BOOL win32Attach,
  607.                                [out] ICorDebugProcess **ppProcess);
  608.  
  609.     /*
  610.      * EnumerateProcesses returns an enum of processes being debugged.
  611.      */
  612.  
  613.     HRESULT EnumerateProcesses([out] ICorDebugProcessEnum **ppProcess);
  614.  
  615.     /*
  616.      * GetProcess returns the ICorDebugProcess with the given OS Id.  
  617.      */
  618.     
  619.     HRESULT GetProcess([in] DWORD dwProcessId, 
  620.                        [out] ICorDebugProcess **ppProcess);
  621. };
  622.  
  623.  
  624. /* ------------------------------------------------------------------------- *
  625.  * Controller interface
  626.  * ------------------------------------------------------------------------- */
  627.  
  628.  
  629. /*
  630.  * A thread's DebugState determines whether the debugger lets a thread
  631.  * run or not.  Possible states are:
  632.  *
  633.  * THREAD_RUN - thread runs freely, unless a debug event occurs
  634.  * THREAD_SUSPEND - thread cannot run.
  635.  *
  636.  * NOTE: We allow for message pumping via a callback provided to the Hosting
  637.  *        API, thus we don't need an 'interrupted' state here.
  638.  */
  639.  
  640. typedef enum CorDebugThreadState
  641. {
  642.     THREAD_RUN,
  643.     THREAD_SUSPEND
  644. } CorDebugThreadState;
  645.  
  646.  
  647. /*
  648.  * ICorDebugController represents a scope at which program execution context
  649.  * can be controlled.  It represents either a process or an app domain.
  650.  * 
  651.  * If this is the controller of a process, this controller affects all 
  652.  * threads in the process.  Otherwise it just affects the threads of 
  653.  * a particular app domain
  654.  */
  655.  
  656. [
  657.     object,
  658.     uuid(3d6f5f62-7538-11d3-8d5b-00104b35e7ef),
  659.     pointer_default(unique)
  660. ]
  661.  
  662. interface ICorDebugController : IUnknown
  663. {
  664.     /* 
  665.      * Stop performs a cooperative stop on all threads running managed
  666.      * code in the process.  Threads running unmanaged code are
  667.      * suspended (unless this is in-process).  If the cooperative stop
  668.      * fails due to a deadlock, all threads are suspended (and E_TIMEOUT 
  669.      * is returned)
  670.      *
  671.      * Not Implemented In-Proc
  672.      */
  673.  
  674.     HRESULT Stop([in] DWORD dwTimeout);
  675.  
  676.     /*
  677.      * Continue continues the process after a call to Stop.
  678.      *
  679.      * Continue continues the process. fIsOutOfBand is set to TRUE
  680.      * if continuing from an unmanaged event that was sent with the
  681.      * fOutOfBand flag in the unmanaged callback and it is set to
  682.      * FALSE if continuing from a managed event or a normal
  683.      * unmanaged event.
  684.      *
  685.      * Not Implemented In-Proc
  686.      */
  687.  
  688.     HRESULT Continue([in] BOOL fIsOutOfBand);
  689.  
  690.     /*
  691.      * IsRunning returns TRUE if the threads in the process are running freely.
  692.      *
  693.      * Not Implemented In-Proc
  694.      */
  695.  
  696.     HRESULT IsRunning([out] BOOL *pbRunning);
  697.  
  698.     /*
  699.      * HasQueuedCallbacks returns TRUE if there are currently managed
  700.      * callbacks which are queued up for the given thread.  These
  701.      * callbacks will be dispatched one at a time, each time Continue
  702.      * is called.
  703.      *
  704.      * The debugger can check this flag if it wishes to report multiple 
  705.      * debugging events which occur simultaneously.
  706.      *
  707.      * If NULL is given for the pThread parameter, HasQueuedCallbacks
  708.      * will return TRUE if there are currently managed callbacks
  709.      * queued for any thread.
  710.      *
  711.      * Not Implemented In-Proc
  712.      */
  713.     
  714.     HRESULT HasQueuedCallbacks([in] ICorDebugThread *pThread,
  715.                                [out] BOOL *pbQueued);
  716.  
  717.     /*
  718.      * EnumerateThreads returns an enum of all threads active in the process.
  719.      */
  720.  
  721.     HRESULT EnumerateThreads([out] ICorDebugThreadEnum **ppThreads);
  722.  
  723.     /*
  724.      * SetAllThreadsDebugState sets the current debug state of each thread.
  725.      * See ICorDebugThread::SetDebugState for details.
  726.      *
  727.      * The pExceptThisThread parameter allows you to specify one
  728.      * thread which is exempted from the debug state change. Pass NULL
  729.      * if you want to affect all threads.
  730.      *
  731.      * Not Implemented In-Proc
  732.      */
  733.  
  734.     HRESULT SetAllThreadsDebugState([in] CorDebugThreadState state,
  735.                                     [in] ICorDebugThread *pExceptThisThread);
  736.  
  737.     /*
  738.      * Detach detaches the debugger from the process/appdomain.  The process  
  739.      * continues execution normally. The ICorDebugProcess/AppDomain object is  
  740.      * no longer valid and no further callbacks will occur.
  741.      *
  742.      * Note that currently if unmanaged debugging is enabled this call will 
  743.      * fail due to OS limitations.
  744.      *
  745.      * Not Implemented In-Proc
  746.      */
  747.  
  748.     HRESULT Detach();
  749.  
  750.     /*
  751.      * Terminate terminates the process (with extreme prejudice, I might add).
  752.      *
  753.      * Not Implemented In-Proc
  754.      */
  755.  
  756.     HRESULT Terminate([in] UINT exitCode);
  757.     
  758.     /*
  759.      * CanCommitChanges is called to see if the delta PE's can be applied to
  760.      * the running process.  If there are any known problems with the changes,
  761.      * then an error information is returned.
  762.      *
  763.      * Not Implemented In-Proc
  764.      */
  765.  
  766.     HRESULT CanCommitChanges([in] ULONG cSnapshots, 
  767.                              [in, size_is(cSnapshots)] ICorDebugEditAndContinueSnapshot *pSnapshots[], 
  768.                              [out] ICorDebugErrorInfoEnum **pError);
  769.  
  770.  
  771.     /*
  772.      * CommitChanges is called to apply the delta PE's to the running
  773.      * process.  Any failures return detailed error information.
  774.      * There are no rollback guarantees when a failure occurs.
  775.      * Applying delta PE's to a running process must be done in the
  776.      * order the snapshots are retrieved and may not be interleaved
  777.      * (ie: there is no merging of multiple snapshots applied out of
  778.      * order or with the same root).
  779.      *
  780.      * Not Implemented In-Proc
  781.      */
  782.  
  783.     HRESULT CommitChanges([in] ULONG cSnapshots, 
  784.                           [in, size_is(cSnapshots)] ICorDebugEditAndContinueSnapshot *pSnapshots[], 
  785.                           [out] ICorDebugErrorInfoEnum **pError);
  786.  
  787. };
  788.  
  789.  
  790.  
  791. /* ------------------------------------------------------------------------- *
  792.  *    
  793.  * AppDomain interface
  794.  * ------------------------------------------------------------------------- */
  795.  
  796.  
  797. [
  798.     object,
  799.     uuid(3d6f5f63-7538-11d3-8d5b-00104b35e7ef),
  800.     pointer_default(unique)
  801. ]
  802. interface ICorDebugAppDomain : ICorDebugController
  803. {
  804.     /*         
  805.      * GetProcess returns the process containing the app domain
  806.      */
  807.  
  808.     HRESULT GetProcess([out] ICorDebugProcess **ppProcess);        
  809.  
  810.     /*          
  811.      * EnumerateAssemblies enumerates all assemblies in the app domain
  812.      */
  813.  
  814.     HRESULT EnumerateAssemblies([out] ICorDebugAssemblyEnum **ppAssemblies);
  815.  
  816.     /*
  817.      * GetModuleFromMetaDataInterface returns the ICorDebugModule with
  818.      * the given metadata interface.
  819.      */
  820.     
  821.     HRESULT GetModuleFromMetaDataInterface([in] IUnknown *pIMetaData, 
  822.                                            [out] ICorDebugModule **ppModule);
  823.  
  824.     /*
  825.      * EnumerateBreakpoints returns an enum of all active breakpoints
  826.      * in the app domain.  This includes all types of breakpoints :
  827.      * function breakpoints, data breakpoints, etc.
  828.      */
  829.  
  830.     HRESULT EnumerateBreakpoints([out] ICorDebugBreakpointEnum **ppBreakpoints);
  831.  
  832.     /*
  833.      * EnumerateSteppers returns an enum of all active steppers in the app domain.
  834.      *
  835.      * Not Implemented In-Proc
  836.      */
  837.  
  838.     HRESULT EnumerateSteppers([out] ICorDebugStepperEnum **ppSteppers);
  839.     /*
  840.      * IsAttached returns whether or not the debugger is attached to the 
  841.      * app domain.  The controller methods on the app domain cannot be used
  842.      * until the debugger attaches to the app domain.
  843.      *
  844.      * Not Implemented In-Proc
  845.      */
  846.  
  847.     HRESULT IsAttached([out] BOOL *pbAttached);
  848.  
  849.  
  850.     /*
  851.      * GetName returns the name of the app domain. 
  852.      */
  853.  
  854.     HRESULT GetName([in] ULONG32 cchName, 
  855.                     [out] ULONG32 *pcchName,
  856.                     [out, size_is(cchName), 
  857.                     length_is(*pcchName)] WCHAR szName[]); 
  858.  
  859.     /*
  860.      * GetObject returns the runtime app domain object. 
  861.      * Note:   This method is not yet implemented.
  862.      */
  863.  
  864.     HRESULT GetObject([out] ICorDebugValue **ppObject);
  865.  
  866.     /* Attach() should be called to attach to the app domain to 
  867.      * receive all app domain related events (load assembly, load module, etc.)
  868.      * in order to be able to debug the app domain. 
  869.      *
  870.      * Not Implemented In-Proc
  871.      */
  872.  
  873.     HRESULT Attach();
  874.  
  875.     /*
  876.      * Get the ID of this app domain.
  877.      */
  878.  
  879.     HRESULT GetID([out] ULONG32 *pId);
  880.  
  881. };
  882.  
  883.  
  884. /* ------------------------------------------------------------------------- *
  885.  * Assembly interface
  886.  * ------------------------------------------------------------------------- */
  887.  
  888.  
  889. [
  890.     object,
  891.     uuid(df59507c-d47a-459e-bce2-6427eac8fd06),
  892.     pointer_default(unique)
  893. ]
  894.  
  895. interface ICorDebugAssembly : IUnknown
  896. {
  897.     /*         
  898.      * GetProcess returns the process containing the assembly
  899.      */
  900.  
  901.     HRESULT GetProcess([out] ICorDebugProcess **ppProcess);        
  902.  
  903.     /*         
  904.      * GetAppDomain returns the app domain containing the assembly.
  905.      * Returns null if this is the system assembly
  906.      */
  907.  
  908.     HRESULT GetAppDomain([out] ICorDebugAppDomain **ppAppDomain);        
  909.  
  910.     /*          
  911.      * EnumerateModules enumerates all modules in the assembly
  912.      */
  913.  
  914.     HRESULT EnumerateModules([out] ICorDebugModuleEnum **ppModules);
  915.  
  916.     /*
  917.      * GetCodeBase returns the code base used to load the assembly
  918.      * Note:   This method is not yet implemented.
  919.      */
  920.  
  921.     HRESULT GetCodeBase([in] ULONG32 cchName, 
  922.                         [out] ULONG32 *pcchName,
  923.                         [out, size_is(cchName), 
  924.                         length_is(*pcchName)] WCHAR szName[]); 
  925.  
  926.     /*
  927.      * GetName returns the name of the assembly
  928.      */
  929.  
  930.     HRESULT GetName([in] ULONG32 cchName, 
  931.                     [out] ULONG32 *pcchName,
  932.                     [out, size_is(cchName), 
  933.                     length_is(*pcchName)] WCHAR szName[]); 
  934. };
  935.  
  936.  
  937. /* ------------------------------------------------------------------------- *
  938.  * Process interface
  939.  * ------------------------------------------------------------------------- */
  940.  
  941.  
  942. /*
  943.  * ICorDebugProcess represents a process running some managed code.
  944.  */
  945.  
  946. [
  947.     object,
  948.     uuid(3d6f5f64-7538-11d3-8d5b-00104b35e7ef),
  949.     pointer_default(unique)
  950. ]
  951. interface ICorDebugProcess : ICorDebugController
  952. {
  953.     /*
  954.      * GetID returns the OS ID of the process. 
  955.      */
  956.  
  957.     HRESULT GetID([out] DWORD *pdwProcessId);
  958.  
  959.     /*
  960.      * GetHandle returns a handle to the process. 
  961.      */
  962.  
  963.     HRESULT GetHandle([out] HPROCESS *phProcessHandle);
  964.  
  965.     /*
  966.      * GetThread returns the ICorDebugThread with the given OS Id.  
  967.      * 
  968.      * Note that eventually there will not be a one to one correspondence
  969.      * between OS threads and runtime threads, so this entry point will
  970.      * go away.
  971.      */
  972.     
  973.     HRESULT GetThread([in] DWORD dwThreadId, [out] ICorDebugThread **ppThread);
  974.  
  975.     /* 
  976.      * TENTATIVE:
  977.      * 
  978.      * EnumerateObjects returns an enum which will return all managed objects
  979.      * in the process. 
  980.      * 
  981.      * Note: not yet implemented.
  982.      *
  983.      * Not Implemented In-Proc
  984.      */
  985.  
  986.     HRESULT EnumerateObjects([out] ICorDebugObjectEnum **ppObjects);
  987.  
  988.     /*
  989.      * IsTransitionStub tests whether an address is inside of a transition stub
  990.      * which will cause a transition to managed code.  This can be used by
  991.      * unmanaged stepping code to decide when to return stepping control to
  992.      * the managed stepper.
  993.      *
  994.      * Note that, tentatively, these stubs may also be able to be identified
  995.      * ahead of time by looking at information in the PE file.
  996.      *
  997.      * Not Implemented In-Proc
  998.      */
  999.  
  1000.     HRESULT IsTransitionStub([in] CORDB_ADDRESS address,
  1001.                              [out] BOOL *pbTransitionStub);
  1002.  
  1003.  
  1004.     /* 
  1005.      * IsOSSuspended returns whether or not the thread has been
  1006.      * suspended as part of the debugger logic of stopping the process. 
  1007.      * (that is, it has had its Win32 suspend count incremented by
  1008.      * one.)  The debugger UI may want to take this into account if
  1009.      * it shows the user the OS suspend count of the thread.
  1010.      *
  1011.      * This function only makes sense in the context of 
  1012.      * unmanaged debugging - during managed debugging threads are not
  1013.      * OS suspended. (They are cooperatively suspended.)
  1014.      */
  1015.  
  1016.     HRESULT IsOSSuspended([in] DWORD threadID, [out] BOOL *pbSuspended);
  1017.  
  1018.     /*
  1019.      * GetThreadContext returns the context for the given thread.  The
  1020.      * debugger should call this function rather than the Win32 
  1021.      * GetThreadContext, because the thread may actually be in a "hijacked" 
  1022.      * state where its context has been temporarily changed.
  1023.      * 
  1024.      * The data returned is a CONTEXT structure for the current platform.
  1025.      */
  1026.  
  1027.     HRESULT GetThreadContext([in] DWORD threadID, 
  1028.                              [in] ULONG32 contextSize,
  1029.                              [out, length_is(contextSize), 
  1030.                              size_is(contextSize)] BYTE context[]);
  1031.  
  1032.     /*
  1033.      * SetThreadContext sets the context for the given thread.  The
  1034.      * debugger should call this function rather than the Win32 
  1035.      * SetThreadContext, because the thread may actually be in a "hijacked" 
  1036.      * state where its context has been temporarily changed.
  1037.      * 
  1038.      * The data returned is a CONTEXT structure for the current platform.
  1039.      *
  1040.      * This is a dangerous call which can corrupt the runtime if used 
  1041.      * improperly.
  1042.      *
  1043.      * Not Implemented In-Proc
  1044.      */
  1045.  
  1046.     HRESULT SetThreadContext([in] DWORD threadID, 
  1047.                              [in] ULONG32 contextSize,
  1048.                              [in, length_is(contextSize), 
  1049.                              size_is(contextSize)] BYTE context[]);
  1050.  
  1051.     /*
  1052.      * ReadMemory reads memory from the process.  Any debugger patches will
  1053.      * be automatically removed.  No caching of process memory is peformed.
  1054.      */
  1055.  
  1056.     HRESULT ReadMemory([in] CORDB_ADDRESS address, [in] DWORD size,
  1057.                        [out, size_is(size), length_is(size)] BYTE buffer[],
  1058.                        [out] DWORD *read);
  1059.  
  1060.     /*
  1061.      * WriteMemory writes memory in the process.  Any debugger patches will
  1062.      * be automatically written behind.
  1063.      *
  1064.      * This is a dangerous call which can corrupt the runtime if used 
  1065.      * improperly.
  1066.      *
  1067.      * Not Implemented In-Proc
  1068.      */
  1069.  
  1070.     HRESULT WriteMemory([in] CORDB_ADDRESS address, [in] DWORD size,
  1071.                         [in, size_is(size)] BYTE buffer[],
  1072.                         [out]DWORD *written);
  1073.  
  1074.  
  1075.     /*
  1076.      * ClearCurrentException clears the current unmanaged exception on
  1077.      * the given thread. Call this before calling Continue when a
  1078.      * thread has reported an unmanaged exception that should be
  1079.      * ignored by the debuggee.
  1080.      *
  1081.      * Not Implemented In-Proc
  1082.      */
  1083.  
  1084.     HRESULT ClearCurrentException([in] DWORD threadID);
  1085.  
  1086.     /*
  1087.      * EnableLogMessages enables/disables sending of log messages to the 
  1088.      * debugger for logging.
  1089.      *
  1090.      * Not Implemented In-Proc
  1091.      */
  1092.  
  1093.     HRESULT EnableLogMessages([in]BOOL fOnOff);
  1094.  
  1095.     /*
  1096.      * ModifyLogSwitch modifies the specified switch's severity level.
  1097.      *
  1098.      * Not Implemented In-Proc
  1099.      */
  1100.     HRESULT ModifyLogSwitch([in] WCHAR *pLogSwitchName,
  1101.                             [in]LONG lLevel);
  1102.     
  1103.     /* 
  1104.      * EnumerateAppDomains enumerates all app domains in the process.
  1105.      */
  1106.  
  1107.     HRESULT EnumerateAppDomains([out] ICorDebugAppDomainEnum **ppAppDomains);
  1108.     /*
  1109.      * GetObject returns the runtime process object.
  1110.      * Note: This method is not yet implemented.
  1111.      */
  1112.  
  1113.     HRESULT GetObject([out] ICorDebugValue **ppObject);
  1114.  
  1115.     /*
  1116.      * Given a fiber cookie from the Runtime Hosting API, return
  1117.      * the matching ICorDebugThread.
  1118.      *
  1119.      * If the thread is found, returns S_OK. Returns S_FALSE otherwise.
  1120.      */
  1121.     
  1122.     HRESULT ThreadForFiberCookie([in] DWORD fiberCookie,
  1123.                                  [out] ICorDebugThread **ppThread);
  1124. };
  1125.  
  1126. /* ------------------------------------------------------------------------- *
  1127.  * Breakpoint interface
  1128.  * ------------------------------------------------------------------------- */
  1129.  
  1130. /*
  1131.  * ICorDebugBreakpoint represents a breakpoint; either a breakpoint
  1132.  * set in a function, or a watchpoint set on a value.
  1133.  * 
  1134.  * Note that breakpoints have no direct support for condition 
  1135.  * expressions.  The debugger must implement this functionality on top of 
  1136.  * this interface if desired.
  1137.  *
  1138.  * Not Implemented In-Proc : There are _no_ breakpoints within the in-proc
  1139.  * interface.
  1140.  */
  1141.  
  1142. [
  1143.     object,
  1144.     uuid(CC7BCAE8-8A68-11d2-983C-0000F808342D),
  1145.     pointer_default(unique)
  1146. ]
  1147. interface ICorDebugBreakpoint : IUnknown
  1148. {
  1149.     HRESULT Activate([in] BOOL bActive);
  1150.     HRESULT IsActive([out] BOOL *pbActive);
  1151. };
  1152.  
  1153. [
  1154.     object,
  1155.     uuid(CC7BCAE9-8A68-11d2-983C-0000F808342D),
  1156.     pointer_default(unique)
  1157. ]
  1158. interface ICorDebugFunctionBreakpoint : ICorDebugBreakpoint
  1159. {
  1160.     HRESULT GetFunction([out] ICorDebugFunction **ppFunction);
  1161.     HRESULT GetOffset([out] ULONG32 *pnOffset);
  1162. };
  1163.  
  1164. [
  1165.     object,
  1166.     uuid(CC7BCAEA-8A68-11d2-983C-0000F808342D),
  1167.     pointer_default(unique)
  1168. ]
  1169. interface ICorDebugModuleBreakpoint : ICorDebugBreakpoint
  1170. {
  1171.     HRESULT GetModule([out] ICorDebugModule **ppModule);
  1172. };
  1173.  
  1174. [
  1175.     object,
  1176.     uuid(CC7BCAEB-8A68-11d2-983C-0000F808342D),
  1177.     pointer_default(unique)
  1178. ]
  1179. interface ICorDebugValueBreakpoint : ICorDebugBreakpoint
  1180. {
  1181.     HRESULT GetValue([out] ICorDebugValue **ppValue);
  1182. };
  1183.  
  1184. /* ------------------------------------------------------------------------- *
  1185.  * Stepper interface
  1186.  * ------------------------------------------------------------------------- */
  1187.  
  1188. /*
  1189.  * A Stepper object represents a stepping operation being performed by 
  1190.  * the debugger.  Note that there can be more than one stepper per
  1191.  * thread; for instance a breakpoint may be hit in the midst of a
  1192.  * stepping over a function, and the user may wish to start a new 
  1193.  * stepping operation inside that function. (Note that it is up to the
  1194.  * debugger how to handle this; it may want to cancel the original
  1195.  * stepping operation, or nest them.  This API allows either behavior.) 
  1196.  * 
  1197.  * Also, a stepper may migrate between threads if a cross-thread
  1198.  * marshalled call is made by the EE.
  1199.  * 
  1200.  * This object serves several purposes.  Its serves as an identifer between a
  1201.  * step command issued and the completion of that command. It also
  1202.  * provides a central interface to encapsulate all of the stepping
  1203.  * that can be performed.  Finally it provides a way to prematurely
  1204.  * cancel a stepping operation.
  1205.  *
  1206.  * Not Implemented In-Proc
  1207.  */
  1208.  
  1209. [
  1210.     object,
  1211.     uuid(CC7BCAEC-8A68-11d2-983C-0000F808342D),
  1212.     pointer_default(unique)
  1213. ]
  1214. interface ICorDebugStepper : IUnknown
  1215. {
  1216.     /*
  1217.      * IsActive returns whether or not the stepper is active, that is, whether
  1218.      * it is currently stepping.
  1219.      *
  1220.      * Any step action remains active until StepComplete is called.  Note that
  1221.      * this automatically deactivates the stepper.
  1222.      *
  1223.      * A stepper may also be deactivated prematurely by calling
  1224.      * Deactivate before a callback condition is reached.
  1225.      */
  1226.  
  1227.     HRESULT IsActive([out] BOOL *pbActive);
  1228.  
  1229.     /*
  1230.      * Deactivate causes a stepper to cancel the last stepping command it
  1231.      * received.  A new stepping command may then be issued.
  1232.      */
  1233.  
  1234.     HRESULT Deactivate();
  1235.  
  1236.     /*
  1237.      * SetInterceptMask controls which intercept code will be stepped
  1238.      * into by the stepper. If the bit for an interceptor is set, the
  1239.      * stepper will complete with reason STEPPER_INTERCEPT when the
  1240.      * given type of intercept occurs.  If the bit is cleared, the 
  1241.      * intercepting code will be skipped.
  1242.      *
  1243.      * Note that SetInterceptMask may have unforeseen interactions
  1244.      * with SetUnmappedStopMask (from the user's point of view).  For
  1245.      * example, if the only visible (ie, non internal) portion of class
  1246.      * init code lacks mapping info (STOP_NO_MAPPING_INFO) and
  1247.      * STOP_NO_MAPPING_INFO isn't set, then we'll step over the class init.
  1248.      *
  1249.      * By default, only INTERCEPT_NONE will be used.
  1250.      */
  1251.  
  1252.     typedef enum CorDebugIntercept
  1253.     {
  1254.           INTERCEPT_NONE                = 0x0 ,
  1255.           INTERCEPT_CLASS_INIT            = 0x01,
  1256.           INTERCEPT_EXCEPTION_FILTER    = 0x02,
  1257.           INTERCEPT_SECURITY            = 0x04,
  1258.           INTERCEPT_CONTEXT_POLICY        = 0x08,
  1259.           INTERCEPT_INTERCEPTION        = 0x10,
  1260.           INTERCEPT_ALL                    = 0xffff
  1261.     } CorDebugIntercept;
  1262.  
  1263.     HRESULT SetInterceptMask([in] CorDebugIntercept mask);
  1264.  
  1265.     /*
  1266.      * SetUnmappedStopMask controls whether the stepper
  1267.      * will stop in jitted code which is not mapped to IL.
  1268.      * 
  1269.      * If the given flag is set, then that type of unmapped code
  1270.      * will be stopped in.  Otherwise stepping transparently continues.
  1271.      *
  1272.      * It should be noted that if one doesn't use a stepper to enter a
  1273.      * method (for example, the main() method of C++), then one
  1274.      * won't neccessarily step over prologs,etc.
  1275.      *
  1276.      * By default, STOP_OTHER_UNMAPPED will be used.
  1277.      */
  1278.  
  1279.     typedef enum CorDebugUnmappedStop
  1280.     {
  1281.         STOP_NONE               = 0x0,
  1282.         STOP_PROLOG                = 0x01,
  1283.         STOP_EPILOG                = 0x02,
  1284.         STOP_NO_MAPPING_INFO    = 0x04,        
  1285.         STOP_OTHER_UNMAPPED        = 0x08,
  1286.         STOP_UNMANAGED          = 0x10,
  1287.         STOP_ALL                = 0xffff
  1288.     } CorDebugUnmappedStop;
  1289.  
  1290.     HRESULT SetUnmappedStopMask([in] CorDebugUnmappedStop mask);
  1291.  
  1292.     /*
  1293.      * Step is called when a thread is to be single stepped.  The step
  1294.      * will complete at the next managed instruction executed by the
  1295.      * EE in the stepper's frame.
  1296.      * 
  1297.      * If bStepIn is TRUE, any function calls made during the step
  1298.      * will be stepped into.  Otherwise they will be skipped.
  1299.      *
  1300.      * If Step is called on a stepper which is not in managed code,
  1301.      * the step will complete when the next managed code is executed
  1302.      * by the thread. (if bStepIn is FALSE, it will only complete 
  1303.      * when managed code is returned to, not when it is stepped into.)
  1304.      */
  1305.  
  1306.     HRESULT Step([in] BOOL bStepIn);
  1307.  
  1308.     /*
  1309.      * StepRange works just like Step, except it will not complete
  1310.      * until code outside the given range is reached.  This can be
  1311.      * more efficient than stepping one instruction at a time.
  1312.      * 
  1313.      * Ranges are specified as a list of offset pairs [start, end)
  1314.      * (note that end is exclusive) from the start of the stepper's
  1315.      * frame's code.
  1316.      *
  1317.      * Ranges are in relative to the IL code of a method.  Call
  1318.      * SetRangeIL(FALSE) to specify ranges relative to the native code
  1319.      * of a method.
  1320.      */
  1321.  
  1322.     typedef struct COR_DEBUG_STEP_RANGE
  1323.     {
  1324.         ULONG32 startOffset, endOffset;
  1325.     } COR_DEBUG_STEP_RANGE;
  1326.  
  1327.     HRESULT StepRange([in] BOOL bStepIn, 
  1328.                       [in,size_is(cRangeCount)] COR_DEBUG_STEP_RANGE ranges[], 
  1329.                       [in] ULONG32 cRangeCount);
  1330.  
  1331.     /*
  1332.      * A StepOut operation will complete after the current frame is 
  1333.      * returned from normally and the previous frame is reactivated.
  1334.      * 
  1335.      * If this is called when in unmanaged code, the step will complete
  1336.      * when the calling managed code is returned to.
  1337.      */
  1338.  
  1339.     HRESULT StepOut();
  1340.  
  1341.     /*
  1342.      * SetRangeIL is used to set whether the ranges passed StepRange are
  1343.      * relative to the IL code or the native code for the method being 
  1344.      * stepped in.
  1345.      *
  1346.      * By default the range is in IL.
  1347.      */
  1348.  
  1349.     HRESULT SetRangeIL([in] BOOL bIL);
  1350. };
  1351.  
  1352.  
  1353. /* ------------------------------------------------------------------------- *
  1354.  * Program state object interfaces
  1355.  * ------------------------------------------------------------------------- */
  1356.  
  1357. /*
  1358.  * ICorDebugRegisterSet 
  1359.  */
  1360.  
  1361. [
  1362.     object,
  1363.     uuid(CC7BCB0B-8A68-11d2-983C-0000F808342D),
  1364.     pointer_default(unique)
  1365. ]
  1366. interface ICorDebugRegisterSet : IUnknown
  1367. {
  1368.     typedef enum CorDebugRegister
  1369.     {
  1370.         // registers (potentially) available on all architectures
  1371.         // Note that these overlap with the architecture-specific 
  1372.         // registers
  1373.  
  1374.         REGISTER_INSTRUCTION_POINTER = 0,
  1375.         REGISTER_STACK_POINTER,
  1376.         REGISTER_FRAME_POINTER,
  1377.         
  1378.         // X86 registers
  1379.  
  1380.         REGISTER_X86_EIP = 0,
  1381.         REGISTER_X86_ESP,
  1382.         REGISTER_X86_EBP,
  1383.  
  1384.         REGISTER_X86_EAX,
  1385.         REGISTER_X86_ECX,
  1386.         REGISTER_X86_EDX,
  1387.         REGISTER_X86_EBX,
  1388.  
  1389.         REGISTER_X86_ESI,
  1390.         REGISTER_X86_EDI,
  1391.  
  1392.         REGISTER_X86_FPSTACK_0,
  1393.         REGISTER_X86_FPSTACK_1,
  1394.         REGISTER_X86_FPSTACK_2,
  1395.         REGISTER_X86_FPSTACK_3,
  1396.         REGISTER_X86_FPSTACK_4,
  1397.         REGISTER_X86_FPSTACK_5,
  1398.         REGISTER_X86_FPSTACK_6,
  1399.         REGISTER_X86_FPSTACK_7,
  1400.  
  1401.         // other architectures here
  1402.     } CorDebugRegister;
  1403.  
  1404.     /*
  1405.      * GetRegistersAvailable returns a mask indicating which registers
  1406.      * are available in the given register set.  Registers may be unavailable
  1407.      * if their value is undeterminable for the given situation.  The returned
  1408.      * word contains a bit for each register (1 << register index), which will
  1409.      * be 1 if the register is available or 0 if it is not.
  1410.      */
  1411.  
  1412.     HRESULT GetRegistersAvailable([out] ULONG64 *pAvailable);
  1413.  
  1414.     /* 
  1415.      * GetRegisters returns an array of register values corresponding
  1416.      * to the given mask.  The registers which have their bit set in
  1417.      * the mask will be packed into the resulting array.  (No room is
  1418.      * assigned in the array for registers whose mask bit is not set.)
  1419.      * Thus, the size of the array should be equal to the number of
  1420.      * 1's in the mask.
  1421.      *
  1422.      * If an unavailable register is indicated by the mask, an indeterminate
  1423.      * value will be returned for the corresponding register.
  1424.      *
  1425.      * registerBufferCount should indicate number of elements in the
  1426.      * buffer to receive the register values.  If it is too small for
  1427.      * the number of registers indicated by the mask, the higher
  1428.      * numbered registers will be truncated from the set.  Or, if it
  1429.      * is too large, the unused registerBuffer elements will be
  1430.      * unmodified.  */
  1431.  
  1432.     HRESULT GetRegisters([in] ULONG64 mask, [in] ULONG32 regCount,
  1433.                          [out, size_is(regCount), length_is(regCount)] 
  1434.                          CORDB_REGISTER regBuffer[]);
  1435.  
  1436.     /* 
  1437.      * SetRegisters sets the value of the set registers corresponding
  1438.      * to the given mask.  For each bit set in the mask, the
  1439.      * corresponding register will be set from the corresponding
  1440.      * element in the registerBuffer. (Note that the correlation is by
  1441.      * sequence, not by the position of the bit.  That is,
  1442.      * registerBuffer is "packed"; there are no elements corresponding
  1443.      * to registers whose bit is not set.
  1444.      *
  1445.      * If an unavailable register is indicated by the mask, the
  1446.      * register will not be set (although a value for that register is
  1447.      * recognized from the registerBuffer.)
  1448.      *
  1449.      * registerBufferCount should indicate number of elements in the
  1450.      * buffer to be the register values.  If it is too small for the
  1451.      * number of registers indicated by the mask, the higher numbered
  1452.      * registers will not be set.  If it is too large, the extra
  1453.      * values will be ignored.
  1454.      *
  1455.      * Note that setting registers this way is inherently dangerous.
  1456.      * CorDebug makes no attempt to insure that the runtime remains in
  1457.      * a valid state when register values are changed. (For example,
  1458.      * if the IP were set to point to non-managed code, who knows what
  1459.      * would happen.)  
  1460.      *
  1461.      * Not Implemented In-Proc
  1462.      */
  1463.  
  1464.     HRESULT SetRegisters([in] ULONG64 mask, 
  1465.                          [in] ULONG32 regCount, 
  1466.                          [in, size_is(regCount)] CORDB_REGISTER regBuffer[]);
  1467.  
  1468.     /*
  1469.      * GetThreadContext returns the context for the given thread.  The
  1470.      * debugger should call this function rather than the Win32 
  1471.      * GetThreadContext, because the thread may actually be in a "hijacked" 
  1472.      * state where its context has been temporarily changed.
  1473.      * 
  1474.      * The data returned is a CONTEXT structure for the current platform.
  1475.      */
  1476.  
  1477.     HRESULT GetThreadContext([in] ULONG32 contextSize,
  1478.                              [out, length_is(contextSize), 
  1479.                              size_is(contextSize)] BYTE context[]);
  1480.  
  1481.     /*
  1482.      * SetThreadContext sets the context for the given thread.  The
  1483.      * debugger should call this function rather than the Win32 
  1484.      * SetThreadContext, because the thread may actually be in a "hijacked" 
  1485.      * state where its context has been temporarily changed.
  1486.      * 
  1487.      * The data returned is a CONTEXT structure for the current platform.
  1488.      *
  1489.      * This is a dangerous call which can corrupt the runtime if used 
  1490.      * improperly.
  1491.      *
  1492.      * Not Implemented In-Proc
  1493.      */
  1494.  
  1495.     HRESULT SetThreadContext([in] ULONG32 contextSize,
  1496.                              [in, length_is(contextSize), 
  1497.                              size_is(contextSize)] BYTE context[]);
  1498. }
  1499.  
  1500. /*
  1501.  * ICorDebugThread represents a thread in the process.  The lifetime of a 
  1502.  * thread object is equal to the lifetime of the thread it represents.
  1503.  */
  1504.  
  1505. [
  1506.     object,
  1507.     uuid(938c6d66-7fb6-4f69-b389-425b8987329b),
  1508.     pointer_default(unique)
  1509. ]
  1510. interface ICorDebugThread : IUnknown
  1511. {
  1512.     /*
  1513.      * GetProcess returns the process of which this thread is a part.
  1514.      */
  1515.  
  1516.     HRESULT GetProcess([out] ICorDebugProcess **ppProcess);
  1517.  
  1518.     /*
  1519.      * GetID returns the current OS ID of the active part of the thread.  
  1520.      * Note that this may theoretically change as the process executes,
  1521.      * and even be different for different parts of the thread.
  1522.      */
  1523.  
  1524.     HRESULT GetID([out] DWORD *pdwThreadId);
  1525.  
  1526.     /*
  1527.      * GetHandle returns the current Handle of the active part of the thread.  
  1528.      * Note that this may theoretically change as the process executes,
  1529.      * and even be different for different parts of the thread.
  1530.      */
  1531.  
  1532.     HRESULT GetHandle([out] HTHREAD *phThreadHandle);
  1533.  
  1534.     /*
  1535.      * GetAppDomain returns the app domain which owns the thread.
  1536.      */
  1537.  
  1538.     HRESULT GetAppDomain([out] ICorDebugAppDomain **ppAppDomain);
  1539.  
  1540.     /*
  1541.      * SetDebugState sets the current debug state of the thread.
  1542.      * (The "current debug state"
  1543.      * represents the debug state if the process were to be continued,
  1544.      * not the actual current state.)
  1545.      *
  1546.      * The normal value for this is THREAD_RUNNING.  Only the debugger
  1547.      * can affect the debug state of a thread.  Debug states do
  1548.      * last across continues, so if you want to keep a thread
  1549.      * THREAD_SUSPENDed over mulitple continues, you can set it once
  1550.      * and thereafter not have to worry about it.
  1551.      *
  1552.      * Not Implemented In-Proc
  1553.      */
  1554.  
  1555.     HRESULT SetDebugState([in] CorDebugThreadState state);
  1556.  
  1557.     /*
  1558.      * GetDebugState returns the current debug state of the thread.
  1559.      * (If the process is currently stopped, the "current debug state"
  1560.      * represents the debug state if the process were to be continued,
  1561.      * not the actual current state.)
  1562.      */
  1563.  
  1564.     HRESULT GetDebugState([out] CorDebugThreadState *pState);
  1565.  
  1566.     /*
  1567.      * GetUserState returns the user state of the thread, that is, the state
  1568.      * which it has when the program being debugged examines it.
  1569.      */
  1570.  
  1571.     typedef enum CorDebugUserState
  1572.     {
  1573.         USER_STOP_REQUESTED        = 0x01,
  1574.         USER_SUSPEND_REQUESTED    = 0x02,
  1575.         USER_BACKGROUND            = 0x04,
  1576.         USER_UNSTARTED            = 0x08,
  1577.         USER_STOPPED            = 0x10,
  1578.         USER_WAIT_SLEEP_JOIN    = 0x20,
  1579.         USER_SUSPENDED            = 0x40
  1580.     } CorDebugUserState;
  1581.  
  1582.     HRESULT GetUserState([out] CorDebugUserState *pState);
  1583.  
  1584.     /* 
  1585.      * GetCurrentException returns the exception object which is
  1586.      * currently being thrown by the thread.  This will only exist for
  1587.      * the duration of an Exception callback.
  1588.      *
  1589.      * Not Implemented In-Proc
  1590.      */
  1591.  
  1592.     HRESULT GetCurrentException([out] ICorDebugValue **ppExceptionObject);
  1593.  
  1594.     /* 
  1595.      * ClearCurrentException clears the current exception object,
  1596.      * preventing it from being thrown.  This should be called before
  1597.      * the Exception callback returns.
  1598.      * 
  1599.      * This can only succeed if the current exception is 
  1600.      * a continuable exception.
  1601.      *
  1602.      * Not Implemented In-Proc
  1603.      */
  1604.  
  1605.     HRESULT ClearCurrentException();
  1606.  
  1607.     /*
  1608.      * CreateStepper creates a stepper object which operates relative
  1609.      * to the active frame in the given thread. (Note that this may be
  1610.      * unmanaged code.)  The Stepper API must then be used to perform
  1611.      * actual stepping.
  1612.      *
  1613.      * Not Implemented In-Proc
  1614.      */
  1615.  
  1616.     HRESULT CreateStepper([out] ICorDebugStepper **ppStepper);
  1617.  
  1618.     /*
  1619.      * EnumerateChains returns an enum which will return all the stack
  1620.      * chains in the thread, starting at the active (most recent) one.
  1621.      * These chains represent the physical call stack for the thread.
  1622.      * 
  1623.      * Chain boundaries occur for several reasons:
  1624.      *   managed <-> unmanaged transitions
  1625.      *   context switches
  1626.      *   debugger hijacking of user threads
  1627.      * 
  1628.      * Note that in the simple case for a thread running purely
  1629.      * managed code in a single context there will be a one to one
  1630.      * correspondence between threads & chains.
  1631.      *
  1632.      * A debugger may want to rearrange the physical call
  1633.      * stacks of all threads into logical call stacks. This would involve
  1634.      * sorting all the threads' chains by their caller/callee
  1635.      * relationships & regrouping them.
  1636.      *
  1637.      * InProc Only: Note that invoking this method will cause a stack trace
  1638.      * to occur, and thus will refresh any caches that the inprocess debugger
  1639.      * maintains.  This should only be called once per time that you want
  1640.      * the stack traced (mostly, once after managed code has been allowed to
  1641.      * execute) - the enumerator that's
  1642.      * returned can be cloned / reset if multiple stack traces are desired.
  1643.      *
  1644.      */
  1645.  
  1646.     HRESULT EnumerateChains([out] ICorDebugChainEnum **ppChains);
  1647.  
  1648.     /*
  1649.      * GetActiveChain is a convenience routine to return the 
  1650.      * active (most recent) chain on the thread, if any.
  1651.      *
  1652.      */
  1653.  
  1654.     HRESULT GetActiveChain([out] ICorDebugChain **ppChain);
  1655.  
  1656.     /*
  1657.      * GetActiveFrame is a convenience routine to return the 
  1658.      * active (most recent) frame on the thread, if any.
  1659.      *
  1660.      */
  1661.  
  1662.     HRESULT GetActiveFrame([out] ICorDebugFrame **ppFrame);
  1663.  
  1664.     /*
  1665.      * GetRegisterSet returns the register set for the active part
  1666.      * of the thread.
  1667.      *
  1668.      */
  1669.  
  1670.     HRESULT GetRegisterSet([out] ICorDebugRegisterSet **ppRegisters);
  1671.  
  1672.     /*
  1673.      * CreateEval creates an evaluation object which operates on the 
  1674.      * given thread.  The Eval will push a new chain on the thread before
  1675.      * doing its computation.  
  1676.      *
  1677.      * Note that this interrupts the computation currently
  1678.      * being performed on the thread until the eval completes.
  1679.      *
  1680.      * Not Implemented In-Proc
  1681.      */
  1682.  
  1683.     HRESULT CreateEval([out] ICorDebugEval **ppEval);
  1684.  
  1685.     /*
  1686.      * Returns the runtime thread object.
  1687.      */
  1688.     
  1689.     HRESULT GetObject([out] ICorDebugValue **ppObject);
  1690. };
  1691.  
  1692. /*
  1693.  * ICorDebugChain represents a segment of a physical or logical call
  1694.  * stack.  All frames in a chain occupy contiguous stack space, and
  1695.  * they share the same thread & context.  A chain may represent either
  1696.  * managed or unmanaged code, although an unmanaged chain will have no
  1697.  * visible frames.
  1698.  */
  1699.  
  1700. [
  1701.     object,
  1702.     uuid(CC7BCAEE-8A68-11d2-983C-0000F808342D),
  1703.     pointer_default(unique)
  1704. ]
  1705. interface ICorDebugChain : IUnknown
  1706. {
  1707.     /* 
  1708.      * GetThread returns the physical thread which this call chain is
  1709.      * part of.
  1710.      */
  1711.  
  1712.     HRESULT GetThread([out] ICorDebugThread **ppThread);
  1713.  
  1714.     /*
  1715.      * GetStackRange returns the address range of the stack segment for the
  1716.      * call chain.  Note that you cannot make any assumptions about
  1717.      * what is actually stored on
  1718.      * the stack - the numeric range is to compare stack frame
  1719.      * locations only.  
  1720.      */
  1721.  
  1722.     HRESULT GetStackRange([out] CORDB_ADDRESS *pStart, [out] CORDB_ADDRESS *pEnd);
  1723.  
  1724.     /*
  1725.      * GetContext returns the COM+ context for all of the frames in
  1726.      * the chain. 
  1727.      *
  1728.      * Note: not yet implemented.
  1729.      */
  1730.  
  1731.     HRESULT GetContext([out] ICorDebugContext **ppContext);
  1732.  
  1733.     /*
  1734.      * GetCaller returns a pointer to the chain which called this
  1735.      * chain.  Note that this may be a chain on another thread in the
  1736.      * case of cross-thread-marshalled calls. The caller will be NULL
  1737.      * for spontaneously called chains (e.g. the ThreadProc, a
  1738.      * debugger initiated call, etc.)
  1739.      */
  1740.  
  1741.     HRESULT GetCaller([out] ICorDebugChain **ppChain);
  1742.  
  1743.     /*
  1744.      * GetCallee returns a pointer to the chain which this chain is
  1745.      * waiting on before it resumes. Note that this may be a chain on
  1746.      * another thread in the case of cross-thread-marshalled
  1747.      * calls. The callee will be NULL if the chain is currently
  1748.      * actively running.
  1749.      */
  1750.  
  1751.     HRESULT GetCallee([out] ICorDebugChain **ppChain);
  1752.  
  1753.     /*
  1754.      * GetPrevious returns a pointer to the chain which was on this 
  1755.      * thread before the current one was pushed, if there is one.
  1756.      */
  1757.  
  1758.     HRESULT GetPrevious([out] ICorDebugChain **ppChain);
  1759.  
  1760.     /*
  1761.      * GetNext returns a pointer to the chain which was pushed on this 
  1762.      * thread after the current one, if there is one.
  1763.      */
  1764.  
  1765.     HRESULT GetNext([out] ICorDebugChain **ppChain);
  1766.  
  1767.     /*
  1768.      * IsManaged returns whether or not the chain is running managed
  1769.      * code.  
  1770.      */
  1771.  
  1772.     HRESULT IsManaged([out] BOOL *pManaged);
  1773.  
  1774.     /*
  1775.      * These chains represent the physical call stack for the thread.
  1776.      * EnumerateFrames returns an iterator which will list all the stack
  1777.      * frames in the chain, starting at the active (most recent) one. This 
  1778.      * should be called only for managed chains.
  1779.      */
  1780.  
  1781.     HRESULT EnumerateFrames([out] ICorDebugFrameEnum **ppFrames);
  1782.  
  1783.     /*
  1784.      * GetActiveFrame is a convenience routine to return the 
  1785.      * active (most recent) frame on the chain, if any.
  1786.      */
  1787.  
  1788.     HRESULT GetActiveFrame([out] ICorDebugFrame **ppFrame);
  1789.  
  1790.     /*
  1791.      * GetRegisterSet returns the register set for the active part
  1792.      * of the chain.
  1793.      *
  1794.      */
  1795.  
  1796.     HRESULT GetRegisterSet([out] ICorDebugRegisterSet **ppRegisters);
  1797.  
  1798.     /* 
  1799.      * GetReason returns the reason for the genesis of this calling chain.
  1800.      */
  1801.  
  1802.     typedef enum CorDebugChainReason
  1803.     {
  1804.         // Note that the first five line up with CorDebugIntercept
  1805.         CHAIN_NONE              = 0x000,
  1806.         CHAIN_CLASS_INIT        = 0x001,
  1807.         CHAIN_EXCEPTION_FILTER  = 0x002,
  1808.         CHAIN_SECURITY          = 0x004,
  1809.         CHAIN_CONTEXT_POLICY    = 0x008,
  1810.         CHAIN_INTERCEPTION      = 0x010,
  1811.         CHAIN_PROCESS_START     = 0x020,
  1812.         CHAIN_THREAD_START      = 0x040,
  1813.         CHAIN_ENTER_MANAGED     = 0x080,
  1814.         CHAIN_ENTER_UNMANAGED   = 0x100,
  1815.         CHAIN_DEBUGGER_EVAL     = 0x200,
  1816.         CHAIN_CONTEXT_SWITCH    = 0x400,
  1817.         CHAIN_FUNC_EVAL         = 0x800,
  1818.     } CorDebugChainReason;
  1819.  
  1820.     HRESULT GetReason([out] CorDebugChainReason *pReason);
  1821. };
  1822.  
  1823.  
  1824. [
  1825.     object,
  1826.     uuid(CC7BCAEF-8A68-11d2-983C-0000F808342D),
  1827.     pointer_default(unique)
  1828. ]
  1829. interface ICorDebugFrame : IUnknown
  1830. {
  1831.     /*
  1832.      * GetChain returns the chain of which this stack frame is a part.
  1833.      */
  1834.  
  1835.     HRESULT GetChain([out] ICorDebugChain **ppChain);
  1836.  
  1837.     /*
  1838.      * GetCode returns the code which this stack frame is running.
  1839.      */
  1840.  
  1841.     HRESULT GetCode([out] ICorDebugCode **ppCode);
  1842.  
  1843.     /*
  1844.      * GetFunction is a convenience routine to return the function for the 
  1845.      * code which this stack frame is running.
  1846.      */
  1847.  
  1848.     HRESULT GetFunction([out] ICorDebugFunction **ppFunction);
  1849.  
  1850.     /*
  1851.      * GetFunctionToken is a convenience routine to return the token for the
  1852.      * function for the code which this stack frame is running.
  1853.      */
  1854.  
  1855.     HRESULT GetFunctionToken([out] mdMethodDef *pToken);
  1856.  
  1857.     /* 
  1858.      * GetStackRange returns the absolute address range of the stack
  1859.      * frame.  (This is useful for piecing together interleaved stack
  1860.      * traces gathered from multiple ee engines.)  Note that you
  1861.      * cannot make any assumptions about what is actually stored on
  1862.      * the stack - the numeric range is to compare stack frame
  1863.      * locations only.  
  1864.      */
  1865.  
  1866.     HRESULT GetStackRange([out] CORDB_ADDRESS *pStart, [out] CORDB_ADDRESS *pEnd);
  1867.  
  1868.     /*
  1869.      * GetCaller returns a pointer to the frame in the current chain 
  1870.      * which called this frame, or NULL if this is the outermost frame 
  1871.      * in the chain.
  1872.      */
  1873.  
  1874.     HRESULT GetCaller([out] ICorDebugFrame **ppFrame);
  1875.  
  1876.     /* 
  1877.      * GetCallee returns a pointer to the frame in the current chain 
  1878.      * which this frame called, or NULL if this is the innermost frame 
  1879.      * in the chain.
  1880.      */
  1881.  
  1882.     HRESULT GetCallee([out] ICorDebugFrame **ppFrame);
  1883.  
  1884.     /*
  1885.      * CreateStepper creates a stepper object which operates relative to the 
  1886.      * frame. The Stepper API must then be used to perform actual stepping. 
  1887.      *
  1888.      * Note that if this frame is not active, the frame will typically have to 
  1889.      * be returned to before the step is completed. 
  1890.      *
  1891.      * Not Implemented In-Proc
  1892.      */
  1893.  
  1894.     HRESULT CreateStepper([out] ICorDebugStepper **ppStepper);
  1895. };
  1896.  
  1897. /*
  1898.  * ICorDebugILFrame is a specialized interface of ICorDebugFrame for
  1899.  * which is used either for IL frames or jitted frames.  (Note
  1900.  * that jitted frames implement both ILFrame and NativeFrame.)
  1901.  */
  1902.  
  1903. [
  1904.     object,
  1905.     uuid(03E26311-4F76-11d3-88C6-006097945418),
  1906.     pointer_default(unique)
  1907. ]
  1908. interface ICorDebugILFrame : ICorDebugFrame
  1909. {
  1910.     /*
  1911.      * GetIP returns the stack frame's offset into the function's IL code.  
  1912.      * If this stack frame is active, this address is the next 
  1913.      * instruction to execute.  If this stack frame is not active, this is the 
  1914.      * next instruction to execute when the stack frame is reactivated. 
  1915.      *
  1916.      * Note that if this a jitted frame, the IP will be determined by
  1917.      * mapping backwards from the actual native IP, so the value may
  1918.      * be only approximately correct.
  1919.      *
  1920.      * If pMappingResult is not NULL, A mapping result is returned which
  1921.      * indicates the details of how the IP was obtained.  The following values
  1922.      * can be returned:
  1923.      *
  1924.      *    MAPPING_EXACT - the IP is correct; either the frame is
  1925.      *    interpreted or there is an exact IL map for the function.
  1926.      *
  1927.      *  MAPPING_APPROXIMATE - the IP was successfully mapped, but may
  1928.      *  be only approximately correct
  1929.      *
  1930.      *  MAPPING_UNMAPPED_ADDRESS - although there is mapping info for
  1931.      *  the function, the current address is not mappable to IL.  An
  1932.      *  IP of 0 is returned.
  1933.      *
  1934.      *  MAPPING_PROLOG - the native code is in the prolog, so an IP of
  1935.      *  0 is returned
  1936.      *
  1937.      *  MAPPING_EPILOG - the native code is in an epilog, so the last
  1938.      *  IP of the method is returned
  1939.      *
  1940.      *  MAPPING_NO_INFO - no mapping info is available for the method,
  1941.      *  so an IP of 0 is returned
  1942.      *
  1943.      */
  1944.  
  1945.     typedef enum CorDebugMappingResult
  1946.     {
  1947.         MAPPING_PROLOG              = 0x1,
  1948.         MAPPING_EPILOG              = 0x2,
  1949.         MAPPING_NO_INFO             = 0x4,
  1950.         MAPPING_UNMAPPED_ADDRESS    = 0x8,
  1951.         MAPPING_EXACT               = 0x10,
  1952.         MAPPING_APPROXIMATE         = 0x20,
  1953.     } CorDebugMappingResult;
  1954.  
  1955.     HRESULT GetIP([out] ULONG32 *pnOffset, [out] CorDebugMappingResult *pMappingResult);
  1956.  
  1957.     /* 
  1958.      * SetIP sets the instruction pointer to the IL at the given offset. 
  1959.      * The debugger will do its best to fix up the state of the executing code
  1960.      * so that it is consistent with the new IP as far as the EE is concerned,
  1961.      * while preserving as much of the state of the user program as possible.
  1962.      *
  1963.      * Not Implemented In-Proc
  1964.      */
  1965.  
  1966.     HRESULT SetIP([in] ULONG32 nOffset);
  1967.  
  1968.     /* 
  1969.      * EnumerateLocalVariables returns a list of the local variables
  1970.      * available in the frame.  Note that this may not include all of
  1971.      * the locals in the running function, as some of them may not be
  1972.      * active.  
  1973.      */
  1974.  
  1975.     HRESULT EnumerateLocalVariables([out] ICorDebugValueEnum **ppValueEnum);
  1976.  
  1977.     /* 
  1978.      * GetLocalVariable gets the value for a local variable
  1979.      * in an IL frame.  This can be used either in an IL
  1980.      * frame or a jitted frame.  
  1981.      */
  1982.  
  1983.     HRESULT GetLocalVariable([in] DWORD dwIndex, 
  1984.                              [out] ICorDebugValue **ppValue);
  1985.  
  1986.     /* 
  1987.      * EnumerateArguments returns a list of the arguments available in the
  1988.      * frame.  Note that this will include varargs arguments as well as
  1989.      * arguments declared by the function signature.
  1990.      */
  1991.  
  1992.     HRESULT EnumerateArguments([out] ICorDebugValueEnum **ppValueEnum);
  1993.  
  1994.     /* 
  1995.      * GetArgument gets the value for an argument
  1996.      * in an IL frame.  This can be used either in an IL
  1997.      * frame or a jitted frame.  
  1998.      */
  1999.  
  2000.     HRESULT GetArgument([in] DWORD dwIndex, 
  2001.                         [out] ICorDebugValue **ppValue);
  2002.  
  2003.     /*
  2004.      * GetStackDepth gets the operand stack depth of an IL frame
  2005.      *
  2006.      * Note: not yet implemented.
  2007.      */
  2008.  
  2009.     HRESULT GetStackDepth([out] ULONG32 *pDepth);
  2010.  
  2011.     /* 
  2012.      * GetStackValue gets a value from the operand stack in an IL
  2013.      * frame.  This can be only be used on IL frames.  The
  2014.      * index is the index from the top of the stack (the topmost
  2015.      * element is at index 0).  
  2016.      *
  2017.      * Note: not yet implemented.
  2018.      */
  2019.  
  2020.     HRESULT GetStackValue([in] DWORD dwIndex, 
  2021.                           [out] ICorDebugValue **ppValue);
  2022.  
  2023.     /* 
  2024.      * CanSetIP attempts to determine if it's safe to set the instruction pointer 
  2025.      * to the IL at the given offset. If this returns S_OK, then executing 
  2026.      * SetIP (see above) will result in a safe, correct, continued execution.
  2027.      * If CanSetIP returns anything else, SetIP can still be invoked, but
  2028.      * continued, correct execution of the debuggee cannot be guaranteed.
  2029.      *
  2030.      * Not Implemented In-Proc
  2031.      */
  2032.  
  2033.     HRESULT CanSetIP([in] ULONG32 nOffset);
  2034.  
  2035. };
  2036.  
  2037. /*
  2038.  * ICorDebugNativeFrame is a specialized interface of ICorDebugFrame for
  2039.  * which is used either for jitted frames or managed native frames.  (Note
  2040.  * that jitted frames implement both ILFrame and NativeFrame.)
  2041.  */
  2042.  
  2043. [
  2044.     object,
  2045.     uuid(03E26314-4F76-11d3-88C6-006097945418),
  2046.     pointer_default(unique)
  2047. ]
  2048. interface ICorDebugNativeFrame : ICorDebugFrame
  2049. {
  2050.     /*
  2051.      * GetIP returns the stack frame's offset into the function's
  2052.      * native code.  If this stack frame is active, this address is
  2053.      * the next instruction to execute.  If this stack frame is not
  2054.      * active, this is the next instruction to execute when the stack
  2055.      * frame is reactivated.
  2056.      */
  2057.  
  2058.     HRESULT GetIP([out] ULONG32 *pnOffset);
  2059.  
  2060.     /* 
  2061.      * SetIP sets the instruction pointer to the given native
  2062.      * offset. CorDebug will attempt to keep the stack frame in a
  2063.      * coherent state.  (Note that even if the frame is in a valid
  2064.      * state as far as the runtime is concerned, there still may be
  2065.      * problems - e.g. uninitialized local variables, etc.  The caller
  2066.      * (or perhaps the user) is responsible for insuring coherency of
  2067.      * the running program.)  
  2068.      *
  2069.      * Not Implemented In-Proc
  2070.      */
  2071.  
  2072.     HRESULT SetIP([in] ULONG32 nOffset);
  2073.  
  2074.     /*
  2075.      * GetRegisterSet returns the register set for the given frame.
  2076.      *
  2077.      */
  2078.  
  2079.     HRESULT GetRegisterSet([out] ICorDebugRegisterSet **ppRegisters);
  2080.  
  2081.     /* 
  2082.      * GetLocalRegisterValue gets the value for a local variable or
  2083.      * argument stored in a register of a native frame. This can be
  2084.      * used either in a native frame or a jitted frame.  
  2085.      */
  2086.  
  2087.     HRESULT GetLocalRegisterValue([in] CorDebugRegister reg,
  2088.                                   [in] ULONG cbSigBlob,
  2089.                                   [in] PCCOR_SIGNATURE pvSigBlob,
  2090.                                   [out] ICorDebugValue **ppValue);
  2091.  
  2092.     /* 
  2093.      * GetLocalDoubleRegisterValue gets the value for a local variable
  2094.      * or argument stored in 2 registers of a native frame. This can
  2095.      * be used either in a native frame or a jitted frame.  
  2096.      */
  2097.  
  2098.     HRESULT GetLocalDoubleRegisterValue([in] CorDebugRegister highWordReg, 
  2099.                                         [in] CorDebugRegister lowWordReg, 
  2100.                                         [in] ULONG cbSigBlob,
  2101.                                         [in] PCCOR_SIGNATURE pvSigBlob,
  2102.                                         [out] ICorDebugValue **ppValue);
  2103.  
  2104.     /* 
  2105.      * GetLocalMemoryValue gets the value for a local variable stored
  2106.      * at the given address. 
  2107.      */
  2108.  
  2109.     HRESULT GetLocalMemoryValue([in] CORDB_ADDRESS address, 
  2110.                                 [in] ULONG cbSigBlob,
  2111.                                 [in] PCCOR_SIGNATURE pvSigBlob,
  2112.                                 [out] ICorDebugValue **ppValue);
  2113.  
  2114.     /* 
  2115.      * GetLocalRegisterMemoryValue gets the value for a local which
  2116.      * is stored half in a register and half in memory.
  2117.      */
  2118.  
  2119.     HRESULT GetLocalRegisterMemoryValue([in] CorDebugRegister highWordReg, 
  2120.                                         [in] CORDB_ADDRESS lowWordAddress,
  2121.                                         [in] ULONG cbSigBlob,
  2122.                                         [in] PCCOR_SIGNATURE pvSigBlob,
  2123.                                         [out] ICorDebugValue **ppValue);
  2124.  
  2125.     /* 
  2126.      * GetLocalMemoryRegisterValue gets the value for a local which
  2127.      * is stored half in a register and half in memory.
  2128.      */
  2129.  
  2130.     HRESULT GetLocalMemoryRegisterValue([in] CORDB_ADDRESS highWordAddress, 
  2131.                                         [in] CorDebugRegister lowWordRegister,
  2132.                                         [in] ULONG cbSigBlob,
  2133.                                         [in] PCCOR_SIGNATURE pvSigBlob,
  2134.                                         [out] ICorDebugValue **ppValue);
  2135.     /* 
  2136.      * CanSetIP attempts to determine if it's safe to set the instruction pointer 
  2137.      * to the given native offset. If this returns S_OK, then executing 
  2138.      * SetIP (see above) will result in a safe, correct, continued execution.
  2139.      * If CanSetIP returns anything else, SetIP can still be invoked, but
  2140.      * continued, correct execution of the debuggee cannot be guaranteed.
  2141.      *
  2142.      * Not Implemented In-Proc
  2143.      */
  2144.  
  2145.     HRESULT CanSetIP([in] ULONG32 nOffset);
  2146. };
  2147.  
  2148. /*
  2149.  * ICorDebugModule represents a COM+ module.  (either an executable or
  2150.  * DLL.)
  2151.  */
  2152.  
  2153. [
  2154.     object,
  2155.     uuid(dba2d8c1-e5c5-4069-8c13-10a7c6abf43d),
  2156.     pointer_default(unique)
  2157. ]
  2158. interface ICorDebugModule : IUnknown
  2159. {
  2160.     /*
  2161.      * GetProcess returns the process of which this module is a part.
  2162.      */
  2163.  
  2164.     HRESULT GetProcess([out] ICorDebugProcess **ppProcess);
  2165.  
  2166.     /*
  2167.      * GetBaseAddress returns the base address of the module.
  2168.      */
  2169.  
  2170.     HRESULT GetBaseAddress([out] CORDB_ADDRESS *pAddress);
  2171.     
  2172.     /* 
  2173.      * GetAssembly returns the assembly of which this module is a part.
  2174.      */
  2175.  
  2176.     HRESULT GetAssembly([out] ICorDebugAssembly **ppAssembly);
  2177.  
  2178.     /*
  2179.      * GetName returns the name of the module
  2180.      */
  2181.  
  2182.     HRESULT GetName([in] ULONG32 cchName, 
  2183.                     [out] ULONG32 *pcchName,
  2184.                     [out, size_is(cchName), 
  2185.                     length_is(*pcchName)] WCHAR szName[]); 
  2186.  
  2187.     /* 
  2188.      * EnableJITDebugging controls whether the jitter preserves
  2189.      * debugging information for methods within this module.
  2190.      * If bTrackJITInfo is true, then the jitter preserves
  2191.      * mapping information between the IL version of a function and
  2192.      * the jitted version for functions in the module.  If bAllowJitOpts
  2193.      * is true, then the jitter will generate code with certain (JIT-specific)
  2194.      * optimizations.
  2195.      *
  2196.      * JITDebug is enabled by default for all modules loaded when the
  2197.      * debugger is active.  Programmatically enabling/disabling these
  2198.      * settings will override global settings.
  2199.      *
  2200.      * Not Implemented In-Proc
  2201.      */
  2202.     HRESULT EnableJITDebugging([in] BOOL bTrackJITInfo,
  2203.                                [in] BOOL bAllowJitOpts);
  2204.  
  2205.     /*
  2206.      * EnableClassLoadCallbacks controls whether on not ClassLoad
  2207.      * callbacks are called for the particular module.  ClassLoad
  2208.      * callbacks are off by default.
  2209.      *
  2210.      * Not Implemented In-Proc
  2211.      */
  2212.      
  2213.     HRESULT EnableClassLoadCallbacks([in] BOOL bClassLoadCallbacks);
  2214.  
  2215.     /*
  2216.      * GetFunctionFromToken returns the ICorDebugFunction from
  2217.      * metadata information. Returns CORDBG_E_FUNCTION_NOT_IL if
  2218.      * called with a methodDef that does not refer to an IL method.
  2219.      */
  2220.  
  2221.     HRESULT GetFunctionFromToken([in] mdMethodDef methodDef,
  2222.                                  [out] ICorDebugFunction **ppFunction);
  2223.  
  2224.     /*
  2225.      * GetFunctionFromRVA returns the ICorDebugFunction from the relative
  2226.      * address of the function in the module.
  2227.      * Note:   This method is not yet implemented.
  2228.      */
  2229.  
  2230.     HRESULT GetFunctionFromRVA([in] CORDB_ADDRESS rva,
  2231.                                [out] ICorDebugFunction **ppFunction);
  2232.  
  2233.     /*
  2234.      * GetClassFromToken returns the ICorDebugClass from metadata information.
  2235.      */
  2236.  
  2237.     HRESULT GetClassFromToken([in] mdTypeDef typeDef,
  2238.                               [out] ICorDebugClass **ppClass);
  2239.  
  2240.     /* ISSUE: global variables.
  2241.      *
  2242.      * We should probally have a method here that will return a
  2243.      * ICorDebugVariable given some metadata token for a global variable.
  2244.      * Need to find out how the metadata will represent such things before
  2245.      * we can really specify this. 
  2246.      */
  2247.  
  2248.     /*
  2249.      * CreateBreakpoint creates a breakpoint which will be triggered
  2250.      * when any code in the module is executed.
  2251.      *
  2252.      * Note: not yet implemented.
  2253.      *
  2254.      * Not Implemented In-Proc
  2255.      */
  2256.     
  2257.     HRESULT CreateBreakpoint([out] ICorDebugModuleBreakpoint **ppBreakpoint);
  2258.  
  2259.     /*
  2260.      * Edit & Continue support.  GetEditAndContinueSnapshot produces
  2261.      * a snapshot of the running process.  This snapshot can then be
  2262.      * fed into the compiler to guarantee the same token values are
  2263.      * returned by the meta data during compile, to find the address
  2264.      * where new static data should go, etc.  These changes are
  2265.      * comitted using ICorDebugProcess.
  2266.      *
  2267.      * Not Implemented In-Proc
  2268.      */
  2269.     
  2270.     HRESULT GetEditAndContinueSnapshot([out] ICorDebugEditAndContinueSnapshot **ppEditAndContinueSnapshot);
  2271.  
  2272.     /*
  2273.      * Return a meta data interface pointer that can be used to examine the
  2274.      * meta data for this module.
  2275.      */
  2276.     HRESULT GetMetaDataInterface([in] REFIID riid, [out] IUnknown **ppObj);
  2277.  
  2278.  
  2279.     /*
  2280.      * Return the token for the Module table entry for this object.  The token
  2281.      * may then be passed to the meta data import api's.
  2282.      */
  2283.     HRESULT GetToken([out] mdModule *pToken);
  2284.  
  2285.     /*
  2286.      * If the this is a dynamic module, sets *pDynamic to true, otherwise
  2287.      * sets *pDynamic to false.
  2288.      */
  2289.     HRESULT IsDynamic([out] BOOL *pDynamic);
  2290.  
  2291.     /*
  2292.      * GetGlobalVariableValue returns a value object for the given global
  2293.      * variable.
  2294.      */
  2295.     HRESULT GetGlobalVariableValue([in] mdFieldDef fieldDef,
  2296.                                    [out] ICorDebugValue **ppValue);
  2297.  
  2298.     /*
  2299.      * GetSize returns the size, in bytes, of the module.
  2300.      */
  2301.     HRESULT GetSize([out] ULONG32 *pcBytes);
  2302. };
  2303.  
  2304. [
  2305.     object,
  2306.     uuid(CC7BCAF3-8A68-11d2-983C-0000F808342D),
  2307.     pointer_default(unique)
  2308. ]
  2309. interface ICorDebugFunction : IUnknown
  2310. {
  2311.     /*
  2312.      * GetModule returns the module for the function.
  2313.      */
  2314.  
  2315.     HRESULT GetModule([out] ICorDebugModule **ppModule);
  2316.  
  2317.     /*
  2318.      * GetClass returns the class for the function. Returns null if
  2319.      * the function is not a member.
  2320.      */
  2321.  
  2322.     HRESULT GetClass([out] ICorDebugClass **ppClass);
  2323.  
  2324.     /*
  2325.      * GetToken returns the metadata memberdef token for the function.
  2326.      */
  2327.  
  2328.     HRESULT GetToken([out] mdMethodDef *pMethodDef);
  2329.  
  2330.     /* 
  2331.      * GetILCode returns the IL code for the function.  Returns null
  2332.      * if there is no IL code for the function.  
  2333.      */
  2334.  
  2335.     HRESULT GetILCode([out] ICorDebugCode **ppCode);
  2336.  
  2337.     /* 
  2338.      * GetNativeCode returns the native code for the function.
  2339.      * Returns null if there is no native code for the function
  2340.      * (i.e. it is an IL function which has not been jitted) 
  2341.      */
  2342.  
  2343.     HRESULT GetNativeCode([out] ICorDebugCode **ppCode);
  2344.  
  2345.     /* 
  2346.      * CreateBreakpoint creates a breakpoint at the start of the function.
  2347.      *
  2348.      * Not Implemented In-Proc
  2349.      */
  2350.  
  2351.     HRESULT CreateBreakpoint([out] ICorDebugFunctionBreakpoint **ppBreakpoint);
  2352.  
  2353.     /* 
  2354.      * Returns the token for the local variable signature for this function.
  2355.      * If there is no signature (ie, the function doesn't have any local
  2356.      * variables), then mdSignatureNil will be returned.
  2357.      */
  2358.  
  2359.     HRESULT GetLocalVarSigToken([out] mdSignature *pmdSig);
  2360.  
  2361.  
  2362.     /*
  2363.      * Obtains the current version of the function, which is the same version
  2364.      * as that obtained by Get{IL or Native}Code's ICorDebugCode's 
  2365.      * GetVersionNumber()
  2366.      */
  2367.  
  2368.      HRESULT GetCurrentVersionNumber([out] ULONG32 *pnCurrentVersion);
  2369. };
  2370.  
  2371. [
  2372.     object,
  2373.     uuid(CC7BCAF4-8A68-11d2-983C-0000F808342D),
  2374.     pointer_default(unique)
  2375. ]
  2376. interface ICorDebugCode : IUnknown
  2377. {
  2378.     /*
  2379.      * IsIL returns whether the code is IL (as opposed to native.)
  2380.      */
  2381.     
  2382.     HRESULT IsIL([out] BOOL *pbIL);
  2383.     
  2384.     /*
  2385.      * GetFunction returns the function for the code.
  2386.      */
  2387.     
  2388.     HRESULT GetFunction([out] ICorDebugFunction **ppFunction);
  2389.     
  2390.     /*
  2391.      * GetAddress returns the address of the code.
  2392.      */
  2393.  
  2394.     HRESULT GetAddress([out] CORDB_ADDRESS *pStart);
  2395.  
  2396.     /*
  2397.      * GetSize returns the size in bytes of the code.
  2398.      */
  2399.  
  2400.     HRESULT GetSize([out] ULONG32 *pcBytes);
  2401.  
  2402.     /* 
  2403.      * CreateBreakpoint creates a breakpoint in the function at the
  2404.      * given offset.  Note that the breakpoint must be added to the
  2405.      * process object before it is active.
  2406.      * 
  2407.      * If this code is IL code, and there is a jitted native version
  2408.      * of the code, the breakpoint will be applied in the jitted code
  2409.      * as well.  (The same is true if the code is later jitted.)  
  2410.      *
  2411.      * Not Implemented In-Proc
  2412.      */
  2413.  
  2414.     HRESULT CreateBreakpoint([in] ULONG32 offset, 
  2415.                              [out] ICorDebugFunctionBreakpoint **ppBreakpoint);
  2416.  
  2417.     /*
  2418.      * GetCode returns the code of the method, suitable for disassembly.  Note 
  2419.      * that instruction boundaries aren't checked.
  2420.      */
  2421.  
  2422.     HRESULT GetCode([in] ULONG32 startOffset, [in] ULONG32 endOffset,
  2423.                     [in] ULONG32 cBufferAlloc,
  2424.                     [out, size_is(cBufferAlloc),
  2425.                           length_is(*pcBufferSize)] BYTE buffer[],
  2426.                     [out] ULONG32 *pcBufferSize);
  2427.  
  2428.     /*
  2429.      * GetVersionNumber returns the 1 based number identifying the
  2430.      * version of the code that this ICorDebugCode corresponds to.  The
  2431.      * version number is incremented each time the function is Edit-And-
  2432.      * Continue'd.
  2433.      */
  2434.     
  2435.     HRESULT GetVersionNumber([out] ULONG32 *nVersion);
  2436.  
  2437.     /*
  2438.      * GetILToNativeMapping returns a map from IL offsets to native
  2439.      * offsets for this code. An array of COR_DEBUG_IL_TO_NATIVE_MAP
  2440.      * structs will be returned, and some of the ilOffsets in this array
  2441.      * map be the values specified in CorDebugIlToNativeMappingTypes.
  2442.      *
  2443.      * Note: this method is only valid for ICorDebugCodes representing
  2444.      * native code that was jitted from IL code.
  2445.      */
  2446.     typedef enum CorDebugIlToNativeMappingTypes
  2447.     {
  2448.         NO_MAPPING = -1,
  2449.         PROLOG     = -2,
  2450.         EPILOG     = -3
  2451.     } CorDebugIlToNativeMappingTypes;
  2452.  
  2453.     typedef struct COR_DEBUG_IL_TO_NATIVE_MAP
  2454.     {
  2455.         ULONG32 ilOffset;
  2456.         ULONG32 nativeStartOffset;
  2457.         ULONG32 nativeEndOffset;
  2458.     } COR_DEBUG_IL_TO_NATIVE_MAP;
  2459.  
  2460.     HRESULT GetILToNativeMapping([in] ULONG32 cMap,
  2461.                                  [out] ULONG32 *pcMap,
  2462.                                  [out, size_is(cMap), length_is(*pcMap)]
  2463.                                  COR_DEBUG_IL_TO_NATIVE_MAP map[]);
  2464. };
  2465.  
  2466. [
  2467.     object,
  2468.     uuid(CC7BCAF5-8A68-11d2-983C-0000F808342D),
  2469.     pointer_default(unique)
  2470. ]
  2471. interface ICorDebugClass : IUnknown
  2472. {
  2473.     /*
  2474.      * GetModule returns the module for the class.
  2475.      */
  2476.  
  2477.     HRESULT GetModule([out] ICorDebugModule **pModule);
  2478.  
  2479.     /*
  2480.      * GetTypeDefToken returns the metadata typedef token for the class.
  2481.      */
  2482.  
  2483.     HRESULT GetToken([out] mdTypeDef *pTypeDef);
  2484.  
  2485.     /*
  2486.      * GetStaticFieldValue returns a value object for the given static field
  2487.      * variable. If the static field could possibly be relative to either
  2488.      * a thread, context, or appdomain, then pFrame will help the debugger
  2489.      * determine the proper value.
  2490.      */
  2491.  
  2492.     HRESULT GetStaticFieldValue([in] mdFieldDef fieldDef,
  2493.                                 [in] ICorDebugFrame *pFrame,
  2494.                                 [out] ICorDebugValue **ppValue);
  2495.  
  2496. };
  2497.  
  2498. /* ------------------------------------------------------------------------- *
  2499.  * Function call interfaces
  2500.  * ------------------------------------------------------------------------- */
  2501.  
  2502. /*
  2503.  * ICorDebugEval collects functionality which requires running code
  2504.  * inside the debuggee. Note that the operations do not complete until
  2505.  * ICorDebugProcess::Continue is called, and the EvalComplete callback
  2506.  * is called.
  2507.  *
  2508.  * An ICorDebugEval object is created in the context of a specific
  2509.  * thread, which will be used to perform the evaluations.
  2510.  *
  2511.  * If you need to use this functionality without changing the state of
  2512.  * the program, set the DebugState of the program's threads to STOP
  2513.  * before calling Continue.
  2514.  *
  2515.  * Note that since user code is running when the evaluation is in
  2516.  * progress, any debug events can occur, including class loads,
  2517.  * breakpoints, etc. Callbacks will be called normally in such a
  2518.  * case. The state of the Eval will be seen as part of the normal
  2519.  * program state inspection; the full debugger API continues to
  2520.  * operate as normal in such a circumstance. Evals can even be nested.
  2521.  *
  2522.  * Also, the user code may never complete due to deadlock or infinite
  2523.  * looping. In this case you will need to Abort the Eval before
  2524.  * resuming the program.
  2525.  *
  2526.  * Not Implemented In-Proc : In-proc can't do func eval
  2527.  */
  2528.  
  2529. [
  2530.     object,
  2531.     uuid(CC7BCAF6-8A68-11d2-983C-0000F808342D),
  2532.     pointer_default(unique)
  2533. ]
  2534. interface ICorDebugEval : IUnknown
  2535. {
  2536.     /*
  2537.      * CallFunction sets up a function call.  Note that the given function
  2538.      * is called directly; there is no virtual dispatch.  
  2539.      * (Use ICorDebugObjectValue::GetVirtualMethod to do virtual dispatch.)
  2540.      */
  2541.  
  2542.     HRESULT CallFunction([in] ICorDebugFunction *pFunction, 
  2543.                          [in] ULONG32 nArgs,
  2544.                          [in, size_is(nArgs)] ICorDebugValue *ppArgs[]);
  2545.  
  2546.     /*
  2547.      * NewObject allocates and calls the constructor for an object.
  2548.      */
  2549.  
  2550.     HRESULT NewObject([in] ICorDebugFunction *pConstructor,
  2551.                       [in] ULONG32 nArgs,
  2552.                       [in, size_is(nArgs)] ICorDebugValue *ppArgs[]);
  2553.  
  2554.     /*
  2555.      * NewObjectNoConstructor allocates a new object without
  2556.      * attempting to call any constructor on the object.
  2557.      */
  2558.  
  2559.     HRESULT NewObjectNoConstructor([in] ICorDebugClass *pClass);
  2560.  
  2561.     /*
  2562.      * NewString allocates a string object with the given contents.
  2563.      */
  2564.  
  2565.     HRESULT NewString([in] LPCWSTR string);
  2566.  
  2567.     /*
  2568.      * NewArray allocates a new array with the given element type and
  2569.      * dimensions. If the elementType is a primitive, pElementClass
  2570.      * may be NULL. Otherwise, pElementClass should be the class of
  2571.      * the elements of the array. Note: lowBounds is optional. If
  2572.      * omitted, a zero lower bound for each dimension is assumed.
  2573.      */
  2574.  
  2575.     HRESULT NewArray([in] CorElementType elementType,
  2576.                      [in] ICorDebugClass *pElementClass, 
  2577.                      [in] ULONG32 rank,
  2578.                      [in, size_is(rank)] ULONG32 dims[], 
  2579.                      [in, size_is(rank)] ULONG32 lowBounds[]);
  2580.  
  2581.     /*
  2582.      * IsActive returns whether or not the Eval has an active computation.
  2583.      */
  2584.  
  2585.     HRESULT IsActive([out] BOOL *pbActive);
  2586.  
  2587.     /*
  2588.      * Abort aborts the current computation.  Note that in the case of nested
  2589.      * Evals, this may fail unless it is the most recent Eval.
  2590.      */
  2591.  
  2592.     HRESULT Abort();
  2593.  
  2594.     /*
  2595.      * GetResult returns the result of the evaluation.  This is only
  2596.      * valid after the evaluation is completed.
  2597.      *
  2598.      * If the evaluation completes normally, the result will be the
  2599.      * return value.  If it terminates with an exception, the result
  2600.      * is the exception thrown. If the evaluation was for a new object,
  2601.      * the return value is the reference to the object.
  2602.      */
  2603.  
  2604.     HRESULT GetResult([out] ICorDebugValue **ppResult);
  2605.  
  2606.     /* 
  2607.      * GetThread returns the thread which this eval was created from.
  2608.      */
  2609.  
  2610.     HRESULT GetThread([out] ICorDebugThread **ppThread);
  2611.  
  2612.     /*
  2613.      * CreateValue creates an ICorDebugValue of the given type for the
  2614.      * sole purpose of using it in a function evaluation. These can be
  2615.      * use to pass user constants as parameters. The value has a zero
  2616.      * or NULL initial value. Use ICorDebugValue::SetValue to
  2617.      * set the value.
  2618.      *
  2619.      * pElementClass is only required for value classes. Pass NULL
  2620.      * otherwise.
  2621.      *
  2622.      * If elementType == ELEMENT_TYPE_CLASS, then you get an
  2623.      * ICorDebugReferenceValue representing the NULL object reference.
  2624.      * You can use this to pass NULL to evals that have object reference
  2625.      * parameters. You cannot set the ICorDebugReferenceValue to
  2626.      * anything... it always remains NULL.
  2627.      */
  2628.     
  2629.     HRESULT CreateValue([in] CorElementType elementType,
  2630.                         [in] ICorDebugClass *pElementClass,
  2631.                         [out] ICorDebugValue **ppValue);
  2632. };
  2633.  
  2634. /* ------------------------------------------------------------------------- *
  2635.  * Runtime value interfaces
  2636.  * ------------------------------------------------------------------------- */
  2637.  
  2638. /* 
  2639.  * ICorDebugValue represents a value in the remote process.  Note that
  2640.  * the values can be both Get and Set; they are "lvalues".
  2641.  * 
  2642.  * In general, ownership of a value object is passed when it is returned. The 
  2643.  * recipient is responsible for removing a reference from the object when 
  2644.  * finished with it.
  2645.  *
  2646.  * Depending on where the value was retrieved from, the value may not remain 
  2647.  * valid after the process is resumed, 
  2648.  * so in general they shouldn't be held across continues.  
  2649.  */
  2650.  
  2651. [
  2652.     object,
  2653.     uuid(CC7BCAF7-8A68-11d2-983C-0000F808342D),
  2654.     pointer_default(unique)
  2655. ]
  2656. interface ICorDebugValue : IUnknown 
  2657. {
  2658.     /*
  2659.      * GetType returns the simple type of the value.  If the object 
  2660.      * has a more complex runtime type, that type may be examined through the
  2661.      * appropriate subclasses (e.g. ICorDebugObjectValue can get the class of
  2662.      * an object.)
  2663.      */
  2664.  
  2665.     HRESULT GetType([out] CorElementType *pType);
  2666.  
  2667.     /*
  2668.      * GetSize returns the size of the value in bytes. Note that for reference
  2669.      * types this will be the size of the pointer rather than the size of
  2670.      * the object.
  2671.      */
  2672.  
  2673.     HRESULT GetSize([out] ULONG32 *pSize);
  2674.  
  2675.     /*
  2676.      * GetAddress returns the address of the value in the debugee
  2677.      * process.  This might be useful information for the debugger to
  2678.      * show.
  2679.      * 
  2680.      * If the value is at least partly in registers, 0 is returned.
  2681.      */
  2682.  
  2683.     HRESULT GetAddress([out] CORDB_ADDRESS *pAddress); 
  2684.  
  2685.     /*
  2686.      * CreateBreakpoint creates a breakpoint which will be triggered when 
  2687.      * the value is modified. 
  2688.      *
  2689.      * Note: not yet implemented.
  2690.      *
  2691.      * Not Implemented In-Proc
  2692.      */
  2693.  
  2694.     HRESULT CreateBreakpoint([out] ICorDebugValueBreakpoint **ppBreakpoint);
  2695. };
  2696.  
  2697. /*
  2698.  * ICorDebugGenericValue is a subclass of ICorDebugValue which applies to 
  2699.  * all values, and can be used to get & set the value.  It is a 
  2700.  * separate subinterface because it is non-remotable.
  2701.  *
  2702.  * Note that for reference types, the value is the reference rather than
  2703.  * the contents.
  2704.  */
  2705.  
  2706. [
  2707.     object,
  2708.     local,
  2709.     uuid(CC7BCAF8-8A68-11d2-983C-0000F808342D),
  2710.     pointer_default(unique)
  2711. ]
  2712. interface ICorDebugGenericValue : ICorDebugValue 
  2713. {
  2714.     /*
  2715.      * GetValue copies the value into the specified buffer.  The buffer should
  2716.      * be the appropriate size for the simple type.
  2717.      */
  2718.  
  2719.     HRESULT GetValue([out] void *pTo);
  2720.  
  2721.     /*
  2722.      * SetValue copies a new value from the specified buffer. The buffer should
  2723.      * be the approprirate size for the simple type.
  2724.      *
  2725.      * Not Implemented In-Proc
  2726.      */
  2727.  
  2728.     HRESULT SetValue([in] void *pFrom); 
  2729. };
  2730.  
  2731. /* ISSUE: an remotable interface for each simple type
  2732.  * 
  2733.  * It might be nice to have a subclass with a typesafe Get/Set for each simple
  2734.  * type.
  2735.  */
  2736.  
  2737. /*
  2738.  * ICorDebugReferenceValue is a subclass of ICorDebugValue which applies to 
  2739.  * a reference type. 
  2740.  */
  2741.  
  2742. [
  2743.     object,
  2744.     uuid(CC7BCAF9-8A68-11d2-983C-0000F808342D),
  2745.     pointer_default(unique)
  2746. ]
  2747. interface ICorDebugReferenceValue : ICorDebugValue 
  2748. {
  2749.     /*
  2750.      * IsNull tests whether the reference is null.
  2751.      */
  2752.  
  2753.     HRESULT IsNull([out] BOOL *pbNull);
  2754.  
  2755.     /*
  2756.      * GetValue copies the value into the specified buffer.  The buffer should
  2757.      * be the appropriate size for the simple type.
  2758.      */
  2759.  
  2760.     HRESULT GetValue([out] CORDB_ADDRESS *pValue);
  2761.  
  2762.     /*
  2763.      * SetValue copies a new value from the specified buffer. The buffer should
  2764.      * be the appropriate size for the simple type.
  2765.      *
  2766.      * Not Implemented In-Proc
  2767.      */
  2768.  
  2769.     HRESULT SetValue([in] CORDB_ADDRESS value); 
  2770.  
  2771.     /*
  2772.      * Dereference returns a ICorDebugValue representing the value
  2773.      * referenced. If the resulting value is a garbage collected
  2774.      * object, then the resulting value is a "weak reference" which
  2775.      * will become invalid if the object is garbage collected.
  2776.      */
  2777.     
  2778.     HRESULT Dereference([out] ICorDebugValue **ppValue);
  2779.  
  2780.     /*
  2781.      * DereferenceStrong returns a ICorDebugValue representing the value
  2782.      * referenced. If the resulting value is a garbage collected object,
  2783.      * then the resulting value is a "strong reference" which will cause
  2784.      * the object referenced to not be collect as long as it exists.
  2785.      */
  2786.     
  2787.     HRESULT DereferenceStrong([out] ICorDebugValue **ppValue);
  2788. };
  2789.  
  2790. /*
  2791.  * ICorDebugHeapValue is a subclass of ICorDebugValue which represents
  2792.  * a garbage collected object 
  2793.  */
  2794.  
  2795. [
  2796.     object,
  2797.     uuid(CC7BCAFA-8A68-11d2-983C-0000F808342D),
  2798.     pointer_default(unique)
  2799. ]
  2800. interface ICorDebugHeapValue : ICorDebugValue 
  2801. {
  2802.     /*
  2803.      * IsValid tests whether the object is valid.  (The object
  2804.      * becomes invalid if the garbage collector reclaims the object.)
  2805.      */
  2806.  
  2807.     HRESULT IsValid([out] BOOL *pbValid);
  2808.  
  2809.     /*
  2810.      * CreateRelocBreakpoint creates a breakpoint which will be triggered when 
  2811.      * the address in the reference changes due to a garbage collection.
  2812.      *
  2813.      * Note: not yet implemented.
  2814.      *
  2815.      * Not Implemented In-Proc
  2816.      */
  2817.  
  2818.     HRESULT CreateRelocBreakpoint([out] 
  2819.                                   ICorDebugValueBreakpoint **ppBreakpoint);
  2820. };
  2821.  
  2822. /*
  2823.  * ICorDebugObjectValue is a subclass of ICorDebugValue which applies to 
  2824.  * values which contain an object.  
  2825.  */
  2826.  
  2827. [
  2828.     object,
  2829.     uuid(18AD3D6E-B7D2-11d2-BD04-0000F80849BD),
  2830.     pointer_default(unique)
  2831. ]
  2832. interface ICorDebugObjectValue : ICorDebugValue
  2833. {
  2834.     /*
  2835.      * GetClass returns the runtime class of the object in the value. 
  2836.      */
  2837.  
  2838.     HRESULT GetClass([out] ICorDebugClass **ppClass);
  2839.  
  2840.     /*
  2841.      * GetFieldValue returns a value for the given field in the given
  2842.      * class. The class must be on the class hierarchy of the object's
  2843.      * class, and the field must be a field of that class.
  2844.      */
  2845.  
  2846.     HRESULT GetFieldValue([in] ICorDebugClass *pClass,
  2847.                           [in] mdFieldDef fieldDef,
  2848.                           [out] ICorDebugValue **ppValue);
  2849.  
  2850.     /*
  2851.      * GetVirtualMethod returns the most derived function
  2852.      * for the given ref on this object.
  2853.      *
  2854.      * Note: not yet implemented.
  2855.      */
  2856.  
  2857.     HRESULT GetVirtualMethod([in] mdMemberRef memberRef,
  2858.                              [out] ICorDebugFunction **ppFunction);
  2859.  
  2860.     /*
  2861.      * GetContext returns the COM+ context for the object.
  2862.      *
  2863.      * Note: not yet implemented.
  2864.      */
  2865.  
  2866.     HRESULT GetContext([out] ICorDebugContext **ppContext);
  2867.  
  2868.     /*
  2869.      * IsValueClass returns true if the the class of this object is
  2870.      * a value class.
  2871.      */
  2872.  
  2873.     HRESULT IsValueClass([out] BOOL *pbIsValueClass);
  2874.  
  2875.     /*
  2876.      * GetManagedCopy will return an IUnknown that is a managed copy
  2877.      * of a value class object. This can be used with COM+ Interop to
  2878.      * get info about the object, like calling System.Object::ToString
  2879.      * on it.
  2880.      *
  2881.      * Returns CORDB_E_OBJECT_IS_NOT_COPYABLE_VALUE_CLASS if the class of this
  2882.      * object is not a value class.
  2883.      */
  2884.  
  2885.     HRESULT GetManagedCopy([out] IUnknown **ppObject);
  2886.  
  2887.     /*
  2888.      * SetFromManagedCopy will update a object's contents given a
  2889.      * managed copy of the object. This can be used after using
  2890.      * GetManagedCopy to update an object with a changed version.
  2891.      *
  2892.      * Returns CORDB_E_OBJECT_IS_NOT_COPYABLE_VALUE_CLASS if the class of this
  2893.      * object is not a value class.
  2894.      *
  2895.      * Not Implemented In-Proc
  2896.      *
  2897.      */
  2898.  
  2899.     HRESULT SetFromManagedCopy([in] IUnknown *pObject);
  2900. };
  2901.  
  2902. /*
  2903.  * ICorDebugBoxValue is a subclass of ICorDebugValue which
  2904.  * represents a boxed value class object.  
  2905.  */
  2906.  
  2907. [
  2908.     object,
  2909.     uuid(CC7BCAFC-8A68-11d2-983C-0000F808342D),
  2910.     pointer_default(unique)
  2911. ]
  2912. interface ICorDebugBoxValue : ICorDebugHeapValue
  2913. {
  2914.     /*
  2915.      * GetObject returns the value object which is in the box.
  2916.      */
  2917.  
  2918.     HRESULT GetObject([out] ICorDebugObjectValue **ppObject);
  2919. };
  2920.  
  2921. /* 
  2922.  * ICorDebugStringValue is a subclass of ICorDebugValue which
  2923.  * applies to values which contain a string.  This interface
  2924.  * provides an easy way to get the string contents.  
  2925.  */
  2926.  
  2927. [
  2928.     object,
  2929.     uuid(CC7BCAFD-8A68-11d2-983C-0000F808342D),
  2930.     pointer_default(unique)
  2931. ]
  2932. interface ICorDebugStringValue : ICorDebugHeapValue
  2933. {
  2934.     /* 
  2935.      * GetLength returns the number of characters in the string.
  2936.      */
  2937.  
  2938.     HRESULT GetLength([out] ULONG32 *pcchString);
  2939.  
  2940.     /* 
  2941.      * GetString returns the contents of the string.
  2942.      */
  2943.  
  2944.     HRESULT GetString([in] ULONG32 cchString, 
  2945.                       [out] ULONG32 *pcchString,
  2946.                       [out, size_is(cchString), 
  2947.                       length_is(*pcchString)] WCHAR szString[]); 
  2948. };
  2949.  
  2950. /*
  2951.  * ICorDebugArrayValue is a subclass of ICorDebugValue which applies
  2952.  * to values which contain an array. This interface supports both
  2953.  * single and multidimension arrays.
  2954.  */
  2955.  
  2956. [
  2957.     object,
  2958.     uuid(0405B0DF-A660-11d2-BD02-0000F80849BD),
  2959.     pointer_default(unique)
  2960. ]
  2961. interface ICorDebugArrayValue : ICorDebugHeapValue
  2962. {
  2963.     /*
  2964.      * GetElementType returns the simple type of the elements in the 
  2965.      * array. 
  2966.      */
  2967.  
  2968.     HRESULT GetElementType([out] CorElementType *pType);
  2969.  
  2970.     /*
  2971.      * GetRank returns the number of dimensions in the array.  
  2972.      */
  2973.  
  2974.     HRESULT GetRank([out] ULONG32 *pnRank);
  2975.  
  2976.     /*
  2977.      * GetCount returns the number of elements in all dimensions of
  2978.      * the array.  
  2979.      */
  2980.  
  2981.     HRESULT GetCount([out] ULONG32 *pnCount);
  2982.  
  2983.     /*
  2984.      * GetDimensions returns the dimensions of the array.
  2985.      */
  2986.  
  2987.     HRESULT GetDimensions([in] ULONG32 cdim,
  2988.                           [out, size_is(cdim), 
  2989.                            length_is(cdim)] ULONG32 dims[]);
  2990.  
  2991.     /*
  2992.      * HasBaseIndicies returns whether or not the array has base indicies.
  2993.      * If the answer is no, then all dimensions have a base index of 0.
  2994.      */
  2995.  
  2996.     HRESULT HasBaseIndicies([out] BOOL *pbHasBaseIndicies);
  2997.     
  2998.     /*
  2999.      * GetBaseIndicies returns the base index of each dimension in 
  3000.      * the array
  3001.      */
  3002.  
  3003.     HRESULT GetBaseIndicies([in] ULONG32 cdim,
  3004.                             [out, size_is(cdim), 
  3005.                             length_is(cdim)] ULONG32 indicies[]);
  3006.  
  3007.     /*
  3008.      * GetElement returns a value representing the given element in the array.
  3009.      */
  3010.  
  3011.     HRESULT GetElement([in] ULONG32 cdim,
  3012.                        [in, size_is(cdim), 
  3013.                         length_is(cdim)] ULONG32 indices[],
  3014.                        [out] ICorDebugValue **ppValue);
  3015.     /*
  3016.      * GetElementAtPosition returns a value representing the given
  3017.      * element at the given position in the array. The position is
  3018.      * over all dimensions of the array.
  3019.      */
  3020.  
  3021.     HRESULT GetElementAtPosition([in] ULONG32 nPosition, 
  3022.                                  [out] ICorDebugValue **ppValue);
  3023. };
  3024.  
  3025. /*
  3026.  * ICorDebugContext represents a context object.  
  3027.  * 
  3028.  * Interface TBD.
  3029.  */
  3030.  
  3031. [
  3032.     object,
  3033.     uuid(CC7BCB00-8A68-11d2-983C-0000F808342D),
  3034.     pointer_default(unique)
  3035. ]
  3036. interface ICorDebugContext : ICorDebugObjectValue 
  3037. {
  3038. };
  3039.  
  3040.  
  3041. /* ------------------------------------------------------------------------- *
  3042.  * Enum interfaces
  3043.  * ------------------------------------------------------------------------- */
  3044.  
  3045. /*
  3046.  * ICorDebugEnum is an abstract enumerator.
  3047.  */
  3048.  
  3049. [
  3050.     object,
  3051.     uuid(CC7BCB01-8A68-11d2-983C-0000F808342D),
  3052.     pointer_default(unique)
  3053. ]
  3054. interface ICorDebugEnum : IUnknown
  3055. {
  3056.     HRESULT Skip([in] ULONG celt);
  3057.     HRESULT Reset();
  3058.     HRESULT Clone([out] ICorDebugEnum **ppEnum);
  3059.     HRESULT GetCount([out] ULONG *pcelt);
  3060. };
  3061.  
  3062. [
  3063.     object,
  3064.     uuid(CC7BCB02-8A68-11d2-983C-0000F808342D),
  3065.     pointer_default(unique)
  3066. ]
  3067. interface ICorDebugObjectEnum : ICorDebugEnum
  3068. {
  3069.     HRESULT Next([in] ULONG celt,
  3070.                  [out, size_is(celt), 
  3071.                   length_is(*pceltFetched)]  CORDB_ADDRESS objects[],
  3072.                  [out] ULONG *pceltFetched);
  3073. };
  3074.  
  3075. /*
  3076.  * Not Implemented In-Proc : There aren't any inproc breakpoints to enum!
  3077.  */
  3078. [
  3079.     object,
  3080.     uuid(CC7BCB03-8A68-11d2-983C-0000F808342D),
  3081.     pointer_default(unique)
  3082. ]
  3083.  
  3084. interface ICorDebugBreakpointEnum : ICorDebugEnum
  3085. {
  3086.     HRESULT Next([in] ULONG celt,
  3087.                  [out, size_is(celt), length_is(*pceltFetched)]  
  3088.                     ICorDebugBreakpoint *breakpoints[],
  3089.                  [out] ULONG *pceltFetched);
  3090. };
  3091.  
  3092. /*
  3093.  * Not Implemented In-Proc : There aren't any inproc steppers to enum!
  3094.  */
  3095. [
  3096.     object,
  3097.     uuid(CC7BCB04-8A68-11d2-983C-0000F808342D),
  3098.     pointer_default(unique)
  3099. ]
  3100.  
  3101. interface ICorDebugStepperEnum : ICorDebugEnum
  3102. {
  3103.     HRESULT Next([in] ULONG celt,
  3104.                  [out, size_is(celt), length_is(*pceltFetched)]  
  3105.                     ICorDebugStepper *steppers[],
  3106.                  [out] ULONG *pceltFetched);
  3107. };
  3108.  
  3109. [
  3110.     object,
  3111.     uuid(CC7BCB05-8A68-11d2-983C-0000F808342D),
  3112.     pointer_default(unique)
  3113. ]
  3114. interface ICorDebugProcessEnum : ICorDebugEnum
  3115. {
  3116.     HRESULT Next([in] ULONG celt,
  3117.                  [out, size_is(celt), length_is(*pceltFetched)]  
  3118.                     ICorDebugProcess *processes[],
  3119.                  [out] ULONG *pceltFetched);
  3120. };
  3121.  
  3122. [
  3123.     object,
  3124.     uuid(CC7BCB06-8A68-11d2-983C-0000F808342D),
  3125.     pointer_default(unique)
  3126. ]
  3127. interface ICorDebugThreadEnum : ICorDebugEnum
  3128. {
  3129.     HRESULT Next([in] ULONG celt,
  3130.                  [out, size_is(celt), length_is(*pceltFetched)]  
  3131.                     ICorDebugThread *threads[],
  3132.                  [out] ULONG *pceltFetched);
  3133. };
  3134.  
  3135. [
  3136.     object,
  3137.     uuid(CC7BCB07-8A68-11d2-983C-0000F808342D),
  3138.     pointer_default(unique)
  3139. ]
  3140. interface ICorDebugFrameEnum : ICorDebugEnum
  3141. {
  3142.     HRESULT Next([in] ULONG celt,
  3143.                  [out, size_is(celt), length_is(*pceltFetched)]  
  3144.                     ICorDebugFrame *frames[],
  3145.                  [out] ULONG *pceltFetched);
  3146. };
  3147.  
  3148. [
  3149.     object,
  3150.     uuid(CC7BCB08-8A68-11d2-983C-0000F808342D),
  3151.     pointer_default(unique)
  3152. ]
  3153. interface ICorDebugChainEnum : ICorDebugEnum
  3154. {
  3155.     HRESULT Next([in] ULONG celt,
  3156.                  [out, size_is(celt), length_is(*pceltFetched)]  
  3157.                     ICorDebugChain *chains[],
  3158.                  [out] ULONG *pceltFetched);
  3159. };
  3160.  
  3161. [
  3162.     object,
  3163.     uuid(CC7BCB09-8A68-11d2-983C-0000F808342D),
  3164.     pointer_default(unique)
  3165. ]
  3166. interface ICorDebugModuleEnum : ICorDebugEnum
  3167. {
  3168.     HRESULT Next([in] ULONG celt,
  3169.                  [out, size_is(celt), length_is(*pceltFetched)]  
  3170.                     ICorDebugModule *modules[],
  3171.                  [out] ULONG *pceltFetched);
  3172. };
  3173.  
  3174. [
  3175.     object,
  3176.     uuid(CC7BCB0A-8A68-11d2-983C-0000F808342D),
  3177.     pointer_default(unique)
  3178. ]
  3179. interface ICorDebugValueEnum : ICorDebugEnum
  3180. {
  3181.     HRESULT Next([in] ULONG celt,
  3182.                  [out, size_is(celt), length_is(*pceltFetched)]  
  3183.                     ICorDebugValue *values[],
  3184.                  [out] ULONG *pceltFetched);
  3185. };
  3186.  
  3187. [
  3188.     object,
  3189.     uuid(F0E18809-72B5-11d2-976F-00A0C9B4D50C),
  3190.     pointer_default(unique)
  3191. ]
  3192. interface ICorDebugErrorInfoEnum : ICorDebugEnum
  3193. {
  3194.     HRESULT Next([in] ULONG celt,
  3195.                  [out, size_is(celt), length_is(*pceltFetched)]  
  3196.                     IErrorInfo *modules[],
  3197.                  [out] ULONG *pceltFetched);
  3198. };
  3199.  
  3200.  
  3201.  
  3202. /* ------------------------------------------------------------------------- *
  3203.  * AppDomainEnum interface
  3204.  * ------------------------------------------------------------------------- */
  3205.  
  3206. [
  3207.     object,
  3208.     uuid(63ca1b24-4359-4883-bd57-13f815f58744),
  3209.     pointer_default(unique)
  3210. ]
  3211.  
  3212. interface ICorDebugAppDomainEnum : ICorDebugEnum
  3213. {
  3214.     HRESULT Next([in] ULONG celt,
  3215.                  [out, size_is(celt), length_is(*pceltFetched)]
  3216.                     ICorDebugAppDomain *values[],
  3217.                  [out] ULONG *pceltFetched);
  3218.  
  3219. };
  3220.  
  3221.  
  3222. /* ------------------------------------------------------------------------- *
  3223.  * AssemblyEnum interface
  3224.  * ------------------------------------------------------------------------- */
  3225.  
  3226. [
  3227.     object,
  3228.     uuid(4a2a1ec9-85ec-4bfb-9f15-a89fdfe0fe83),
  3229.     pointer_default(unique)
  3230. ]
  3231.  
  3232. interface ICorDebugAssemblyEnum : ICorDebugEnum
  3233. {
  3234.     HRESULT Next([in] ULONG celt,
  3235.                  [out, size_is(celt), length_is(*pceltFetched)]
  3236.                     ICorDebugAssembly *values[],
  3237.                  [out] ULONG *pceltFetched);
  3238.  
  3239. };
  3240.  
  3241.  
  3242.  
  3243. /* ------------------------------------------------------------------------- *
  3244.  * Edit and Continue interfaces
  3245.  * ------------------------------------------------------------------------- */
  3246.  
  3247. /*
  3248.  * ICorDebugEditAndContinueSnapshot - This interface is used to (a) get
  3249.  * required    data for a compiler to emit changes based on a running
  3250.  * process, and (b)    pass the updated delta PE back to the Runtime.
  3251.  *
  3252.  *  Not Implemented In-Proc : EnC isn't allowed inproc
  3253.  */
  3254.  
  3255. [
  3256.     object,
  3257.     uuid(6DC3FA01-D7CB-11d2-8A95-0080C792E5D8),
  3258.     pointer_default(unique)
  3259. ]
  3260. interface ICorDebugEditAndContinueSnapshot : IUnknown
  3261. {
  3262.     /*
  3263.      * CopyMetaData saves a copy of the executing metadata from the debuggee
  3264.      * for this snapshot to the output stream.  The stream implementation must
  3265.      * be supplied by the caller and will typically either save the copy to
  3266.      * memory or to disk.  Only the IStream::Write method will be called by
  3267.      * this method.  The MVID value returned is the unique metadata ID for
  3268.      * this copy of the metadata.  It may be used on subsequent edit and 
  3269.      * continue operations to determine if the client has the most recent
  3270.      * version already (performance win to cache).
  3271.      */
  3272.     HRESULT CopyMetaData([in] IStream *pIStream, [out] GUID *pMvid);
  3273.     
  3274.     /*
  3275.      * GetMvid will return the currently active metadata ID for the executing
  3276.      * process.  This value can be used in conjunction with CopyMetaData to
  3277.      * cache the most recent copy of the metadata and avoid expensive copies.
  3278.      * So for example, if you call CopyMetaData once and save that copy,
  3279.      * then on the next E&C operation you can ask for the current MVID and see
  3280.      * if it is already in your cache.  If it is, use your version instead of
  3281.      * calling CopyMetaData again.
  3282.      */
  3283.     HRESULT GetMvid([out] GUID *pMvid);
  3284.  
  3285.     /*
  3286.      * GetRoDataRVA returns the base RVA that should be used when adding new
  3287.      * static read only data to an existing image.  The EE will guarantee that
  3288.      * any RVA values embedded in the code are valid when the delta PE is
  3289.      * applied with new data.  The new data will be added to a page that is
  3290.      * marked read only.
  3291.      */
  3292.     HRESULT GetRoDataRVA([out] ULONG32 *pRoDataRVA);
  3293.  
  3294.     /*
  3295.      * GetRwDataRVA returns the base RVA that should be used when adding new
  3296.      * static read/write data to an existing image.  The EE will guarantee that
  3297.      * any RVA values embedded in the code are valid when the delta PE is
  3298.      * applied with new data.  The ew data will be added to a page that is 
  3299.      * marked for both read and write access.
  3300.      */
  3301.     HRESULT GetRwDataRVA([out] ULONG32 *pRwDataRVA);
  3302.  
  3303.  
  3304.     /*
  3305.      * SetPEBytes gives the snapshot object a reference to the delta PE which was
  3306.      * based on the snapshot.  This reference will be AddRef'd and cached until
  3307.      * CanCommitChanges and/or CommitChanges are called, at which point the 
  3308.      * engine will read the delta PE and remote it into the debugee process where
  3309.      * the changes will be checked/applied.
  3310.      */
  3311.     HRESULT SetPEBytes([in] IStream *pIStream);
  3312.  
  3313.     /*
  3314.      * SetILMap is called once for every method being replace that has
  3315.      * active instances on a call stack on a thread in the target process.
  3316.      * It is up to the caller of this API to determine this case exists.
  3317.      * One should halt the target process before making this check and
  3318.      * calling this method.
  3319.      */
  3320.     HRESULT SetILMap([in] mdToken mdFunction, [in] ULONG cMapSize, 
  3321.                      [in, size_is(cMapSize)] COR_IL_MAP map[]);
  3322.  
  3323.     /*
  3324.      * SetPESymbolBytes gives the snapshot object a reference to the
  3325.      * updated symbols for the delta PE. This reference will be AddRef'd
  3326.      * and cached until CanCommitChanged and/or CommitChanges are called,
  3327.      * at which point the engine will read the delta and remote it into
  3328.      * the debuggee process where the changes will be checked/applied.
  3329.      */
  3330.     HRESULT SetPESymbolBytes([in] IStream *pIStream);
  3331. };
  3332.  
  3333.