/// <summary> /// Uses the Path Copy Copy DLL to execute the GetPath function for a /// given plugin. /// </summary> /// <param name="pluginId">ID of plugin to get path from.</param> /// <param name="path">Path to pass to the plugin.</param> /// <returns>Path returned by the plugin, or an empty string if /// the DLL failed to provide the path.</returns> /// <exception cref="PCCExecutorException">Thrown when execution fails /// for some reason.</exception> public string GetPathWithPlugin(Guid pluginId, string path) { Debug.Assert(path != null); // Create a wrapper to know which registry value to use for output. string resultingPath; using (RegistryOutput output = new RegistryOutput()) { // Call PCC via rundll32 for the plugin. Call("RegGetPathWithPlugin", String.Format("{0},{1},{2}", pluginId.ToString("B"), output.RegistryValueName, path)); // Result should be in the registry. resultingPath = output.GetOutput(); } return(resultingPath ?? String.Empty); }
/// <summary> /// Uses the Path Copy Copy DLL to execute the GetPath function for a /// given plugin. /// </summary> /// <param name="pluginId">ID of plugin to get path from.</param> /// <param name="path">Path to pass to the plugin.</param> /// <param name="tempPipelinePlugin">Whether to call the version /// of the function that supports temp pipeline plugins only.</param> /// <returns>Path returned by the plugin, or an empty string if /// the DLL failed to provide the path.</returns> /// <exception cref="PCCExecutorException">Thrown when execution fails /// for some reason.</exception> public string GetPathWithPlugin(Guid pluginId, string path, bool tempPipelinePlugin) { if (path == null) { throw new ArgumentNullException(nameof(path)); } // Create a wrapper to know which registry value to use for output. string resultingPath; using (RegistryOutput output = new RegistryOutput()) { // Call PCC via rundll32 for the plugin. Call(tempPipelinePlugin ? "RegGetPathWithTempPipelinePlugin" : "RegGetPathWithPlugin", $"{pluginId.ToString("B", CultureInfo.InvariantCulture)},{output.RegistryValueName},{path}"); // Result should be in the registry. resultingPath = output.GetOutput(); } return(resultingPath ?? string.Empty); }