Beispiel #1
0
        public int EnumProcesses(out IEnumDebugProcesses2 processEnum)
        {
            IDebugProcess2[] processes = EnumProcessesInternal();
            processEnum = new AD7ProcessEnum(processes);

            return(HR.S_OK);
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        #region IDebugPort2 Members

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
        {
            //
            // Returns a list of all the processes running on a port.
            //

            LoggingUtils.PrintFunction();

            try
            {
                RefreshProcesses();

                DebuggeeProcess [] processes = new DebuggeeProcess [m_portProcesses.Count];

                m_portProcesses.Values.CopyTo(processes, 0);

                ppEnum = new DebuggeeProcess.Enumerator(processes);

                return(Constants.S_OK);
            }
            catch (Exception e)
            {
                LoggingUtils.HandleException(e);

                ppEnum = null;

                return(Constants.E_FAIL);
            }
        }
 public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     RemoteEnumDebugProcess processList = new RemoteEnumDebugProcess(_computerName);
     processList.connect(this, _supplier.UsesSSL());
     ppEnum = processList;
     return VSConstants.S_OK;
 }
Beispiel #4
0
        public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
        {
            var process = new PythonRemoteDebugProcess(this, 54321, "Python", "*", "*");

            ppEnum = new PythonRemoteEnumDebugProcesses(process);
            return(VSConstants.S_OK);
        }
Beispiel #5
0
        /// <summary>
        /// Enumerates all the processes running on a port. (http://msdn.microsoft.com/en-us/library/bb161302.aspx)
        /// </summary>
        /// <param name="ppEnum"> Returns an IEnumDebugProcesses2 object that contains a list of all the processes running on a port. </param>
        /// <returns> VSConstants.S_OK. </returns>
        public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
        {
            if (this.m_IP == "")
            {
                processes = new IDebugProcess2[0];
            }
            else
            {
                DateTime now = DateTime.Now;

                TimeSpan diff    = now - lastTimeRefresh;
                double   seconds = diff.TotalSeconds;

                if (seconds > 1)
                {
                    IEnumerable <AD7Process> procList = GetProcesses();
                    processes = new IDebugProcess2[procList.Count()];
                    int i = 0;
                    foreach (var debugProcess in procList)
                    {
                        processes[i] = debugProcess;
                        i++;
                    }
                    lastTimeRefresh = DateTime.Now;
                }
            }
            ppEnum = new AD7ProcessEnum(processes);

            return(VSConstants.S_OK);
        }
 public int Clone(out IEnumDebugProcesses2 ppEnum)
 {
     ppEnum = new RemoteEnumDebugProcess(_remoteComputer);
     foreach (ScriptDebugProcess process in _runningProcesses)
     {
         ((RemoteEnumDebugProcess)ppEnum)._runningProcesses.Add(process);
     }
     return(VSConstants.S_OK);
 }
Beispiel #7
0
 public int EnumProcesses(out IEnumDebugProcesses2 ppEnum) {
     var process = PythonRemoteDebugProcess.Connect(this);
     if (process == null) {
         ppEnum = null;
         return VSConstants.E_FAIL;
     } else {
         ppEnum = new PythonRemoteEnumDebugProcesses(process);
         return VSConstants.S_OK;
     }
 }
        public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
        {
            var process = PythonRemoteDebugProcess.Connect(this);

            if (process == null)
            {
                ppEnum = null;
                return(VSConstants.E_FAIL);
            }
            else
            {
                ppEnum = new PythonRemoteEnumDebugProcesses(process);
                return(VSConstants.S_OK);
            }
        }
Beispiel #9
0
        /// <summary>
        /// Enumerates all the processes running on a port. (http://msdn.microsoft.com/en-us/library/bb161302.aspx)
        /// </summary>
        /// <param name="ppEnum"> Returns an IEnumDebugProcesses2 object that contains a list of all the processes running on a port. </param>
        /// <returns> VSConstants.S_OK. </returns>
        public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
        {
            IEnumerable <AD7Process> procList = GetProcesses();

            IDebugProcess2[] processes = new IDebugProcess2[procList.Count()];
            int i = 0;

            foreach (var debugProcess in procList)
            {
                processes[i] = debugProcess;
                i++;
            }
            ppEnum = new AD7ProcessEnum(processes);
            return(VSConstants.S_OK);
        }
Beispiel #10
0
        public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
        {
            var process = TaskHelpers.RunSynchronouslyOnUIThread(ct => PythonRemoteDebugProcess.ConnectAsync(this, _debugLog, ct));

            if (process == null)
            {
                ppEnum = null;
                return(VSConstants.E_FAIL);
            }
            else
            {
                ppEnum = new PythonRemoteEnumDebugProcesses(process);
                return(VSConstants.S_OK);
            }
        }
Beispiel #11
0
        public int EnumProcesses(out IEnumDebugProcesses2 processEnum)
        {
            IEnumDebugProcesses2 result = null;
            var connection = GetConnection(ConnectionReason.Deferred);

            if (connection == null)
            {
                processEnum = null;
                return HR.E_REMOTE_CONNECT_USER_CANCELED;
            }

            VS.VSOperationWaiter.Wait(StringResources.WaitingOp_ExecutingPS, throwOnCancel: true, action: () =>
              {
                  List<PSOutputParser.Process> processList = connection.ListProcesses();
                  IDebugProcess2[] processes = processList.Select((proc) => new AD7Process(this, proc)).ToArray();
                  result = new AD7ProcessEnum(processes);
              });

            processEnum = result;
            return HR.S_OK;
        }
Beispiel #12
0
        public int EnumProcesses(out IEnumDebugProcesses2 processEnum)
        {
            IEnumDebugProcesses2 result = null;
            var connection = GetConnection(ConnectionReason.Deferred);

            if (connection == null)
            {
                processEnum = null;
                return(HR.E_REMOTE_CONNECT_USER_CANCELED);
            }

            VS.VSOperationWaiter.Wait(StringResources.WaitingOp_ExecutingPS, throwOnCancel: true, action: () =>
            {
                List <PSOutputParser.Process> processList = connection.ListProcesses();
                IDebugProcess2[] processes = processList.Select((proc) => new AD7Process(this, proc)).ToArray();
                result = new AD7ProcessEnum(processes);
            });

            processEnum = result;
            return(HR.S_OK);
        }
Beispiel #13
0
        public int EnumProcesses(out IEnumDebugProcesses2 processEnum)
        {
            IEnumDebugProcesses2 result = null;
            var connection = GetConnection();

            if (connection == null)
            {
                // Don't return a failure to prevent vsdebug.dll from showing an error message
                processEnum = new AD7ProcessEnum(Array.Empty <IDebugProcess2>());
                return(HR.S_OK);
            }

            VS.VSOperationWaiter.Wait(StringResources.WaitingOp_ExecutingPS, throwOnCancel: true, action: (cancellationToken) =>
            {
                List <Process> processList = connection.ListProcesses();
                IDebugProcess2[] processes = processList.Select((proc) => new AD7Process(this, proc)).ToArray();
                result = new AD7ProcessEnum(processes);
            });

            processEnum = result;
            return(HR.S_OK);
        }
Beispiel #14
0
 public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     if (!PythonDebugOptionsServiceHelper.Options.UseLegacyDebugger)
     {
         var process = new PythonRemoteDebugProcess(this, 54321, "Python", "*", "*");
         ppEnum = new PythonRemoteEnumDebugProcesses(process);
         return(VSConstants.S_OK);
     }
     else
     {
         var process = TaskHelpers.RunSynchronouslyOnUIThread(ct => PythonRemoteDebugProcess.ConnectAsync(this, _debugLog, ct));
         if (process == null)
         {
             ppEnum = null;
             return(VSConstants.E_FAIL);
         }
         else
         {
             ppEnum = new PythonRemoteEnumDebugProcesses(process);
             return(VSConstants.S_OK);
         }
     }
 }
Beispiel #15
0
        public int EnumProcesses(out IEnumDebugProcesses2 processesEnum)
        {
            List <IDebugProcess2> processes;

            try
            {
                var results = GetProcessList(_processListRequestFactory.Create());
                processes =
                    results
                    .Select(r => _debugProcessFactory.Create(this, r.Pid, r.Title, r.Command))
                    .ToList();
            }
            catch (ProcessException e)
            {
                Trace.WriteLine("ProcessException:" + e);
                _dialogUtil.ShowError(ErrorStrings.ErrorQueryingGameletProcesses(e.Message),
                                      e.ToString());
                processes = new List <IDebugProcess2>();
            }

            processesEnum = new ProcessesEnum(processes.ToArray());
            return(VSConstants.S_OK);
        }
 public int Clone(out IEnumDebugProcesses2 ppEnum)
 {
     ppEnum = new LuaRemoteEnumDebugProcesses(_port);
     return(0);
 }
Beispiel #17
0
 int Microsoft.VisualStudio.Debugger.Interop.IDebugPort2.EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     RefreshProcesses();
     ppEnum = new CorDebugEnum(m_alProcesses, typeof(IDebugProcess2), typeof(IEnumDebugProcesses2));
     return Utility.COM_HResults.S_OK;
 }
Beispiel #18
0
 /// <summary>
 /// Returns a list of all the processes running on a port.
 /// </summary>
 /// <param name="ppEnum">Returns an IEnumDebugProcesses2 object that contains a list of all the processes running on a port.</param>
 /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns>
 public virtual int EnumProcesses( out IEnumDebugProcesses2 ppEnum )
 {
     Logger.Debug( string.Empty );
     ppEnum = null;
     return VSConstants.E_NOTIMPL;
 }
 public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     ppEnum = new SquirrelEnumDebugProcesses2(procs);
     return(Microsoft.VisualStudio.VSConstants.S_OK);
 }
Beispiel #20
0
 public int Clone(out IEnumDebugProcesses2 ppEnum)
 {
     ppEnum = (IEnumDebugProcesses2)Clone();
     return(COM_HResults.S_OK);
 }
Beispiel #21
0
 int IDebugPort2.EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     ppEnum = new AD7ProcessEnum(new[] { new RemoteProcess(this) });
     return(VSConstants.S_OK);
 }
Beispiel #22
0
 public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     ppEnum = new LuaRemoteEnumDebugProcesses(this);
     return(0);
 }
Beispiel #23
0
 /// <summary>
 /// Returns a list of all the processes running on a port.
 /// </summary>
 /// <param name="ppEnum">Returns an IEnumDebugProcesses2 object that contains a list of all the processes running on a port.</param>
 /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns>
 public virtual int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     Logger.Debug(string.Empty);
     ppEnum = null;
     return(VSConstants.E_NOTIMPL);
 }
Beispiel #24
0
 public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     throw new NotImplementedTestDoubleException();
 }
Beispiel #25
0
 public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     ppEnum = new AD7ProcessEnum(processes.ToArray());
     return(Constants.S_OK);
 }
 public int EnumProcesses(out IEnumDebugProcesses2 ppEnum) {
     ppEnum = new NodeRemoteEnumDebugProcesses(this, new NetworkClientFactory());
     return VSConstants.S_OK;
 }
Beispiel #27
0
 /// <summary>
 /// Enumerates all the processes running on a port. (http://msdn.microsoft.com/en-us/library/bb161302.aspx)
 /// </summary>
 /// <param name="ppEnum"> Returns an IEnumDebugProcesses2 object that contains a list of all the processes running on a port. </param>
 /// <returns> VSConstants.S_OK. </returns>
 public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     IEnumerable<AD7Process> procList = GetProcesses();
     IDebugProcess2[] processes = new IDebugProcess2[procList.Count()];
     int i = 0;
     foreach (var debugProcess in procList)
     {
         processes[i] = debugProcess;
         i++;
     }
     ppEnum = new AD7ProcessEnum(processes);
     return VSConstants.S_OK;
 }
 int Microsoft.VisualStudio.Debugger.Interop.IDebugPort2.EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     RefreshProcesses();
     ppEnum = new CorDebugEnum(m_alProcesses, typeof(IDebugProcess2), typeof(IEnumDebugProcesses2));
     return(Utility.COM_HResults.S_OK);
 }
Beispiel #29
0
 int IDebugPort2.EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     throw new NotImplementedException();
 }
Beispiel #30
0
 int IDebugPort2.EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     throw new NotImplementedException();
 }
Beispiel #31
0
        /// <summary>
        /// Enumerates all the processes running on a port. (http://msdn.microsoft.com/en-us/library/bb161302.aspx)
        /// </summary>
        /// <param name="ppEnum"> Returns an IEnumDebugProcesses2 object that contains a list of all the processes running on a port. </param>
        /// <returns> VSConstants.S_OK. </returns>
        public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
        {
            if (this.m_IP == "")
            {
                processes = new IDebugProcess2[0];
            }
            else
            {
                DateTime now = DateTime.Now;

                TimeSpan diff = now - lastTimeRefresh;
                double seconds = diff.TotalSeconds;

                if (seconds > 1)
                {
                    IEnumerable<AD7Process> procList = GetProcesses();
                    processes = new IDebugProcess2[procList.Count()];
                    int i = 0;
                    foreach (var debugProcess in procList)
                    {
                        processes[i] = debugProcess;
                        i++;
                    }
                    lastTimeRefresh = DateTime.Now;
                }
            }
            ppEnum = new AD7ProcessEnum(processes);

            return VSConstants.S_OK;
        }
 public int Clone(out IEnumDebugProcesses2 ppEnum)
 {
     ppEnum = (IEnumDebugProcesses2) Clone();
     return Utility.COM_HResults.S_OK;
 }
 public int Clone(out IEnumDebugProcesses2 ppEnum)
 {
     throw new NotImplementedException();
 }
 public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     ppEnum = new NodeRemoteEnumDebugProcesses(this, new NetworkClientFactory());
     return(VSConstants.S_OK);
 }
Beispiel #35
0
 public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     ppEnum = new AD7ProcessEnum(GetProcesses().Cast <IDebugProcess2>().ToArray());
     return(VSConstants.S_OK);
 }
Beispiel #36
0
 /// <summary>
 /// Returns a list of all the processes running on a port.
 /// </summary>
 public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     DLog.Debug(DContext.VSDebuggerComCall, "DebugPort.EnumProcesses");
     ppEnum = new ProcessEnum(processes.Cast<IDebugProcess2>().ToArray());
     return VSConstants.S_OK;
 }
Beispiel #37
0
 /// <summary>
 /// Returns a list of all the processes running on a port.
 /// </summary>
 public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     DLog.Debug(DContext.VSDebuggerComCall, "DebugPort.EnumProcesses");
     ppEnum = new ProcessEnum(processes.Cast <IDebugProcess2>().ToArray());
     return(VSConstants.S_OK);
 }
Beispiel #38
0
 public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     ppEnum = new JRemoteEnumDebugProcesses(this);
     return 0;
 }
 public int Clone(out IEnumDebugProcesses2 ppEnum)
 {
     ppEnum = new NodeRemoteEnumDebugProcesses(this);
     return(VSConstants.S_OK);
 }
 public int Clone(out IEnumDebugProcesses2 ppEnum)
 {
     ppEnum = new PythonRemoteEnumDebugProcesses(_process);
     return(0);
 }
 public int EnumProcesses(out IEnumDebugProcesses2 ppEnum) {
     ppEnum = new AD7ProcessEnum(GetProcesses().Cast<IDebugProcess2>().ToArray());
     return VSConstants.S_OK;
 }
Beispiel #42
0
 /// <inheritdoc />
 public int EnumProcesses(out IEnumDebugProcesses2 ppEnum)
 {
     ppEnum = null;
     return(VSConstants.S_OK);
 }