private void SetupAppIdEntry(COMAppIDEntry entry) { textBoxAppIdName.Text = entry.Name; textBoxAppIdGuid.Text = entry.AppId.FormatGuid(); textBoxLaunchPermission.Text = entry.LaunchPermission; textBoxAccessPermission.Text = entry.AccessPermission; textBoxAppIDRunAs.Text = GetStringValue(entry.RunAs); textBoxAppIDService.Text = GetStringValue(entry.IsService ? entry.LocalService.Name : null); textBoxAppIDFlags.Text = entry.Flags.ToString(); textBoxDllSurrogate.Text = GetStringValue(entry.DllSurrogate); btnViewAccessPermissions.Enabled = entry.HasAccessPermission; btnViewLaunchPermissions.Enabled = entry.HasLaunchPermission; tabControlProperties.TabPages.Add(tabPageAppID); if (entry.IsService) { textBoxServiceName.Text = entry.LocalService.Name; textBoxServiceDisplayName.Text = GetStringValue(entry.LocalService.DisplayName); textBoxServiceType.Text = entry.LocalService.ServiceType.ToString(); textBoxServiceImagePath.Text = entry.LocalService.ImagePath; textBoxServiceDll.Text = GetStringValue(entry.LocalService.ServiceDll); textBoxServiceUserName.Text = GetStringValue(entry.LocalService.UserName); textBoxServiceProtectionLevel.Text = entry.LocalService.ProtectionLevel.ToString(); tabControlProperties.TabPages.Add(tabPageService); } m_appid = entry; }
private void LoadAppIDs(RegistryKey rootKey) { m_appid = new SortedDictionary<Guid, COMAppIDEntry>(); using (RegistryKey appIdKey = rootKey.OpenSubKey("AppID")) { if (appIdKey != null) { string[] subkeys = appIdKey.GetSubKeyNames(); foreach (string key in subkeys) { Guid appid; if (Guid.TryParse(key, out appid)) { if (!m_appid.ContainsKey(appid)) { using (RegistryKey regKey = appIdKey.OpenSubKey(key)) { if (regKey != null) { COMAppIDEntry ent = new COMAppIDEntry(appid, regKey); m_appid.Add(appid, ent); } } } } } } } }