Esempio n. 1
0
        public static COMRegistry Diff(COMRegistry left, COMRegistry right, COMRegistryDiffMode mode, IProgress <Tuple <string, int> > progress)
        {
            const int   total_count = 10;
            COMRegistry ret         = new COMRegistry(COMRegistryMode.Diff);

            Report(progress, "CLSIDs", 1, total_count);
            ret.m_clsids = DiffDicts(left.m_clsids, right.m_clsids, mode, p => p.Clsid);
            Report(progress, "ProgIDs", 2, total_count);
            ret.m_progids = DiffDicts(left.m_progids, right.m_progids, mode, p => p.ProgID);
            Report(progress, "MIME Types", 3, total_count);
            ret.m_mimetypes = DiffLists(left.m_mimetypes, right.m_mimetypes, mode).ToList();
            Report(progress, "AppIDs", 4, total_count);
            ret.m_appid = DiffDicts(left.m_appid, right.m_appid, mode, p => p.AppId);
            Report(progress, "Interfaces", 5, total_count);
            ret.m_interfaces = DiffDicts(left.m_interfaces, right.m_interfaces, mode, p => p.Iid);
            Report(progress, "Categories", 6, total_count);
            ret.m_categories = DiffDicts(left.m_categories, right.m_categories, mode, p => p.CategoryID);
            Report(progress, "LowRights", 7, total_count);
            ret.m_lowrights = DiffLists(left.m_lowrights, right.m_lowrights, mode).ToList();
            Report(progress, "TypeLibs", 8, total_count);
            ret.m_typelibs = DiffDicts(left.m_typelibs, right.m_typelibs, mode, p => p.TypelibId);
            Report(progress, "PreApproved", 9, total_count);
            ret.m_preapproved = DiffLists(left.m_preapproved, right.m_preapproved, mode).ToList();
            Report(progress, "Runtime Classes", 10, total_count);
            ret.m_runtime_classes    = DiffDicts(left.m_runtime_classes, right.m_runtime_classes, mode, p => p.Name);
            ret.m_runtime_servers    = DiffDicts(left.m_runtime_servers, right.m_runtime_servers, mode, p => p.Name);
            ret.m_runtime_extensions = DiffLists(left.m_runtime_extensions, right.m_runtime_extensions, mode).ToList();
            return(ret);
        }
 public COMIELowRightsElevationPolicy(COMRegistry registry, Guid guid, SortedDictionary <Guid, COMCLSIDEntry> clsids, SortedDictionary <string, List <COMCLSIDEntry> > servers, RegistryKey key)
 {
     m_registry = registry;
     Uuid       = guid;
     Name       = Uuid.ToString("B");
     LoadFromRegistry(clsids, servers, key);
 }
        public DynamicComObjectWrapper(COMRegistry registry, Type instanceType, object entry)
        {
            _registry = registry;

            if (instanceType == null)
            {
                throw new ArgumentNullException("instanceType");
            }

            if (entry == null)
            {
                throw new ArgumentNullException("entry");
            }

            if (!COMUtilities.IsComImport(instanceType))
            {
                throw new ArgumentException("Interface type must be an imported COM type");
            }

            if (!Marshal.IsComObject(entry))
            {
                throw new ArgumentException("Target must be a COM object");
            }

            _methods = instanceType.GetMethods().Where(m => !m.IsSpecialName).ToDictionary(m => m.Name);
            _properties = instanceType.GetProperties().ToDictionary(m => m.Name);

            _target = entry;
            _instanceType = instanceType;
        }
 private COMCLSIDEntry(COMRegistry registry, Guid clsid) : this(registry)
 {
     Clsid      = clsid;
     Servers    = new Dictionary <COMServerType, COMCLSIDServerEntry>();
     Name       = string.Empty;
     Categories = new Guid[0];
 }
Esempio n. 5
0
 public RegistryPropertiesControl(COMRegistry registry)
 {
     InitializeComponent();
     AddListItem("Created Date", registry.CreatedDate);
     AddListItem("Created Machine", registry.CreatedMachine);
     AddListItem("Created User", registry.CreatedUser);
     AddListItem("Loading Mode", registry.LoadingMode);
     AddListItem("64bit", registry.SixtyFourBit);
     AddListItem("File Path", registry.FilePath);
     AddListItem("CLSID Count", registry.Clsids.Count);
     AddListItem("InProcServer CLSID Count", registry.Clsids.Values.Where(c => c.Servers.ContainsKey(COMServerType.InProcServer32)).Count());
     AddListItem("LocalServer CLSID Count", registry.Clsids.Values.Where(c => c.Servers.ContainsKey(COMServerType.LocalServer32)).Count());
     AddListItem("InProcHandler CLSID Count", registry.Clsids.Values.Where(c => c.Servers.ContainsKey(COMServerType.InProcHandler32)).Count());
     AddListItem("AppID Count", registry.AppIDs.Count);
     AddListItem("ProgID Count", registry.Progids.Count);
     AddListItem("Interfaces Count", registry.Interfaces.Count);
     AddListItem("Implemented Categories Count", registry.ImplementedCategories.Count);
     AddListItem("Low Rights Policy Count", registry.LowRights.Count());
     AddListItem("MIME Types Count", registry.MimeTypes.Count());
     AddListItem("Pre-Approved Count", registry.PreApproved.Count());
     AddListItem("Type Libs Count", registry.Typelibs.Count);
     AddListItem("Runtime Class Count", registry.RuntimeClasses.Count);
     listViewProperties.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
     listViewProperties.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
     Text = "Registry Properties";
 }
Esempio n. 6
0
        internal COMCLSIDEntry(COMRegistry registry, Guid clsid, COMPackagedEntry packageEntry,
                               COMPackagedClassEntry classEntry) : this(registry, clsid)
        {
            Source    = COMRegistryEntrySource.Packaged;
            Name      = classEntry.DisplayName;
            PackageId = packageEntry.PackageId;

            Dictionary <COMServerType, COMCLSIDServerEntry> servers = new Dictionary <COMServerType, COMCLSIDServerEntry>();

            if (!string.IsNullOrWhiteSpace(classEntry.DllPath))
            {
                servers.Add(COMServerType.InProcServer32, new COMCLSIDServerEntry(COMServerType.InProcServer32, classEntry.DllPath, classEntry.Threading));
            }

            if (packageEntry.Servers.ContainsKey(classEntry.ServerId))
            {
                COMPackagedServerEntry server = packageEntry.Servers[classEntry.ServerId];
                AppID = server.SurrogateAppId;
                string serverPath  = "<APPID HOSTED>";
                string commandLine = string.Empty;
                if (AppID == Guid.Empty)
                {
                    serverPath  = server.Executable;
                    commandLine = server.CommandLine;
                }
                servers.Add(COMServerType.LocalServer32, new COMCLSIDServerEntry(COMServerType.LocalServer32, serverPath, commandLine));
            }

            Servers    = new ReadOnlyDictionary <COMServerType, COMCLSIDServerEntry>(servers);
            Categories = classEntry.ImplementedCategories.AsReadOnly();
        }
 public COMRuntimeClassEntry(COMRegistry registry,
                             string package_id, string name, RegistryKey rootKey)
     : this(registry, package_id, name)
 {
     LoadFromKey(rootKey);
     Source = rootKey.GetSource();
 }
Esempio n. 8
0
        public MainForm(COMRegistry registry)
        {
            m_registry = registry;
            InitializeComponent();
            m_dockPanel = new DockPanel();
            m_dockPanel.ActiveAutoHideContent = null;
            m_dockPanel.Dock = DockStyle.Fill;
            m_dockPanel.Name = "dockPanel";
            Controls.Add(m_dockPanel);
            m_dockPanel.BringToFront();
            CreatePropertyGrid(true);

            if (!Environment.Is64BitOperatingSystem)
            {
                menuFileOpenViewer.Visible = false;
            }
            else
            {
                if (!Environment.Is64BitProcess)
                {
                    menuFileOpenViewer.Text = "Open 64bit Viewer";
                }
                else
                {
                    menuFileOpenViewer.Text = "Open 32bit Viewer";
                }
            }

            UpdateTitle();
        }
Esempio n. 9
0
        public static ObjectEntry Add(COMRegistry registry, string name, object instance, COMInterfaceEntry[] interfaces)
        {
            ObjectEntry ret = new ObjectEntry(registry, name, instance, interfaces);
            m_objects.Add(ret);

            return ret;
        }
Esempio n. 10
0
 internal COMRuntimeExtensionEntry(string package_id, string contract_id, string id,
                                   RegistryKey key, COMRegistry registry) : this(registry)
 {
     PackageId  = package_id;
     ContractId = contract_id;
     AppId      = id;
     LoadFromKey(key);
 }
Esempio n. 11
0
 public COMRuntimeServerEntry(COMRegistry registry, string package_id,
                              string name, RegistryKey rootKey) : this(registry)
 {
     Name      = name;
     PackageId = package_id ?? string.Empty;
     LoadFromKey(rootKey);
     Source = rootKey.GetSource();
 }
 public ClassFactoryTypeViewer(COMRegistry registry, string objName, object obj)
 {
     InitializeComponent();
     _obj = obj;
     _name = objName;
     _registry = registry;
     Text = objName + " ClassFactory";
 }
Esempio n. 13
0
 internal COMProxyInstance(IEnumerable <NdrComProxyDefinition> entries,
                           IEnumerable <NdrComplexTypeReference> complex_types,
                           COMRegistry registry)
 {
     Entries      = new List <NdrComProxyDefinition>(entries).AsReadOnly();
     ComplexTypes = new List <NdrComplexTypeReference>(complex_types).AsReadOnly();
     m_registry   = registry;
 }
 public COMIELowRightsElevationPolicy(COMRegistry registry, Guid guid, COMRegistryEntrySource source, RegistryKey key)
     : this(registry)
 {
     Uuid   = guid;
     Name   = Uuid.FormatGuidDefault();
     Source = source;
     LoadFromRegistry(key);
 }
Esempio n. 15
0
 public COMProgIDEntry(COMRegistry registry,
                       string progid, Guid clsid, RegistryKey rootKey) : this(registry)
 {
     Clsid  = clsid;
     ProgID = progid;
     Name   = rootKey.GetValue(null, string.Empty).ToString();
     Source = rootKey.GetSource();
 }
Esempio n. 16
0
        private COMProxyInstance(string path, Guid clsid, ISymbolResolver resolver, COMRegistry registry)
        {
            NdrParser parser = new NdrParser(resolver);

            Entries      = parser.ReadFromComProxyFile(path, clsid);
            ComplexTypes = parser.ComplexTypes;
            m_registry   = registry;
        }
Esempio n. 17
0
        public static ObjectEntry Add(COMRegistry registry, string name, object instance, COMInterfaceEntry[] interfaces)
        {
            ObjectEntry ret = new ObjectEntry(registry, name, instance, interfaces);

            m_objects.Add(ret);

            return(ret);
        }
Esempio n. 18
0
 internal COMProgIDEntry(COMRegistry registry,
                         ActCtxComProgIdRedirection progid_redirection)
 {
     Clsid  = progid_redirection.Clsid;
     ProgID = progid_redirection.ProgId;
     Name   = ProgID;
     Source = COMRegistryEntrySource.ActCtx;
 }
Esempio n. 19
0
 internal COMProgIDEntry(COMRegistry registry,
                         string progid, Guid clsid, COMPackagedClassEntry classEntry) : this(registry)
 {
     Clsid  = clsid;
     ProgID = progid;
     Name   = classEntry.DisplayName;
     Source = COMRegistryEntrySource.Packaged;
 }
 public ClassFactoryTypeViewer(COMRegistry registry, string objName, object obj)
 {
     InitializeComponent();
     _obj      = obj;
     _name     = objName;
     _registry = registry;
     Text      = objName + " ClassFactory";
 }
Esempio n. 21
0
 public COMTypeLibVersionEntry(COMRegistry registry, ActCtxComTypeLibraryRedirection typelib_redirection)
     : this(registry, typelib_redirection.TypeLibraryId)
 {
     Name      = TypelibId.FormatGuid();
     Win32Path = typelib_redirection.FullPath;
     Win64Path = typelib_redirection.FullPath;
     Source    = COMRegistryEntrySource.ActCtx;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="reg">The COM registry</param>
 /// <param name="mode">The display mode</param>
 public COMRegistryViewer(COMRegistry reg, DisplayMode mode)
 {
     InitializeComponent();
     m_reg  = reg;
     m_mode = mode;
     comboBoxMode.SelectedIndex = 0;
     SetupTree();
 }
Esempio n. 23
0
 private COMInterfaceEntry(COMRegistry registry, Guid iid, Guid proxyclsid, int nummethods, string baseName, string name) : this(registry)
 {
     Iid            = iid;
     ProxyClsid     = proxyclsid;
     NumMethods     = nummethods;
     Base           = baseName;
     Name           = name;
     TypeLibVersion = String.Empty;
 }
Esempio n. 24
0
 internal COMRuntimeClassEntry(COMRegistry registry, string package_id, string name)
     : this(registry)
 {
     Name        = name;
     DllPath     = string.Empty;
     Server      = string.Empty;
     Permissions = string.Empty;
     PackageId   = package_id ?? string.Empty;
 }
Esempio n. 25
0
        public static object Wrap(COMRegistry registry, object o, Type objType)
        {
            if ((o != null) && !(o is DynamicComObjectWrapper) && COMUtilities.IsComImport(objType))
            {
                return(new DynamicComObjectWrapper(registry, objType, o));
            }

            return(o);
        }
Esempio n. 26
0
        public InvokeForm(COMRegistry registry, MethodInfo mi, object pObject, string objName)
        {
            m_mi = mi;
            m_pObject = pObject;
            m_objName = objName;
            m_registry = registry;
            LoadParameters();

            InitializeComponent();
        }
Esempio n. 27
0
 internal COMCLSIDEntry(COMRegistry registry, ActCtxComServerRedirection com_server)
     : this(registry, com_server.Clsid)
 {
     Clsid   = com_server.Clsid;
     TypeLib = com_server.TypeLibraryId;
     Servers[COMServerType.InProcServer32] =
         new COMCLSIDServerEntry(COMServerType.InProcServer32, com_server.FullPath, com_server.ThreadingModel);
     Name   = string.IsNullOrWhiteSpace(com_server.ProgId) ? Clsid.ToString() : com_server.ProgId;
     Source = COMRegistryEntrySource.ActCtx;
 }
Esempio n. 28
0
 internal COMTypeLibVersionEntry(COMRegistry registry, Guid typelibid, COMPackagedTypeLibVersionEntry entry)
     : this(registry, typelibid)
 {
     Version   = entry.Version;
     Locale    = entry.LocaleId;
     Name      = entry.DisplayName;
     Win32Path = entry.Win32Path;
     Win64Path = entry.Win64Path;
     Source    = COMRegistryEntrySource.Packaged;
 }
Esempio n. 29
0
        public InvokeForm(COMRegistry registry, MethodInfo mi, object pObject, string objName)
        {
            m_mi       = mi;
            m_pObject  = pObject;
            m_objName  = objName;
            m_registry = registry;
            LoadParameters();

            InitializeComponent();
        }
Esempio n. 30
0
 internal COMTypeLibEntry(COMRegistry registry, ActCtxComTypeLibraryRedirection typelib_redirection)
     : this(registry)
 {
     TypelibId = typelib_redirection.TypeLibraryId;
     Name      = TypelibId.FormatGuid();
     List <COMTypeLibVersionEntry> versions = new List <COMTypeLibVersionEntry>();
     versions.Add(new COMTypeLibVersionEntry(registry, typelib_redirection));
     Versions = versions.AsReadOnly();
     Source   = COMRegistryEntrySource.ActCtx;
 }
Esempio n. 31
0
        private COMProxyInterfaceInstance(COMCLSIDEntry clsid, ISymbolResolver resolver, COMInterfaceEntry intf, COMRegistry registry)
        {
            NdrParser parser = new NdrParser(resolver);

            Entry        = parser.ReadFromComProxyFile(clsid.DefaultServer, clsid.Clsid, new Guid[] { intf.Iid }).FirstOrDefault();
            ComplexTypes = parser.ComplexTypes;
            OriginalName = intf.Name;
            ClassEntry   = clsid;
            m_registry   = registry;
        }
Esempio n. 32
0
 public MainForm(COMRegistry registry)
 {
     m_registry = registry;
     InitializeComponent();
     m_dockPanel = new DockPanel();
     m_dockPanel.ActiveAutoHideContent = null;
     m_dockPanel.Dock = DockStyle.Fill;
     m_dockPanel.Name = "dockPanel";
     Controls.Add(m_dockPanel);
     m_dockPanel.BringToFront();
 }
Esempio n. 33
0
 public MainForm(COMRegistry comRegistry)
 {
     m_comRegistry = comRegistry;
     InitializeComponent();
     m_dockPanel = new DockPanel();
     m_dockPanel.ActiveAutoHideContent = null;
     m_dockPanel.Dock = DockStyle.Fill;
     m_dockPanel.Name = "dockPanel";
     Controls.Add(m_dockPanel);
     m_dockPanel.BringToFront();
 }
Esempio n. 34
0
 internal COMInterfaceEntry(COMRegistry registry, COMPackagedInterfaceEntry entry)
     : this(registry, entry.Iid, entry.ProxyStubCLSID, 3, "IUnknown", entry.Iid.FormatGuidDefault())
 {
     if (entry.UseUniversalMarshaler)
     {
         ProxyClsid = new Guid("00020424-0000-0000-C000-000000000046");
     }
     TypeLib        = entry.TypeLibId;
     TypeLibVersion = entry.TypeLibVersionNumber;
     Source         = COMRegistryEntrySource.Packaged;
 }
Esempio n. 35
0
 private COMCLSIDEntry(COMRegistry registry, Guid clsid)
 {
     Clsid          = clsid;
     m_registry     = registry;
     m_proxies      = new List <COMInterfaceEntry>();
     m_categories   = new HashSet <Guid>();
     Server         = String.Empty;
     CmdLine        = String.Empty;
     ServerType     = COMServerType.UnknownServer;
     ThreadingModel = COMThreadingModel.Apartment;
 }
Esempio n. 36
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="objName">Descriptive name of the object</param>
        /// <param name="pObject">Managed wrapper to the object</param>
        /// <param name="properties">List of textual properties to display</param>
        /// <param name="interfaces">List of available interfaces</param>
        public ObjectInformation(COMRegistry registry, string objName, Object pObject, Dictionary<string, string> properties, COMInterfaceEntry[] interfaces)
        {
            m_registry = registry;
            m_pEntry = ObjectCache.Add(registry, objName, pObject, interfaces);
            m_pObject = pObject;
            m_properties = properties;
            m_interfaces = interfaces;
            m_objName = objName;
            InitializeComponent();

            LoadProperties();
            LoadInterfaces();
            Text = m_objName;
            listViewInterfaces.ListViewItemSorter = new ListItemComparer(0);
        }
Esempio n. 37
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="strObjName">Descriptive name of the object</param>
        /// <param name="pEntry">Instance of the object</param>
        /// <param name="dispType">Reflected type</param>
        public TypedObjectViewer(COMRegistry registry, string strObjName, ObjectEntry pEntry, Type dispType)
        {
            m_pEntry = pEntry;
            m_pObject = pEntry.Instance;
            m_objName = strObjName;
            m_dispType = dispType;
            m_registry = registry;
            InitializeComponent();

            HighlightingManager.Manager.AddSyntaxModeFileProvider(new SimpleSyntaxModeProvider("Python.xshd", "Python", ".py", Properties.Resources.PythonHighlightingRules));

            textEditorControl.SetHighlighting("Python");

            LoadDispatch();
            Text = String.Format("{0} {1}", m_objName, m_dispType.Name);
        }
Esempio n. 38
0
 private void DoWorkEntry(object sender, DoWorkEventArgs e)
 {
     if (m_dbpath != null)
     {
         Instance = COMRegistry.Load(m_dbpath);
     }
     else
     {
         if (m_keyPath != null)
         {
             using (RegistryKey key = m_rootKey.OpenSubKey(m_keyPath))
             {
                 Instance = COMRegistry.Load(key);
             }
         }
         else
         {
             Instance = COMRegistry.Load(m_rootKey);
         }
     }
 }
 public DynamicComFunctionWrapper(COMRegistry registry, MethodInfo mi, object target)
 {
     _mi = mi;
     _target = target;
     _registry = registry;
 }
        public static object Wrap(COMRegistry registry, object o, Type objType)
        {
            if ((o != null) && !(o is DynamicComObjectWrapper) && COMUtilities.IsComImport(objType))
            {
                return new DynamicComObjectWrapper(registry, objType, o);
            }

            return o;
        }
Esempio n. 41
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="reg">The COM registry</param>
 /// <param name="mode">The display mode</param>
 public COMRegistryViewer(COMRegistry reg, DisplayMode mode)
 {
     InitializeComponent();
     m_reg = reg;
     m_mode = mode;
 }
Esempio n. 42
0
 public ROTViewer(COMRegistry reg)
 {
     m_reg = reg;
     InitializeComponent();
 }
Esempio n. 43
0
 public AppContextImpl(COMRegistry comRegistry)
 {
     m_comRegistry = comRegistry;
     CreateNewMainForm();
 }
Esempio n. 44
0
 public TypedObjectViewer(COMRegistry registry, string strObjName, object pObject, Type dispType)
     : this(registry, strObjName, new ObjectEntry(registry, strObjName, pObject), dispType)
 {
 }
Esempio n. 45
0
 private void DoWorkEntry(object sender, DoWorkEventArgs e)
 {
     LoadedReg = new COMRegistry(m_rootKey);
 }
Esempio n. 46
0
 public static void Load(RegistryKey rootKey)
 {
     _instance = new COMRegistry(rootKey);
 }
Esempio n. 47
0
 public ObjectEntry(COMRegistry registry, string name, object instance)
     : this(registry, name, instance, registry.GetInterfacesForObject(instance))
 {
 }
Esempio n. 48
0
        public ObjectEntry(COMRegistry registry, string name, object instance, COMInterfaceEntry[] interfaces)
        {
            m_registry = registry;
            Name = name;
            Instance = instance;
            Id = Guid.NewGuid();

            Interfaces = new KeyValuePair<Guid,string>[interfaces.Length];
            int pos = 0;
            foreach (COMInterfaceEntry ent in interfaces)
            {
                Interfaces[pos++] = new KeyValuePair<Guid, string>(ent.Iid, ent.Name);
            }
        }
Esempio n. 49
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="reg">The COM registry</param>
 /// <param name="mode">The display mode</param>
 public COMRegistryViewer(COMRegistry reg, DisplayMode mode)
 {
     InitializeComponent();
     m_reg = reg;
     m_mode = mode;
     comboBoxMode.SelectedIndex = 0;
     SetupTree();
 }