Exemple #1
0
        // This function is used to terminate a process that the SampleEngine launched
        // The debugger will call IDebugEngineLaunch2::CanTerminateProcess before calling this method.
        int IDebugEngineLaunch2.TerminateProcess(IDebugProcess2 process)
        {
            Debug.Assert(Worker.MainThreadId == Worker.CurrentThreadId);
            Debug.Assert(m_pollThread != null);
            Debug.Assert(m_engineCallback != null);
            Debug.Assert(m_debuggedProcess != null);

            try
            {
                int processId = EngineUtils.GetProcessId(process);
                if (processId != m_debuggedProcess.Id)
                {
                    return(Constants.S_FALSE);
                }

                m_debuggedProcess.Terminate();

                return(Constants.S_OK);
            }
            catch (ComponentException e)
            {
                return(e.HResult);
            }
            catch (Exception e)
            {
                return(EngineUtils.UnexpectedException(e));
            }
        }
 public int TerminateProcess(IDebugProcess2 pProcess)
 {
     DebugHelper.TraceEnteringMethod();
     _dispatcher.Queue(() => DebuggedProcess.Terminate());
     _dispatcher.Stop();
     Events.ProgramDestroyed(this);
     return(VSConstants.S_OK);
 }
 public int Terminate()
 {
     _dispatcher.Queue(() => DebuggedProcess.Terminate());
     return(VSConstants.S_OK);
 }
Exemple #4
0
 public int Terminate()
 {
     DebugHelper.TraceEnteringMethod();
     _dispatcher.Queue(() => DebuggedProcess.Terminate());
     return(VSConstants.S_OK);
 }