VSNDK.DebugEngine.AD7Thread.IDebugThread100 C# (CSharp) Метод

IDebugThread100() приватный Метод

Gets the properties that describe this thread. (http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.debugger.interop.idebugthread100.getthreadproperties100.aspx)
private IDebugThread100 ( uint dwFields, THREADPROPERTIES100 ptp ) : int
dwFields uint A combination of flags from the THREADPROPERTIES100 enumeration that determines which fields of /// ptp are to be filled in.
ptp THREADPROPERTIES100 A THREADPROPERTIES100 structure that that is filled in with the properties of the thread.
Результат int
        int IDebugThread100.GetThreadProperties100(uint dwFields, THREADPROPERTIES100[] ptp)
        {
            try
            {
                if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_ID) != 0)
                {
                    try
                    {
                        ptp[0].dwThreadId = Convert.ToUInt32(this._id);
                    }
                    catch
                    {
                        ptp[0].dwThreadId = 0;
                    }
                    ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_ID;
                }
                if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_SUSPENDCOUNT) != 0)
                {
                    // VSNDK debug engine doesn't support suspending threads
                    ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_SUSPENDCOUNT;
                }
                if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_STATE) != 0)
                {
                    if (this._state == "running")
                        ptp[0].dwThreadState = (uint)enum_THREADSTATE.THREADSTATE_RUNNING;
                    else
                        ptp[0].dwThreadState = (uint)enum_THREADSTATE.THREADSTATE_STOPPED;
                    ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_STATE;
                }
                if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_PRIORITY) != 0)
                {
                    ptp[0].bstrPriority = "Normal";
                    ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_PRIORITY;
                }
                if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_NAME) != 0)
                {
                    ptp[0].bstrName = _threadDisplayName;
                    ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_NAME;
                }
                if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_DISPLAY_NAME) != 0)
                {
                    // Thread display name is being requested
                    ptp[0].bstrDisplayName = _threadDisplayName;
                    ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_DISPLAY_NAME;

                    // Give this display name a higher priority than the default (0)
                    // so that it will actually be displayed
                    ptp[0].DisplayNamePriority = 10;
                    ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_DISPLAY_NAME_PRIORITY;
                }
                if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_LOCATION) != 0)
                {
                    ptp[0].bstrLocation = "";
                    if (__stackFrames != null)
                    {
                        foreach (AD7StackFrame frame in __stackFrames)
                        {
                            if ((frame.m_functionName != "") && (frame.m_functionName != "??"))
                            {
                                ptp[0].bstrLocation = frame.m_functionName;
                                break;
                            }
                        }
                    }
                    else
                        ptp[0].bstrLocation = getFunctionName();

                    if (ptp[0].bstrLocation == "")
                        ptp[0].bstrLocation = "[External Code]";

                    ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_LOCATION;
                }
                if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_CATEGORY) != 0)
                {
                    if (this._id == "1")
                        ptp[0].dwThreadCategory = (uint)enum_THREADCATEGORY.THREADCATEGORY_Main;
                    else
                        ptp[0].dwThreadCategory = (uint)enum_THREADCATEGORY.THREADCATEGORY_Worker;
                    ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_CATEGORY;
                }
                if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_AFFINITY) != 0)
                {
                    // Thread cpu affinity is being requested
                    ptp[0].AffinityMask = 0;
                    ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_AFFINITY;
                }

                if ((dwFields & (uint)enum_THREADPROPERTY_FIELDS100.TPF100_PRIORITY_ID) != 0)
                {
                    // Thread display name is being requested
                    ptp[0].priorityId = 0;
                    ptp[0].dwFields |= (uint)enum_THREADPROPERTY_FIELDS100.TPF100_PRIORITY_ID;
                }
                return Constants.S_OK;
            }
            catch (ComponentException e)
            {
                return e.HResult;
            }
            catch (Exception e)
            {
                return EngineUtils.UnexpectedException(e);
            }
        }

Same methods

AD7Thread::IDebugThread100 ( ) : int
AD7Thread::IDebugThread100 ( string &name ) : int
AD7Thread::IDebugThread100 ( uint &flags ) : int