Exemple #1
0
        public void VisitUnbox(Unbox unbox)
        {
            ++m_numUnboxes;
            if (m_offset < 0)
            {
                m_offset = unbox.Untyped.Offset;
            }

            Log.DebugLine(this, "found unbox at {0:X2}", unbox.Untyped.Offset);
        }
 public void VisitUnbox(Unbox unbox)
 {
     if (m_needsCheck && !m_foundTypeCheck && m_offset < 0)
     {
         // If we find a box to our struct type, and it's using our
         // argument, then we have a problem.
         if (unbox.FromType.FullName == m_info.Instructions.Method.DeclaringType.FullName)
         {
             if (m_tracker.GetStack(unbox.Index, 0) == -33)
             {
                 m_offset = unbox.Untyped.Offset;
                 Log.DebugLine(this, "found unbox at {0:X2}", m_offset);
             }
         }
     }
 }
        private IntPtr GetImageListPtr()
        {
            var vsShell = _visualStudioPackageProvider.Package.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell;

            if (vsShell == null)
            {
                throw new InvalidOperationException();
            }

            object pvar;

            if (ErrorHandler.Failed(vsShell.GetProperty((int)__VSSPROPID.VSSPROPID_ObjectMgrTypesImgList, out pvar)) || pvar == null)
            {
                throw new InvalidOperationException();
            }

            return(Unbox.AsIntPtr(pvar));
        }
            public override bool Equals(object obj)
            {
                Unbox ub = (Unbox)obj;

                return(ub.i == i);
            }