From 0a2ceb3fd146d9171b8c362aa8679d996d3e5bde Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Tue, 8 Jan 2019 01:57:44 +0100 Subject: Moves ComTypes to shared partition (#21861) --- .../System.Private.CoreLib.csproj | 18 -- .../shared/System.Private.CoreLib.Shared.projitems | 20 ++ .../Runtime/InteropServices/ComTypes/IBindCtx.cs | 33 +++ .../InteropServices/ComTypes/IConnectionPoint.cs | 18 ++ .../ComTypes/IConnectionPointContainer.cs | 15 + .../ComTypes/IEnumConnectionPoints.cs | 19 ++ .../InteropServices/ComTypes/IEnumConnections.cs | 27 ++ .../InteropServices/ComTypes/IEnumMoniker.cs | 19 ++ .../InteropServices/ComTypes/IEnumString.cs | 19 ++ .../InteropServices/ComTypes/IEnumVARIANT.cs | 23 ++ .../InteropServices/ComTypes/IEnumerable.cs | 22 ++ .../Runtime/InteropServices/ComTypes/IMoniker.cs | 49 ++++ .../InteropServices/ComTypes/IPersistFile.cs | 23 ++ .../ComTypes/IRunningObjectTable.cs | 23 ++ .../Runtime/InteropServices/ComTypes/IStream.cs | 43 +++ .../Runtime/InteropServices/ComTypes/ITypeComp.cs | 36 +++ .../Runtime/InteropServices/ComTypes/ITypeInfo.cs | 303 +++++++++++++++++++++ .../Runtime/InteropServices/ComTypes/ITypeInfo2.cs | 51 ++++ .../Runtime/InteropServices/ComTypes/ITypeLib.cs | 54 ++++ .../Runtime/InteropServices/ComTypes/ITypeLib2.cs | 31 +++ .../Runtime/InteropServices/ComTypes/IBindCtx.cs | 33 --- .../InteropServices/ComTypes/IConnectionPoint.cs | 18 -- .../ComTypes/IConnectionPointContainer.cs | 15 - .../ComTypes/IEnumConnectionPoints.cs | 19 -- .../InteropServices/ComTypes/IEnumConnections.cs | 27 -- .../InteropServices/ComTypes/IEnumMoniker.cs | 19 -- .../InteropServices/ComTypes/IEnumString.cs | 19 -- .../InteropServices/ComTypes/IEnumVARIANT.cs | 23 -- .../InteropServices/ComTypes/IEnumerable.cs | 22 -- .../Runtime/InteropServices/ComTypes/IMoniker.cs | 49 ---- .../InteropServices/ComTypes/IPersistFile.cs | 23 -- .../ComTypes/IRunningObjectTable.cs | 23 -- .../Runtime/InteropServices/ComTypes/IStream.cs | 43 --- .../Runtime/InteropServices/ComTypes/ITypeComp.cs | 36 --- .../Runtime/InteropServices/ComTypes/ITypeInfo.cs | 303 --------------------- .../Runtime/InteropServices/ComTypes/ITypeInfo2.cs | 51 ---- .../Runtime/InteropServices/ComTypes/ITypeLib.cs | 54 ---- .../Runtime/InteropServices/ComTypes/ITypeLib2.cs | 31 --- 38 files changed, 828 insertions(+), 826 deletions(-) create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IBindCtx.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IConnectionPoint.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IConnectionPointContainer.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumConnectionPoints.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumConnections.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumMoniker.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumString.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumVARIANT.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumerable.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IMoniker.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IPersistFile.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IRunningObjectTable.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IStream.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeComp.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeInfo2.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeLib.cs create mode 100644 src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeLib2.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IBindCtx.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IConnectionPoint.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IConnectionPointContainer.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumConnectionPoints.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumConnections.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumMoniker.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumString.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumVARIANT.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumerable.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IMoniker.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IPersistFile.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IRunningObjectTable.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IStream.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeComp.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeInfo2.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeLib.cs delete mode 100644 src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeLib2.cs (limited to 'src') diff --git a/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/System.Private.CoreLib/System.Private.CoreLib.csproj index 9740d156c3..07f25c67ca 100644 --- a/src/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -257,24 +257,6 @@ - - - - - - - - - - - - - - - - - - diff --git a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems index 0504497f62..4d89fb0d4c 100644 --- a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems +++ b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems @@ -942,6 +942,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IBindCtx.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IBindCtx.cs new file mode 100644 index 0000000000..a535b94f88 --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IBindCtx.cs @@ -0,0 +1,33 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + [StructLayout(LayoutKind.Sequential)] + public struct BIND_OPTS + { + public int cbStruct; + public int grfFlags; + public int grfMode; + public int dwTickCountDeadline; + } + + [Guid("0000000e-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface IBindCtx + { + void RegisterObjectBound([MarshalAs(UnmanagedType.Interface)] object punk); + void RevokeObjectBound([MarshalAs(UnmanagedType.Interface)] object punk); + void ReleaseBoundObjects(); + void SetBindOptions([In()] ref BIND_OPTS pbindopts); + void GetBindOptions(ref BIND_OPTS pbindopts); + void GetRunningObjectTable(out IRunningObjectTable pprot); + void RegisterObjectParam([MarshalAs(UnmanagedType.LPWStr)] string pszKey, [MarshalAs(UnmanagedType.Interface)] object punk); + void GetObjectParam([MarshalAs(UnmanagedType.LPWStr)] string pszKey, [MarshalAs(UnmanagedType.Interface)] out object ppunk); + void EnumObjectParam(out IEnumString ppenum); + [PreserveSig] + int RevokeObjectParam([MarshalAs(UnmanagedType.LPWStr)] string pszKey); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IConnectionPoint.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IConnectionPoint.cs new file mode 100644 index 0000000000..fcca685ad8 --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IConnectionPoint.cs @@ -0,0 +1,18 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + [Guid("B196B286-BAB4-101A-B69C-00AA00341D07")] + [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface IConnectionPoint + { + void GetConnectionInterface(out Guid pIID); + void GetConnectionPointContainer(out IConnectionPointContainer ppCPC); + void Advise([MarshalAs(UnmanagedType.Interface)] object pUnkSink, out int pdwCookie); + void Unadvise(int dwCookie); + void EnumConnections(out IEnumConnections ppEnum); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IConnectionPointContainer.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IConnectionPointContainer.cs new file mode 100644 index 0000000000..84c590d436 --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IConnectionPointContainer.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + [Guid("B196B284-BAB4-101A-B69C-00AA00341D07")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface IConnectionPointContainer + { + void EnumConnectionPoints(out IEnumConnectionPoints ppEnum); + void FindConnectionPoint([In] ref Guid riid, out IConnectionPoint ppCP); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumConnectionPoints.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumConnectionPoints.cs new file mode 100644 index 0000000000..99df6ac60e --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumConnectionPoints.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + [Guid("B196B285-BAB4-101A-B69C-00AA00341D07")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface IEnumConnectionPoints + { + [PreserveSig] + int Next(int celt, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out] IConnectionPoint[] rgelt, IntPtr pceltFetched); + [PreserveSig] + int Skip(int celt); + void Reset(); + void Clone(out IEnumConnectionPoints ppenum); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumConnections.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumConnections.cs new file mode 100644 index 0000000000..951685beff --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumConnections.cs @@ -0,0 +1,27 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct CONNECTDATA + { + [MarshalAs(UnmanagedType.Interface)] + public object pUnk; + public int dwCookie; + } + + [Guid("B196B287-BAB4-101A-B69C-00AA00341D07")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface IEnumConnections + { + [PreserveSig] + int Next(int celt, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out] CONNECTDATA[] rgelt, IntPtr pceltFetched); + [PreserveSig] + int Skip(int celt); + void Reset(); + void Clone(out IEnumConnections ppenum); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumMoniker.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumMoniker.cs new file mode 100644 index 0000000000..9a63ba0a11 --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumMoniker.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + [Guid("00000102-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface IEnumMoniker + { + [PreserveSig] + int Next(int celt, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out] IMoniker[] rgelt, IntPtr pceltFetched); + [PreserveSig] + int Skip(int celt); + void Reset(); + void Clone(out IEnumMoniker ppenum); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumString.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumString.cs new file mode 100644 index 0000000000..57fc59121f --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumString.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + [Guid("00000101-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface IEnumString + { + [PreserveSig] + int Next(int celt, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 0), Out] string[] rgelt, IntPtr pceltFetched); + [PreserveSig] + int Skip(int celt); + void Reset(); + void Clone(out IEnumString ppenum); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumVARIANT.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumVARIANT.cs new file mode 100644 index 0000000000..8440c060bb --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumVARIANT.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + [Guid("00020404-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface IEnumVARIANT + { + [PreserveSig] + int Next(int celt, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out] object[] rgVar, IntPtr pceltFetched); + + [PreserveSig] + int Skip(int celt); + + [PreserveSig] + int Reset(); + + IEnumVARIANT Clone(); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumerable.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumerable.cs new file mode 100644 index 0000000000..e541960cae --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IEnumerable.cs @@ -0,0 +1,22 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information + +using System; +namespace System.Runtime.InteropServices.ComTypes +{ + /*========================================================================== + ** Interface: IEnumerable + ** Purpose: + ** This interface is redefined here since the original IEnumerable interface + ** has all its methods marked as ecall's since it is a managed standard + ** interface. This interface is used from within the runtime to make a call + ** on the COM server directly when it implements the IEnumerable interface. + ==========================================================================*/ + [Guid("496B0ABE-CDEE-11d3-88E8-00902754C43A")] + internal interface IEnumerable + { + [DispId(-4)] + System.Collections.IEnumerator GetEnumerator(); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IMoniker.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IMoniker.cs new file mode 100644 index 0000000000..7a2dd57d16 --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IMoniker.cs @@ -0,0 +1,49 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + [StructLayout(LayoutKind.Sequential)] + public struct FILETIME + { + public int dwLowDateTime; + public int dwHighDateTime; + } + + [Guid("0000000f-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface IMoniker + { + // IPersist portion + void GetClassID(out Guid pClassID); + + // IPersistStream portion + [PreserveSig] + int IsDirty(); + void Load(IStream pStm); + void Save(IStream pStm, [MarshalAs(UnmanagedType.Bool)] bool fClearDirty); + void GetSizeMax(out long pcbSize); + + // IMoniker portion + void BindToObject(IBindCtx pbc, IMoniker pmkToLeft, [In()] ref Guid riidResult, [MarshalAs(UnmanagedType.Interface)] out object ppvResult); + void BindToStorage(IBindCtx pbc, IMoniker pmkToLeft, [In()] ref Guid riid, [MarshalAs(UnmanagedType.Interface)] out object ppvObj); + void Reduce(IBindCtx pbc, int dwReduceHowFar, ref IMoniker ppmkToLeft, out IMoniker ppmkReduced); + void ComposeWith(IMoniker pmkRight, [MarshalAs(UnmanagedType.Bool)] bool fOnlyIfNotGeneric, out IMoniker ppmkComposite); + void Enum([MarshalAs(UnmanagedType.Bool)] bool fForward, out IEnumMoniker ppenumMoniker); + [PreserveSig] + int IsEqual(IMoniker pmkOtherMoniker); + void Hash(out int pdwHash); + [PreserveSig] + int IsRunning(IBindCtx pbc, IMoniker pmkToLeft, IMoniker pmkNewlyRunning); + void GetTimeOfLastChange(IBindCtx pbc, IMoniker pmkToLeft, out FILETIME pFileTime); + void Inverse(out IMoniker ppmk); + void CommonPrefixWith(IMoniker pmkOther, out IMoniker ppmkPrefix); + void RelativePathTo(IMoniker pmkOther, out IMoniker ppmkRelPath); + void GetDisplayName(IBindCtx pbc, IMoniker pmkToLeft, [MarshalAs(UnmanagedType.LPWStr)] out string ppszDisplayName); + void ParseDisplayName(IBindCtx pbc, IMoniker pmkToLeft, [MarshalAs(UnmanagedType.LPWStr)] string pszDisplayName, out int pchEaten, out IMoniker ppmkOut); + [PreserveSig] + int IsSystemMoniker(out int pdwMksys); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IPersistFile.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IPersistFile.cs new file mode 100644 index 0000000000..cb24d985dc --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IPersistFile.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + [Guid("0000010b-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface IPersistFile + { + // IPersist portion + void GetClassID(out Guid pClassID); + + // IPersistFile portion + [PreserveSig] + int IsDirty(); + void Load([MarshalAs(UnmanagedType.LPWStr)] string pszFileName, int dwMode); + void Save([MarshalAs(UnmanagedType.LPWStr)] string pszFileName, [MarshalAs(UnmanagedType.Bool)] bool fRemember); + void SaveCompleted([MarshalAs(UnmanagedType.LPWStr)] string pszFileName); + void GetCurFile([MarshalAs(UnmanagedType.LPWStr)] out string ppszFileName); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IRunningObjectTable.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IRunningObjectTable.cs new file mode 100644 index 0000000000..1884fcc99b --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IRunningObjectTable.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + [Guid("00000010-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface IRunningObjectTable + { + int Register(int grfFlags, [MarshalAs(UnmanagedType.Interface)] object punkObject, IMoniker pmkObjectName); + void Revoke(int dwRegister); + [PreserveSig] + int IsRunning(IMoniker pmkObjectName); + [PreserveSig] + int GetObject(IMoniker pmkObjectName, [MarshalAs(UnmanagedType.Interface)] out object ppunkObject); + void NoteChangeTime(int dwRegister, ref FILETIME pfiletime); + [PreserveSig] + int GetTimeOfLastChange(IMoniker pmkObjectName, out FILETIME pfiletime); + void EnumRunning(out IEnumMoniker ppenumMoniker); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IStream.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IStream.cs new file mode 100644 index 0000000000..09b284041e --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/IStream.cs @@ -0,0 +1,43 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct STATSTG + { + public string pwcsName; + public int type; + public long cbSize; + public FILETIME mtime; + public FILETIME ctime; + public FILETIME atime; + public int grfMode; + public int grfLocksSupported; + public Guid clsid; + public int grfStateBits; + public int reserved; + } + + [Guid("0000000c-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface IStream + { + // ISequentialStream portion + void Read([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1), Out] byte[] pv, int cb, IntPtr pcbRead); + void Write([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] byte[] pv, int cb, IntPtr pcbWritten); + + // IStream portion + void Seek(long dlibMove, int dwOrigin, IntPtr plibNewPosition); + void SetSize(long libNewSize); + void CopyTo(IStream pstm, long cb, IntPtr pcbRead, IntPtr pcbWritten); + void Commit(int grfCommitFlags); + void Revert(); + void LockRegion(long libOffset, long cb, int dwLockType); + void UnlockRegion(long libOffset, long cb, int dwLockType); + void Stat(out STATSTG pstatstg, int grfStatFlag); + void Clone(out IStream ppstm); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeComp.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeComp.cs new file mode 100644 index 0000000000..7e63793615 --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeComp.cs @@ -0,0 +1,36 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + public enum DESCKIND + { + DESCKIND_NONE = 0, + DESCKIND_FUNCDESC = DESCKIND_NONE + 1, + DESCKIND_VARDESC = DESCKIND_FUNCDESC + 1, + DESCKIND_TYPECOMP = DESCKIND_VARDESC + 1, + DESCKIND_IMPLICITAPPOBJ = DESCKIND_TYPECOMP + 1, + DESCKIND_MAX = DESCKIND_IMPLICITAPPOBJ + 1 + } + + [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode)] + public struct BINDPTR + { + [FieldOffset(0)] + public IntPtr lpfuncdesc; + [FieldOffset(0)] + public IntPtr lpvardesc; + [FieldOffset(0)] + public IntPtr lptcomp; + } + + [Guid("00020403-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ITypeComp + { + void Bind([MarshalAs(UnmanagedType.LPWStr)] string szName, int lHashVal, short wFlags, out ITypeInfo ppTInfo, out DESCKIND pDescKind, out BINDPTR pBindPtr); + void BindType([MarshalAs(UnmanagedType.LPWStr)] string szName, int lHashVal, out ITypeInfo ppTInfo, out ITypeComp ppTComp); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs new file mode 100644 index 0000000000..61776e446d --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs @@ -0,0 +1,303 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + public enum TYPEKIND + { + TKIND_ENUM = 0, + TKIND_RECORD = TKIND_ENUM + 1, + TKIND_MODULE = TKIND_RECORD + 1, + TKIND_INTERFACE = TKIND_MODULE + 1, + TKIND_DISPATCH = TKIND_INTERFACE + 1, + TKIND_COCLASS = TKIND_DISPATCH + 1, + TKIND_ALIAS = TKIND_COCLASS + 1, + TKIND_UNION = TKIND_ALIAS + 1, + TKIND_MAX = TKIND_UNION + 1 + } + + [Flags] + public enum TYPEFLAGS : short + { + TYPEFLAG_FAPPOBJECT = 0x1, + TYPEFLAG_FCANCREATE = 0x2, + TYPEFLAG_FLICENSED = 0x4, + TYPEFLAG_FPREDECLID = 0x8, + TYPEFLAG_FHIDDEN = 0x10, + TYPEFLAG_FCONTROL = 0x20, + TYPEFLAG_FDUAL = 0x40, + TYPEFLAG_FNONEXTENSIBLE = 0x80, + TYPEFLAG_FOLEAUTOMATION = 0x100, + TYPEFLAG_FRESTRICTED = 0x200, + TYPEFLAG_FAGGREGATABLE = 0x400, + TYPEFLAG_FREPLACEABLE = 0x800, + TYPEFLAG_FDISPATCHABLE = 0x1000, + TYPEFLAG_FREVERSEBIND = 0x2000, + TYPEFLAG_FPROXY = 0x4000 + } + + [Flags] + public enum IMPLTYPEFLAGS + { + IMPLTYPEFLAG_FDEFAULT = 0x1, + IMPLTYPEFLAG_FSOURCE = 0x2, + IMPLTYPEFLAG_FRESTRICTED = 0x4, + IMPLTYPEFLAG_FDEFAULTVTABLE = 0x8, + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct TYPEATTR + { + // Constant used with the memid fields. + public const int MEMBER_ID_NIL = unchecked((int)0xFFFFFFFF); + + // Actual fields of the TypeAttr struct. + public Guid guid; + public int lcid; + public int dwReserved; + public int memidConstructor; + public int memidDestructor; + public IntPtr lpstrSchema; + public int cbSizeInstance; + public TYPEKIND typekind; + public short cFuncs; + public short cVars; + public short cImplTypes; + public short cbSizeVft; + public short cbAlignment; + public TYPEFLAGS wTypeFlags; + public short wMajorVerNum; + public short wMinorVerNum; + public TYPEDESC tdescAlias; + public IDLDESC idldescType; + } + + [StructLayout(LayoutKind.Sequential)] + public struct FUNCDESC + { + public int memid; //MEMBERID memid; + public IntPtr lprgscode; // /* [size_is(cScodes)] */ SCODE RPC_FAR *lprgscode; + public IntPtr lprgelemdescParam; // /* [size_is(cParams)] */ ELEMDESC __RPC_FAR *lprgelemdescParam; + public FUNCKIND funckind; //FUNCKIND funckind; + public INVOKEKIND invkind; //INVOKEKIND invkind; + public CALLCONV callconv; //CALLCONV callconv; + public short cParams; //short cParams; + public short cParamsOpt; //short cParamsOpt; + public short oVft; //short oVft; + public short cScodes; //short cScodes; + public ELEMDESC elemdescFunc; //ELEMDESC elemdescFunc; + public short wFuncFlags; //WORD wFuncFlags; + } + + [Flags] + public enum IDLFLAG : short + { + IDLFLAG_NONE = PARAMFLAG.PARAMFLAG_NONE, + IDLFLAG_FIN = PARAMFLAG.PARAMFLAG_FIN, + IDLFLAG_FOUT = PARAMFLAG.PARAMFLAG_FOUT, + IDLFLAG_FLCID = PARAMFLAG.PARAMFLAG_FLCID, + IDLFLAG_FRETVAL = PARAMFLAG.PARAMFLAG_FRETVAL + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct IDLDESC + { + public IntPtr dwReserved; + public IDLFLAG wIDLFlags; + } + + [Flags] + public enum PARAMFLAG : short + { + PARAMFLAG_NONE = 0, + PARAMFLAG_FIN = 0x1, + PARAMFLAG_FOUT = 0x2, + PARAMFLAG_FLCID = 0x4, + PARAMFLAG_FRETVAL = 0x8, + PARAMFLAG_FOPT = 0x10, + PARAMFLAG_FHASDEFAULT = 0x20, + PARAMFLAG_FHASCUSTDATA = 0x40 + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct PARAMDESC + { + public IntPtr lpVarValue; + public PARAMFLAG wParamFlags; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct TYPEDESC + { + public IntPtr lpValue; + public short vt; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct ELEMDESC + { + public TYPEDESC tdesc; + + [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode)] + public struct DESCUNION + { + [FieldOffset(0)] + public IDLDESC idldesc; + [FieldOffset(0)] + public PARAMDESC paramdesc; + }; + public DESCUNION desc; + } + + public enum VARKIND : int + { + VAR_PERINSTANCE = 0x0, + VAR_STATIC = 0x1, + VAR_CONST = 0x2, + VAR_DISPATCH = 0x3 + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + + public struct VARDESC + { + public int memid; + public string lpstrSchema; + + [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode)] + public struct DESCUNION + { + [FieldOffset(0)] + public int oInst; + [FieldOffset(0)] + public IntPtr lpvarValue; + }; + + public DESCUNION desc; + + public ELEMDESC elemdescVar; + public short wVarFlags; + public VARKIND varkind; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct DISPPARAMS + { + public IntPtr rgvarg; + public IntPtr rgdispidNamedArgs; + public int cArgs; + public int cNamedArgs; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct EXCEPINFO + { + public short wCode; + public short wReserved; + [MarshalAs(UnmanagedType.BStr)] public string bstrSource; + [MarshalAs(UnmanagedType.BStr)] public string bstrDescription; + [MarshalAs(UnmanagedType.BStr)] public string bstrHelpFile; + public int dwHelpContext; + public IntPtr pvReserved; + public IntPtr pfnDeferredFillIn; + public int scode; + } + + public enum FUNCKIND : int + { + FUNC_VIRTUAL = 0, + FUNC_PUREVIRTUAL = 1, + FUNC_NONVIRTUAL = 2, + FUNC_STATIC = 3, + FUNC_DISPATCH = 4 + } + + [Flags] + public enum INVOKEKIND : int + { + INVOKE_FUNC = 0x1, + INVOKE_PROPERTYGET = 0x2, + INVOKE_PROPERTYPUT = 0x4, + INVOKE_PROPERTYPUTREF = 0x8 + } + + public enum CALLCONV : int + { + CC_CDECL = 1, + CC_MSCPASCAL = 2, + CC_PASCAL = CC_MSCPASCAL, + CC_MACPASCAL = 3, + CC_STDCALL = 4, + CC_RESERVED = 5, + CC_SYSCALL = 6, + CC_MPWCDECL = 7, + CC_MPWPASCAL = 8, + CC_MAX = 9 + } + + [Flags] + public enum FUNCFLAGS : short + { + FUNCFLAG_FRESTRICTED = 0x1, + FUNCFLAG_FSOURCE = 0x2, + FUNCFLAG_FBINDABLE = 0x4, + FUNCFLAG_FREQUESTEDIT = 0x8, + FUNCFLAG_FDISPLAYBIND = 0x10, + FUNCFLAG_FDEFAULTBIND = 0x20, + FUNCFLAG_FHIDDEN = 0x40, + FUNCFLAG_FUSESGETLASTERROR = 0x80, + FUNCFLAG_FDEFAULTCOLLELEM = 0x100, + FUNCFLAG_FUIDEFAULT = 0x200, + FUNCFLAG_FNONBROWSABLE = 0x400, + FUNCFLAG_FREPLACEABLE = 0x800, + FUNCFLAG_FIMMEDIATEBIND = 0x1000 + } + + [Flags] + public enum VARFLAGS : short + { + VARFLAG_FREADONLY = 0x1, + VARFLAG_FSOURCE = 0x2, + VARFLAG_FBINDABLE = 0x4, + VARFLAG_FREQUESTEDIT = 0x8, + VARFLAG_FDISPLAYBIND = 0x10, + VARFLAG_FDEFAULTBIND = 0x20, + VARFLAG_FHIDDEN = 0x40, + VARFLAG_FRESTRICTED = 0x80, + VARFLAG_FDEFAULTCOLLELEM = 0x100, + VARFLAG_FUIDEFAULT = 0x200, + VARFLAG_FNONBROWSABLE = 0x400, + VARFLAG_FREPLACEABLE = 0x800, + VARFLAG_FIMMEDIATEBIND = 0x1000 + } + + [Guid("00020401-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ITypeInfo + { + void GetTypeAttr(out IntPtr ppTypeAttr); + void GetTypeComp(out ITypeComp ppTComp); + void GetFuncDesc(int index, out IntPtr ppFuncDesc); + void GetVarDesc(int index, out IntPtr ppVarDesc); + void GetNames(int memid, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2), Out] string[] rgBstrNames, int cMaxNames, out int pcNames); + void GetRefTypeOfImplType(int index, out int href); + void GetImplTypeFlags(int index, out IMPLTYPEFLAGS pImplTypeFlags); + void GetIDsOfNames([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 1), In] string[] rgszNames, int cNames, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1), Out] int[] pMemId); + void Invoke([MarshalAs(UnmanagedType.IUnknown)] object pvInstance, int memid, short wFlags, ref DISPPARAMS pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, out int puArgErr); + void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); + void GetDllEntry(int memid, INVOKEKIND invKind, IntPtr pBstrDllName, IntPtr pBstrName, IntPtr pwOrdinal); + void GetRefTypeInfo(int hRef, out ITypeInfo ppTI); + void AddressOfMember(int memid, INVOKEKIND invKind, out IntPtr ppv); + void CreateInstance([MarshalAs(UnmanagedType.IUnknown)] object pUnkOuter, [In] ref Guid riid, [MarshalAs(UnmanagedType.IUnknown), Out] out object ppvObj); + void GetMops(int memid, out string pBstrMops); + void GetContainingTypeLib(out ITypeLib ppTLB, out int pIndex); + [PreserveSig] + void ReleaseTypeAttr(IntPtr pTypeAttr); + [PreserveSig] + void ReleaseFuncDesc(IntPtr pFuncDesc); + [PreserveSig] + void ReleaseVarDesc(IntPtr pVarDesc); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeInfo2.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeInfo2.cs new file mode 100644 index 0000000000..bad4f6cbbe --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeInfo2.cs @@ -0,0 +1,51 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + [Guid("00020412-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ITypeInfo2 : ITypeInfo + { + new void GetTypeAttr(out IntPtr ppTypeAttr); + new void GetTypeComp(out ITypeComp ppTComp); + new void GetFuncDesc(int index, out IntPtr ppFuncDesc); + new void GetVarDesc(int index, out IntPtr ppVarDesc); + new void GetNames(int memid, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2), Out] string[] rgBstrNames, int cMaxNames, out int pcNames); + new void GetRefTypeOfImplType(int index, out int href); + new void GetImplTypeFlags(int index, out IMPLTYPEFLAGS pImplTypeFlags); + new void GetIDsOfNames([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 1), In] string[] rgszNames, int cNames, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1), Out] int[] pMemId); + new void Invoke([MarshalAs(UnmanagedType.IUnknown)] object pvInstance, int memid, short wFlags, ref DISPPARAMS pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, out int puArgErr); + new void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); + new void GetDllEntry(int memid, INVOKEKIND invKind, IntPtr pBstrDllName, IntPtr pBstrName, IntPtr pwOrdinal); + new void GetRefTypeInfo(int hRef, out ITypeInfo ppTI); + new void AddressOfMember(int memid, INVOKEKIND invKind, out IntPtr ppv); + new void CreateInstance([MarshalAs(UnmanagedType.IUnknown)] object pUnkOuter, [In] ref Guid riid, [MarshalAs(UnmanagedType.IUnknown), Out] out object ppvObj); + new void GetMops(int memid, out string pBstrMops); + new void GetContainingTypeLib(out ITypeLib ppTLB, out int pIndex); + [PreserveSig] + new void ReleaseTypeAttr(IntPtr pTypeAttr); + [PreserveSig] + new void ReleaseFuncDesc(IntPtr pFuncDesc); + [PreserveSig] + new void ReleaseVarDesc(IntPtr pVarDesc); + void GetTypeKind(out TYPEKIND pTypeKind); + void GetTypeFlags(out int pTypeFlags); + void GetFuncIndexOfMemId(int memid, INVOKEKIND invKind, out int pFuncIndex); + void GetVarIndexOfMemId(int memid, out int pVarIndex); + void GetCustData(ref Guid guid, out object pVarVal); + void GetFuncCustData(int index, ref Guid guid, out object pVarVal); + void GetParamCustData(int indexFunc, int indexParam, ref Guid guid, out object pVarVal); + void GetVarCustData(int index, ref Guid guid, out object pVarVal); + void GetImplTypeCustData(int index, ref Guid guid, out object pVarVal); + [LCIDConversion(1)] + void GetDocumentation2(int memid, out string pbstrHelpString, out int pdwHelpStringContext, out string pbstrHelpStringDll); + void GetAllCustData(IntPtr pCustData); + void GetAllFuncCustData(int index, IntPtr pCustData); + void GetAllParamCustData(int indexFunc, int indexParam, IntPtr pCustData); + void GetAllVarCustData(int index, IntPtr pCustData); + void GetAllImplTypeCustData(int index, IntPtr pCustData); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeLib.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeLib.cs new file mode 100644 index 0000000000..6cab58e117 --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeLib.cs @@ -0,0 +1,54 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + public enum SYSKIND + { + SYS_WIN16 = 0, + SYS_WIN32 = SYS_WIN16 + 1, + SYS_MAC = SYS_WIN32 + 1, + SYS_WIN64 = SYS_MAC + 1 + } + + [Flags] + public enum LIBFLAGS : short + { + LIBFLAG_FRESTRICTED = 0x1, + LIBFLAG_FCONTROL = 0x2, + LIBFLAG_FHIDDEN = 0x4, + LIBFLAG_FHASDISKIMAGE = 0x8 + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct TYPELIBATTR + { + public Guid guid; + public int lcid; + public SYSKIND syskind; + public short wMajorVerNum; + public short wMinorVerNum; + public LIBFLAGS wLibFlags; + } + + [Guid("00020402-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ITypeLib + { + [PreserveSig] + int GetTypeInfoCount(); + void GetTypeInfo(int index, out ITypeInfo ppTI); + void GetTypeInfoType(int index, out TYPEKIND pTKind); + void GetTypeInfoOfGuid(ref Guid guid, out ITypeInfo ppTInfo); + void GetLibAttr(out IntPtr ppTLibAttr); + void GetTypeComp(out ITypeComp ppTComp); + void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); + [return: MarshalAs(UnmanagedType.Bool)] + bool IsName([MarshalAs(UnmanagedType.LPWStr)] string szNameBuf, int lHashVal); + void FindName([MarshalAs(UnmanagedType.LPWStr)] string szNameBuf, int lHashVal, [MarshalAs(UnmanagedType.LPArray), Out] ITypeInfo[] ppTInfo, [MarshalAs(UnmanagedType.LPArray), Out] int[] rgMemId, ref short pcFound); + [PreserveSig] + void ReleaseTLibAttr(IntPtr pTLibAttr); + } +} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeLib2.cs b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeLib2.cs new file mode 100644 index 0000000000..76ff8a9be5 --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeLib2.cs @@ -0,0 +1,31 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices.ComTypes +{ + [Guid("00020411-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ITypeLib2 : ITypeLib + { + [PreserveSig] + new int GetTypeInfoCount(); + new void GetTypeInfo(int index, out ITypeInfo ppTI); + new void GetTypeInfoType(int index, out TYPEKIND pTKind); + new void GetTypeInfoOfGuid(ref Guid guid, out ITypeInfo ppTInfo); + new void GetLibAttr(out IntPtr ppTLibAttr); + new void GetTypeComp(out ITypeComp ppTComp); + new void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); + [return: MarshalAs(UnmanagedType.Bool)] + new bool IsName([MarshalAs(UnmanagedType.LPWStr)] string szNameBuf, int lHashVal); + new void FindName([MarshalAs(UnmanagedType.LPWStr)] string szNameBuf, int lHashVal, [MarshalAs(UnmanagedType.LPArray), Out] ITypeInfo[] ppTInfo, [MarshalAs(UnmanagedType.LPArray), Out] int[] rgMemId, ref short pcFound); + [PreserveSig] + new void ReleaseTLibAttr(IntPtr pTLibAttr); + void GetCustData(ref Guid guid, out object pVarVal); + [LCIDConversionAttribute(1)] + void GetDocumentation2(int index, out string pbstrHelpString, out int pdwHelpStringContext, out string pbstrHelpStringDll); + void GetLibStatistics(IntPtr pcUniqueNames, out int pcchUniqueNames); + void GetAllCustData(IntPtr pCustData); + } +} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IBindCtx.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IBindCtx.cs deleted file mode 100644 index a535b94f88..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IBindCtx.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - [StructLayout(LayoutKind.Sequential)] - public struct BIND_OPTS - { - public int cbStruct; - public int grfFlags; - public int grfMode; - public int dwTickCountDeadline; - } - - [Guid("0000000e-0000-0000-C000-000000000046")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface IBindCtx - { - void RegisterObjectBound([MarshalAs(UnmanagedType.Interface)] object punk); - void RevokeObjectBound([MarshalAs(UnmanagedType.Interface)] object punk); - void ReleaseBoundObjects(); - void SetBindOptions([In()] ref BIND_OPTS pbindopts); - void GetBindOptions(ref BIND_OPTS pbindopts); - void GetRunningObjectTable(out IRunningObjectTable pprot); - void RegisterObjectParam([MarshalAs(UnmanagedType.LPWStr)] string pszKey, [MarshalAs(UnmanagedType.Interface)] object punk); - void GetObjectParam([MarshalAs(UnmanagedType.LPWStr)] string pszKey, [MarshalAs(UnmanagedType.Interface)] out object ppunk); - void EnumObjectParam(out IEnumString ppenum); - [PreserveSig] - int RevokeObjectParam([MarshalAs(UnmanagedType.LPWStr)] string pszKey); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IConnectionPoint.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IConnectionPoint.cs deleted file mode 100644 index fcca685ad8..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IConnectionPoint.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - [Guid("B196B286-BAB4-101A-B69C-00AA00341D07")] - [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface IConnectionPoint - { - void GetConnectionInterface(out Guid pIID); - void GetConnectionPointContainer(out IConnectionPointContainer ppCPC); - void Advise([MarshalAs(UnmanagedType.Interface)] object pUnkSink, out int pdwCookie); - void Unadvise(int dwCookie); - void EnumConnections(out IEnumConnections ppEnum); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IConnectionPointContainer.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IConnectionPointContainer.cs deleted file mode 100644 index 84c590d436..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IConnectionPointContainer.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - [Guid("B196B284-BAB4-101A-B69C-00AA00341D07")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface IConnectionPointContainer - { - void EnumConnectionPoints(out IEnumConnectionPoints ppEnum); - void FindConnectionPoint([In] ref Guid riid, out IConnectionPoint ppCP); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumConnectionPoints.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumConnectionPoints.cs deleted file mode 100644 index 99df6ac60e..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumConnectionPoints.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - [Guid("B196B285-BAB4-101A-B69C-00AA00341D07")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface IEnumConnectionPoints - { - [PreserveSig] - int Next(int celt, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out] IConnectionPoint[] rgelt, IntPtr pceltFetched); - [PreserveSig] - int Skip(int celt); - void Reset(); - void Clone(out IEnumConnectionPoints ppenum); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumConnections.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumConnections.cs deleted file mode 100644 index 951685beff..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumConnections.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct CONNECTDATA - { - [MarshalAs(UnmanagedType.Interface)] - public object pUnk; - public int dwCookie; - } - - [Guid("B196B287-BAB4-101A-B69C-00AA00341D07")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface IEnumConnections - { - [PreserveSig] - int Next(int celt, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out] CONNECTDATA[] rgelt, IntPtr pceltFetched); - [PreserveSig] - int Skip(int celt); - void Reset(); - void Clone(out IEnumConnections ppenum); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumMoniker.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumMoniker.cs deleted file mode 100644 index 9a63ba0a11..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumMoniker.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - [Guid("00000102-0000-0000-C000-000000000046")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface IEnumMoniker - { - [PreserveSig] - int Next(int celt, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out] IMoniker[] rgelt, IntPtr pceltFetched); - [PreserveSig] - int Skip(int celt); - void Reset(); - void Clone(out IEnumMoniker ppenum); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumString.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumString.cs deleted file mode 100644 index 57fc59121f..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumString.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - [Guid("00000101-0000-0000-C000-000000000046")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface IEnumString - { - [PreserveSig] - int Next(int celt, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 0), Out] string[] rgelt, IntPtr pceltFetched); - [PreserveSig] - int Skip(int celt); - void Reset(); - void Clone(out IEnumString ppenum); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumVARIANT.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumVARIANT.cs deleted file mode 100644 index 8440c060bb..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumVARIANT.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - [Guid("00020404-0000-0000-C000-000000000046")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface IEnumVARIANT - { - [PreserveSig] - int Next(int celt, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out] object[] rgVar, IntPtr pceltFetched); - - [PreserveSig] - int Skip(int celt); - - [PreserveSig] - int Reset(); - - IEnumVARIANT Clone(); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumerable.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumerable.cs deleted file mode 100644 index e541960cae..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IEnumerable.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information - -using System; -namespace System.Runtime.InteropServices.ComTypes -{ - /*========================================================================== - ** Interface: IEnumerable - ** Purpose: - ** This interface is redefined here since the original IEnumerable interface - ** has all its methods marked as ecall's since it is a managed standard - ** interface. This interface is used from within the runtime to make a call - ** on the COM server directly when it implements the IEnumerable interface. - ==========================================================================*/ - [Guid("496B0ABE-CDEE-11d3-88E8-00902754C43A")] - internal interface IEnumerable - { - [DispId(-4)] - System.Collections.IEnumerator GetEnumerator(); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IMoniker.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IMoniker.cs deleted file mode 100644 index 7a2dd57d16..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IMoniker.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - [StructLayout(LayoutKind.Sequential)] - public struct FILETIME - { - public int dwLowDateTime; - public int dwHighDateTime; - } - - [Guid("0000000f-0000-0000-C000-000000000046")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface IMoniker - { - // IPersist portion - void GetClassID(out Guid pClassID); - - // IPersistStream portion - [PreserveSig] - int IsDirty(); - void Load(IStream pStm); - void Save(IStream pStm, [MarshalAs(UnmanagedType.Bool)] bool fClearDirty); - void GetSizeMax(out long pcbSize); - - // IMoniker portion - void BindToObject(IBindCtx pbc, IMoniker pmkToLeft, [In()] ref Guid riidResult, [MarshalAs(UnmanagedType.Interface)] out object ppvResult); - void BindToStorage(IBindCtx pbc, IMoniker pmkToLeft, [In()] ref Guid riid, [MarshalAs(UnmanagedType.Interface)] out object ppvObj); - void Reduce(IBindCtx pbc, int dwReduceHowFar, ref IMoniker ppmkToLeft, out IMoniker ppmkReduced); - void ComposeWith(IMoniker pmkRight, [MarshalAs(UnmanagedType.Bool)] bool fOnlyIfNotGeneric, out IMoniker ppmkComposite); - void Enum([MarshalAs(UnmanagedType.Bool)] bool fForward, out IEnumMoniker ppenumMoniker); - [PreserveSig] - int IsEqual(IMoniker pmkOtherMoniker); - void Hash(out int pdwHash); - [PreserveSig] - int IsRunning(IBindCtx pbc, IMoniker pmkToLeft, IMoniker pmkNewlyRunning); - void GetTimeOfLastChange(IBindCtx pbc, IMoniker pmkToLeft, out FILETIME pFileTime); - void Inverse(out IMoniker ppmk); - void CommonPrefixWith(IMoniker pmkOther, out IMoniker ppmkPrefix); - void RelativePathTo(IMoniker pmkOther, out IMoniker ppmkRelPath); - void GetDisplayName(IBindCtx pbc, IMoniker pmkToLeft, [MarshalAs(UnmanagedType.LPWStr)] out string ppszDisplayName); - void ParseDisplayName(IBindCtx pbc, IMoniker pmkToLeft, [MarshalAs(UnmanagedType.LPWStr)] string pszDisplayName, out int pchEaten, out IMoniker ppmkOut); - [PreserveSig] - int IsSystemMoniker(out int pdwMksys); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IPersistFile.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IPersistFile.cs deleted file mode 100644 index cb24d985dc..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IPersistFile.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - [Guid("0000010b-0000-0000-C000-000000000046")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface IPersistFile - { - // IPersist portion - void GetClassID(out Guid pClassID); - - // IPersistFile portion - [PreserveSig] - int IsDirty(); - void Load([MarshalAs(UnmanagedType.LPWStr)] string pszFileName, int dwMode); - void Save([MarshalAs(UnmanagedType.LPWStr)] string pszFileName, [MarshalAs(UnmanagedType.Bool)] bool fRemember); - void SaveCompleted([MarshalAs(UnmanagedType.LPWStr)] string pszFileName); - void GetCurFile([MarshalAs(UnmanagedType.LPWStr)] out string ppszFileName); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IRunningObjectTable.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IRunningObjectTable.cs deleted file mode 100644 index 1884fcc99b..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IRunningObjectTable.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - [Guid("00000010-0000-0000-C000-000000000046")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface IRunningObjectTable - { - int Register(int grfFlags, [MarshalAs(UnmanagedType.Interface)] object punkObject, IMoniker pmkObjectName); - void Revoke(int dwRegister); - [PreserveSig] - int IsRunning(IMoniker pmkObjectName); - [PreserveSig] - int GetObject(IMoniker pmkObjectName, [MarshalAs(UnmanagedType.Interface)] out object ppunkObject); - void NoteChangeTime(int dwRegister, ref FILETIME pfiletime); - [PreserveSig] - int GetTimeOfLastChange(IMoniker pmkObjectName, out FILETIME pfiletime); - void EnumRunning(out IEnumMoniker ppenumMoniker); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IStream.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IStream.cs deleted file mode 100644 index 09b284041e..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/IStream.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct STATSTG - { - public string pwcsName; - public int type; - public long cbSize; - public FILETIME mtime; - public FILETIME ctime; - public FILETIME atime; - public int grfMode; - public int grfLocksSupported; - public Guid clsid; - public int grfStateBits; - public int reserved; - } - - [Guid("0000000c-0000-0000-C000-000000000046")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface IStream - { - // ISequentialStream portion - void Read([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1), Out] byte[] pv, int cb, IntPtr pcbRead); - void Write([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] byte[] pv, int cb, IntPtr pcbWritten); - - // IStream portion - void Seek(long dlibMove, int dwOrigin, IntPtr plibNewPosition); - void SetSize(long libNewSize); - void CopyTo(IStream pstm, long cb, IntPtr pcbRead, IntPtr pcbWritten); - void Commit(int grfCommitFlags); - void Revert(); - void LockRegion(long libOffset, long cb, int dwLockType); - void UnlockRegion(long libOffset, long cb, int dwLockType); - void Stat(out STATSTG pstatstg, int grfStatFlag); - void Clone(out IStream ppstm); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeComp.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeComp.cs deleted file mode 100644 index 7e63793615..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeComp.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - public enum DESCKIND - { - DESCKIND_NONE = 0, - DESCKIND_FUNCDESC = DESCKIND_NONE + 1, - DESCKIND_VARDESC = DESCKIND_FUNCDESC + 1, - DESCKIND_TYPECOMP = DESCKIND_VARDESC + 1, - DESCKIND_IMPLICITAPPOBJ = DESCKIND_TYPECOMP + 1, - DESCKIND_MAX = DESCKIND_IMPLICITAPPOBJ + 1 - } - - [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode)] - public struct BINDPTR - { - [FieldOffset(0)] - public IntPtr lpfuncdesc; - [FieldOffset(0)] - public IntPtr lpvardesc; - [FieldOffset(0)] - public IntPtr lptcomp; - } - - [Guid("00020403-0000-0000-C000-000000000046")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ITypeComp - { - void Bind([MarshalAs(UnmanagedType.LPWStr)] string szName, int lHashVal, short wFlags, out ITypeInfo ppTInfo, out DESCKIND pDescKind, out BINDPTR pBindPtr); - void BindType([MarshalAs(UnmanagedType.LPWStr)] string szName, int lHashVal, out ITypeInfo ppTInfo, out ITypeComp ppTComp); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs deleted file mode 100644 index 61776e446d..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs +++ /dev/null @@ -1,303 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - public enum TYPEKIND - { - TKIND_ENUM = 0, - TKIND_RECORD = TKIND_ENUM + 1, - TKIND_MODULE = TKIND_RECORD + 1, - TKIND_INTERFACE = TKIND_MODULE + 1, - TKIND_DISPATCH = TKIND_INTERFACE + 1, - TKIND_COCLASS = TKIND_DISPATCH + 1, - TKIND_ALIAS = TKIND_COCLASS + 1, - TKIND_UNION = TKIND_ALIAS + 1, - TKIND_MAX = TKIND_UNION + 1 - } - - [Flags] - public enum TYPEFLAGS : short - { - TYPEFLAG_FAPPOBJECT = 0x1, - TYPEFLAG_FCANCREATE = 0x2, - TYPEFLAG_FLICENSED = 0x4, - TYPEFLAG_FPREDECLID = 0x8, - TYPEFLAG_FHIDDEN = 0x10, - TYPEFLAG_FCONTROL = 0x20, - TYPEFLAG_FDUAL = 0x40, - TYPEFLAG_FNONEXTENSIBLE = 0x80, - TYPEFLAG_FOLEAUTOMATION = 0x100, - TYPEFLAG_FRESTRICTED = 0x200, - TYPEFLAG_FAGGREGATABLE = 0x400, - TYPEFLAG_FREPLACEABLE = 0x800, - TYPEFLAG_FDISPATCHABLE = 0x1000, - TYPEFLAG_FREVERSEBIND = 0x2000, - TYPEFLAG_FPROXY = 0x4000 - } - - [Flags] - public enum IMPLTYPEFLAGS - { - IMPLTYPEFLAG_FDEFAULT = 0x1, - IMPLTYPEFLAG_FSOURCE = 0x2, - IMPLTYPEFLAG_FRESTRICTED = 0x4, - IMPLTYPEFLAG_FDEFAULTVTABLE = 0x8, - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct TYPEATTR - { - // Constant used with the memid fields. - public const int MEMBER_ID_NIL = unchecked((int)0xFFFFFFFF); - - // Actual fields of the TypeAttr struct. - public Guid guid; - public int lcid; - public int dwReserved; - public int memidConstructor; - public int memidDestructor; - public IntPtr lpstrSchema; - public int cbSizeInstance; - public TYPEKIND typekind; - public short cFuncs; - public short cVars; - public short cImplTypes; - public short cbSizeVft; - public short cbAlignment; - public TYPEFLAGS wTypeFlags; - public short wMajorVerNum; - public short wMinorVerNum; - public TYPEDESC tdescAlias; - public IDLDESC idldescType; - } - - [StructLayout(LayoutKind.Sequential)] - public struct FUNCDESC - { - public int memid; //MEMBERID memid; - public IntPtr lprgscode; // /* [size_is(cScodes)] */ SCODE RPC_FAR *lprgscode; - public IntPtr lprgelemdescParam; // /* [size_is(cParams)] */ ELEMDESC __RPC_FAR *lprgelemdescParam; - public FUNCKIND funckind; //FUNCKIND funckind; - public INVOKEKIND invkind; //INVOKEKIND invkind; - public CALLCONV callconv; //CALLCONV callconv; - public short cParams; //short cParams; - public short cParamsOpt; //short cParamsOpt; - public short oVft; //short oVft; - public short cScodes; //short cScodes; - public ELEMDESC elemdescFunc; //ELEMDESC elemdescFunc; - public short wFuncFlags; //WORD wFuncFlags; - } - - [Flags] - public enum IDLFLAG : short - { - IDLFLAG_NONE = PARAMFLAG.PARAMFLAG_NONE, - IDLFLAG_FIN = PARAMFLAG.PARAMFLAG_FIN, - IDLFLAG_FOUT = PARAMFLAG.PARAMFLAG_FOUT, - IDLFLAG_FLCID = PARAMFLAG.PARAMFLAG_FLCID, - IDLFLAG_FRETVAL = PARAMFLAG.PARAMFLAG_FRETVAL - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct IDLDESC - { - public IntPtr dwReserved; - public IDLFLAG wIDLFlags; - } - - [Flags] - public enum PARAMFLAG : short - { - PARAMFLAG_NONE = 0, - PARAMFLAG_FIN = 0x1, - PARAMFLAG_FOUT = 0x2, - PARAMFLAG_FLCID = 0x4, - PARAMFLAG_FRETVAL = 0x8, - PARAMFLAG_FOPT = 0x10, - PARAMFLAG_FHASDEFAULT = 0x20, - PARAMFLAG_FHASCUSTDATA = 0x40 - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct PARAMDESC - { - public IntPtr lpVarValue; - public PARAMFLAG wParamFlags; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct TYPEDESC - { - public IntPtr lpValue; - public short vt; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct ELEMDESC - { - public TYPEDESC tdesc; - - [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode)] - public struct DESCUNION - { - [FieldOffset(0)] - public IDLDESC idldesc; - [FieldOffset(0)] - public PARAMDESC paramdesc; - }; - public DESCUNION desc; - } - - public enum VARKIND : int - { - VAR_PERINSTANCE = 0x0, - VAR_STATIC = 0x1, - VAR_CONST = 0x2, - VAR_DISPATCH = 0x3 - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - - public struct VARDESC - { - public int memid; - public string lpstrSchema; - - [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode)] - public struct DESCUNION - { - [FieldOffset(0)] - public int oInst; - [FieldOffset(0)] - public IntPtr lpvarValue; - }; - - public DESCUNION desc; - - public ELEMDESC elemdescVar; - public short wVarFlags; - public VARKIND varkind; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct DISPPARAMS - { - public IntPtr rgvarg; - public IntPtr rgdispidNamedArgs; - public int cArgs; - public int cNamedArgs; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct EXCEPINFO - { - public short wCode; - public short wReserved; - [MarshalAs(UnmanagedType.BStr)] public string bstrSource; - [MarshalAs(UnmanagedType.BStr)] public string bstrDescription; - [MarshalAs(UnmanagedType.BStr)] public string bstrHelpFile; - public int dwHelpContext; - public IntPtr pvReserved; - public IntPtr pfnDeferredFillIn; - public int scode; - } - - public enum FUNCKIND : int - { - FUNC_VIRTUAL = 0, - FUNC_PUREVIRTUAL = 1, - FUNC_NONVIRTUAL = 2, - FUNC_STATIC = 3, - FUNC_DISPATCH = 4 - } - - [Flags] - public enum INVOKEKIND : int - { - INVOKE_FUNC = 0x1, - INVOKE_PROPERTYGET = 0x2, - INVOKE_PROPERTYPUT = 0x4, - INVOKE_PROPERTYPUTREF = 0x8 - } - - public enum CALLCONV : int - { - CC_CDECL = 1, - CC_MSCPASCAL = 2, - CC_PASCAL = CC_MSCPASCAL, - CC_MACPASCAL = 3, - CC_STDCALL = 4, - CC_RESERVED = 5, - CC_SYSCALL = 6, - CC_MPWCDECL = 7, - CC_MPWPASCAL = 8, - CC_MAX = 9 - } - - [Flags] - public enum FUNCFLAGS : short - { - FUNCFLAG_FRESTRICTED = 0x1, - FUNCFLAG_FSOURCE = 0x2, - FUNCFLAG_FBINDABLE = 0x4, - FUNCFLAG_FREQUESTEDIT = 0x8, - FUNCFLAG_FDISPLAYBIND = 0x10, - FUNCFLAG_FDEFAULTBIND = 0x20, - FUNCFLAG_FHIDDEN = 0x40, - FUNCFLAG_FUSESGETLASTERROR = 0x80, - FUNCFLAG_FDEFAULTCOLLELEM = 0x100, - FUNCFLAG_FUIDEFAULT = 0x200, - FUNCFLAG_FNONBROWSABLE = 0x400, - FUNCFLAG_FREPLACEABLE = 0x800, - FUNCFLAG_FIMMEDIATEBIND = 0x1000 - } - - [Flags] - public enum VARFLAGS : short - { - VARFLAG_FREADONLY = 0x1, - VARFLAG_FSOURCE = 0x2, - VARFLAG_FBINDABLE = 0x4, - VARFLAG_FREQUESTEDIT = 0x8, - VARFLAG_FDISPLAYBIND = 0x10, - VARFLAG_FDEFAULTBIND = 0x20, - VARFLAG_FHIDDEN = 0x40, - VARFLAG_FRESTRICTED = 0x80, - VARFLAG_FDEFAULTCOLLELEM = 0x100, - VARFLAG_FUIDEFAULT = 0x200, - VARFLAG_FNONBROWSABLE = 0x400, - VARFLAG_FREPLACEABLE = 0x800, - VARFLAG_FIMMEDIATEBIND = 0x1000 - } - - [Guid("00020401-0000-0000-C000-000000000046")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ITypeInfo - { - void GetTypeAttr(out IntPtr ppTypeAttr); - void GetTypeComp(out ITypeComp ppTComp); - void GetFuncDesc(int index, out IntPtr ppFuncDesc); - void GetVarDesc(int index, out IntPtr ppVarDesc); - void GetNames(int memid, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2), Out] string[] rgBstrNames, int cMaxNames, out int pcNames); - void GetRefTypeOfImplType(int index, out int href); - void GetImplTypeFlags(int index, out IMPLTYPEFLAGS pImplTypeFlags); - void GetIDsOfNames([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 1), In] string[] rgszNames, int cNames, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1), Out] int[] pMemId); - void Invoke([MarshalAs(UnmanagedType.IUnknown)] object pvInstance, int memid, short wFlags, ref DISPPARAMS pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, out int puArgErr); - void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); - void GetDllEntry(int memid, INVOKEKIND invKind, IntPtr pBstrDllName, IntPtr pBstrName, IntPtr pwOrdinal); - void GetRefTypeInfo(int hRef, out ITypeInfo ppTI); - void AddressOfMember(int memid, INVOKEKIND invKind, out IntPtr ppv); - void CreateInstance([MarshalAs(UnmanagedType.IUnknown)] object pUnkOuter, [In] ref Guid riid, [MarshalAs(UnmanagedType.IUnknown), Out] out object ppvObj); - void GetMops(int memid, out string pBstrMops); - void GetContainingTypeLib(out ITypeLib ppTLB, out int pIndex); - [PreserveSig] - void ReleaseTypeAttr(IntPtr pTypeAttr); - [PreserveSig] - void ReleaseFuncDesc(IntPtr pFuncDesc); - [PreserveSig] - void ReleaseVarDesc(IntPtr pVarDesc); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeInfo2.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeInfo2.cs deleted file mode 100644 index bad4f6cbbe..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeInfo2.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - [Guid("00020412-0000-0000-C000-000000000046")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ITypeInfo2 : ITypeInfo - { - new void GetTypeAttr(out IntPtr ppTypeAttr); - new void GetTypeComp(out ITypeComp ppTComp); - new void GetFuncDesc(int index, out IntPtr ppFuncDesc); - new void GetVarDesc(int index, out IntPtr ppVarDesc); - new void GetNames(int memid, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2), Out] string[] rgBstrNames, int cMaxNames, out int pcNames); - new void GetRefTypeOfImplType(int index, out int href); - new void GetImplTypeFlags(int index, out IMPLTYPEFLAGS pImplTypeFlags); - new void GetIDsOfNames([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 1), In] string[] rgszNames, int cNames, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1), Out] int[] pMemId); - new void Invoke([MarshalAs(UnmanagedType.IUnknown)] object pvInstance, int memid, short wFlags, ref DISPPARAMS pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, out int puArgErr); - new void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); - new void GetDllEntry(int memid, INVOKEKIND invKind, IntPtr pBstrDllName, IntPtr pBstrName, IntPtr pwOrdinal); - new void GetRefTypeInfo(int hRef, out ITypeInfo ppTI); - new void AddressOfMember(int memid, INVOKEKIND invKind, out IntPtr ppv); - new void CreateInstance([MarshalAs(UnmanagedType.IUnknown)] object pUnkOuter, [In] ref Guid riid, [MarshalAs(UnmanagedType.IUnknown), Out] out object ppvObj); - new void GetMops(int memid, out string pBstrMops); - new void GetContainingTypeLib(out ITypeLib ppTLB, out int pIndex); - [PreserveSig] - new void ReleaseTypeAttr(IntPtr pTypeAttr); - [PreserveSig] - new void ReleaseFuncDesc(IntPtr pFuncDesc); - [PreserveSig] - new void ReleaseVarDesc(IntPtr pVarDesc); - void GetTypeKind(out TYPEKIND pTypeKind); - void GetTypeFlags(out int pTypeFlags); - void GetFuncIndexOfMemId(int memid, INVOKEKIND invKind, out int pFuncIndex); - void GetVarIndexOfMemId(int memid, out int pVarIndex); - void GetCustData(ref Guid guid, out object pVarVal); - void GetFuncCustData(int index, ref Guid guid, out object pVarVal); - void GetParamCustData(int indexFunc, int indexParam, ref Guid guid, out object pVarVal); - void GetVarCustData(int index, ref Guid guid, out object pVarVal); - void GetImplTypeCustData(int index, ref Guid guid, out object pVarVal); - [LCIDConversion(1)] - void GetDocumentation2(int memid, out string pbstrHelpString, out int pdwHelpStringContext, out string pbstrHelpStringDll); - void GetAllCustData(IntPtr pCustData); - void GetAllFuncCustData(int index, IntPtr pCustData); - void GetAllParamCustData(int indexFunc, int indexParam, IntPtr pCustData); - void GetAllVarCustData(int index, IntPtr pCustData); - void GetAllImplTypeCustData(int index, IntPtr pCustData); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeLib.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeLib.cs deleted file mode 100644 index 6cab58e117..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeLib.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - public enum SYSKIND - { - SYS_WIN16 = 0, - SYS_WIN32 = SYS_WIN16 + 1, - SYS_MAC = SYS_WIN32 + 1, - SYS_WIN64 = SYS_MAC + 1 - } - - [Flags] - public enum LIBFLAGS : short - { - LIBFLAG_FRESTRICTED = 0x1, - LIBFLAG_FCONTROL = 0x2, - LIBFLAG_FHIDDEN = 0x4, - LIBFLAG_FHASDISKIMAGE = 0x8 - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct TYPELIBATTR - { - public Guid guid; - public int lcid; - public SYSKIND syskind; - public short wMajorVerNum; - public short wMinorVerNum; - public LIBFLAGS wLibFlags; - } - - [Guid("00020402-0000-0000-C000-000000000046")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ITypeLib - { - [PreserveSig] - int GetTypeInfoCount(); - void GetTypeInfo(int index, out ITypeInfo ppTI); - void GetTypeInfoType(int index, out TYPEKIND pTKind); - void GetTypeInfoOfGuid(ref Guid guid, out ITypeInfo ppTInfo); - void GetLibAttr(out IntPtr ppTLibAttr); - void GetTypeComp(out ITypeComp ppTComp); - void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); - [return: MarshalAs(UnmanagedType.Bool)] - bool IsName([MarshalAs(UnmanagedType.LPWStr)] string szNameBuf, int lHashVal); - void FindName([MarshalAs(UnmanagedType.LPWStr)] string szNameBuf, int lHashVal, [MarshalAs(UnmanagedType.LPArray), Out] ITypeInfo[] ppTInfo, [MarshalAs(UnmanagedType.LPArray), Out] int[] rgMemId, ref short pcFound); - [PreserveSig] - void ReleaseTLibAttr(IntPtr pTLibAttr); - } -} diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeLib2.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeLib2.cs deleted file mode 100644 index 76ff8a9be5..0000000000 --- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComTypes/ITypeLib2.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.InteropServices.ComTypes -{ - [Guid("00020411-0000-0000-C000-000000000046")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ITypeLib2 : ITypeLib - { - [PreserveSig] - new int GetTypeInfoCount(); - new void GetTypeInfo(int index, out ITypeInfo ppTI); - new void GetTypeInfoType(int index, out TYPEKIND pTKind); - new void GetTypeInfoOfGuid(ref Guid guid, out ITypeInfo ppTInfo); - new void GetLibAttr(out IntPtr ppTLibAttr); - new void GetTypeComp(out ITypeComp ppTComp); - new void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); - [return: MarshalAs(UnmanagedType.Bool)] - new bool IsName([MarshalAs(UnmanagedType.LPWStr)] string szNameBuf, int lHashVal); - new void FindName([MarshalAs(UnmanagedType.LPWStr)] string szNameBuf, int lHashVal, [MarshalAs(UnmanagedType.LPArray), Out] ITypeInfo[] ppTInfo, [MarshalAs(UnmanagedType.LPArray), Out] int[] rgMemId, ref short pcFound); - [PreserveSig] - new void ReleaseTLibAttr(IntPtr pTLibAttr); - void GetCustData(ref Guid guid, out object pVarVal); - [LCIDConversionAttribute(1)] - void GetDocumentation2(int index, out string pbstrHelpString, out int pdwHelpStringContext, out string pbstrHelpStringDll); - void GetLibStatistics(IntPtr pcUniqueNames, out int pcchUniqueNames); - void GetAllCustData(IntPtr pCustData); - } -} -- cgit v1.2.3