1 // ==++== 2 // 3 // Copyright (c) Microsoft Corporation. All rights reserved. 4 // 5 // ==--== 6 /*============================================================================= 7 ** 8 ** Class: UCOMITypeInfo 9 ** 10 ** 11 ** Purpose: UCOMITypeInfo interface definition. 12 ** 13 ** 14 =============================================================================*/ 15 16 namespace System.Runtime.InteropServices 17 { 18 using System; 19 20 [Obsolete("Use System.Runtime.InteropServices.ComTypes.TYPEKIND instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 21 [Serializable] 22 public enum TYPEKIND 23 { 24 TKIND_ENUM = 0, 25 TKIND_RECORD = TKIND_ENUM + 1, 26 TKIND_MODULE = TKIND_RECORD + 1, 27 TKIND_INTERFACE = TKIND_MODULE + 1, 28 TKIND_DISPATCH = TKIND_INTERFACE + 1, 29 TKIND_COCLASS = TKIND_DISPATCH + 1, 30 TKIND_ALIAS = TKIND_COCLASS + 1, 31 TKIND_UNION = TKIND_ALIAS + 1, 32 TKIND_MAX = TKIND_UNION + 1 33 } 34 35 [Obsolete("Use System.Runtime.InteropServices.ComTypes.TYPEFLAGS instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 36 [Serializable] 37 [Flags()] 38 public enum TYPEFLAGS : short 39 { 40 TYPEFLAG_FAPPOBJECT = 0x1, 41 TYPEFLAG_FCANCREATE = 0x2, 42 TYPEFLAG_FLICENSED = 0x4, 43 TYPEFLAG_FPREDECLID = 0x8, 44 TYPEFLAG_FHIDDEN = 0x10, 45 TYPEFLAG_FCONTROL = 0x20, 46 TYPEFLAG_FDUAL = 0x40, 47 TYPEFLAG_FNONEXTENSIBLE = 0x80, 48 TYPEFLAG_FOLEAUTOMATION = 0x100, 49 TYPEFLAG_FRESTRICTED = 0x200, 50 TYPEFLAG_FAGGREGATABLE = 0x400, 51 TYPEFLAG_FREPLACEABLE = 0x800, 52 TYPEFLAG_FDISPATCHABLE = 0x1000, 53 TYPEFLAG_FREVERSEBIND = 0x2000, 54 TYPEFLAG_FPROXY = 0x4000 55 } 56 57 [Obsolete("Use System.Runtime.InteropServices.ComTypes.IMPLTYPEFLAGS instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 58 [Serializable] 59 [Flags()] 60 public enum IMPLTYPEFLAGS 61 { 62 IMPLTYPEFLAG_FDEFAULT = 0x1, 63 IMPLTYPEFLAG_FSOURCE = 0x2, 64 IMPLTYPEFLAG_FRESTRICTED = 0x4, 65 IMPLTYPEFLAG_FDEFAULTVTABLE = 0x8, 66 } 67 68 [Obsolete("Use System.Runtime.InteropServices.ComTypes.TYPEATTR instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 69 [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)] 70 public struct TYPEATTR 71 { 72 // Constant used with the memid fields. 73 public const int MEMBER_ID_NIL = unchecked((int)0xFFFFFFFF); 74 75 // Actual fields of the TypeAttr struct. 76 public Guid guid; 77 public Int32 lcid; 78 public Int32 dwReserved; 79 public Int32 memidConstructor; 80 public Int32 memidDestructor; 81 public IntPtr lpstrSchema; 82 public Int32 cbSizeInstance; 83 public TYPEKIND typekind; 84 public Int16 cFuncs; 85 public Int16 cVars; 86 public Int16 cImplTypes; 87 public Int16 cbSizeVft; 88 public Int16 cbAlignment; 89 public TYPEFLAGS wTypeFlags; 90 public Int16 wMajorVerNum; 91 public Int16 wMinorVerNum; 92 public TYPEDESC tdescAlias; 93 public IDLDESC idldescType; 94 } 95 96 [Obsolete("Use System.Runtime.InteropServices.ComTypes.FUNCDESC instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 97 [StructLayout(LayoutKind.Sequential)] 98 public struct FUNCDESC 99 { 100 public int memid; //MEMBERID memid; 101 public IntPtr lprgscode; // /* [size_is(cScodes)] */ SCODE RPC_FAR *lprgscode; 102 public IntPtr lprgelemdescParam; // /* [size_is(cParams)] */ ELEMDESC __RPC_FAR *lprgelemdescParam; 103 public FUNCKIND funckind; //FUNCKIND funckind; 104 public INVOKEKIND invkind; //INVOKEKIND invkind; 105 public CALLCONV callconv; //CALLCONV callconv; 106 public Int16 cParams; //short cParams; 107 public Int16 cParamsOpt; //short cParamsOpt; 108 public Int16 oVft; //short oVft; 109 public Int16 cScodes; //short cScodes; 110 public ELEMDESC elemdescFunc; //ELEMDESC elemdescFunc; 111 public Int16 wFuncFlags; //WORD wFuncFlags; 112 } 113 114 [Obsolete("Use System.Runtime.InteropServices.ComTypes.IDLFLAG instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 115 [Serializable] 116 [Flags()] 117 public enum IDLFLAG : short 118 { 119 IDLFLAG_NONE = PARAMFLAG.PARAMFLAG_NONE, 120 IDLFLAG_FIN = PARAMFLAG.PARAMFLAG_FIN, 121 IDLFLAG_FOUT = PARAMFLAG.PARAMFLAG_FOUT, 122 IDLFLAG_FLCID = PARAMFLAG.PARAMFLAG_FLCID, 123 IDLFLAG_FRETVAL = PARAMFLAG.PARAMFLAG_FRETVAL 124 } 125 126 [Obsolete("Use System.Runtime.InteropServices.ComTypes.IDLDESC instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 127 [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)] 128 public struct IDLDESC 129 { 130 public int dwReserved; 131 public IDLFLAG wIDLFlags; 132 } 133 134 [Obsolete("Use System.Runtime.InteropServices.ComTypes.PARAMFLAG instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 135 [Serializable] 136 [Flags()] 137 public enum PARAMFLAG :short 138 { 139 PARAMFLAG_NONE = 0, 140 PARAMFLAG_FIN = 0x1, 141 PARAMFLAG_FOUT = 0x2, 142 PARAMFLAG_FLCID = 0x4, 143 PARAMFLAG_FRETVAL = 0x8, 144 PARAMFLAG_FOPT = 0x10, 145 PARAMFLAG_FHASDEFAULT = 0x20, 146 PARAMFLAG_FHASCUSTDATA = 0x40 147 } 148 149 [Obsolete("Use System.Runtime.InteropServices.ComTypes.PARAMDESC instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 150 [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)] 151 public struct PARAMDESC 152 { 153 public IntPtr lpVarValue; 154 public PARAMFLAG wParamFlags; 155 } 156 157 [Obsolete("Use System.Runtime.InteropServices.ComTypes.TYPEDESC instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 158 [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)] 159 public struct TYPEDESC 160 { 161 public IntPtr lpValue; 162 public Int16 vt; 163 } 164 165 [Obsolete("Use System.Runtime.InteropServices.ComTypes.ELEMDESC instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 166 [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)] 167 public struct ELEMDESC 168 { 169 public TYPEDESC tdesc; 170 171 [System.Runtime.InteropServices.StructLayout(LayoutKind.Explicit, CharSet=CharSet.Unicode)] 172 [ComVisible(false)] 173 public struct DESCUNION 174 { 175 [FieldOffset(0)] 176 public IDLDESC idldesc; 177 [FieldOffset(0)] 178 public PARAMDESC paramdesc; 179 }; 180 public DESCUNION desc; 181 } 182 183 [Obsolete("Use System.Runtime.InteropServices.ComTypes.VARDESC instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 184 [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)] 185 public struct VARDESC 186 { 187 public int memid; 188 public String lpstrSchema; 189 190 [System.Runtime.InteropServices.StructLayout(LayoutKind.Explicit, CharSet=CharSet.Unicode)] 191 [ComVisible(false)] 192 public struct DESCUNION 193 { 194 [FieldOffset(0)] 195 public int oInst; 196 [FieldOffset(0)] 197 public IntPtr lpvarValue; 198 }; 199 200 public ELEMDESC elemdescVar; 201 public short wVarFlags; 202 public VarEnum varkind; 203 } 204 205 [Obsolete("Use System.Runtime.InteropServices.ComTypes.DISPPARAMS instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 206 [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)] 207 public struct DISPPARAMS 208 { 209 public IntPtr rgvarg; 210 public IntPtr rgdispidNamedArgs; 211 public int cArgs; 212 public int cNamedArgs; 213 } 214 215 [Obsolete("Use System.Runtime.InteropServices.ComTypes.EXCEPINFO instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 216 [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)] 217 public struct EXCEPINFO 218 { 219 public Int16 wCode; 220 public Int16 wReserved; 221 [MarshalAs(UnmanagedType.BStr)] public String bstrSource; 222 [MarshalAs(UnmanagedType.BStr)] public String bstrDescription; 223 [MarshalAs(UnmanagedType.BStr)] public String bstrHelpFile; 224 public int dwHelpContext; 225 public IntPtr pvReserved; 226 public IntPtr pfnDeferredFillIn; 227 } 228 229 [Obsolete("Use System.Runtime.InteropServices.ComTypes.FUNCKIND instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 230 [Serializable] 231 public enum FUNCKIND : int 232 { 233 FUNC_VIRTUAL = 0, 234 FUNC_PUREVIRTUAL = 1, 235 FUNC_NONVIRTUAL = 2, 236 FUNC_STATIC = 3, 237 FUNC_DISPATCH = 4 238 } 239 240 [Obsolete("Use System.Runtime.InteropServices.ComTypes.INVOKEKIND instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 241 [Serializable] 242 public enum INVOKEKIND : int 243 { 244 INVOKE_FUNC = 0x1, 245 INVOKE_PROPERTYGET = 0x2, 246 INVOKE_PROPERTYPUT = 0x4, 247 INVOKE_PROPERTYPUTREF = 0x8 248 } 249 250 [Obsolete("Use System.Runtime.InteropServices.ComTypes.CALLCONV instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 251 [Serializable] 252 public enum CALLCONV : int 253 { 254 CC_CDECL =1, 255 CC_MSCPASCAL=2, 256 CC_PASCAL =CC_MSCPASCAL, 257 CC_MACPASCAL=3, 258 CC_STDCALL =4, 259 CC_RESERVED =5, 260 CC_SYSCALL =6, 261 CC_MPWCDECL =7, 262 CC_MPWPASCAL=8, 263 CC_MAX =9 264 } 265 266 [Obsolete("Use System.Runtime.InteropServices.ComTypes.FUNCFLAGS instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 267 [Serializable] 268 [Flags()] 269 public enum FUNCFLAGS : short 270 { 271 FUNCFLAG_FRESTRICTED= 0x1, 272 FUNCFLAG_FSOURCE = 0x2, 273 FUNCFLAG_FBINDABLE = 0x4, 274 FUNCFLAG_FREQUESTEDIT = 0x8, 275 FUNCFLAG_FDISPLAYBIND = 0x10, 276 FUNCFLAG_FDEFAULTBIND = 0x20, 277 FUNCFLAG_FHIDDEN = 0x40, 278 FUNCFLAG_FUSESGETLASTERROR= 0x80, 279 FUNCFLAG_FDEFAULTCOLLELEM= 0x100, 280 FUNCFLAG_FUIDEFAULT = 0x200, 281 FUNCFLAG_FNONBROWSABLE = 0x400, 282 FUNCFLAG_FREPLACEABLE = 0x800, 283 FUNCFLAG_FIMMEDIATEBIND = 0x1000 284 } 285 286 [Obsolete("Use System.Runtime.InteropServices.ComTypes.VARFLAGS instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 287 [Serializable] 288 [Flags()] 289 public enum VARFLAGS : short 290 { 291 VARFLAG_FREADONLY =0x1, 292 VARFLAG_FSOURCE =0x2, 293 VARFLAG_FBINDABLE =0x4, 294 VARFLAG_FREQUESTEDIT =0x8, 295 VARFLAG_FDISPLAYBIND =0x10, 296 VARFLAG_FDEFAULTBIND =0x20, 297 VARFLAG_FHIDDEN =0x40, 298 VARFLAG_FRESTRICTED =0x80, 299 VARFLAG_FDEFAULTCOLLELEM =0x100, 300 VARFLAG_FUIDEFAULT =0x200, 301 VARFLAG_FNONBROWSABLE =0x400, 302 VARFLAG_FREPLACEABLE =0x800, 303 VARFLAG_FIMMEDIATEBIND =0x1000 304 } 305 306 #if !FULL_AOT_RUNTIME 307 [Obsolete("Use System.Runtime.InteropServices.ComTypes.ITypeInfo instead. http://go.microsoft.com/fwlink/?linkid=14202", false)] 308 [Guid("00020401-0000-0000-C000-000000000046")] 309 [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] 310 [ComImport] 311 public interface UCOMITypeInfo 312 { GetTypeAttr(out IntPtr ppTypeAttr)313 void GetTypeAttr(out IntPtr ppTypeAttr); GetTypeComp(out UCOMITypeComp ppTComp)314 void GetTypeComp(out UCOMITypeComp ppTComp); GetFuncDesc(int index, out IntPtr ppFuncDesc)315 void GetFuncDesc(int index, out IntPtr ppFuncDesc); GetVarDesc(int index, out IntPtr ppVarDesc)316 void GetVarDesc(int index, out IntPtr ppVarDesc); GetNames(int memid, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2), Out] String[] rgBstrNames, int cMaxNames, out int pcNames)317 void GetNames(int memid, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2), Out] String[] rgBstrNames, int cMaxNames, out int pcNames); GetRefTypeOfImplType(int index, out int href)318 void GetRefTypeOfImplType(int index, out int href); GetImplTypeFlags(int index, out int pImplTypeFlags)319 void GetImplTypeFlags(int index, out int pImplTypeFlags); GetIDsOfNames([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 1), In] String[] rgszNames, int cNames, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1), Out] int[] pMemId)320 void GetIDsOfNames([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 1), In] String[] rgszNames, int cNames, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1), Out] int[] pMemId); Invoke([MarshalAs(UnmanagedType.IUnknown)] Object pvInstance, int memid, Int16 wFlags, ref DISPPARAMS pDispParams, out Object pVarResult, out EXCEPINFO pExcepInfo, out int puArgErr)321 void Invoke([MarshalAs(UnmanagedType.IUnknown)] Object pvInstance, int memid, Int16 wFlags, ref DISPPARAMS pDispParams, out Object pVarResult, out EXCEPINFO pExcepInfo, out int puArgErr); GetDocumentation(int index, out String strName, out String strDocString, out int dwHelpContext, out String strHelpFile)322 void GetDocumentation(int index, out String strName, out String strDocString, out int dwHelpContext, out String strHelpFile); GetDllEntry(int memid, INVOKEKIND invKind, out String pBstrDllName, out String pBstrName, out Int16 pwOrdinal)323 void GetDllEntry(int memid, INVOKEKIND invKind, out String pBstrDllName, out String pBstrName, out Int16 pwOrdinal); GetRefTypeInfo(int hRef, out UCOMITypeInfo ppTI)324 void GetRefTypeInfo(int hRef, out UCOMITypeInfo ppTI); AddressOfMember(int memid, INVOKEKIND invKind, out IntPtr ppv)325 void AddressOfMember(int memid, INVOKEKIND invKind, out IntPtr ppv); CreateInstance([MarshalAs(UnmanagedType.IUnknown)] Object pUnkOuter, ref Guid riid, [MarshalAs(UnmanagedType.IUnknown), Out] out Object ppvObj)326 void CreateInstance([MarshalAs(UnmanagedType.IUnknown)] Object pUnkOuter, ref Guid riid, [MarshalAs(UnmanagedType.IUnknown), Out] out Object ppvObj); GetMops(int memid, out String pBstrMops)327 void GetMops(int memid, out String pBstrMops); GetContainingTypeLib(out UCOMITypeLib ppTLB, out int pIndex)328 void GetContainingTypeLib(out UCOMITypeLib ppTLB, out int pIndex); ReleaseTypeAttr(IntPtr pTypeAttr)329 void ReleaseTypeAttr(IntPtr pTypeAttr); ReleaseFuncDesc(IntPtr pFuncDesc)330 void ReleaseFuncDesc(IntPtr pFuncDesc); ReleaseVarDesc(IntPtr pVarDesc)331 void ReleaseVarDesc(IntPtr pVarDesc); 332 } 333 #endif 334 } 335