Пример #1
0
        internal ClrHandle(Microsoft.Diagnostics.Runtime.Desktop.V45Runtime clr, ClrHeap heap, Microsoft.Diagnostics.Runtime.Desktop.HandleData handleData)
        {
            Address obj;

            Address = handleData.Handle;
            clr.ReadPointer(Address, out obj);

            Object = obj;
            Type   = heap.GetObjectType(obj);

            uint refCount = 0;

            if (handleData.Type == (int)HandleType.RefCount)
            {
                if (handleData.IsPegged != 0)
                {
                    refCount = handleData.JupiterRefCount;
                }

                if (refCount < handleData.RefCount)
                {
                    refCount = handleData.RefCount;
                }

                if (Type != null)
                {
                    if (Type.IsCCW(obj))
                    {
                        CcwData data = Type.GetCCWData(obj);
                        if (data != null && refCount < data.RefCount)
                        {
                            refCount = (uint)data.RefCount;
                        }
                    }
                    else if (Type.IsRCW(obj))
                    {
                        RcwData data = Type.GetRCWData(obj);
                        if (data != null && refCount < data.RefCount)
                        {
                            refCount = (uint)data.RefCount;
                        }
                    }
                }

                RefCount = refCount;
            }


            HandleType = (HandleType)handleData.Type;
            AppDomain  = clr.GetAppDomainByAddress(handleData.AppDomain);

            if (HandleType == HandleType.Dependent)
            {
                DependentTarget = handleData.Secondary;
                DependentType   = heap.GetObjectType(handleData.Secondary);
            }
        }
Пример #2
0
        /// <summary>
        ///     Converts the specified data.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <returns>ICcwData.</returns>
        public ICcwData Convert(ClrMd.CcwData data)
        {
            if (data == null)
            {
                return(null);
            }
            var item = new CcwDataAdapter(this, data);

            return(Cache.GetOrAdd <ICcwData>(data, () => item, () => item.Setup()));
        }
Пример #3
0
 public MDCCW(CcwData ccw)
 {
     m_ccw = ccw;
 }