Team Ai
Datasetpublic

MegaBites-AI/Windows-powershell

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes372downloads
1// Copyright (c) Microsoft Corporation.2// Licensed under the MIT License.3 4using System;5using System.Collections;6using System.Collections.Generic;7using System.ComponentModel;8using System.Diagnostics.CodeAnalysis;9using System.IO;10using System.Management.Automation;11using System.Management.Automation.Provider;12using System.Reflection;13using System.Runtime.CompilerServices;14using System.Runtime.InteropServices;15using System.Text;16using System.Xml;17 18#pragma warning disable 159119 20namespace Microsoft.WSMan.Management21{22    #region "public Api"23 24    #region WsManEnumFlags25    /// <summary><para>_WSManEnumFlags enumeration.</para></summary>26    [SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags")]27    [TypeLibType((short)0)]28    public enum WSManEnumFlags29    {30        /// <summary><para><c>WSManFlagNonXmlText</c> constant of <c>_WSManEnumFlags</c> enumeration.  </para><para>Constant value is 1.</para></summary>31        WSManFlagNonXmlText = 1,32 33        /// <summary><para><c>WSManFlagReturnObject</c> constant of <c>_WSManEnumFlags</c> enumeration.  </para><para>Constant value is 0.</para></summary>34        WSManFlagReturnObject = 0,35 36        /// <summary><para><c>WSManFlagReturnEPR</c> constant of <c>_WSManEnumFlags</c> enumeration.  </para><para>Constant value is 2.</para></summary>37        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "EPR")]38        WSManFlagReturnEPR = 2,39 40        /// <summary><para><c>WSManFlagReturnObjectAndEPR</c> constant of <c>_WSManEnumFlags</c> enumeration.  </para><para>Constant value is 4.</para></summary>41        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "EPR")]42        WSManFlagReturnObjectAndEPR = 4,43 44        /// <summary><para><c>WSManFlagHierarchyDeep</c> constant of <c>_WSManEnumFlags</c> enumeration.  </para><para>Constant value is 0.</para></summary>45        WSManFlagHierarchyDeep = 0,46 47        /// <summary><para><c>WSManFlagHierarchyShallow</c> constant of <c>_WSManEnumFlags</c> enumeration.  </para><para>Constant value is 32.</para></summary>48        WSManFlagHierarchyShallow = 32,49 50        /// <summary><para><c>WSManFlagHierarchyDeepBasePropsOnly</c> constant of <c>_WSManEnumFlags</c> enumeration.  </para><para>Constant value is 64.</para></summary>51        WSManFlagHierarchyDeepBasePropsOnly = 64,52 53        /// <summary><para><c>WSManFlagAssociationInstance </c> constant of <c>_WSManEnumFlags</c> enumeration.  </para><para>Constant value is 64.</para></summary>54        WSManFlagAssociationInstance = 12855    }56 57    #endregion WsManEnumFlags58 59    #region WsManSessionFlags60    /// <summary><para>WSManSessionFlags enumeration.</para></summary>61    [SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags")]62    [TypeLibType((short)0)]63    public enum WSManSessionFlags64    {65        /// <summary><para><c>no flag</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 1.</para></summary>66        WSManNone = 0,67 68        /// <summary><para><c>WSManFlagUTF8</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 1.</para></summary>69        WSManFlagUtf8 = 1,70 71        /// <summary><para><c>WSManFlagCredUsernamePassword</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 4096.</para></summary>72        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Cred")]73        WSManFlagCredUserNamePassword = 4096,74 75        /// <summary><para><c>WSManFlagSkipCACheck</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 8192.</para></summary>76        WSManFlagSkipCACheck = 8192,77 78        /// <summary><para><c>WSManFlagSkipCNCheck</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 16384.</para></summary>79        WSManFlagSkipCNCheck = 16384,80 81        /// <summary><para><c>WSManFlagUseNoAuthentication</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 32768.</para></summary>82        WSManFlagUseNoAuthentication = 32768,83 84        /// <summary><para><c>WSManFlagUseDigest</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 65536.</para></summary>85        WSManFlagUseDigest = 65536,86 87        /// <summary><para><c>WSManFlagUseNegotiate</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 131072.</para></summary>88        WSManFlagUseNegotiate = 131072,89 90        /// <summary><para><c>WSManFlagUseBasic</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 262144.</para></summary>91        WSManFlagUseBasic = 262144,92 93        /// <summary><para><c>WSManFlagUseKerberos</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 524288.</para></summary>94        WSManFlagUseKerberos = 524288,95 96        /// <summary><para><c>WSManFlagNoEncryption</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 1048576.</para></summary>97        WSManFlagNoEncryption = 1048576,98 99        /// <summary><para><c>WSManFlagEnableSPNServerPort</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 4194304.</para></summary>100        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Spn")]101        WSManFlagEnableSpnServerPort = 4194304,102 103        /// <summary><para><c>WSManFlagUTF16</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 8388608.</para></summary>104        WSManFlagUtf16 = 8388608,105 106        /// <summary><para><c>WSManFlagUseCredSsp</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 16777216.</para></summary>107        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ssp")]108        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Cred")]109        WSManFlagUseCredSsp = 16777216,110 111        /// <summary><para><c>WSManFlagUseClientCertificate</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 2097152.</para></summary>112        WSManFlagUseClientCertificate = 2097152,113 114        /// <summary><para><c>WSManFlagSkipRevocationCheck</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 33554432.</para></summary>115        WSManFlagSkipRevocationCheck = 33554432,116 117        /// <summary><para><c>WSManFlagAllowNegotiateImplicitCredentials</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 67108864.</para></summary>118        WSManFlagAllowNegotiateImplicitCredentials = 67108864,119 120        /// <summary><para><c>WSManFlagUseSsl</c> constant of <c>_WSManSessionFlags</c> enumeration.  </para><para>Constant value is 134217728.</para></summary>121        WSManFlagUseSsl = 134217728122    }123    #endregion WsManSessionFlags124 125    #region AuthenticationMechanism126    /// <summary>WSManEnumFlags enumeration</summary>127    [SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags")]128    public enum AuthenticationMechanism129    {130        /// <summary>131        /// Use no authentication.132        /// </summary>133        None = 0x0,134        /// <summary>135        /// Use Default authentication.136        /// </summary>137        Default = 0x1,138        /// <summary>139        /// Use digest authentication for a remote operation.140        /// </summary>141        Digest = 0x2,142        /// <summary>143        /// Use negotiate authentication for a remote operation (may use kerberos or ntlm)144        /// </summary>145        Negotiate = 0x4,146        /// <summary>147        /// Use basic authentication for a remote operation.148        /// </summary>149        Basic = 0x8,150        /// <summary>151        /// Use kerberos authentication for a remote operation.152        /// </summary>153        Kerberos = 0x10,154        /// <summary>155        /// Use client certificate authentication for a remote operation.156        /// </summary>157        ClientCertificate = 0x20,158        /// <summary>159        /// Use CredSSP authentication for a remote operation.160        /// </summary>161        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Credssp")]162        Credssp = 0x80,163    }164 165    #endregion AuthenticationMechanism166 167    #region IWsMan168 169    /// <summary><para><c>IWSMan</c> interface.</para></summary>170    [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Error")]171    [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]172    [Guid("190D8637-5CD3-496D-AD24-69636BB5A3B5")]173    [ComImport]174    [TypeLibType((short)4304)]175#if CORECLR176    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]177#else178    [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]179#endif180 181    public interface IWSMan182    {183#if CORECLR184        [return: MarshalAs(UnmanagedType.IUnknown)]185        object GetTypeInfoCount();186 187        [return: MarshalAs(UnmanagedType.IUnknown)]188        object GetTypeInfo();189 190        [return: MarshalAs(UnmanagedType.IUnknown)]191        object GetIDsOfNames();192 193        [return: MarshalAs(UnmanagedType.IUnknown)]194        object Invoke();195#endif196 197        /// <summary><para><c>CreateSession</c> method of <c>IWSMan</c> interface.</para></summary>198        /// <remarks><para>An original IDL definition of <c>CreateSession</c> method was the following:  <c>HRESULT CreateSession ([optional, defaultvalue(string.Empty)] BSTR connection, [optional, defaultvalue(0)] long flags, [optional] IDispatch* connectionOptions, [out, retval] IDispatch** ReturnValue)</c>;</para></remarks>199        // IDL: HRESULT CreateSession ([optional, defaultvalue(string.Empty)] BSTR connection, [optional, defaultvalue(0)] long flags, [optional] IDispatch* connectionOptions, [out, retval] IDispatch** ReturnValue);200 201        [DispId(1)]202#if CORECLR203        [return: MarshalAs(UnmanagedType.IUnknown)]204        object CreateSession([MarshalAs(UnmanagedType.BStr)] string connection, int flags, [MarshalAs(UnmanagedType.IUnknown)] object connectionOptions);205#else206        [return: MarshalAs(UnmanagedType.IDispatch)]207        object CreateSession([MarshalAs(UnmanagedType.BStr)] string connection, int flags, [MarshalAs(UnmanagedType.IDispatch)] object connectionOptions);208#endif209        /// <summary><para><c>CreateConnectionOptions</c> method of <c>IWSMan</c> interface.</para></summary>210        /// <remarks><para>An original IDL definition of <c>CreateConnectionOptions</c> method was the following:  <c>HRESULT CreateConnectionOptions ([out, retval] IDispatch** ReturnValue)</c>;</para></remarks>211        // IDL: HRESULT CreateConnectionOptions ([out, retval] IDispatch** ReturnValue);212        //213        [DispId(2)]214#if CORECLR215        [return: MarshalAs(UnmanagedType.IUnknown)]216#else217        [return: MarshalAs(UnmanagedType.IDispatch)]218#endif219        object CreateConnectionOptions();220 221        /// <summary><para><c>CommandLine</c> property of <c>IWSMan</c> interface.</para></summary>222        /// <remarks><para>An original IDL definition of <c>CommandLine</c> property was the following:  <c>BSTR CommandLine</c>;</para></remarks>223        // IDL: BSTR CommandLine;224        //225        string CommandLine226        {227            // IDL: HRESULT CommandLine ([out, retval] BSTR* ReturnValue);228 229            [DispId(3)]230            [return: MarshalAs(UnmanagedType.BStr)]231            get;232        }233 234        /// <summary><para><c>Error</c> property of <c>IWSMan</c> interface.</para></summary>235        /// <remarks><para>An original IDL definition of <c>Error</c> property was the following:  <c>BSTR Error</c>;</para></remarks>236        // IDL: BSTR Error;237        //238 239        [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Error")]240        string Error241        {242            // IDL: HRESULT Error ([out, retval] BSTR* ReturnValue);243 244            [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Error")]245            [DispId(4)]246            [return: MarshalAs(UnmanagedType.BStr)]247            get;248        }249    }250    #endregion IWsMan251 252    #region IWSManConnectionOptions253    /// <summary><para><c>IWSManConnectionOptions</c> interface.</para></summary>254    [Guid("F704E861-9E52-464F-B786-DA5EB2320FDD")]255    [ComImport]256    [TypeLibType((short)4288)]257#if CORECLR258    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]259#else260    [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]261#endif262    [SuppressMessage("Microsoft.Design", "CA1044:PropertiesShouldNotBeWriteOnly")]263    public interface IWSManConnectionOptions264    {265#if CORECLR266        [return: MarshalAs(UnmanagedType.IUnknown)]267        object GetTypeInfoCount();268 269        [return: MarshalAs(UnmanagedType.IUnknown)]270        object GetTypeInfo();271 272        [return: MarshalAs(UnmanagedType.IUnknown)]273        object GetIDsOfNames();274 275        [return: MarshalAs(UnmanagedType.IUnknown)]276        object Invoke();277#endif278        /// <summary><para><c>UserName</c> property of <c>IWSManConnectionOptions</c> interface.</para></summary>279        /// <remarks><para>An original IDL definition of <c>UserName</c> property was the following:  <c>BSTR UserName</c>;</para></remarks>280        // IDL: BSTR UserName;281 282        string UserName283        {284            // IDL: HRESULT UserName ([out, retval] BSTR* ReturnValue);285 286            [DispId(1)]287            [return: MarshalAs(UnmanagedType.BStr)]288            get;289            // IDL: HRESULT UserName (BSTR value);290 291            [DispId(1)]292            set;293        }294 295        /// <summary><para><c>Password</c> property of <c>IWSManConnectionOptions</c> interface.</para></summary>296        /// <remarks><para>An original IDL definition of <c>Password</c> property was the following:  <c>BSTR Password</c>;</para></remarks>297        // IDL: BSTR Password;298 299        [SuppressMessage("Microsoft.Design", "CA1044:PropertiesShouldNotBeWriteOnly")]300        string Password301        {302            // IDL: HRESULT Password (BSTR value);303 304            [SuppressMessage("Microsoft.Design", "CA1044:PropertiesShouldNotBeWriteOnly")]305            [DispId(2)]306            set;307        }308    }309 310    /// <summary><para><c>IWSManConnectionOptions</c> interface.</para></summary>311    [Guid("EF43EDF7-2A48-4d93-9526-8BD6AB6D4A6B")]312    [ComImport]313    [TypeLibType((short)4288)]314#if CORECLR315    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]316#else317    [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]318#endif319    [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")]320    public interface IWSManConnectionOptionsEx : IWSManConnectionOptions321    {322        /// <summary><para><c>CertificateThumbprint</c> property of <c>IWSManConnectionOptionsEx</c> interface.</para></summary>323        string CertificateThumbprint324        {325            [DispId(3)]326            [return: MarshalAs(UnmanagedType.BStr)]327            get;328 329            [DispId(1)]330            set;331        }332    }333 334    /// <summary><para><c>IWSManConnectionOptions</c> interface.</para></summary>335    [Guid("F500C9EC-24EE-48ab-B38D-FC9A164C658E")]336    [ComImport]337    [TypeLibType((short)4288)]338#if CORECLR339    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]340#else341    [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]342#endif343    public interface IWSManConnectionOptionsEx2 : IWSManConnectionOptionsEx344    {345        /// <summary><para><c>SetProxy</c> method of <c>IWSManConnectionOptionsEx2</c> interface.</para></summary>346        [DispId(4)]347        void SetProxy(int accessType,348            int authenticationMechanism,349            [In, MarshalAs(UnmanagedType.BStr)] string userName,350            [In, MarshalAs(UnmanagedType.BStr)] string password);351 352        /// <summary><para><c>ProxyIEConfig</c> method of <c>IWSManConnectionOptionsEx2</c> interface.</para></summary>353        [DispId(5)]354        int ProxyIEConfig();355 356        /// <summary><para><c>ProxyWinHttpConfig</c> method of <c>IWSManConnectionOptionsEx2</c> interface.</para></summary>357        [DispId(6)]358        int ProxyWinHttpConfig();359 360        /// <summary><para><c>ProxyAutoDetect</c> method of <c>IWSManConnectionOptionsEx2</c> interface.</para></summary>361        [DispId(7)]362        int ProxyAutoDetect();363 364        /// <summary><para><c>ProxyNoProxyServer</c> method of <c>IWSManConnectionOptionsEx2</c> interface.</para></summary>365        [DispId(8)]366        int ProxyNoProxyServer();367 368        /// <summary><para><c>ProxyAuthenticationUseNegotiate</c> method of <c>IWSManConnectionOptionsEx2</c> interface.</para></summary>369        [DispId(9)]370        int ProxyAuthenticationUseNegotiate();371 372        /// <summary><para><c>ProxyAuthenticationUseBasic</c> method of <c>IWSManConnectionOptionsEx2</c> interface.</para></summary>373        [DispId(10)]374        int ProxyAuthenticationUseBasic();375 376        /// <summary><para><c>ProxyAuthenticationUseDigest</c> method of <c>IWSManConnectionOptionsEx2</c> interface.</para></summary>377        [DispId(11)]378        int ProxyAuthenticationUseDigest();379    }380 381    #endregion IWSManConnectionOptions382 383    #region IWSManEnumerator384    /// <summary><para><c>IWSManEnumerator</c> interface.</para></summary>385    [Guid("F3457CA9-ABB9-4FA5-B850-90E8CA300E7F")]386    [ComImport]387    [TypeLibType((short)4288)]388#if CORECLR389    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]390#else391    [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]392#endif393 394    public interface IWSManEnumerator395    {396#if CORECLR397        [return: MarshalAs(UnmanagedType.IUnknown)]398        object GetTypeInfoCount();399 400        [return: MarshalAs(UnmanagedType.IUnknown)]401        object GetTypeInfo();402 403        [return: MarshalAs(UnmanagedType.IUnknown)]404        object GetIDsOfNames();405 406        [return: MarshalAs(UnmanagedType.IUnknown)]407        object Invoke();408#endif409 410        /// <summary><para><c>ReadItem</c> method of <c>IWSManEnumerator</c> interface.</para></summary>411        /// <remarks><para>An original IDL definition of <c>ReadItem</c> method was the following:  <c>HRESULT ReadItem ([out, retval] BSTR* ReturnValue)</c>;</para></remarks>412        // IDL: HRESULT ReadItem ([out, retval] BSTR* ReturnValue);413 414        [DispId(1)]415        [return: MarshalAs(UnmanagedType.BStr)]416        string ReadItem();417 418        /// <summary><para><c>AtEndOfStream</c> property of <c>IWSManEnumerator</c> interface.</para></summary>419        /// <remarks><para>An original IDL definition of <c>AtEndOfStream</c> property was the following:  <c>BOOL AtEndOfStream</c>;</para></remarks>420        // IDL: BOOL AtEndOfStream;421 422        bool AtEndOfStream423        {424            // IDL: HRESULT AtEndOfStream ([out, retval] BOOL* ReturnValue);425 426            [DispId(2)]427            [return: MarshalAs(UnmanagedType.Bool)]428            get;429        }430 431        /// <summary><para><c>Error</c> property of <c>IWSManEnumerator</c> interface.</para></summary>432        /// <remarks><para>An original IDL definition of <c>Error</c> property was the following:  <c>BSTR Error</c>;</para></remarks>433        // IDL: BSTR Error;434        [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Error")]435        string Error436        {437            // IDL: HRESULT Error ([out, retval] BSTR* ReturnValue);438            [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Error")]439            [DispId(8)]440            [return: MarshalAs(UnmanagedType.BStr)]441            get;442        }443    }444    #endregion IWSManEnumerator445 446    #region IWSManEx447    /// <summary><para><c>IWSManEx</c> interface.</para></summary>448    [Guid("2D53BDAA-798E-49E6-A1AA-74D01256F411")]449    [ComImport]450    [TypeLibType((short)4304)]451    [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")]452#if CORECLR453    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]454#else455    [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]456#endif457    [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "str")]458    [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Cred")]459    [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Username")]460    [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Error")]461    public interface IWSManEx462    {463#if CORECLR464        [return: MarshalAs(UnmanagedType.IUnknown)]465        object GetTypeInfoCount();466 467        [return: MarshalAs(UnmanagedType.IUnknown)]468        object GetTypeInfo();469 470        [return: MarshalAs(UnmanagedType.IUnknown)]471        object GetIDsOfNames();472 473        [return: MarshalAs(UnmanagedType.IUnknown)]474        object Invoke();475#endif476 477        /// <summary><para><c>CreateSession</c> method of <c>IWSManEx</c> interface.</para></summary>478        /// <remarks><para>An original IDL definition of <c>CreateSession</c> method was the following:  <c>HRESULT CreateSession ([optional, defaultvalue(string.Empty)] BSTR connection, [optional, defaultvalue(0)] long flags, [optional] IDispatch* connectionOptions, [out, retval] IDispatch** ReturnValue)</c>;</para></remarks>479        // IDL: HRESULT CreateSession ([optional, defaultvalue(string.Empty)] BSTR connection, [optional, defaultvalue(0)] long flags, [optional] IDispatch* connectionOptions, [out, retval] IDispatch** ReturnValue);480 481        [DispId(1)]482#if CORECLR483        [return: MarshalAs(UnmanagedType.IUnknown)]484        object CreateSession([MarshalAs(UnmanagedType.BStr)] string connection, int flags, [MarshalAs(UnmanagedType.IUnknown)] object connectionOptions);485#else486        [return: MarshalAs(UnmanagedType.IDispatch)]487        object CreateSession([MarshalAs(UnmanagedType.BStr)] string connection, int flags, [MarshalAs(UnmanagedType.IDispatch)] object connectionOptions);488#endif489 490        /// <summary><para><c>CreateConnectionOptions</c> method of <c>IWSManEx</c> interface.</para></summary>491        /// <remarks><para>An original IDL definition of <c>CreateConnectionOptions</c> method was the following:  <c>HRESULT CreateConnectionOptions ([out, retval] IDispatch** ReturnValue)</c>;</para></remarks>492        // IDL: HRESULT CreateConnectionOptions ([out, retval] IDispatch** ReturnValue);493 494        [DispId(2)]495#if CORECLR496        [return: MarshalAs(UnmanagedType.IUnknown)]497#else498        [return: MarshalAs(UnmanagedType.IDispatch)]499#endif500        object CreateConnectionOptions();501 502        /// <summary>503        /// </summary>504        /// <returns></returns>505        string CommandLine506        {507            // IDL: HRESULT CommandLine ([out, retval] BSTR* ReturnValue);508 509            [DispId(3)]510            [return: MarshalAs(UnmanagedType.BStr)]511            get;512        }513 514        /// <summary><para><c>Error</c> property of <c>IWSManEx</c> interface.</para></summary>515        /// <remarks><para>An original IDL definition of <c>Error</c> property was the following:  <c>BSTR Error</c>;</para></remarks>516        // IDL: BSTR Error;517 518        [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Error")]519        string Error520        {521            // IDL: HRESULT Error ([out, retval] BSTR* ReturnValue);522 523            [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Error")]524            [DispId(4)]525            [return: MarshalAs(UnmanagedType.BStr)]526            get;527        }528 529        /// <summary><para><c>CreateResourceLocator</c> method of <c>IWSManEx</c> interface.</para></summary>530        /// <remarks><para>An original IDL definition of <c>CreateResourceLocator</c> method was the following:  <c>HRESULT CreateResourceLocator ([optional, defaultvalue(string.Empty)] BSTR strResourceLocator, [out, retval] IDispatch** ReturnValue)</c>;</para></remarks>531        // IDL: HRESULT CreateResourceLocator ([optional, defaultvalue(string.Empty)] BSTR strResourceLocator, [out, retval] IDispatch** ReturnValue);532 533        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "str")]534        [DispId(5)]535#if CORECLR536        [return: MarshalAs(UnmanagedType.IUnknown)]537#else538        [return: MarshalAs(UnmanagedType.IDispatch)]539#endif540        object CreateResourceLocator([MarshalAs(UnmanagedType.BStr)] string strResourceLocator);541 542        /// <summary><para><c>SessionFlagUTF8</c> method of <c>IWSManEx</c> interface.</para></summary>543        /// <remarks><para>An original IDL definition of <c>SessionFlagUTF8</c> method was the following:  <c>HRESULT SessionFlagUTF8 ([out, retval] long* ReturnValue)</c>;</para></remarks>544        // IDL: HRESULT SessionFlagUTF8 ([out, retval] long* ReturnValue);545 546        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "UTF")]547        [DispId(6)]548        int SessionFlagUTF8();549 550        /// <summary><para><c>SessionFlagCredUsernamePassword</c> method of <c>IWSManEx</c> interface.</para></summary>551        /// <remarks><para>An original IDL definition of <c>SessionFlagCredUsernamePassword</c> method was the following:  <c>HRESULT SessionFlagCredUsernamePassword ([out, retval] long* ReturnValue)</c>;</para></remarks>552        // IDL: HRESULT SessionFlagCredUsernamePassword ([out, retval] long* ReturnValue);553 554        [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Username")]555        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Cred")]556        [DispId(7)]557        int SessionFlagCredUsernamePassword();558 559        /// <summary><para><c>SessionFlagSkipCACheck</c> method of <c>IWSManEx</c> interface.</para></summary>560        /// <remarks><para>An original IDL definition of <c>SessionFlagSkipCACheck</c> method was the following:  <c>HRESULT SessionFlagSkipCACheck ([out, retval] long* ReturnValue)</c>;</para></remarks>561        // IDL: HRESULT SessionFlagSkipCACheck ([out, retval] long* ReturnValue);562 563        [DispId(8)]564        int SessionFlagSkipCACheck();565 566        /// <summary><para><c>SessionFlagSkipCNCheck</c> method of <c>IWSManEx</c> interface.</para></summary>567        /// <remarks><para>An original IDL definition of <c>SessionFlagSkipCNCheck</c> method was the following:  <c>HRESULT SessionFlagSkipCNCheck ([out, retval] long* ReturnValue)</c>;</para></remarks>568        // IDL: HRESULT SessionFlagSkipCNCheck ([out, retval] long* ReturnValue);569 570        [DispId(9)]571        int SessionFlagSkipCNCheck();572 573        /// <summary><para><c>SessionFlagUseDigest</c> method of <c>IWSManEx</c> interface.</para></summary>574        /// <remarks><para>An original IDL definition of <c>SessionFlagUseDigest</c> method was the following:  <c>HRESULT SessionFlagUseDigest ([out, retval] long* ReturnValue)</c>;</para></remarks>575        // IDL: HRESULT SessionFlagUseDigest ([out, retval] long* ReturnValue);576 577        [DispId(10)]578        int SessionFlagUseDigest();579 580        /// <summary><para><c>SessionFlagUseNegotiate</c> method of <c>IWSManEx</c> interface.</para></summary>581        /// <remarks><para>An original IDL definition of <c>SessionFlagUseNegotiate</c> method was the following:  <c>HRESULT SessionFlagUseNegotiate ([out, retval] long* ReturnValue)</c>;</para></remarks>582        // IDL: HRESULT SessionFlagUseNegotiate ([out, retval] long* ReturnValue);583 584        [DispId(11)]585        int SessionFlagUseNegotiate();586 587        /// <summary><para><c>SessionFlagUseBasic</c> method of <c>IWSManEx</c> interface.</para></summary>588        /// <remarks><para>An original IDL definition of <c>SessionFlagUseBasic</c> method was the following:  <c>HRESULT SessionFlagUseBasic ([out, retval] long* ReturnValue)</c>;</para></remarks>589        // IDL: HRESULT SessionFlagUseBasic ([out, retval] long* ReturnValue);590 591        [DispId(12)]592        int SessionFlagUseBasic();593 594        /// <summary><para><c>SessionFlagUseKerberos</c> method of <c>IWSManEx</c> interface.</para></summary>595        /// <remarks><para>An original IDL definition of <c>SessionFlagUseKerberos</c> method was the following:  <c>HRESULT SessionFlagUseKerberos ([out, retval] long* ReturnValue)</c>;</para></remarks>596        // IDL: HRESULT SessionFlagUseKerberos ([out, retval] long* ReturnValue);597 598        [DispId(13)]599        int SessionFlagUseKerberos();600 601        /// <summary><para><c>SessionFlagNoEncryption</c> method of <c>IWSManEx</c> interface.</para></summary>602        /// <remarks><para>An original IDL definition of <c>SessionFlagNoEncryption</c> method was the following:  <c>HRESULT SessionFlagNoEncryption ([out, retval] long* ReturnValue)</c>;</para></remarks>603        // IDL: HRESULT SessionFlagNoEncryption ([out, retval] long* ReturnValue);604 605        [DispId(14)]606        int SessionFlagNoEncryption();607 608        /// <summary><para><c>SessionFlagEnableSPNServerPort</c> method of <c>IWSManEx</c> interface.</para></summary>609        /// <remarks><para>An original IDL definition of <c>SessionFlagEnableSPNServerPort</c> method was the following:  <c>HRESULT SessionFlagEnableSPNServerPort ([out, retval] long* ReturnValue)</c>;</para></remarks>610        // IDL: HRESULT SessionFlagEnableSPNServerPort ([out, retval] long* ReturnValue);611 612        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "SPN")]613        [DispId(15)]614        int SessionFlagEnableSPNServerPort();615 616        /// <summary><para><c>SessionFlagUseNoAuthentication</c> method of <c>IWSManEx</c> interface.</para></summary>617        /// <remarks><para>An original IDL definition of <c>SessionFlagUseNoAuthentication</c> method was the following:  <c>HRESULT SessionFlagUseNoAuthentication ([out, retval] long* ReturnValue)</c>;</para></remarks>618        // IDL: HRESULT SessionFlagUseNoAuthentication ([out, retval] long* ReturnValue);619 620        [DispId(16)]621        int SessionFlagUseNoAuthentication();622 623        /// <summary><para><c>EnumerationFlagNonXmlText</c> method of <c>IWSManEx</c> interface.</para></summary>624        /// <remarks><para>An original IDL definition of <c>EnumerationFlagNonXmlText</c> method was the following:  <c>HRESULT EnumerationFlagNonXmlText ([out, retval] long* ReturnValue)</c>;</para></remarks>625        // IDL: HRESULT EnumerationFlagNonXmlText ([out, retval] long* ReturnValue);626 627        [DispId(17)]628        int EnumerationFlagNonXmlText();629 630        /// <summary><para><c>EnumerationFlagReturnEPR</c> method of <c>IWSManEx</c> interface.</para></summary>631        /// <remarks><para>An original IDL definition of <c>EnumerationFlagReturnEPR</c> method was the following:  <c>HRESULT EnumerationFlagReturnEPR ([out, retval] long* ReturnValue)</c>;</para></remarks>632        // IDL: HRESULT EnumerationFlagReturnEPR ([out, retval] long* ReturnValue);633 634        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "EPR")]635        [DispId(18)]636        int EnumerationFlagReturnEPR();637 638        /// <summary><para><c>EnumerationFlagReturnObjectAndEPR</c> method of <c>IWSManEx</c> interface.</para></summary>639        /// <remarks><para>An original IDL definition of <c>EnumerationFlagReturnObjectAndEPR</c> method was the following:  <c>HRESULT EnumerationFlagReturnObjectAndEPR ([out, retval] long* ReturnValue)</c>;</para></remarks>640        // IDL: HRESULT EnumerationFlagReturnObjectAndEPR ([out, retval] long* ReturnValue);641 642        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "EPR")]643        [DispId(19)]644        int EnumerationFlagReturnObjectAndEPR();645 646        /// <summary><para><c>GetErrorMessage</c> method of <c>IWSManEx</c> interface.</para></summary>647        /// <remarks><para>An original IDL definition of <c>GetErrorMessage</c> method was the following:  <c>HRESULT GetErrorMessage (unsigned long errorNumber, [out, retval] BSTR* ReturnValue)</c>;</para></remarks>648        // IDL: HRESULT GetErrorMessage (unsigned long errorNumber, [out, retval] BSTR* ReturnValue);649 650        [DispId(20)]651        [return: MarshalAs(UnmanagedType.BStr)]652        string GetErrorMessage(uint errorNumber);653 654        /// <summary><para><c>EnumerationFlagHierarchyDeep</c> method of <c>IWSManEx</c> interface.</para></summary>655        /// <remarks><para>An original IDL definition of <c>EnumerationFlagHierarchyDeep</c> method was the following:  <c>HRESULT EnumerationFlagHierarchyDeep ([out, retval] long* ReturnValue)</c>;</para></remarks>656        // IDL: HRESULT EnumerationFlagHierarchyDeep ([out, retval] long* ReturnValue);657 658        [DispId(21)]659        int EnumerationFlagHierarchyDeep();660 661        /// <summary><para><c>EnumerationFlagHierarchyShallow</c> method of <c>IWSManEx</c> interface.</para></summary>662        /// <remarks><para>An original IDL definition of <c>EnumerationFlagHierarchyShallow</c> method was the following:  <c>HRESULT EnumerationFlagHierarchyShallow ([out, retval] long* ReturnValue)</c>;</para></remarks>663        // IDL: HRESULT EnumerationFlagHierarchyShallow ([out, retval] long* ReturnValue);664 665        [DispId(22)]666        int EnumerationFlagHierarchyShallow();667 668        /// <summary><para><c>EnumerationFlagHierarchyDeepBasePropsOnly</c> method of <c>IWSManEx</c> interface.</para></summary>669        /// <remarks><para>An original IDL definition of <c>EnumerationFlagHierarchyDeepBasePropsOnly</c> method was the following:  <c>HRESULT EnumerationFlagHierarchyDeepBasePropsOnly ([out, retval] long* ReturnValue)</c>;</para></remarks>670        // IDL: HRESULT EnumerationFlagHierarchyDeepBasePropsOnly ([out, retval] long* ReturnValue);671 672        [DispId(23)]673        int EnumerationFlagHierarchyDeepBasePropsOnly();674 675        /// <summary><para><c>EnumerationFlagReturnObject</c> method of <c>IWSManEx</c> interface.</para></summary>676        /// <remarks><para>An original IDL definition of <c>EnumerationFlagReturnObject</c> method was the following:  <c>HRESULT EnumerationFlagReturnObject ([out, retval] long* ReturnValue)</c>;</para></remarks>677        // IDL: HRESULT EnumerationFlagReturnObject ([out, retval] long* ReturnValue);678 679        [DispId(24)]680        int EnumerationFlagReturnObject();681 682        /// <summary><para><c>CommandLine</c> property of <c>IWSManEx</c> interface.</para></summary>683        /// <remarks><para>An original IDL definition of <c>CommandLine</c> property was the following:  <c>BSTR CommandLine</c>;</para></remarks>684        // IDL: BSTR CommandLine;685        [DispId(28)]686        int EnumerationFlagAssociationInstance();687 688        /// <summary><para><c>CommandLine</c> property of <c>IWSManEx</c> interface.</para></summary>689        /// <remarks><para>An original IDL definition of <c>CommandLine</c> property was the following:  <c>BSTR CommandLine</c>;</para></remarks>690        // IDL: BSTR CommandLine;691        [DispId(29)]692        int EnumerationFlagAssociatedInstance();693    }694    #endregion IWsManEx695 696    #region IWsManResourceLocator697 698    /// <summary><para><c>IWSManResourceLocator</c> interface.</para></summary>699    [SuppressMessage("Microsoft.Design", "CA1040:AvoidEmptyInterfaces")]700 701    [SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]702 703    [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sel")]704 705    [Guid("A7A1BA28-DE41-466A-AD0A-C4059EAD7428")]706    [ComImport]707    [TypeLibType((short)4288)]708#if CORECLR709    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]710#else711    [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]712#endif713 714    public interface IWSManResourceLocator715    {716#if CORECLR717        [return: MarshalAs(UnmanagedType.IUnknown)]718        object GetTypeInfoCount();719 720        [return: MarshalAs(UnmanagedType.IUnknown)]721        object GetTypeInfo();722 723        [return: MarshalAs(UnmanagedType.IUnknown)]724        object GetIDsOfNames();725 726        [return: MarshalAs(UnmanagedType.IUnknown)]727        object Invoke();728#endif729        /// <summary><para><c>resourceUri</c> property of <c>IWSManResourceLocator</c> interface.  </para><para>Set the resource URI. Must contain path only -- query string is not allowed here.</para></summary>730        /// <remarks><para>An original IDL definition of <c>resourceUri</c> property was the following:  <c>BSTR resourceUri</c>;</para></remarks>731        // Set the resource URI. Must contain path only -- query string is not allowed here.732        // IDL: BSTR resourceUri;733        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "resource")]734        [SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]735        string ResourceUri736        {737            // IDL: HRESULT resourceUri (BSTR value);738            [SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1212:PropertyAccessorsMustFollowOrder", Justification = "COM interface defines put_ before get_.")]739            [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "resource")]740            [SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]741            [DispId(1)]742            set;743 744            // IDL: HRESULT resourceUri ([out, retval] BSTR* ReturnValue);745            [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "resource")]746            [SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]747            [DispId(1)]748            [return: MarshalAs(UnmanagedType.BStr)]749            get;750        }751 752        /// <summary><para><c>AddSelector</c> method of <c>IWSManResourceLocator</c> interface.  </para><para>Add selector to resource locator</para></summary>753        /// <remarks><para>An original IDL definition of <c>AddSelector</c> method was the following:  <c>HRESULT AddSelector (BSTR resourceSelName, VARIANT selValue)</c>;</para></remarks>754        // Add selector to resource locator755        // IDL: HRESULT AddSelector (BSTR resourceSelName, VARIANT selValue);756 757        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "resource")]758        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "sel")]759        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sel")]760        [DispId(2)]761        void AddSelector([MarshalAs(UnmanagedType.BStr)] string resourceSelName, object selValue);762 763        /// <summary><para><c>ClearSelectors</c> method of <c>IWSManResourceLocator</c> interface.  </para><para>Clear all selectors</para></summary>764        /// <remarks><para>An original IDL definition of <c>ClearSelectors</c> method was the following:  <c>HRESULT ClearSelectors (void)</c>;</para></remarks>765        // Clear all selectors766        // IDL: HRESULT ClearSelectors (void);767 768        [DispId(3)]769        void ClearSelectors();770 771        /// <summary><para><c>FragmentPath</c> property of <c>IWSManResourceLocator</c> interface.  </para><para>Gets the fragment path</para></summary>772        /// <remarks><para>An original IDL definition of <c>FragmentPath</c> property was the following:  <c>BSTR FragmentPath</c>;</para></remarks>773        // Gets the fragment path774        // IDL: BSTR FragmentPath;775 776        string FragmentPath777        {778            // IDL: HRESULT FragmentPath ([out, retval] BSTR* ReturnValue);779 780            [DispId(4)]781            [return: MarshalAs(UnmanagedType.BStr)]782            get;783            // IDL: HRESULT FragmentPath (BSTR value);784 785            [DispId(4)]786            set;787        }788 789        /// <summary><para><c>FragmentDialect</c> property of <c>IWSManResourceLocator</c> interface.  </para><para>Gets the Fragment dialect</para></summary>790        /// <remarks><para>An original IDL definition of <c>FragmentDialect</c> property was the following:  <c>BSTR FragmentDialect</c>;</para></remarks>791        // Gets the Fragment dialect792        // IDL: BSTR FragmentDialect;793 794        string FragmentDialect795        {796            // IDL: HRESULT FragmentDialect ([out, retval] BSTR* ReturnValue);797 798            [DispId(5)]799            [return: MarshalAs(UnmanagedType.BStr)]800            get;801            // IDL: HRESULT FragmentDialect (BSTR value);802 803            [DispId(5)]804            set;805        }806 807        /// <summary><para><c>AddOption</c> method of <c>IWSManResourceLocator</c> interface.  </para><para>Add option to resource locator</para></summary>808        /// <remarks><para>An original IDL definition of <c>AddOption</c> method was the following:  <c>HRESULT AddOption (BSTR OptionName, VARIANT OptionValue, [optional, defaultvalue(0)] long mustComply)</c>;</para></remarks>809        // Add option to resource locator810        // IDL: HRESULT AddOption (BSTR OptionName, VARIANT OptionValue, [optional, defaultvalue(0)] long mustComply);811        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Option")]812        [DispId(6)]813        void AddOption([MarshalAs(UnmanagedType.BStr)] string OptionName, object OptionValue, int mustComply);814 815        /// <summary><para><c>MustUnderstandOptions</c> property of <c>IWSManResourceLocator</c> interface.  </para><para>Sets the MustUnderstandOptions value</para></summary>816        /// <remarks><para>An original IDL definition of <c>MustUnderstandOptions</c> property was the following:  <c>long MustUnderstandOptions</c>;</para></remarks>817        // Sets the MustUnderstandOptions value818        // IDL: long MustUnderstandOptions;819 820        int MustUnderstandOptions821        {822            // IDL: HRESULT MustUnderstandOptions (long value);823 824            [SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1212:PropertyAccessorsMustFollowOrder", Justification = "COM interface defines put_ before get_.")]825            [DispId(7)]826            set;827 828            // IDL: HRESULT MustUnderstandOptions ([out, retval] long* ReturnValue);829 830            [DispId(7)]831            get;832        }833 834        /// <summary><para><c>ClearOptions</c> method of <c>IWSManResourceLocator</c> interface.  </para><para>Clear all options</para></summary>835        /// <remarks><para>An original IDL definition of <c>ClearOptions</c> method was the following:  <c>HRESULT ClearOptions (void)</c>;</para></remarks>836        // Clear all options837        // IDL: HRESULT ClearOptions (void);838 839        [DispId(8)]840        void ClearOptions();841 842        /// <summary><para><c>Error</c> property of <c>IWSManResourceLocator</c> interface.</para></summary>843        /// <remarks><para>An original IDL definition of <c>Error</c> property was the following:  <c>BSTR Error</c>;</para></remarks>844        // IDL: BSTR Error;845 846        [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Error")]847        string Error848        {849            // IDL: HRESULT Error ([out, retval] BSTR* ReturnValue);850 851            [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Error")]852            [DispId(9)]853            [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Error")]854            [return: MarshalAs(UnmanagedType.BStr)]855            get;856        }857    }858    #endregion IWsManResourceLocator859 860    #region IWSManSession861    /// <summary><para><c>IWSManSession</c> interface.</para></summary>862    [Guid("FC84FC58-1286-40C4-9DA0-C8EF6EC241E0")]863    [ComImport]864    [TypeLibType((short)4288)]865#if CORECLR866    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]867#else868    [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]869#endif870 871    [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Error")]872    [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]873    [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "0#")]874    [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "URI")]875    public interface IWSManSession876    {877#if CORECLR878        [return: MarshalAs(UnmanagedType.IUnknown)]879        object GetTypeInfoCount();880 881        [return: MarshalAs(UnmanagedType.IUnknown)]882        object GetTypeInfo();883 884        [return: MarshalAs(UnmanagedType.IUnknown)]885        object GetIDsOfNames();886 887        [return: MarshalAs(UnmanagedType.IUnknown)]888        object Invoke();889#endif890 891        /// <summary><para><c>Get</c> method of <c>IWSManSession</c> interface.</para></summary>892        /// <remarks><para>An original IDL definition of <c>Get</c> method was the following:  <c>HRESULT Get (VARIANT resourceUri, [optional, defaultvalue(0)] long flags, [out, retval] BSTR* ReturnValue)</c>;</para></remarks>893        // IDL: HRESULT Get (VARIANT resourceUri, [optional, defaultvalue(0)] long flags, [out, retval] BSTR* ReturnValue);894 895        [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]896        [DispId(1)]897        [return: MarshalAs(UnmanagedType.BStr)]898        string Get(object resourceUri, int flags);899 900        /// <summary><para><c>Put</c> method of <c>IWSManSession</c> interface.</para></summary>901        /// <remarks><para>An original IDL definition of <c>Put</c> method was the following:  <c>HRESULT Put (VARIANT resourceUri, BSTR resource, [optional, defaultvalue(0)] long flags, [out, retval] BSTR* ReturnValue)</c>;</para></remarks>902        // IDL: HRESULT Put (VARIANT resourceUri, BSTR resource, [optional, defaultvalue(0)] long flags, [out, retval] BSTR* ReturnValue);903 904        [DispId(2)]905        [return: MarshalAs(UnmanagedType.BStr)]906        string Put(object resourceUri, [MarshalAs(UnmanagedType.BStr)] string resource, int flags);907 908        /// <summary><para><c>Create</c> method of <c>IWSManSession</c> interface.</para></summary>909        /// <remarks><para>An original IDL definition of <c>Create</c> method was the following:  <c>HRESULT Create (VARIANT resourceUri, BSTR resource, [optional, defaultvalue(0)] long flags, [out, retval] BSTR* ReturnValue)</c>;</para></remarks>910        // IDL: HRESULT Create (VARIANT resourceUri, BSTR resource, [optional, defaultvalue(0)] long flags, [out, retval] BSTR* ReturnValue);911 912        [DispId(3)]913        [return: MarshalAs(UnmanagedType.BStr)]914        string Create(object resourceUri, [MarshalAs(UnmanagedType.BStr)] string resource, int flags);915 916        /// <summary><para><c>Delete</c> method of <c>IWSManSession</c> interface.</para></summary>917        /// <remarks><para>An original IDL definition of <c>Delete</c> method was the following:  <c>HRESULT Delete (VARIANT resourceUri, [optional, defaultvalue(0)] long flags)</c>;</para></remarks>918        // IDL: HRESULT Delete (VARIANT resourceUri, [optional, defaultvalue(0)] long flags);919 920        [DispId(4)]921        void Delete(object resourceUri, int flags);922 923        /// <summary>924        /// </summary>925        /// <param name="actionURI"></param>926        /// <param name="resourceUri"></param>927        /// <param name="parameters"></param>928        /// <param name="flags"></param>929        /// <returns></returns>930        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "URI")]931        [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "0#")]932        [DispId(5)]933        string Invoke([MarshalAs(UnmanagedType.BStr)] string actionURI, [In] object resourceUri, [MarshalAs(UnmanagedType.BStr)] string parameters, [In] int flags);934 935        /// <summary><para><c>Enumerate</c> method of <c>IWSManSession</c> interface.</para></summary>936        /// <remarks><para>An original IDL definition of <c>Enumerate</c> method was the following:  <c>HRESULT Enumerate (VARIANT resourceUri, [optional, defaultvalue(string.Empty)] BSTR filter, [optional, defaultvalue(string.Empty)] BSTR dialect, [optional, defaultvalue(0)] long flags, [out, retval] IDispatch** ReturnValue)</c>;</para></remarks>937        // IDL: HRESULT Enumerate (VARIANT resourceUri, [optional, defaultvalue(string.Empty)] BSTR filter, [optional, defaultvalue(string.Empty)] BSTR dialect, [optional, defaultvalue(0)] long flags, [out, retval] IDispatch** ReturnValue);938 939        [DispId(6)]940#if CORECLR941        [return: MarshalAs(UnmanagedType.IUnknown)]942#else943        [return: MarshalAs(UnmanagedType.IDispatch)]944#endif945        object Enumerate(object resourceUri, [MarshalAs(UnmanagedType.BStr)] string filter, [MarshalAs(UnmanagedType.BStr)] string dialect, int flags);946 947        /// <summary><para><c>Identify</c> method of <c>IWSManSession</c> interface.</para></summary>948        /// <remarks><para>An original IDL definition of <c>Identify</c> method was the following:  <c>HRESULT Identify ([optional, defaultvalue(0)] long flags, [out, retval] BSTR* ReturnValue)</c>;</para></remarks>949        // IDL: HRESULT Identify ([optional, defaultvalue(0)] long flags, [out, retval] BSTR* ReturnValue);950 951        [DispId(7)]952        [return: MarshalAs(UnmanagedType.BStr)]953        string Identify(int flags);954 955        /// <summary><para><c>Error</c> property of <c>IWSManSession</c> interface.</para></summary>956        /// <remarks><para>An original IDL definition of <c>Error</c> property was the following:  <c>BSTR Error</c>;</para></remarks>957        // IDL: BSTR Error;958 959        [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Error")]960        string Error961        {962            // IDL: HRESULT Error ([out, retval] BSTR* ReturnValue);963 964            [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Error")]965            [DispId(8)]966            [return: MarshalAs(UnmanagedType.BStr)]967            get;968        }969 970        /// <summary><para><c>BatchItems</c> property of <c>IWSManSession</c> interface.</para></summary>971        /// <remarks><para>An original IDL definition of <c>BatchItems</c> property was the following:  <c>long BatchItems</c>;</para></remarks>972        // IDL: long BatchItems;973 974        int BatchItems975        {976            // IDL: HRESULT BatchItems ([out, retval] long* ReturnValue);977 978            [DispId(9)]979            get;980            // IDL: HRESULT BatchItems (long value);981 982            [DispId(9)]983            set;984        }985 986        /// <summary><para><c>Timeout</c> property of <c>IWSManSession</c> interface.</para></summary>987        /// <remarks><para>An original IDL definition of <c>Timeout</c> property was the following:  <c>long Timeout</c>;</para></remarks>988        // IDL: long Timeout;989 990        int Timeout991        {992            // IDL: HRESULT Timeout ([out, retval] long* ReturnValue);993 994            [DispId(10)]995            get;996            // IDL: HRESULT Timeout (long value);997 998            [DispId(10)]999            set;1000        }1001    }1002 1003    #endregion IWSManSession1004 1005    #region IWSManResourceLocatorInternal1006    /// <summary><para><c>IWSManResourceLocatorInternal</c> interface.</para></summary>1007    [Guid("EFFAEAD7-7EC8-4716-B9BE-F2E7E9FB4ADB")]1008    [ComImport]1009    [TypeLibType((short)400)]1010#if CORECLR1011    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]1012#else1013    [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]1014#endif1015    [SuppressMessage("Microsoft.Design", "CA1040:AvoidEmptyInterfaces")]1016    public interface IWSManResourceLocatorInternal1017    {1018#if CORECLR1019        [return: MarshalAs(UnmanagedType.IUnknown)]1020        object GetTypeInfoCount();1021 1022        [return: MarshalAs(UnmanagedType.IUnknown)]1023        object GetTypeInfo();1024 1025        [return: MarshalAs(UnmanagedType.IUnknown)]1026        object GetIDsOfNames();1027 1028        [return: MarshalAs(UnmanagedType.IUnknown)]1029        object Invoke();1030#endif1031    }1032 1033    #endregion IWSManResourceLocatorInternal1034 1035    /// <summary><para><c>WSMan</c> interface.</para></summary>1036    [Guid("BCED617B-EC03-420b-8508-977DC7A686BD")]1037    [ComImport]1038#if CORECLR1039    [ClassInterface(ClassInterfaceType.None)]1040#else1041    [ClassInterface(ClassInterfaceType.AutoDual)]1042#endif1043    public class WSManClass1044    {1045    }1046 1047    #region IGroupPolicyObject1048 1049    /// <summary><para><c>GPClass</c> interface.</para></summary>1050    [Guid("EA502722-A23D-11d1-A7D3-0000F87571E3")]1051    [ComImport]1052    [ClassInterface(ClassInterfaceType.None)]1053    public class GPClass1054    {1055    }1056 1057    [ComImport, Guid("EA502723-A23D-11d1-A7D3-0000F87571E3"),1058    InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]1059    internal interface IGroupPolicyObject1060    {1061        void New(1062          [MarshalAs(UnmanagedType.LPWStr)] string pszDomainName,1063          [MarshalAs(UnmanagedType.LPWStr)] string pszDisplayName,1064          uint dwFlags);1065 1066        void OpenDSGPO(1067          [MarshalAs(UnmanagedType.LPWStr)] string pszPath,1068          uint dwFlags);1069 1070        void OpenLocalMachineGPO(uint dwFlags);1071 1072        void OpenRemoteMachineGPO(1073          [MarshalAs(UnmanagedType.LPWStr)] string pszComputerName,1074          uint dwFlags);1075 1076        void Save(1077          [MarshalAs(UnmanagedType.Bool)] bool bMachine,1078          [MarshalAs(UnmanagedType.Bool)] bool bAdd,1079          [MarshalAs(UnmanagedType.LPStruct)] Guid pGuidExtension,1080          [MarshalAs(UnmanagedType.LPStruct)] Guid pGuid);1081 1082        void Delete();1083 1084        void GetName(1085          [MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszName,1086          int cchMaxLength);1087 1088        void GetDisplayName(1089          [MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszName,1090          int cchMaxLength);1091 1092        void SetDisplayName(1093          [MarshalAs(UnmanagedType.LPWStr)] string pszName);1094 1095        void GetPath(1096          [MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszPath,1097          int cchMaxPath);1098 1099        void GetDSPath(1100          uint dwSection,1101          [MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszPath,1102          int cchMaxPath);1103 1104        void GetFileSysPath(1105          uint dwSection,1106          [MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszPath,1107          int cchMaxPath);1108 1109        IntPtr GetRegistryKey(uint dwSection);1110 1111        uint GetOptions();1112 1113        void SetOptions(uint dwOptions, uint dwMask);1114 1115        void GetMachineName(1116          [MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszName,1117          int cchMaxLength);1118 1119        uint GetPropertySheetPages(out IntPtr hPages);1120    }1121 1122    #endregion IGroupPolicyObject1123 1124    /// <summary><para><c>GpoNativeApi</c></para></summary>1125    public sealed class GpoNativeApi1126    {1127        private GpoNativeApi() { }1128 1129        [DllImport("Userenv.dll", CharSet = CharSet.Unicode, SetLastError = true)]1130        internal static extern System.IntPtr EnterCriticalPolicySection(1131             [In, MarshalAs(UnmanagedType.Bool)] bool bMachine);1132 1133        [DllImport("Userenv.dll", CharSet = CharSet.Unicode, SetLastError = true)]1134        [return: MarshalAs(UnmanagedType.Bool)]1135        internal static extern bool LeaveCriticalPolicySection(1136             [In] System.IntPtr hSection);1137    }1138    #endregion1139}1140 1141#pragma warning restore 15911142