예제 #1
0
        /// <summary> Retrieve the a moniker's display name (i.e. it's unique string) </summary>
        protected string GetMonikerString(UCOMIMoniker moniker)
        {
            string s;

            moniker.GetDisplayName(null, null, out s);
            return(s);
        }
예제 #2
0
        // Get moniker string of the moniker
        private string GetMonikerString(UCOMIMoniker moniker)
        {
            string str;

            moniker.GetDisplayName(null, null, out str);
            return(str);
        }
예제 #3
0
        // Token: 0x0600033B RID: 827 RVA: 0x000137F0 File Offset: 0x000119F0
        protected string getMonikerString(UCOMIMoniker moniker)
        {
            string result;

            moniker.GetDisplayName(null, null, out result);
            return(result);
        }
예제 #4
0
 /// <summary> Retrieve the a moniker's display name (i.e. it's unique string) </summary>
 protected string getMonikerString(UCOMIMoniker moniker)
 {
     string s;
     moniker.GetDisplayName( null, null, out s );
     return( s );
 }
예제 #5
0
파일: Filter.cs 프로젝트: tdhieu/openvss
		// Get moniker string of the moniker
		private string GetMonikerString(UCOMIMoniker moniker)
		{
			string str;
			moniker.GetDisplayName(null, null, out str);
			return str;
		}
예제 #6
0
        // Finds the COM running objects
        public static IList GetRunningObjects(ProgressDialog progress)
        {
            ArrayList               runningObjects = new ArrayList();
            Hashtable               runningHash    = new Hashtable();
            UCOMIBindCtx            bc;
            UCOMIRunningObjectTable rot;
            UCOMIEnumMoniker        em;

            UCOMIMoniker[] monikers = new UCOMIMoniker[1];

            ActiveX.CreateBindCtx(0, out bc);
            bc.GetRunningObjectTable(out rot);
            rot.EnumRunning(out em);
            // Look at each Moniker in the ROT
            int unused;

            while (0 == em.Next(1, monikers, out unused))
            {
                try
                {
                    UCOMIMoniker moniker = monikers[0];
                    Object       obj;
                    rot.GetObject(moniker, out obj);
                    String monikerName;
                    moniker.GetDisplayName(bc, null, out monikerName);

                    ComObjectInfo comObjInfo;
                    // Check for duplicates against the other running objects
                    Object runObj = runningHash[obj];
                    if (runObj != null)
                    {
                        // Get the existing object's moniker
                        comObjInfo = (ComObjectInfo)
                                     ObjectInfo.GetObjectInfo(obj);
                        if (monikerName.Equals(comObjInfo._monikerName))
                        {
                            TraceUtil.WriteLineInfo
                                (typeof(ComObjectInfo),
                                "ROT - Skipping duplicate: " + monikerName);
                            progress.UpdateProgress(1);
                            continue;
                        }
                    }
                    else
                    {
                        runningHash.Add(obj, obj);
                    }
                    comObjInfo = (ComObjectInfo)
                                 ObjectInfoFactory.GetObjectInfo(true, obj);
                    // Need moniker name before update progress
                    comObjInfo.CalcRunningObjName(rot, bc,
                                                  moniker, monikerName);
                    progress.UpdateProgressText(comObjInfo.GetMonikerName());
                    progress.UpdateProgress(1);
                    runningObjects.Add(comObjInfo);
                    TraceUtil.WriteLineIf(typeof(ComObjectInfo),
                                          TraceLevel.Info,
                                          "ROT - added: "
                                          + comObjInfo.GetName()
                                          + " "
                                          + comObjInfo.ObjType
                                          + " "
                                          + Win32Utils.RegKeyToString
                                              (comObjInfo._classIdKey)
                                          + Win32Utils.RegKeyToString
                                              (comObjInfo._classNameKey));
                }
                catch (Exception ex)
                {
                    TraceUtil.WriteLineIf(typeof(ComObjectInfo),
                                          TraceLevel.Info,
                                          "ROT - Exception processing ROT entry: "
                                          + ex);
                    progress.UpdateProgress(1);
                    continue;
                }
            }
            Marshal.ReleaseComObject(em);
            Marshal.ReleaseComObject(bc);
            Marshal.ReleaseComObject(rot);
            return(runningObjects);
        }