Unregisters a plugin, removing it from our registry. @param p_CLSID ID of plugin COM class. @param p_User Whether the plugin was registered per-user (true) or per-machine (false). @return true if plugin has been unregistered, false if it wasn't registered.
| 882 | // @return true if plugin has been unregistered, false if it wasn't registered. |
| 883 | // |
| 884 | bool Settings::UnregisterCOMPlugin(const CLSID& p_CLSID, |
| 885 | const bool p_User) |
| 886 | { |
| 887 | // Do not revise here. COM plugins that try to register in their DllRegisterServer |
| 888 | // will be called back when we revise. |
| 889 | |
| 890 | bool unregistered = false; |
| 891 | |
| 892 | if (p_User || !m_GlobalPluginsKeyReadOnly) { |
| 893 | // Get proper key depending on target. |
| 894 | AtlRegKey& rKey = p_User ? m_UserPluginsKey : m_GlobalPluginsKey; |
| 895 | |
| 896 | // Convert CLSID to string. |
| 897 | StOleStr clsidAsString; |
| 898 | const HRESULT hRes = ::StringFromCLSID(p_CLSID, &clsidAsString); |
| 899 | if (SUCCEEDED(hRes)) { |
| 900 | // Unregister the plugin and check if it worked in one swoop. |
| 901 | unregistered = rKey.DeleteValue(clsidAsString.Get()) == ERROR_SUCCESS; |
| 902 | } else { |
| 903 | throw SettingsException(hRes); |
| 904 | } |
| 905 | } |
| 906 | |
| 907 | return unregistered; |
| 908 | } |
| 909 | |
| 910 | // |
| 911 | // Loads pipeline plugins found in the registry as saved there by the settings app. |
no test coverage detected