コード例 #1
0
        public override CcwData GetCCWData(ulong obj)
        {
            if (_notCCW)
            {
                return(null);
            }

            // The dac cannot report this information prior to v4.5.
            if (DesktopHeap.DesktopRuntime.CLRVersion != DesktopVersion.v45)
            {
                return(null);
            }

            DesktopCCWData result = null;
            IObjectData    data   = DesktopHeap.GetObjectData(obj);

            if (data != null && data.CCW != 0)
            {
                ICCWData ccw = DesktopHeap.DesktopRuntime.GetCCWData(data.CCW);
                if (ccw != null)
                {
                    result = new DesktopCCWData(DesktopHeap, data.CCW, ccw);
                }
            }
            else if (!_checkedIfIsCCW)
            {
                _notCCW = true;
            }

            _checkedIfIsCCW = true;
            return(result);
        }
コード例 #2
0
ファイル: types.cs プロジェクト: CaledoniaProject/KeeThief
        public override CcwData GetCCWData(Address obj)
        {
            if (_notCCW)
                return null;

            // The dac cannot report this information prior to v4.5.
            if (DesktopHeap.DesktopRuntime.CLRVersion != DesktopVersion.v45)
                return null;

            DesktopCCWData result = null;
            IObjectData data = DesktopHeap.GetObjectData(obj);

            if (data != null && data.CCW != 0)
            {
                ICCWData ccw = DesktopHeap.DesktopRuntime.GetCCWData(data.CCW);
                if (ccw != null)
                    result = new DesktopCCWData(DesktopHeap, data.CCW, ccw);
            }
            else if (!_checkedIfIsCCW)
            {
                _notCCW = true;
            }

            _checkedIfIsCCW = true;
            return result;
        }