Team Ai
Datasetpublic

MegaBites-AI/Windows-powershell

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes372downloads
ComInterop.cs59 linesDownload Raw Back to ComInterop
1// Licensed to the .NET Foundation under one or more agreements.2// The .NET Foundation licenses this file to you under the MIT license.3 4using System;5using System.Runtime.InteropServices;6using ComTypes = System.Runtime.InteropServices.ComTypes;7 8namespace System.Management.Automation.ComInterop9{10    [ComImport]11    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]12    [Guid("00020400-0000-0000-C000-000000000046")]13    internal interface IDispatch14    {15        [PreserveSig]16        int TryGetTypeInfoCount(out uint pctinfo);17 18        [PreserveSig]19        int TryGetTypeInfo(uint iTInfo, int lcid, out IntPtr info);20 21        [PreserveSig]22        int TryGetIDsOfNames(23            ref Guid iid,24            [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 2)]25            string[] names,26            uint cNames,27            int lcid,28            [Out]29            [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.I4, SizeParamIndex = 2)]30            int[] rgDispId);31 32        [PreserveSig]33        int TryInvoke(34            int dispIdMember,35            ref Guid riid,36            int lcid,37            ComTypes.INVOKEKIND wFlags,38            ref ComTypes.DISPPARAMS pDispParams,39            IntPtr VarResult,40            IntPtr pExcepInfo,41            IntPtr puArgErr);42    }43 44    [ComImport]45    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]46    [Guid("B196B283-BAB4-101A-B69C-00AA00341D07")]47    internal interface IProvideClassInfo48    {49        void GetClassInfo(out IntPtr info);50    }51 52    internal static class ComDispIds53    {54        internal const int DISPID_VALUE = 0;55        internal const int DISPID_PROPERTYPUT = -3;56        internal const int DISPID_NEWENUM = -4;57    }58}59