Beispiel #1
0
        public static ICorPublishProcessEnum EnumProcesses(this ICorPublish instance, COR_PUB_ENUMPROCESS Type)
        {
            ICorPublishProcessEnum ppIEnum;

            instance.__EnumProcesses(Type, out ppIEnum);
            return(ppIEnum);
        }
Beispiel #2
0
        public static ICorPublishProcess GetProcess(this ICorPublish instance, uint pid)
        {
            ICorPublishProcess ppProcess;

            instance.__GetProcess(pid, out ppProcess);
            return(ppProcess);
        }
Beispiel #3
0
        public bool IsManaged(int processId)
        {
            corPublish = new CorpubPublishClass();
            CorDbg.Interop.TrackedComObjects.Track(corPublish);

            ICorPublishProcess process = corPublish.GetProcess((uint)processId);

            if (process != null)
            {
                return(process.IsManaged() != 0);
            }
            return(false);
        }
        public static ManagedProcessInfoCollection GetProcesses()
        {
            ICorPublish publish = (ICorPublish) new CorpubPublish();

            if (publish != null)
            {
                ICorPublishProcessEnum ppIenum = null;
                publish.EnumProcesses(COR_PUB_ENUMPROCESS.COR_PUB_MANAGEDONLY, out ppIenum);
                if (ppIenum != null)
                {
                    return(new ManagedProcessInfoCollection(ppIenum));
                }
            }
            return(null);
        }
        public static ManagedProcessInfo GetProcessByID(uint ID)
        {
            ICorPublish publish = (ICorPublish) new CorpubPublish();

            if (publish != null)
            {
                ICorPublishProcess ppProcess = null;
                publish.GetProcess(ID, out ppProcess);
                if (ppProcess != null)
                {
                    return(new ManagedProcessInfo(ppProcess));
                }
            }
            return(null);
        }
        public bool IsManaged(int processId)
        {
            if (corPublish == null)
            {
                corPublish = new ICorPublish();
            }

            ICorPublishProcess process = corPublish.GetProcess(processId);

            if (process != null)
            {
                return(process.IsManaged);
            }
            return(false);
        }
Beispiel #7
0
		public bool IsManaged(int processId)
		{
			corPublish = new CorpubPublishClass();
			Debugger.Interop.TrackedComObjects.Track(corPublish);
			
			ICorPublishProcess process = corPublish.GetProcess((uint)processId);
			if (process != null) {
				return process.IsManaged() != 0;
			}
			return false;
		}
Beispiel #8
0
 public CorPublish()
 {
     m_publish = new CorpubPublishClass();
 }
        void EnumAppDomainsShown(object sender, EventArgs e)
        {
            ICorPublish publish = (ICorPublish) new CorpubPublish();

            if (publish != null)
            {
                ICorPublishProcess ppProcess = null;
                try
                {
                    publish.GetProcess((uint)procid, out ppProcess);
                }
                catch
                {
                }

                if (ppProcess != null)
                {
                    bool IsManaged = false;
                    ppProcess.IsManaged(out IsManaged);
                    if (IsManaged)
                    {
// Enumerate the domains within the process.
                        ICorPublishAppDomainEnum ppEnum = null;
                        ppProcess.EnumAppDomains(out ppEnum);

                        ICorPublishAppDomain pappDomain; // ICorPublishAppDomain
                        uint aFetched = 0;
                        while (ppEnum.Next(1, out pappDomain, out aFetched) == 0 && aFetched > 0)
                        {
                            StringBuilder szName = null;
                            try
                            {
                                uint pcchName = 0;
                                pappDomain.GetName(0, out pcchName, null);
                                szName = new StringBuilder((int)pcchName);
                                pappDomain.GetName((uint)szName.Capacity, out pcchName, szName);
                            }
                            catch
                            {
                            }

                            string appdomainname = szName.ToString();
                            uint   appdomainid   = 0;
                            pappDomain.GetID(out appdomainid);

                            ListViewItem appdomaintoadd = new ListViewItem(new string[] { appdomainid.ToString(), appdomainname });
                            lvdomains.Items.Add(appdomaintoadd);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Selected process is not a managed .NET process!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
                else
                {
                    MessageBox.Show("Failed to open slected process \r\n" +
                                    "maybe is not a .NET process!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
Beispiel #10
0
 public CorPublish()
 {
     m_publish = new CorpubPublishClass();
 }