winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

ConfigurationSetProcessorFactoryRemoting.h (2351B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 #pragma once
      4 #include <Windows.h>
      5 #include <winrt/Microsoft.Management.Configuration.h>
      6 
      7 namespace AppInstaller::CLI::ConfigurationRemoting
      8 {
      9     // The processor engine being used by the factory.
     10     enum class ProcessorEngine
     11     {
     12         // An unknown processor.
     13         Unknown,
     14         // Uses PowerShell DSC v2.
     15         PowerShell,
     16         // Uses DSC v3.
     17         DSCv3,
     18     };
     19 
     20     std::wstring_view ToString(ProcessorEngine value);
     21 
     22     // Determines the appropriate processor engine to use for the given configuration set.
     23     ProcessorEngine DetermineProcessorEngine(winrt::Microsoft::Management::Configuration::ConfigurationSet set);
     24 
     25     // Creates a factory in another process
     26     winrt::Microsoft::Management::Configuration::IConfigurationSetProcessorFactory CreateOutOfProcessFactory(ProcessorEngine processorEngine, bool useRunAs = false, const std::string& properties = {}, const std::string& restrictions = {});
     27 
     28     // Creates a factory that can route configurations to the appropriate internal factory.
     29     winrt::Microsoft::Management::Configuration::IConfigurationSetProcessorFactory CreateDynamicRuntimeFactory(ProcessorEngine processorEngine);
     30 
     31     // The property names used with IMap property semantics of remote factories.
     32     enum class PropertyName
     33     {
     34         // The path to the dsc.exe executable.
     35         // Read / Write
     36         DscExecutablePath,
     37         // The path to the dsc.exe executable, as discovered.
     38         // Read only.
     39         FoundDscExecutablePath,
     40         // Whether to request detailed traces from the processor.
     41         // Read / Write
     42         DiagnosticTraceEnabled,
     43         // Getting this value pumps the state machine to determine the best DSC to use.
     44         // We must respond to the value it returns to properly transition states.
     45         // Read only.
     46         FindDscStateMachine,
     47     };
     48 
     49     // Gets the string for a property name.
     50     winrt::hstring ToHString(PropertyName name);
     51 }
     52 
     53 // Export for use by the out of process factory server to report its initialization.
     54 HRESULT WindowsPackageManagerConfigurationCompleteOutOfProcessFactoryInitialization(HRESULT result, void* factory, LPWSTR staticsCallback, LPWSTR completionEventName, DWORD parentProcessId);