public async static Task <COMEnumerateInterfaces> GetInterfacesOOP(COMRuntimeClassEntry ent)
        {
            string apartment = "s";

            if (ent.Threading == ThreadingType.Both ||
                ent.Threading == ThreadingType.Mta)
            {
                apartment = "m";
            }
            string command_line = string.Format("{0} {1}", ent.Name, apartment);
            var    interfaces   = await GetInterfacesOOP(command_line, true);

            return(new COMEnumerateInterfaces(Guid.Empty, 0, ent.Name, interfaces.Interfaces, interfaces.FactoryInterfaces));
        }
Пример #2
0
        public async static Task <COMEnumerateInterfaces> GetInterfacesOOP(COMRuntimeClassEntry ent, COMRegistry registry)
        {
            string apartment = "s";

            if (ent.Threading == ThreadingType.Both ||
                ent.Threading == ThreadingType.Mta)
            {
                apartment = "m";
            }
            string command_line = string.Format("{0} {1} {2}", ent.Name, apartment,
                                                ent.ActivationType == ActivationType.InProcess ? CLSCTX.INPROC_SERVER : CLSCTX.LOCAL_SERVER);
            var interfaces = await GetInterfacesOOP(command_line, true, registry);

            return(new COMEnumerateInterfaces(Guid.Empty, 0, ent.Name, interfaces.Interfaces, interfaces.FactoryInterfaces));
        }
Пример #3
0
        public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return(true);
            }

            COMRuntimeClassEntry right = obj as COMRuntimeClassEntry;

            if (right == null)
            {
                return(false);
            }

            return(Clsid == right.Clsid && Name == right.Name && DllPath == right.DllPath && Server == right.Server &&
                   ActivationType == right.ActivationType && TrustLevel == right.TrustLevel &&
                   Permissions == right.Permissions && Threading == right.Threading);
        }
Пример #4
0
 private void LoadRuntimeClasses(RegistryKey runtime_key, string package_id,
                                 COMRegistry registry, Dictionary <string, COMRuntimeClassEntry> classes)
 {
     using (RegistryKey classes_key = runtime_key.OpenSubKey("ActivatableClassId"))
     {
         List <COMRuntimeClassEntry> entries = new List <COMRuntimeClassEntry>();
         if (classes_key != null)
         {
             foreach (string name in classes_key.GetSubKeyNames())
             {
                 using (RegistryKey subkey = classes_key.OpenSubKey(name))
                 {
                     if (subkey != null)
                     {
                         classes[name] = new COMRuntimeClassEntry(registry, package_id, name, subkey);
                     }
                 }
             }
         }
     }
 }
Пример #5
0
        private void SetupRuntimeClassEntry(COMRuntimeClassEntry entry)
        {
            textBoxRuntimeClassName.Text           = entry.Name;
            textBoxRuntimeClassCLSID.Text          = GetGuidValue(entry.Clsid);
            textBoxRuntimeClassServer.Text         = GetStringValue(entry.Server);
            textBoxRuntimeClassPermissions.Text    = GetStringValue(entry.Permissions);
            textBoxRuntimeClassDllPath.Text        = GetStringValue(entry.DllPath);
            textBoxRuntimeClassActivationType.Text = entry.ActivationType.ToString();
            textBoxRuntimeClassTrustLevel.Text     = entry.TrustLevel.ToString();
            textBoxRuntimeClassThreading.Text      = entry.Threading.ToString();
            LoadInterfaceList(entry.Interfaces, listViewInterfaces);
            LoadInterfaceList(entry.FactoryInterfaces, listViewFactoryInterfaces);
            btnRuntimeClassViewPermissions.Enabled = entry.HasPermission;
            tabPageSupportedInterfaces.Tag         = entry;
            m_runtime_class = entry;
            tabControlProperties.TabPages.Add(tabPageRuntimeClass);
            tabControlProperties.TabPages.Add(tabPageSupportedInterfaces);
            COMRuntimeServerEntry server = m_registry.MapRuntimeClassToServerEntry(entry);

            if (server != null)
            {
                SetupRuntimeServerEntry(server);
            }
        }
Пример #6
0
 public COMRuntimeServerEntry MapRuntimeClassToServerEntry(COMRuntimeClassEntry runtime_class)
 {
     return(MapServerNameToEntry(runtime_class.Server));
 }