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); } }
/// <summary> /// Converts the specified data. /// </summary> /// <param name="data">The data.</param> /// <returns>IRcwData.</returns> public IRcwData Convert(ClrMd.RcwData data) { if (data == null) { return(null); } var item = new RcwDataAdapter(this, data); return(Cache.GetOrAdd <IRcwData>(data, () => item, () => item.Setup())); }
public MDRCW(RcwData rcw) { m_rcw = rcw; }