Example #1
0
        public int EnumThreads(out IEnumDebugThreads2 ppEnum)
        {
            DebugHelper.TraceEnteringMethod();
            var threads = DebuggedProcess.GetThreads();

            ppEnum = new AD7ThreadEnum(threads);
            return(VSConstants.S_OK);
        }
Example #2
0
        // EnumThreads is called by the debugger when it needs to enumerate the threads in the program.
        public int EnumThreads(out IEnumDebugThreads2 ppEnum)
        {
            Debug.Assert(Worker.MainThreadId == Worker.CurrentThreadId);

            DebuggedThread[] threads = m_debuggedProcess.GetThreads();

            AD7Thread[] threadObjects = new AD7Thread[threads.Length];
            for (int i = 0; i < threads.Length; i++)
            {
                Debug.Assert(threads[i].Client != null);
                threadObjects[i] = (AD7Thread)threads[i].Client;
            }

            ppEnum = new Microsoft.VisualStudio.Debugger.SampleEngine.AD7ThreadEnum(threadObjects);

            return(Constants.S_OK);
        }