source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/cor.h@ 1180

Last change on this file since 1180 was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 62.9 KB
RevLine 
[1166]1/**
2 * This file is part of the mingw-w64 runtime package.
3 * No warranty is given; refer to the file DISCLAIMER within this package.
4 */
5#ifndef _COR_H_
6#define _COR_H_
7
8#include <ole2.h>
9#include "corerror.h"
10#include <corhdr.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16 EXTERN_GUID (LIBID_ComPlusRuntime, 0xbed7f4ea, 0x1a96, 0x11d2, 0x8f, 0x8, 0x0, 0xa0, 0xc9, 0xa6, 0x18, 0x6d);
17 EXTERN_GUID (GUID_ExportedFromComPlus, 0x90883f05, 0x3d28, 0x11d2, 0x8f, 0x17, 0x0, 0xa0, 0xc9, 0xa6, 0x18, 0x6d);
18 EXTERN_GUID (GUID_ManagedName, 0xf21f359, 0xab84, 0x41e8, 0x9a, 0x78, 0x36, 0xd1, 0x10, 0xe6, 0xd2, 0xf9);
19 EXTERN_GUID (GUID_Function2Getter, 0x54fc8f55, 0x38de, 0x4703, 0x9c, 0x4e, 0x25, 0x3, 0x51, 0x30, 0x2b, 0x1c);
20 EXTERN_GUID (CLSID_CorMetaDataDispenserRuntime, 0x1ec2de53, 0x75cc, 0x11d2, 0x97, 0x75, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);
21 EXTERN_GUID (GUID_DispIdOverride, 0xcd2bc5c9, 0xf452, 0x4326, 0xb7, 0x14, 0xf9, 0xc5, 0x39, 0xd4, 0xda, 0x58);
22 EXTERN_GUID (GUID_ForceIEnumerable, 0xb64784eb, 0xd8d4, 0x4d9b, 0x9a, 0xcd, 0x0e, 0x30, 0x80, 0x64, 0x26, 0xf7);
23 EXTERN_GUID (GUID_PropGetCA, 0x2941ff83, 0x88d8, 0x4f73, 0xb6, 0xa9, 0xbd, 0xf8, 0x71, 0x2d, 0x00, 0x0d);
24 EXTERN_GUID (GUID_PropPutCA, 0x29533527, 0x3683, 0x4364, 0xab, 0xc0, 0xdb, 0x1a, 0xdd, 0x82, 0x2f, 0xa2);
25 EXTERN_GUID (CLSID_CLR_v1_MetaData, 0x005023ca, 0x72b1, 0x11d3, 0x9f, 0xc4, 0x0, 0xc0, 0x4f, 0x79, 0xa0, 0xa3);
26 EXTERN_GUID (CLSID_CLR_v2_MetaData, 0xefea471a, 0x44fd, 0x4862, 0x92, 0x92, 0xc, 0x58, 0xd4, 0x6e, 0x1f, 0x3a);
27 EXTERN_GUID (MetaDataCheckDuplicatesFor, 0x30fe7be8, 0xd7d9, 0x11d2, 0x9f, 0x80, 0x0, 0xc0, 0x4f, 0x79, 0xa0, 0xa3);
28 EXTERN_GUID (MetaDataRefToDefCheck, 0xde3856f8, 0xd7d9, 0x11d2, 0x9f, 0x80, 0x0, 0xc0, 0x4f, 0x79, 0xa0, 0xa3);
29 EXTERN_GUID (MetaDataNotificationForTokenMovement, 0xe5d71a4c, 0xd7da, 0x11d2, 0x9f, 0x80, 0x0, 0xc0, 0x4f, 0x79, 0xa0, 0xa3);
30 EXTERN_GUID (MetaDataSetUpdate, 0x2eee315c, 0xd7db, 0x11d2, 0x9f, 0x80, 0x0, 0xc0, 0x4f, 0x79, 0xa0, 0xa3);
31 EXTERN_GUID (MetaDataImportOption, 0x79700f36, 0x4aac, 0x11d3, 0x84, 0xc3, 0x0, 0x90, 0x27, 0x86, 0x8c, 0xb1);
32 EXTERN_GUID (MetaDataThreadSafetyOptions, 0xf7559806, 0xf266, 0x42ea, 0x8c, 0x63, 0xa, 0xdb, 0x45, 0xe8, 0xb2, 0x34);
33 EXTERN_GUID (MetaDataErrorIfEmitOutOfOrder, 0x1547872d, 0xdc03, 0x11d2, 0x94, 0x20, 0x0, 0x0, 0xf8, 0x8, 0x34, 0x60);
34 EXTERN_GUID (MetaDataGenerateTCEAdapters, 0xdcc9de90, 0x4151, 0x11d3, 0x88, 0xd6, 0x0, 0x90, 0x27, 0x54, 0xc4, 0x3a);
35 EXTERN_GUID (MetaDataTypeLibImportNamespace, 0xf17ff889, 0x5a63, 0x11d3, 0x9f, 0xf2, 0x0, 0xc0, 0x4f, 0xf7, 0x43, 0x1a);
36 EXTERN_GUID (MetaDataLinkerOptions, 0x47e099b6, 0xae7c, 0x4797, 0x83, 0x17, 0xb4, 0x8a, 0xa6, 0x45, 0xb8, 0xf9);
37 EXTERN_GUID (MetaDataRuntimeVersion, 0x47e099b7, 0xae7c, 0x4797, 0x83, 0x17, 0xb4, 0x8a, 0xa6, 0x45, 0xb8, 0xf9);
38 EXTERN_GUID (MetaDataMergerOptions, 0x132d3a6e, 0xb35d, 0x464e, 0x95, 0x1a, 0x42, 0xef, 0xb9, 0xfb, 0x66, 0x1);
39 EXTERN_GUID (MetaDataPreserveLocalRefs, 0xa55c0354, 0xe91b, 0x468b, 0x86, 0x48, 0x7c, 0xc3, 0x10, 0x35, 0xd5, 0x33);
40 EXTERN_GUID (CLSID_Cor, 0xbee00010, 0xee77, 0x11d0, 0xa0, 0x15, 0x00, 0xc0, 0x4f, 0xbb, 0xb8, 0x84);
41 EXTERN_GUID (CLSID_CorMetaDataDispenser, 0xe5cb7a31, 0x7512, 0x11d2, 0x89, 0xce, 0x0, 0x80, 0xc7, 0x92, 0xe5, 0xd8);
42 EXTERN_GUID (CLSID_CorMetaDataDispenserReg, 0x435755ff, 0x7397, 0x11d2, 0x97, 0x71, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);
43 EXTERN_GUID (CLSID_CorMetaDataReg, 0x87f3a1f5, 0x7397, 0x11d2, 0x97, 0x71, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);
44 EXTERN_GUID (IID_IMapToken, 0x6a3ea8b, 0x225, 0x11d1, 0xbf, 0x72, 0x0, 0xc0, 0x4f, 0xc3, 0x1e, 0x12);
45 EXTERN_GUID (IID_IMetaDataError, 0xb81ff171, 0x20f3, 0x11d2, 0x8d, 0xcc, 0x0, 0xa0, 0xc9, 0xb0, 0x9c, 0x19);
46 EXTERN_GUID (IID_IMetaDataDispenser, 0x809c652e, 0x7396, 0x11d2, 0x97, 0x71, 0x00, 0xa0, 0xc9, 0xb4, 0xd5, 0x0c);
47 EXTERN_GUID (IID_IMetaDataImport, 0x7dac8207, 0xd3ae, 0x4c75, 0x9b, 0x67, 0x92, 0x80, 0x1a, 0x49, 0x7d, 0x44);
48 EXTERN_GUID (IID_IMetaDataImport2, 0xfce5efa0, 0x8bba, 0x4f8e, 0xa0, 0x36, 0x8f, 0x20, 0x22, 0xb0, 0x84, 0x66);
49 EXTERN_GUID (IID_IMetaDataFilter, 0xd0e80dd1, 0x12d4, 0x11d3, 0xb3, 0x9d, 0x0, 0xc0, 0x4f, 0xf8, 0x17, 0x95);
50 EXTERN_GUID (IID_IHostFilter, 0xd0e80dd3, 0x12d4, 0x11d3, 0xb3, 0x9d, 0x0, 0xc0, 0x4f, 0xf8, 0x17, 0x95);
51 EXTERN_GUID (IID_IMetaDataEmit, 0xba3fee4c, 0xecb9, 0x4e41, 0x83, 0xb7, 0x18, 0x3f, 0xa4, 0x1c, 0xd8, 0x59);
52 EXTERN_GUID (IID_IMetaDataEmit2, 0xf5dd9950, 0xf693, 0x42e6, 0x83, 0xe, 0x7b, 0x83, 0x3e, 0x81, 0x46, 0xa9);
53 EXTERN_GUID (IID_IMetaDataAssemblyEmit, 0x211ef15b, 0x5317, 0x4438, 0xb1, 0x96, 0xde, 0xc8, 0x7b, 0x88, 0x76, 0x93);
54 EXTERN_GUID (IID_IMetaDataAssemblyImport, 0xee62470b, 0xe94b, 0x424e, 0x9b, 0x7c, 0x2f, 0x0, 0xc9, 0x24, 0x9f, 0x93);
55 EXTERN_GUID (IID_IMetaDataValidate, 0x4709c9c6, 0x81ff, 0x11d3, 0x9f, 0xc7, 0x0, 0xc0, 0x4f, 0x79, 0xa0, 0xa3);
56 EXTERN_GUID (IID_IMetaDataDispenserEx, 0x31bcfce2, 0xdafb, 0x11d2, 0x9f, 0x81, 0x0, 0xc0, 0x4f, 0x79, 0xa0, 0xa3);
57 EXTERN_GUID (IID_ICeeGen, 0x7ed1bdff, 0x8e36, 0x11d2, 0x9c, 0x56, 0x0, 0xa0, 0xc9, 0xb7, 0xcc, 0x45);
58 EXTERN_GUID (IID_IMetaDataTables, 0xd8f579ab, 0x402d, 0x4b8e, 0x82, 0xd9, 0x5d, 0x63, 0xb1, 0x6, 0x5c, 0x68);
59 EXTERN_GUID (IID_IMetaDataTables2, 0xbadb5f70, 0x58da, 0x43a9, 0xa1, 0xc6, 0xd7, 0x48, 0x19, 0xf1, 0x9b, 0x15);
60 EXTERN_GUID (IID_IMetaDataInfo, 0x7998ea64, 0x7f95, 0x48b8, 0x86, 0xfc, 0x17, 0xca, 0xf4, 0x8b, 0xf5, 0xcb);
61
62#define CLSID_CorMetaDataRuntime CLSID_CLR_v2_MetaData
63#define MetaDataSetENC MetaDataSetUpdate
64
65#define MAIN_CLR_MODULE_NAME_W L"clr"
66#define MAIN_CLR_MODULE_NAME_A "clr"
67
68#define MSCOREE_SHIM_W L"mscoree.dll"
69#define MSCOREE_SHIM_A "mscoree.dll"
70
71#define COR_NATIVE_LINK_CUSTOM_VALUE L"COMPLUS_NativeLink"
72#define COR_NATIVE_LINK_CUSTOM_VALUE_ANSI "COMPLUS_NativeLink"
73
74#define COR_BASE_SECURITY_ATTRIBUTE_CLASS L"System.Security.Permissions.SecurityAttribute"
75#define COR_BASE_SECURITY_ATTRIBUTE_CLASS_ANSI "System.Security.Permissions.SecurityAttribute"
76
77#define COR_SUPPRESS_UNMANAGED_CODE_CHECK_ATTRIBUTE L"System.Security.SuppressUnmanagedCodeSecurityAttribute"
78#define COR_SUPPRESS_UNMANAGED_CODE_CHECK_ATTRIBUTE_ANSI "System.Security.SuppressUnmanagedCodeSecurityAttribute"
79
80#define COR_UNVER_CODE_ATTRIBUTE L"System.Security.UnverifiableCodeAttribute"
81#define COR_UNVER_CODE_ATTRIBUTE_ANSI "System.Security.UnverifiableCodeAttribute"
82
83#define COR_REQUIRES_SECOBJ_ATTRIBUTE L"System.Security.DynamicSecurityMethodAttribute"
84#define COR_REQUIRES_SECOBJ_ATTRIBUTE_ANSI "System.Security.DynamicSecurityMethodAttribute"
85
86#define COR_COMPILERSERVICE_DISCARDABLEATTRIBUTE L"System.Runtime.CompilerServices.DiscardableAttribute"
87#define COR_COMPILERSERVICE_DISCARDABLEATTRIBUTE_ASNI "System.Runtime.CompilerServices.DiscardableAttribute"
88
89#define MAIN_CLR_DLL_NAME_W MAKEDLLNAME_W (MAIN_CLR_MODULE_NAME_W)
90#define MAIN_CLR_DLL_NAME_A MAKEDLLNAME_A (MAIN_CLR_MODULE_NAME_A)
91
92#define INVALID_CONNECTION_ID 0x0
93#define INVALID_TASK_ID 0x0
94#define MAX_CONNECTION_NAME MAX_PATH
95
96#define SWITCHOUT_HANDLE_VALUE ((HANDLE) (LONG_PTR)-2)
97
98#define COR_NATIVE_LINK_CUSTOM_VALUE_CC 18
99
100 interface IMetaDataImport;
101 interface IMetaDataAssemblyEmit;
102 interface IMetaDataAssemblyImport;
103 interface IMetaDataEmit;
104 interface ICeeGen;
105 interface IMetaDataDispenser;
106
107 typedef interface IMetaDataAssemblyEmit IMetaDataAssemblyEmit;
108 typedef interface IMetaDataAssemblyImport IMetaDataAssemblyImport;
109 typedef interface IMetaDataImport IMetaDataImport;
110
111 typedef enum tagCOINITCOR {
112 COINITCOR_DEFAULT = 0x0
113 } COINITICOR;
114
115 typedef enum tagCOINITEE {
116 COINITEE_DEFAULT = 0x0,
117 COINITEE_DLL = 0x1,
118 COINITEE_MAIN = 0x2
119 } COINITIEE;
120
121 typedef enum tagCOUNINITEE {
122 COUNINITEE_DEFAULT = 0x0,
123 COUNINITEE_DLL = 0x1
124 } COUNINITIEE;
125
126 typedef enum {
127 regNoCopy = 1,
128 regConfig = 2,
129 regHasRefs = 4
130 } CorRegFlags;
131
132 typedef enum {
133 sdNone = 0,
134 sdReadOnly = IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA,
135 sdReadWrite = sdReadOnly | IMAGE_SCN_MEM_WRITE,
136 sdExecute = IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE
137 } CeeSectionAttr;
138
139 typedef enum {
140 srRelocAbsolute,
141 srRelocHighLow = 3,
142 srRelocHighAdj,
143 srRelocMapToken,
144 srRelocRelative,
145 srRelocFilePos,
146 srRelocCodeRelative,
147 srRelocIA64Imm64,
148 srRelocDir64,
149 srRelocIA64PcRel25,
150 srRelocIA64PcRel64,
151 srRelocAbsoluteTagged,
152 srRelocSentinel,
153 srNoBaseReloc = 0x4000,
154 srRelocPtr = 0x8000,
155 srRelocAbsolutePtr = srRelocPtr + srRelocAbsolute,
156 srRelocHighLowPtr = srRelocPtr + srRelocHighLow,
157 srRelocRelativePtr = srRelocPtr + srRelocRelative,
158 srRelocIA64Imm64Ptr = srRelocPtr + srRelocIA64Imm64,
159 srRelocDir64Ptr = srRelocPtr + srRelocDir64
160 } CeeSectionRelocType;
161
162 typedef enum {
163 nltNone = 1,
164 nltAnsi = 2,
165 nltUnicode = 3,
166 nltAuto = 4,
167 nltOle = 5,
168 nltMaxValue = 7,
169 } CorNativeLinkType;
170
171 typedef enum {
172 nlfNone = 0x0,
173 nlfLastError = 0x1,
174 nlfNoMangle = 0x2,
175 nlfMaxValue = 0x3,
176 } CorNativeLinkFlags;
177
178 typedef void const *UVCP_CONSTANT;
179 typedef void *HCEESECTION;
180 typedef GUID CVID;
181
182 typedef struct {
183 DWORD dwOSPlatformId;
184 DWORD dwOSMajorVersion;
185 DWORD dwOSMinorVersion;
186 } OSINFO;
187
188 typedef struct {
189 USHORT usMajorVersion;
190 USHORT usMinorVersion;
191 USHORT usBuildNumber;
192 USHORT usRevisionNumber;
193 LPWSTR szLocale;
194 ULONG cbLocale;
195 DWORD *rProcessor;
196 ULONG ulProcessor;
197 OSINFO *rOS;
198 ULONG ulOS;
199 } ASSEMBLYMETADATA;
200
201 typedef union {
202 USHORT highAdj;
203 } CeeSectionRelocExtra;
204
205 typedef struct {
206 short Major;
207 short Minor;
208 short Sub;
209 short Build;
210 } CVStruct;
211
212#include <pshpack1.h>
213 typedef struct {
214 BYTE m_linkType;
215 BYTE m_flags;
216 mdMemberRef m_entryPoint;
217 } COR_NATIVE_LINK;
218#include <poppack.h>
219
220 WINBOOL STDMETHODCALLTYPE _CorDllMain (HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved);
221 int STDMETHODCALLTYPE _CorExeMain ();
222 int STDMETHODCALLTYPE _CorExeMainInternal ();
223 int STDMETHODCALLTYPE _CorExeMain2 (PBYTE pUnmappedPE, DWORD cUnmappedPE, LPWSTR pImageNameIn, LPWSTR pLoadersFileName, LPWSTR pCmdLine);
224 STDAPI CoInitializeEE (DWORD fFlags);
225 STDAPI _CorValidateImage (PVOID *ImageBase, LPCWSTR FileName);
226 STDAPI_ (VOID) _CorImageUnloading (PVOID ImageBase);
227 STDAPI_ (void) CoUninitializeEE (WINBOOL fFlags);
228 STDAPI_ (void) CoEEShutDownCOM (void);
229 STDAPI CoInitializeCor (DWORD fFlags);
230 STDAPI_ (void) CoUninitializeCor (void);
231
232#undef INTERFACE
233#define INTERFACE IMetaDataError
234 DECLARE_INTERFACE_ (IMetaDataError, IUnknown) {
235#ifndef __cplusplus
236 /* IUnknown methods */
237 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
238 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
239 STDMETHOD_(ULONG, Release)(THIS) PURE;
240#endif
241 /* IMetaDataError */
242 STDMETHOD (OnError) (THIS_ HRESULT hrError, mdToken token) PURE;
243 };
244
245#undef INTERFACE
246#define INTERFACE IMapToken
247 DECLARE_INTERFACE_ (IMapToken, IUnknown) {
248#ifndef __cplusplus
249 /* IUnknown methods */
250 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
251 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
252 STDMETHOD_(ULONG, Release)(THIS) PURE;
253#endif
254
255 /* IMapToken methods */
256 STDMETHOD (Map) (THIS_ mdToken tkImp, mdToken tkEmit) PURE;
257 };
258
259#undef INTERFACE
260#define INTERFACE IMetaDataDispenser
261 DECLARE_INTERFACE_ (IMetaDataDispenser, IUnknown) {
262#ifndef __cplusplus
263 /* IUnknown methods */
264 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
265 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
266 STDMETHOD_(ULONG, Release)(THIS) PURE;
267#endif
268 /* IMetaDataDispenser */
269 STDMETHOD (DefineScope) (THIS_ REFCLSID rclsid, DWORD dwCreateFlags, REFIID riid, IUnknown **ppIUnk) PURE;
270 STDMETHOD (OpenScope) (THIS_ LPCWSTR szScope, DWORD dwOpenFlags, REFIID riid, IUnknown **ppIUnk) PURE;
271 STDMETHOD (OpenScopeOnMemory) (THIS_ LPCVOID pData, ULONG cbData, DWORD dwOpenFlags, REFIID riid, IUnknown **ppIUnk) PURE;
272 };
273
274#undef INTERFACE
275#define INTERFACE IMetaDataEmit
276 DECLARE_INTERFACE_ (IMetaDataEmit, IUnknown) {
277#ifndef __cplusplus
278 /* IUnknown methods */
279 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
280 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
281 STDMETHOD_(ULONG, Release)(THIS) PURE;
282#endif
283 /* IMetaDataEmit */
284 STDMETHOD (SetModuleProps) (THIS_ LPCWSTR szName) PURE;
285 STDMETHOD (Save) (THIS_ LPCWSTR szFile, DWORD dwSaveFlags) PURE;
286 STDMETHOD (SaveToStream) (THIS_ IStream *pIStream, DWORD dwSaveFlags) PURE;
287 STDMETHOD (GetSaveSize) (THIS_ CorSaveSize fSave, DWORD *pdwSaveSize) PURE;
288 STDMETHOD (DefineTypeDef) (THIS_ LPCWSTR szTypeDef, DWORD dwTypeDefFlags, mdToken tkExtends, mdToken rtkImplements[], mdTypeDef *ptd) PURE;
289 STDMETHOD (DefineNestedType) (THIS_ LPCWSTR szTypeDef, DWORD dwTypeDefFlags, mdToken tkExtends, mdToken rtkImplements[], mdTypeDef tdEncloser, mdTypeDef *ptd) PURE;
290 STDMETHOD (SetHandler) (THIS_ IUnknown *pUnk) PURE;
291 STDMETHOD (DefineMethod) (THIS_ mdTypeDef td, LPCWSTR szName, DWORD dwMethodFlags, PCCOR_SIGNATURE pvSigBlob, ULONG cbSigBlob, ULONG ulCodeRVA, DWORD dwImplFlags, mdMethodDef *pmd) PURE;
292 STDMETHOD (DefineMethodImpl) (THIS_ mdTypeDef td, mdToken tkBody, mdToken tkDecl) PURE;
293 STDMETHOD (DefineTypeRefByName) (THIS_ mdToken tkResolutionScope, LPCWSTR szName, mdTypeRef *ptr) PURE;
294 STDMETHOD (DefineImportType) (THIS_ IMetaDataAssemblyImport *pAssemImport, const void *pbHashValue, ULONG cbHashValue, IMetaDataImport *pImport, mdTypeDef tdImport, IMetaDataAssemblyEmit *pAssemEmit, mdTypeRef *ptr) PURE;
295 STDMETHOD (DefineMemberRef) (THIS_ mdToken tkImport, LPCWSTR szName, PCCOR_SIGNATURE pvSigBlob, ULONG cbSigBlob, mdMemberRef *pmr) PURE;
296 STDMETHOD (DefineImportMember) (THIS_ IMetaDataAssemblyImport *pAssemImport, const void *pbHashValue, ULONG cbHashValue, IMetaDataImport *pImport, mdToken mbMember, IMetaDataAssemblyEmit *pAssemEmit, mdToken tkParent, mdMemberRef *pmr) PURE;
297 STDMETHOD (DefineEvent) (THIS_ mdTypeDef td, LPCWSTR szEvent, DWORD dwEventFlags, mdToken tkEventType, mdMethodDef mdAddOn, mdMethodDef mdRemoveOn, mdMethodDef mdFire, mdMethodDef rmdOtherMethods[], mdEvent *pmdEvent) PURE;
298 STDMETHOD (SetClassLayout) (THIS_ mdTypeDef td, DWORD dwPackSize, COR_FIELD_OFFSET rFieldOffsets[], ULONG ulClassSize) PURE;
299 STDMETHOD (DeleteClassLayout) (THIS_ mdTypeDef td) PURE;
300 STDMETHOD (SetFieldMarshal) (THIS_ mdToken tk, PCCOR_SIGNATURE pvNativeType, ULONG cbNativeType) PURE;
301 STDMETHOD (DeleteFieldMarshal) (THIS_ mdToken tk) PURE;
302 STDMETHOD (DefinePermissionSet) (THIS_ mdToken tk, DWORD dwAction, void const *pvPermission, ULONG cbPermission, mdPermission *ppm) PURE;
303 STDMETHOD (SetRVA) (THIS_ mdMethodDef md, ULONG ulRVA) PURE;
304 STDMETHOD (GetTokenFromSig) (THIS_ PCCOR_SIGNATURE pvSig, ULONG cbSig, mdSignature *pmsig) PURE;
305 STDMETHOD (DefineModuleRef) (THIS_ LPCWSTR szName, mdModuleRef *pmur) PURE;
306 STDMETHOD (SetParent) (THIS_ mdMemberRef mr, mdToken tk) PURE;
307 STDMETHOD (GetTokenFromTypeSpec) (THIS_ PCCOR_SIGNATURE pvSig, ULONG cbSig, mdTypeSpec *ptypespec) PURE;
308 STDMETHOD (SaveToMemory) (THIS_ void *pbData, ULONG cbData) PURE;
309 STDMETHOD (DefineUserString) (THIS_ LPCWSTR szString, ULONG cchString, mdString *pstk) PURE;
310 STDMETHOD (DeleteToken) (THIS_ mdToken tkObj) PURE;
311 STDMETHOD (SetMethodProps) (THIS_ mdMethodDef md, DWORD dwMethodFlags, ULONG ulCodeRVA, DWORD dwImplFlags) PURE;
312 STDMETHOD (SetTypeDefProps) (THIS_ mdTypeDef td, DWORD dwTypeDefFlags, mdToken tkExtends, mdToken rtkImplements[]) PURE;
313 STDMETHOD (SetEventProps) (THIS_ mdEvent ev, DWORD dwEventFlags, mdToken tkEventType, mdMethodDef mdAddOn, mdMethodDef mdRemoveOn, mdMethodDef mdFire, mdMethodDef rmdOtherMethods[]) PURE;
314 STDMETHOD (SetPermissionSetProps) (THIS_ mdToken tk, DWORD dwAction, void const *pvPermission, ULONG cbPermission, mdPermission *ppm) PURE;
315 STDMETHOD (DefinePinvokeMap) (THIS_ mdToken tk, DWORD dwMappingFlags, LPCWSTR szImportName, mdModuleRef mrImportDLL) PURE;
316 STDMETHOD (SetPinvokeMap) (THIS_ mdToken tk, DWORD dwMappingFlags, LPCWSTR szImportName, mdModuleRef mrImportDLL) PURE;
317 STDMETHOD (DeletePinvokeMap) (THIS_ mdToken tk) PURE;
318 STDMETHOD (DefineCustomAttribute) (THIS_ mdToken tkOwner, mdToken tkCtor, void const *pCustomAttribute, ULONG cbCustomAttribute, mdCustomAttribute *pcv) PURE;
319 STDMETHOD (SetCustomAttributeValue) (THIS_ mdCustomAttribute pcv, void const *pCustomAttribute, ULONG cbCustomAttribute) PURE;
320 STDMETHOD (DefineField) (THIS_ mdTypeDef td, LPCWSTR szName, DWORD dwFieldFlags, PCCOR_SIGNATURE pvSigBlob, ULONG cbSigBlob, DWORD dwCPlusTypeFlag, void const *pValue, ULONG cchValue, mdFieldDef *pmd) PURE;
321 STDMETHOD (DefineProperty) (THIS_ mdTypeDef td, LPCWSTR szProperty, DWORD dwPropFlags, PCCOR_SIGNATURE pvSig, ULONG cbSig, DWORD dwCPlusTypeFlag, void const *pValue, ULONG cchValue, mdMethodDef mdSetter, mdMethodDef mdGetter, mdMethodDef rmdOtherMethods[], mdProperty *pmdProp) PURE;
322 STDMETHOD (DefineParam) (THIS_ mdMethodDef md, ULONG ulParamSeq, LPCWSTR szName, DWORD dwParamFlags, DWORD dwCPlusTypeFlag, void const *pValue, ULONG cchValue, mdParamDef *ppd) PURE;
323 STDMETHOD (SetFieldProps) (THIS_ mdFieldDef fd, DWORD dwFieldFlags, DWORD dwCPlusTypeFlag, void const *pValue, ULONG cchValue) PURE;
324 STDMETHOD (SetPropertyProps) (THIS_ mdProperty pr, DWORD dwPropFlags, DWORD dwCPlusTypeFlag, void const *pValue, ULONG cchValue, mdMethodDef mdSetter, mdMethodDef mdGetter, mdMethodDef rmdOtherMethods[]) PURE;
325 STDMETHOD (SetParamProps) (THIS_ mdParamDef pd, LPCWSTR szName, DWORD dwParamFlags, DWORD dwCPlusTypeFlag, void const *pValue, ULONG cchValue) PURE;
326 STDMETHOD (DefineSecurityAttributeSet) (THIS_ mdToken tkObj, COR_SECATTR rSecAttrs[], ULONG cSecAttrs, ULONG *pulErrorAttr) PURE;
327 STDMETHOD (ApplyEditAndContinue) (THIS_ IUnknown *pImport) PURE;
328 STDMETHOD (TranslateSigWithScope) (THIS_ IMetaDataAssemblyImport *pAssemImport, const void *pbHashValue, ULONG cbHashValue, IMetaDataImport *import, PCCOR_SIGNATURE pbSigBlob, ULONG cbSigBlob, IMetaDataAssemblyEmit *pAssemEmit, IMetaDataEmit *emit, PCOR_SIGNATURE pvTranslatedSig, ULONG cbTranslatedSigMax, ULONG *pcbTranslatedSig) PURE;
329 STDMETHOD (SetMethodImplFlags) (THIS_ mdMethodDef md, DWORD dwImplFlags) PURE;
330 STDMETHOD (SetFieldRVA) (THIS_ mdFieldDef fd, ULONG ulRVA) PURE;
331 STDMETHOD (Merge) (THIS_ IMetaDataImport *pImport, IMapToken *pHostMapToken, IUnknown *pHandler) PURE;
332 STDMETHOD (MergeEnd) (THIS) PURE;
333 };
334
335#undef INTERFACE
336#define INTERFACE IMetaDataEmit2
337 DECLARE_INTERFACE_ (IMetaDataEmit2, IMetaDataEmit) {
338#ifndef __cplusplus
339 /* IUnknown methods */
340 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
341 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
342 STDMETHOD_(ULONG, Release)(THIS) PURE;
343
344 /* IMetaDataEmit */
345 STDMETHOD (SetModuleProps) (THIS_ LPCWSTR szName) PURE;
346 STDMETHOD (Save) (THIS_ LPCWSTR szFile, DWORD dwSaveFlags) PURE;
347 STDMETHOD (SaveToStream) (THIS_ IStream *pIStream, DWORD dwSaveFlags) PURE;
348 STDMETHOD (GetSaveSize) (THIS_ CorSaveSize fSave, DWORD *pdwSaveSize) PURE;
349 STDMETHOD (DefineTypeDef) (THIS_ LPCWSTR szTypeDef, DWORD dwTypeDefFlags, mdToken tkExtends, mdToken rtkImplements[], mdTypeDef *ptd) PURE;
350 STDMETHOD (DefineNestedType) (THIS_ LPCWSTR szTypeDef, DWORD dwTypeDefFlags, mdToken tkExtends, mdToken rtkImplements[], mdTypeDef tdEncloser, mdTypeDef *ptd) PURE;
351 STDMETHOD (SetHandler) (THIS_ IUnknown *pUnk) PURE;
352 STDMETHOD (DefineMethod) (THIS_ mdTypeDef td, LPCWSTR szName, DWORD dwMethodFlags, PCCOR_SIGNATURE pvSigBlob, ULONG cbSigBlob, ULONG ulCodeRVA, DWORD dwImplFlags, mdMethodDef *pmd) PURE;
353 STDMETHOD (DefineMethodImpl) (THIS_ mdTypeDef td, mdToken tkBody, mdToken tkDecl) PURE;
354 STDMETHOD (DefineTypeRefByName) (THIS_ mdToken tkResolutionScope, LPCWSTR szName, mdTypeRef *ptr) PURE;
355 STDMETHOD (DefineImportType) (THIS_ IMetaDataAssemblyImport *pAssemImport, const void *pbHashValue, ULONG cbHashValue, IMetaDataImport *pImport, mdTypeDef tdImport, IMetaDataAssemblyEmit *pAssemEmit, mdTypeRef *ptr) PURE;
356 STDMETHOD (DefineMemberRef) (THIS_ mdToken tkImport, LPCWSTR szName, PCCOR_SIGNATURE pvSigBlob, ULONG cbSigBlob, mdMemberRef *pmr) PURE;
357 STDMETHOD (DefineImportMember) (THIS_ IMetaDataAssemblyImport *pAssemImport, const void *pbHashValue, ULONG cbHashValue, IMetaDataImport *pImport, mdToken mbMember, IMetaDataAssemblyEmit *pAssemEmit, mdToken tkParent, mdMemberRef *pmr) PURE;
358 STDMETHOD (DefineEvent) (THIS_ mdTypeDef td, LPCWSTR szEvent, DWORD dwEventFlags, mdToken tkEventType, mdMethodDef mdAddOn, mdMethodDef mdRemoveOn, mdMethodDef mdFire, mdMethodDef rmdOtherMethods[], mdEvent *pmdEvent) PURE;
359 STDMETHOD (SetClassLayout) (THIS_ mdTypeDef td, DWORD dwPackSize, COR_FIELD_OFFSET rFieldOffsets[], ULONG ulClassSize) PURE;
360 STDMETHOD (DeleteClassLayout) (THIS_ mdTypeDef td) PURE;
361 STDMETHOD (SetFieldMarshal) (THIS_ mdToken tk, PCCOR_SIGNATURE pvNativeType, ULONG cbNativeType) PURE;
362 STDMETHOD (DeleteFieldMarshal) (THIS_ mdToken tk) PURE;
363 STDMETHOD (DefinePermissionSet) (THIS_ mdToken tk, DWORD dwAction, void const *pvPermission, ULONG cbPermission, mdPermission *ppm) PURE;
364 STDMETHOD (SetRVA) (THIS_ mdMethodDef md, ULONG ulRVA) PURE;
365 STDMETHOD (GetTokenFromSig) (THIS_ PCCOR_SIGNATURE pvSig, ULONG cbSig, mdSignature *pmsig) PURE;
366 STDMETHOD (DefineModuleRef) (THIS_ LPCWSTR szName, mdModuleRef *pmur) PURE;
367 STDMETHOD (SetParent) (THIS_ mdMemberRef mr, mdToken tk) PURE;
368 STDMETHOD (GetTokenFromTypeSpec) (THIS_ PCCOR_SIGNATURE pvSig, ULONG cbSig, mdTypeSpec *ptypespec) PURE;
369 STDMETHOD (SaveToMemory) (THIS_ void *pbData, ULONG cbData) PURE;
370 STDMETHOD (DefineUserString) (THIS_ LPCWSTR szString, ULONG cchString, mdString *pstk) PURE;
371 STDMETHOD (DeleteToken) (THIS_ mdToken tkObj) PURE;
372 STDMETHOD (SetMethodProps) (THIS_ mdMethodDef md, DWORD dwMethodFlags, ULONG ulCodeRVA, DWORD dwImplFlags) PURE;
373 STDMETHOD (SetTypeDefProps) (THIS_ mdTypeDef td, DWORD dwTypeDefFlags, mdToken tkExtends, mdToken rtkImplements[]) PURE;
374 STDMETHOD (SetEventProps) (THIS_ mdEvent ev, DWORD dwEventFlags, mdToken tkEventType, mdMethodDef mdAddOn, mdMethodDef mdRemoveOn, mdMethodDef mdFire, mdMethodDef rmdOtherMethods[]) PURE;
375 STDMETHOD (SetPermissionSetProps) (THIS_ mdToken tk, DWORD dwAction, void const *pvPermission, ULONG cbPermission, mdPermission *ppm) PURE;
376 STDMETHOD (DefinePinvokeMap) (THIS_ mdToken tk, DWORD dwMappingFlags, LPCWSTR szImportName, mdModuleRef mrImportDLL) PURE;
377 STDMETHOD (SetPinvokeMap) (THIS_ mdToken tk, DWORD dwMappingFlags, LPCWSTR szImportName, mdModuleRef mrImportDLL) PURE;
378 STDMETHOD (DeletePinvokeMap) (THIS_ mdToken tk) PURE;
379 STDMETHOD (DefineCustomAttribute) (THIS_ mdToken tkOwner, mdToken tkCtor, void const *pCustomAttribute, ULONG cbCustomAttribute, mdCustomAttribute *pcv) PURE;
380 STDMETHOD (SetCustomAttributeValue) (THIS_ mdCustomAttribute pcv, void const *pCustomAttribute, ULONG cbCustomAttribute) PURE;
381 STDMETHOD (DefineField) (THIS_ mdTypeDef td, LPCWSTR szName, DWORD dwFieldFlags, PCCOR_SIGNATURE pvSigBlob, ULONG cbSigBlob, DWORD dwCPlusTypeFlag, void const *pValue, ULONG cchValue, mdFieldDef *pmd) PURE;
382 STDMETHOD (DefineProperty) (THIS_ mdTypeDef td, LPCWSTR szProperty, DWORD dwPropFlags, PCCOR_SIGNATURE pvSig, ULONG cbSig, DWORD dwCPlusTypeFlag, void const *pValue, ULONG cchValue, mdMethodDef mdSetter, mdMethodDef mdGetter, mdMethodDef rmdOtherMethods[], mdProperty *pmdProp) PURE;
383 STDMETHOD (DefineParam) (THIS_ mdMethodDef md, ULONG ulParamSeq, LPCWSTR szName, DWORD dwParamFlags, DWORD dwCPlusTypeFlag, void const *pValue, ULONG cchValue, mdParamDef *ppd) PURE;
384 STDMETHOD (SetFieldProps) (THIS_ mdFieldDef fd, DWORD dwFieldFlags, DWORD dwCPlusTypeFlag, void const *pValue, ULONG cchValue) PURE;
385 STDMETHOD (SetPropertyProps) (THIS_ mdProperty pr, DWORD dwPropFlags, DWORD dwCPlusTypeFlag, void const *pValue, ULONG cchValue, mdMethodDef mdSetter, mdMethodDef mdGetter, mdMethodDef rmdOtherMethods[]) PURE;
386 STDMETHOD (SetParamProps) (THIS_ mdParamDef pd, LPCWSTR szName, DWORD dwParamFlags, DWORD dwCPlusTypeFlag, void const *pValue, ULONG cchValue) PURE;
387 STDMETHOD (DefineSecurityAttributeSet) (THIS_ mdToken tkObj, COR_SECATTR rSecAttrs[], ULONG cSecAttrs, ULONG *pulErrorAttr) PURE;
388 STDMETHOD (ApplyEditAndContinue) (THIS_ IUnknown *pImport) PURE;
389 STDMETHOD (TranslateSigWithScope) (THIS_ IMetaDataAssemblyImport *pAssemImport, const void *pbHashValue, ULONG cbHashValue, IMetaDataImport *import, PCCOR_SIGNATURE pbSigBlob, ULONG cbSigBlob, IMetaDataAssemblyEmit *pAssemEmit, IMetaDataEmit *emit, PCOR_SIGNATURE pvTranslatedSig, ULONG cbTranslatedSigMax, ULONG *pcbTranslatedSig) PURE;
390 STDMETHOD (SetMethodImplFlags) (THIS_ mdMethodDef md, DWORD dwImplFlags) PURE;
391 STDMETHOD (SetFieldRVA) (THIS_ mdFieldDef fd, ULONG ulRVA) PURE;
392 STDMETHOD (Merge) (THIS_ IMetaDataImport *pImport, IMapToken *pHostMapToken, IUnknown *pHandler) PURE;
393 STDMETHOD (MergeEnd) (THIS) PURE;
394#endif
395 /* IMetaDataEmit2 */
396 STDMETHOD (DefineMethodSpec) (THIS_ mdToken tkParent, PCCOR_SIGNATURE pvSigBlob, ULONG cbSigBlob, mdMethodSpec *pmi) PURE;
397 STDMETHOD (GetDeltaSaveSize) (THIS_ CorSaveSize fSave, DWORD *pdwSaveSize) PURE;
398 STDMETHOD (SaveDelta) (THIS_ LPCWSTR szFile, DWORD dwSaveFlags) PURE;
399 STDMETHOD (SaveDeltaToStream) (THIS_ IStream *pIStream, DWORD dwSaveFlags) PURE;
400 STDMETHOD (SaveDeltaToMemory) (THIS_ void *pbData, ULONG cbData) PURE;
401 STDMETHOD (DefineGenericParam) (THIS_ mdToken tk, ULONG ulParamSeq, DWORD dwParamFlags, LPCWSTR szname, DWORD reserved, mdToken rtkConstraints[], mdGenericParam *pgp) PURE;
402 STDMETHOD (SetGenericParamProps) (THIS_ mdGenericParam gp, DWORD dwParamFlags, LPCWSTR szName, DWORD reserved, mdToken rtkConstraints[]) PURE;
403 STDMETHOD (ResetENCLog) (THIS) PURE;
404 };
405
406#undef INTERFACE
407#define INTERFACE IMetaDataImport
408 DECLARE_INTERFACE_ (IMetaDataImport, IUnknown) {
409#ifndef __cplusplus
410 /* IUnknown methods */
411 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
412 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
413 STDMETHOD_(ULONG, Release)(THIS) PURE;
414#endif
415 /* IMetaDataImport */
416 STDMETHOD_ (void, CloseEnum) (THIS_ HCORENUM hEnum) PURE;
417 STDMETHOD (CountEnum) (THIS_ HCORENUM hEnum, ULONG *pulCount) PURE;
418 STDMETHOD (ResetEnum) (THIS_ HCORENUM hEnum, ULONG ulPos) PURE;
419 STDMETHOD (EnumTypeDefs) (THIS_ HCORENUM *phEnum, mdTypeDef rTypeDefs[], ULONG cMax, ULONG *pcTypeDefs) PURE;
420 STDMETHOD (EnumInterfaceImpls) (THIS_ HCORENUM *phEnum, mdTypeDef td, mdInterfaceImpl rImpls[], ULONG cMax, ULONG *pcImpls) PURE;
421 STDMETHOD (EnumTypeRefs) (THIS_ HCORENUM *phEnum, mdTypeRef rTypeRefs[], ULONG cMax, ULONG *pcTypeRefs) PURE;
422 STDMETHOD (FindTypeDefByName) (THIS_ LPCWSTR szTypeDef, mdToken tkEnclosingClass, mdTypeDef *ptd) PURE;
423 STDMETHOD (GetScopeProps) (THIS_ LPWSTR szName, ULONG cchName, ULONG *pchName, GUID *pmvid) PURE;
424 STDMETHOD (GetModuleFromScope) (THIS_ mdModule *pmd) PURE;
425 STDMETHOD (GetTypeDefProps) (THIS_ mdTypeDef td, LPWSTR szTypeDef, ULONG cchTypeDef, ULONG *pchTypeDef, DWORD *pdwTypeDefFlags, mdToken *ptkExtends) PURE;
426 STDMETHOD (GetInterfaceImplProps) (THIS_ mdInterfaceImpl iiImpl, mdTypeDef *pClass, mdToken *ptkIface) PURE;
427 STDMETHOD (GetTypeRefProps) (THIS_ mdTypeRef tr, mdToken *ptkResolutionScope, LPWSTR szName, ULONG cchName, ULONG *pchName) PURE;
428 STDMETHOD (ResolveTypeRef) (THIS_ mdTypeRef tr, REFIID riid, IUnknown **ppIScope, mdTypeDef *ptd) PURE;
429 STDMETHOD (EnumMembers) (THIS_ HCORENUM *phEnum, mdTypeDef cl, mdToken rMembers[], ULONG cMax, ULONG *pcTokens) PURE;
430 STDMETHOD (EnumMembersWithName) (THIS_ HCORENUM *phEnum, mdTypeDef cl, LPCWSTR szName, mdToken rMembers[], ULONG cMax, ULONG *pcTokens) PURE;
431 STDMETHOD (EnumMethods) (THIS_ HCORENUM *phEnum, mdTypeDef cl, mdMethodDef rMethods[], ULONG cMax, ULONG *pcTokens) PURE;
432 STDMETHOD (EnumMethodsWithName) (THIS_ HCORENUM *phEnum, mdTypeDef cl, LPCWSTR szName, mdMethodDef rMethods[], ULONG cMax, ULONG *pcTokens) PURE;
433 STDMETHOD (EnumFields) (THIS_ HCORENUM *phEnum, mdTypeDef cl, mdFieldDef rFields[], ULONG cMax, ULONG *pcTokens) PURE;
434 STDMETHOD (EnumFieldsWithName) (THIS_ HCORENUM *phEnum, mdTypeDef cl, LPCWSTR szName, mdFieldDef rFields[], ULONG cMax, ULONG *pcTokens) PURE;
435 STDMETHOD (EnumParams) (THIS_ HCORENUM *phEnum, mdMethodDef mb, mdParamDef rParams[], ULONG cMax, ULONG *pcTokens) PURE;
436 STDMETHOD (EnumMemberRefs) (THIS_ HCORENUM *phEnum, mdToken tkParent, mdMemberRef rMemberRefs[], ULONG cMax, ULONG *pcTokens) PURE;
437 STDMETHOD (EnumMethodImpls) (THIS_ HCORENUM *phEnum, mdTypeDef td, mdToken rMethodBody[], mdToken rMethodDecl[], ULONG cMax, ULONG *pcTokens) PURE;
438 STDMETHOD (EnumPermissionSets) (THIS_ HCORENUM *phEnum, mdToken tk, DWORD dwActions, mdPermission rPermission[], ULONG cMax, ULONG *pcTokens) PURE;
439 STDMETHOD (FindMember) (THIS_ mdTypeDef td, LPCWSTR szName, PCCOR_SIGNATURE pvSigBlob, ULONG cbSigBlob, mdToken *pmb) PURE;
440 STDMETHOD (FindMethod) (THIS_ mdTypeDef td, LPCWSTR szName, PCCOR_SIGNATURE pvSigBlob, ULONG cbSigBlob, mdMethodDef *pmb) PURE;
441 STDMETHOD (FindField) (THIS_ mdTypeDef td, LPCWSTR szName, PCCOR_SIGNATURE pvSigBlob, ULONG cbSigBlob, mdFieldDef *pmb) PURE;
442 STDMETHOD (FindMemberRef) (THIS_ mdTypeRef td, LPCWSTR szName, PCCOR_SIGNATURE pvSigBlob, ULONG cbSigBlob, mdMemberRef *pmr) PURE;
443 STDMETHOD (GetMethodProps) (THIS_ mdMethodDef mb, mdTypeDef *pClass, LPWSTR szMethod, ULONG cchMethod, ULONG *pchMethod, DWORD *pdwAttr, PCCOR_SIGNATURE *ppvSigBlob, ULONG *pcbSigBlob, ULONG *pulCodeRVA, DWORD *pdwImplFlags) PURE;
444 STDMETHOD (GetMemberRefProps) (THIS_ mdMemberRef mr, mdToken *ptk, LPWSTR szMember, ULONG cchMember, ULONG *pchMember, PCCOR_SIGNATURE *ppvSigBlob, ULONG *pbSig) PURE;
445 STDMETHOD (EnumProperties) (THIS_ HCORENUM *phEnum, mdTypeDef td, mdProperty rProperties[], ULONG cMax, ULONG *pcProperties) PURE;
446 STDMETHOD (EnumEvents) (THIS_ HCORENUM *phEnum, mdTypeDef td, mdEvent rEvents[], ULONG cMax, ULONG *pcEvents) PURE;
447 STDMETHOD (GetEventProps) (THIS_ mdEvent ev, mdTypeDef *pClass, LPCWSTR szEvent, ULONG cchEvent, ULONG *pchEvent, DWORD *pdwEventFlags, mdToken *ptkEventType, mdMethodDef *pmdAddOn, mdMethodDef *pmdRemoveOn, mdMethodDef *pmdFire, mdMethodDef rmdOtherMethod[], ULONG cMax, ULONG *pcOtherMethod) PURE;
448 STDMETHOD (EnumMethodSemantics) (THIS_ HCORENUM *phEnum, mdMethodDef mb, mdToken rEventProp[], ULONG cMax, ULONG *pcEventProp) PURE;
449 STDMETHOD (GetMethodSemantics) (THIS_ mdMethodDef mb, mdToken tkEventProp, DWORD *pdwSemanticsFlags) PURE;
450 STDMETHOD (GetClassLayout) (THIS_ mdTypeDef td, DWORD *pdwPackSize, COR_FIELD_OFFSET rFieldOffset[], ULONG cMax, ULONG *pcFieldOffset, ULONG *pulClassSize) PURE;
451 STDMETHOD (GetFieldMarshal) (THIS_ mdToken tk, PCCOR_SIGNATURE *ppvNativeType, ULONG *pcbNativeType) PURE;
452 STDMETHOD (GetRVA) (THIS_ mdToken tk, ULONG *pulCodeRVA, DWORD *pdwImplFlags) PURE;
453 STDMETHOD (GetPermissionSetProps) (THIS_ mdPermission pm, DWORD *pdwAction, void const **ppvPermission, ULONG *pcbPermission) PURE;
454 STDMETHOD (GetSigFromToken) (THIS_ mdSignature mdSig, PCCOR_SIGNATURE *ppvSig, ULONG *pcbSig) PURE;
455 STDMETHOD (GetModuleRefProps) (THIS_ mdModuleRef mur, LPWSTR szName, ULONG cchName, ULONG *pchName) PURE;
456 STDMETHOD (EnumModuleRefs) (THIS_ HCORENUM *phEnum, mdModuleRef rModuleRefs[], ULONG cmax, ULONG *pcModuleRefs) PURE;
457 STDMETHOD (GetTypeSpecFromToken) (THIS_ mdTypeSpec typespec, PCCOR_SIGNATURE *ppvSig, ULONG *pcbSig) PURE;
458 STDMETHOD (GetNameFromToken) (THIS_ mdToken tk, MDUTF8CSTR *pszUtf8NamePtr) PURE;
459 STDMETHOD (EnumUnresolvedMethods) (THIS_ HCORENUM *phEnum, mdToken rMethods[], ULONG cMax, ULONG *pcTokens) PURE;
460 STDMETHOD (GetUserString) (THIS_ mdString stk, LPWSTR szString, ULONG cchString, ULONG *pchString) PURE;
461 STDMETHOD (GetPinvokeMap) (THIS_ mdToken tk, DWORD *pdwMappingFlags, LPWSTR szImportName, ULONG cchImportName, ULONG *pchImportName, mdModuleRef *pmrImportDLL) PURE;
462 STDMETHOD (EnumSignatures) (THIS_ HCORENUM *phEnum, mdSignature rSignatures[], ULONG cmax, ULONG *pcSignatures) PURE;
463 STDMETHOD (EnumTypeSpecs) (THIS_ HCORENUM *phEnum, mdTypeSpec rTypeSpecs[], ULONG cmax, ULONG *pcTypeSpecs) PURE;
464 STDMETHOD (EnumUserStrings) (THIS_ HCORENUM *phEnum, mdString rStrings[], ULONG cmax, ULONG *pcStrings) PURE;
465 STDMETHOD (GetParamForMethodIndex) (THIS_ mdMethodDef md, ULONG ulParamSeq, mdParamDef *ppd) PURE;
466 STDMETHOD (EnumCustomAttributes) (THIS_ HCORENUM *phEnum, mdToken tk, mdToken tkType, mdCustomAttribute rCustomAttributes[], ULONG cMax, ULONG *pcCustomAttributes) PURE;
467 STDMETHOD (GetCustomAttributeProps) (THIS_ mdCustomAttribute cv, mdToken *ptkObj, mdToken *ptkType, void const **ppBlob, ULONG *pcbSize) PURE;
468 STDMETHOD (FindTypeRef) (THIS_ mdToken tkResolutionScope, LPCWSTR szName, mdTypeRef *ptr) PURE;
469 STDMETHOD (GetMemberProps) (THIS_ mdToken mb, mdTypeDef *pClass, LPWSTR szMember, ULONG cchMember, ULONG *pchMember, DWORD *pdwAttr, PCCOR_SIGNATURE *ppvSigBlob, ULONG *pcbSigBlob, ULONG *pulCodeRVA, DWORD *pdwImplFlags, DWORD *pdwCPlusTypeFlag, UVCP_CONSTANT *ppValue, ULONG *pcchValue) PURE;
470 STDMETHOD (GetFieldProps) (THIS_ mdFieldDef mb, mdTypeDef *pClass, LPWSTR szField, ULONG cchField, ULONG *pchField, DWORD *pdwAttr, PCCOR_SIGNATURE *ppvSigBlob, ULONG *pcbSigBlob, DWORD *pdwCPlusTypeFlag, UVCP_CONSTANT *ppValue, ULONG *pcchValue) PURE;
471 STDMETHOD (GetPropertyProps) (THIS_ mdProperty prop, mdTypeDef *pClass, LPCWSTR szProperty, ULONG cchProperty, ULONG *pchProperty, DWORD *pdwPropFlags, PCCOR_SIGNATURE *ppvSig, ULONG *pbSig, DWORD *pdwCPlusTypeFlag, UVCP_CONSTANT *ppDefaultValue, ULONG *pcchDefaultValue, mdMethodDef *pmdSetter, mdMethodDef *pmdGetter, mdMethodDef rmdOtherMethod[], ULONG cMax, ULONG *pcOtherMethod) PURE;
472 STDMETHOD (GetParamProps) (THIS_ mdParamDef tk, mdMethodDef *pmd, ULONG *pulSequence, LPWSTR szName, ULONG cchName, ULONG *pchName, DWORD *pdwAttr, DWORD *pdwCPlusTypeFlag, UVCP_CONSTANT *ppValue, ULONG *pcchValue) PURE;
473 STDMETHOD (GetCustomAttributeByName) (THIS_ mdToken tkObj, LPCWSTR szName, const void **ppData, ULONG *pcbData) PURE;
474 STDMETHOD_ (WINBOOL, IsValidToken) (THIS_ mdToken tk) PURE;
475 STDMETHOD (GetNestedClassProps) (THIS_ mdTypeDef tdNestedClass, mdTypeDef *ptdEnclosingClass) PURE;
476 STDMETHOD (GetNativeCallConvFromSig) (THIS_ void const *pvSig, ULONG cbSig, ULONG *pCallConv) PURE;
477 STDMETHOD (IsGlobal) (THIS_ mdToken pd, int *pbGlobal) PURE;
478 };
479
480#undef INTERFACE
481#define INTERFACE IMetaDataImport2
482 DECLARE_INTERFACE_ (IMetaDataImport2, IMetaDataImport) {
483#ifndef __cplusplus
484 /* IUnknown methods */
485 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
486 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
487 STDMETHOD_(ULONG, Release)(THIS) PURE;
488
489 /* IMetaDataImport */
490 STDMETHOD_ (void, CloseEnum) (THIS_ HCORENUM hEnum) PURE;
491 STDMETHOD (CountEnum) (THIS_ HCORENUM hEnum, ULONG *pulCount) PURE;
492 STDMETHOD (ResetEnum) (THIS_ HCORENUM hEnum, ULONG ulPos) PURE;
493 STDMETHOD (EnumTypeDefs) (THIS_ HCORENUM *phEnum, mdTypeDef rTypeDefs[], ULONG cMax, ULONG *pcTypeDefs) PURE;
494 STDMETHOD (EnumInterfaceImpls) (THIS_ HCORENUM *phEnum, mdTypeDef td, mdInterfaceImpl rImpls[], ULONG cMax, ULONG *pcImpls) PURE;
495 STDMETHOD (EnumTypeRefs) (THIS_ HCORENUM *phEnum, mdTypeRef rTypeRefs[], ULONG cMax, ULONG *pcTypeRefs) PURE;
496 STDMETHOD (FindTypeDefByName) (THIS_ LPCWSTR szTypeDef, mdToken tkEnclosingClass, mdTypeDef *ptd) PURE;
497 STDMETHOD (GetScopeProps) (THIS_ LPWSTR szName, ULONG cchName, ULONG *pchName, GUID *pmvid) PURE;
498 STDMETHOD (GetModuleFromScope) (THIS_ mdModule *pmd) PURE;
499 STDMETHOD (GetTypeDefProps) (THIS_ mdTypeDef td, LPWSTR szTypeDef, ULONG cchTypeDef, ULONG *pchTypeDef, DWORD *pdwTypeDefFlags, mdToken *ptkExtends) PURE;
500 STDMETHOD (GetInterfaceImplProps) (THIS_ mdInterfaceImpl iiImpl, mdTypeDef *pClass, mdToken *ptkIface) PURE;
501 STDMETHOD (GetTypeRefProps) (THIS_ mdTypeRef tr, mdToken *ptkResolutionScope, LPWSTR szName, ULONG cchName, ULONG *pchName) PURE;
502 STDMETHOD (ResolveTypeRef) (THIS_ mdTypeRef tr, REFIID riid, IUnknown **ppIScope, mdTypeDef *ptd) PURE;
503 STDMETHOD (EnumMembers) (THIS_ HCORENUM *phEnum, mdTypeDef cl, mdToken rMembers[], ULONG cMax, ULONG *pcTokens) PURE;
504 STDMETHOD (EnumMembersWithName) (THIS_ HCORENUM *phEnum, mdTypeDef cl, LPCWSTR szName, mdToken rMembers[], ULONG cMax, ULONG *pcTokens) PURE;
505 STDMETHOD (EnumMethods) (THIS_ HCORENUM *phEnum, mdTypeDef cl, mdMethodDef rMethods[], ULONG cMax, ULONG *pcTokens) PURE;
506 STDMETHOD (EnumMethodsWithName) (THIS_ HCORENUM *phEnum, mdTypeDef cl, LPCWSTR szName, mdMethodDef rMethods[], ULONG cMax, ULONG *pcTokens) PURE;
507 STDMETHOD (EnumFields) (THIS_ HCORENUM *phEnum, mdTypeDef cl, mdFieldDef rFields[], ULONG cMax, ULONG *pcTokens) PURE;
508 STDMETHOD (EnumFieldsWithName) (THIS_ HCORENUM *phEnum, mdTypeDef cl, LPCWSTR szName, mdFieldDef rFields[], ULONG cMax, ULONG *pcTokens) PURE;
509 STDMETHOD (EnumParams) (THIS_ HCORENUM *phEnum, mdMethodDef mb, mdParamDef rParams[], ULONG cMax, ULONG *pcTokens) PURE;
510 STDMETHOD (EnumMemberRefs) (THIS_ HCORENUM *phEnum, mdToken tkParent, mdMemberRef rMemberRefs[], ULONG cMax, ULONG *pcTokens) PURE;
511 STDMETHOD (EnumMethodImpls) (THIS_ HCORENUM *phEnum, mdTypeDef td, mdToken rMethodBody[], mdToken rMethodDecl[], ULONG cMax, ULONG *pcTokens) PURE;
512 STDMETHOD (EnumPermissionSets) (THIS_ HCORENUM *phEnum, mdToken tk, DWORD dwActions, mdPermission rPermission[], ULONG cMax, ULONG *pcTokens) PURE;
513 STDMETHOD (FindMember) (THIS_ mdTypeDef td, LPCWSTR szName, PCCOR_SIGNATURE pvSigBlob, ULONG cbSigBlob, mdToken *pmb) PURE;
514 STDMETHOD (FindMethod) (THIS_ mdTypeDef td, LPCWSTR szName, PCCOR_SIGNATURE pvSigBlob, ULONG cbSigBlob, mdMethodDef *pmb) PURE;
515 STDMETHOD (FindField) (THIS_ mdTypeDef td, LPCWSTR szName, PCCOR_SIGNATURE pvSigBlob, ULONG cbSigBlob, mdFieldDef *pmb) PURE;
516 STDMETHOD (FindMemberRef) (THIS_ mdTypeRef td, LPCWSTR szName, PCCOR_SIGNATURE pvSigBlob, ULONG cbSigBlob, mdMemberRef *pmr) PURE;
517 STDMETHOD (GetMethodProps) (THIS_ mdMethodDef mb, mdTypeDef *pClass, LPWSTR szMethod, ULONG cchMethod, ULONG *pchMethod, DWORD *pdwAttr, PCCOR_SIGNATURE *ppvSigBlob, ULONG *pcbSigBlob, ULONG *pulCodeRVA, DWORD *pdwImplFlags) PURE;
518 STDMETHOD (GetMemberRefProps) (THIS_ mdMemberRef mr, mdToken *ptk, LPWSTR szMember, ULONG cchMember, ULONG *pchMember, PCCOR_SIGNATURE *ppvSigBlob, ULONG *pbSig) PURE;
519 STDMETHOD (EnumProperties) (THIS_ HCORENUM *phEnum, mdTypeDef td, mdProperty rProperties[], ULONG cMax, ULONG *pcProperties) PURE;
520 STDMETHOD (EnumEvents) (THIS_ HCORENUM *phEnum, mdTypeDef td, mdEvent rEvents[], ULONG cMax, ULONG *pcEvents) PURE;
521 STDMETHOD (GetEventProps) (THIS_ mdEvent ev, mdTypeDef *pClass, LPCWSTR szEvent, ULONG cchEvent, ULONG *pchEvent, DWORD *pdwEventFlags, mdToken *ptkEventType, mdMethodDef *pmdAddOn, mdMethodDef *pmdRemoveOn, mdMethodDef *pmdFire, mdMethodDef rmdOtherMethod[], ULONG cMax, ULONG *pcOtherMethod) PURE;
522 STDMETHOD (EnumMethodSemantics) (THIS_ HCORENUM *phEnum, mdMethodDef mb, mdToken rEventProp[], ULONG cMax, ULONG *pcEventProp) PURE;
523 STDMETHOD (GetMethodSemantics) (THIS_ mdMethodDef mb, mdToken tkEventProp, DWORD *pdwSemanticsFlags) PURE;
524 STDMETHOD (GetClassLayout) (THIS_ mdTypeDef td, DWORD *pdwPackSize, COR_FIELD_OFFSET rFieldOffset[], ULONG cMax, ULONG *pcFieldOffset, ULONG *pulClassSize) PURE;
525 STDMETHOD (GetFieldMarshal) (THIS_ mdToken tk, PCCOR_SIGNATURE *ppvNativeType, ULONG *pcbNativeType) PURE;
526 STDMETHOD (GetRVA) (THIS_ mdToken tk, ULONG *pulCodeRVA, DWORD *pdwImplFlags) PURE;
527 STDMETHOD (GetPermissionSetProps) (THIS_ mdPermission pm, DWORD *pdwAction, void const **ppvPermission, ULONG *pcbPermission) PURE;
528 STDMETHOD (GetSigFromToken) (THIS_ mdSignature mdSig, PCCOR_SIGNATURE *ppvSig, ULONG *pcbSig) PURE;
529 STDMETHOD (GetModuleRefProps) (THIS_ mdModuleRef mur, LPWSTR szName, ULONG cchName, ULONG *pchName) PURE;
530 STDMETHOD (EnumModuleRefs) (THIS_ HCORENUM *phEnum, mdModuleRef rModuleRefs[], ULONG cmax, ULONG *pcModuleRefs) PURE;
531 STDMETHOD (GetTypeSpecFromToken) (THIS_ mdTypeSpec typespec, PCCOR_SIGNATURE *ppvSig, ULONG *pcbSig) PURE;
532 STDMETHOD (GetNameFromToken) (THIS_ mdToken tk, MDUTF8CSTR *pszUtf8NamePtr) PURE;
533 STDMETHOD (EnumUnresolvedMethods) (THIS_ HCORENUM *phEnum, mdToken rMethods[], ULONG cMax, ULONG *pcTokens) PURE;
534 STDMETHOD (GetUserString) (THIS_ mdString stk, LPWSTR szString, ULONG cchString, ULONG *pchString) PURE;
535 STDMETHOD (GetPinvokeMap) (THIS_ mdToken tk, DWORD *pdwMappingFlags, LPWSTR szImportName, ULONG cchImportName, ULONG *pchImportName, mdModuleRef *pmrImportDLL) PURE;
536 STDMETHOD (EnumSignatures) (THIS_ HCORENUM *phEnum, mdSignature rSignatures[], ULONG cmax, ULONG *pcSignatures) PURE;
537 STDMETHOD (EnumTypeSpecs) (THIS_ HCORENUM *phEnum, mdTypeSpec rTypeSpecs[], ULONG cmax, ULONG *pcTypeSpecs) PURE;
538 STDMETHOD (EnumUserStrings) (THIS_ HCORENUM *phEnum, mdString rStrings[], ULONG cmax, ULONG *pcStrings) PURE;
539 STDMETHOD (GetParamForMethodIndex) (THIS_ mdMethodDef md, ULONG ulParamSeq, mdParamDef *ppd) PURE;
540 STDMETHOD (EnumCustomAttributes) (THIS_ HCORENUM *phEnum, mdToken tk, mdToken tkType, mdCustomAttribute rCustomAttributes[], ULONG cMax, ULONG *pcCustomAttributes) PURE;
541 STDMETHOD (GetCustomAttributeProps) (THIS_ mdCustomAttribute cv, mdToken *ptkObj, mdToken *ptkType, void const **ppBlob, ULONG *pcbSize) PURE;
542 STDMETHOD (FindTypeRef) (THIS_ mdToken tkResolutionScope, LPCWSTR szName, mdTypeRef *ptr) PURE;
543 STDMETHOD (GetMemberProps) (THIS_ mdToken mb, mdTypeDef *pClass, LPWSTR szMember, ULONG cchMember, ULONG *pchMember, DWORD *pdwAttr, PCCOR_SIGNATURE *ppvSigBlob, ULONG *pcbSigBlob, ULONG *pulCodeRVA, DWORD *pdwImplFlags, DWORD *pdwCPlusTypeFlag, UVCP_CONSTANT *ppValue, ULONG *pcchValue) PURE;
544 STDMETHOD (GetFieldProps) (THIS_ mdFieldDef mb, mdTypeDef *pClass, LPWSTR szField, ULONG cchField, ULONG *pchField, DWORD *pdwAttr, PCCOR_SIGNATURE *ppvSigBlob, ULONG *pcbSigBlob, DWORD *pdwCPlusTypeFlag, UVCP_CONSTANT *ppValue, ULONG *pcchValue) PURE;
545 STDMETHOD (GetPropertyProps) (THIS_ mdProperty prop, mdTypeDef *pClass, LPCWSTR szProperty, ULONG cchProperty, ULONG *pchProperty, DWORD *pdwPropFlags, PCCOR_SIGNATURE *ppvSig, ULONG *pbSig, DWORD *pdwCPlusTypeFlag, UVCP_CONSTANT *ppDefaultValue, ULONG *pcchDefaultValue, mdMethodDef *pmdSetter, mdMethodDef *pmdGetter, mdMethodDef rmdOtherMethod[], ULONG cMax, ULONG *pcOtherMethod) PURE;
546 STDMETHOD (GetParamProps) (THIS_ mdParamDef tk, mdMethodDef *pmd, ULONG *pulSequence, LPWSTR szName, ULONG cchName, ULONG *pchName, DWORD *pdwAttr, DWORD *pdwCPlusTypeFlag, UVCP_CONSTANT *ppValue, ULONG *pcchValue) PURE;
547 STDMETHOD (GetCustomAttributeByName) (THIS_ mdToken tkObj, LPCWSTR szName, const void **ppData, ULONG *pcbData) PURE;
548 STDMETHOD_ (WINBOOL, IsValidToken) (THIS_ mdToken tk) PURE;
549 STDMETHOD (GetNestedClassProps) (THIS_ mdTypeDef tdNestedClass, mdTypeDef *ptdEnclosingClass) PURE;
550 STDMETHOD (GetNativeCallConvFromSig) (THIS_ void const *pvSig, ULONG cbSig, ULONG *pCallConv) PURE;
551 STDMETHOD (IsGlobal) (THIS_ mdToken pd, int *pbGlobal) PURE;
552#endif
553 /* IMetaDataImport2 */
554 STDMETHOD (EnumGenericParams) (THIS_ HCORENUM *phEnum, mdToken tk, mdGenericParam rGenericParams[], ULONG cMax, ULONG *pcGenericParams) PURE;
555 STDMETHOD (GetGenericParamProps) (THIS_ mdGenericParam gp, ULONG *pulParamSeq, DWORD *pdwParamFlags, mdToken *ptOwner, DWORD *reserved, LPWSTR wzname, ULONG cchName, ULONG *pchName) PURE;
556 STDMETHOD (GetMethodSpecProps) (THIS_ mdMethodSpec mi, mdToken *tkParent, PCCOR_SIGNATURE *ppvSigBlob, ULONG *pcbSigBlob) PURE;
557 STDMETHOD (EnumGenericParamConstraints) (THIS_ HCORENUM *phEnum, mdGenericParam tk, mdGenericParamConstraint rGenericParamConstraints[], ULONG cMax, ULONG *pcGenericParamConstraints) PURE;
558 STDMETHOD (GetGenericParamConstraintProps) (THIS_ mdGenericParamConstraint gpc, mdGenericParam *ptGenericParam, mdToken *ptkConstraintType) PURE;
559 STDMETHOD (GetPEKind) (THIS_ DWORD *pdwPEKind, DWORD *pdwMAchine) PURE;
560 STDMETHOD (GetVersionString) (THIS_ LPWSTR pwzBuf, DWORD ccBufSize, DWORD *pccBufSize) PURE;
561 STDMETHOD (EnumMethodSpecs) (THIS_ HCORENUM *phEnum, mdToken tk, mdMethodSpec rMethodSpecs[], ULONG cMax, ULONG *pcMethodSpecs) PURE;
562 };
563
564#undef INTERFACE
565#define INTERFACE IMetaDataFilter
566 DECLARE_INTERFACE_ (IMetaDataFilter, IUnknown) {
567#ifndef __cplusplus
568 /* IUnknown methods */
569 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
570 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
571 STDMETHOD_(ULONG, Release)(THIS) PURE;
572#endif
573 /* IMetaDataFilter */
574 STDMETHOD (UnmarkAll) (THIS) PURE;
575 STDMETHOD (MarkToken) (THIS_ mdToken tk) PURE;
576 STDMETHOD (IsTokenMarked) (THIS_ mdToken tk, WINBOOL *pIsMarked) PURE;
577 };
578
579#undef INTERFACE
580#define INTERFACE IHostFilter
581 DECLARE_INTERFACE_ (IHostFilter, IUnknown) {
582#ifndef __cplusplus
583 /* IUnknown methods */
584 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
585 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
586 STDMETHOD_(ULONG, Release)(THIS) PURE;
587#endif
588 /* IHostFilter */
589 STDMETHOD (MarkToken) (THIS_ mdToken tk) PURE;
590 };
591
592#undef INTERFACE
593#define INTERFACE IMetaDataAssemblyEmit
594 DECLARE_INTERFACE_ (IMetaDataAssemblyEmit, IUnknown) {
595#ifndef __cplusplus
596 /* IUnknown methods */
597 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
598 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
599 STDMETHOD_(ULONG, Release)(THIS) PURE;
600#endif
601 /* IMetaDataAssemblyEmit */
602 STDMETHOD (DefineAssembly) (THIS_ const void *pbPublicKey, ULONG cbPublicKey, ULONG ulHashAlgId, LPCWSTR szName, const ASSEMBLYMETADATA *pMetaData, DWORD dwAssemblyFlags, mdAssembly *pma) PURE;
603 STDMETHOD (DefineAssemblyRef) (THIS_ const void *pbPublicKeyOrToken, ULONG cbPublicKeyOrToken, LPCWSTR szName, const ASSEMBLYMETADATA *pMetaData, const void *pbHashValue, ULONG cbHashValue, DWORD dwAssemblyRefFlags, mdAssemblyRef *pmdar) PURE;
604 STDMETHOD (DefineFile) (THIS_ LPCWSTR szName, const void *pbHashValue, ULONG cbHashValue, DWORD dwFileFlags, mdFile *pmdf) PURE;
605 STDMETHOD (DefineExportedType) (THIS_ LPCWSTR szName, mdToken tkImplementation, mdTypeDef tkTypeDef, DWORD dwExportedTypeFlags, mdExportedType *pmdct) PURE;
606 STDMETHOD (DefineManifestResource) (THIS_ LPCWSTR szName, mdToken tkImplementation, DWORD dwOffset, DWORD dwResourceFlags, mdManifestResource *pmdmr) PURE;
607 STDMETHOD (SetAssemblyProps) (THIS_ mdAssembly pma, const void *pbPublicKey, ULONG cbPublicKey, ULONG ulHashAlgId, LPCWSTR szName, const ASSEMBLYMETADATA *pMetaData, DWORD dwAssemblyFlags) PURE;
608 STDMETHOD (SetAssemblyRefProps) (THIS_ mdAssemblyRef ar, const void *pbPublicKeyOrToken, ULONG cbPublicKeyOrToken, LPCWSTR szName, const ASSEMBLYMETADATA *pMetaData, const void *pbHashValue, ULONG cbHashValue, DWORD dwAssemblyRefFlags) PURE;
609 STDMETHOD (SetFileProps) (THIS_ mdFile file, const void *pbHashValue, ULONG cbHashValue, DWORD dwFileFlags) PURE;
610 STDMETHOD (SetExportedTypeProps) (THIS_ mdExportedType ct, mdToken tkImplementation, mdTypeDef tkTypeDef, DWORD dwExportedTypeFlags) PURE;
611 STDMETHOD (SetManifestResourceProps) (THIS_ mdManifestResource mr, mdToken tkImplementation, DWORD dwOffset, DWORD dwResourceFlags) PURE;
612 };
613
614#undef INTERFACE
615#define INTERFACE IMetaDataAssemblyImport
616 DECLARE_INTERFACE_ (IMetaDataAssemblyImport, IUnknown) {
617#ifndef __cplusplus
618 /* IUnknown methods */
619 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
620 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
621 STDMETHOD_(ULONG, Release)(THIS) PURE;
622#endif
623 /* IMetaDataAssemblyImport */
624 STDMETHOD (GetAssemblyProps) (THIS_ mdAssembly mda, const void **ppbPublicKey, ULONG *pcbPublicKey, ULONG *pulHashAlgId, LPWSTR szName, ULONG cchName, ULONG *pchName, ASSEMBLYMETADATA *pMetaData, DWORD *pdwAssemblyFlags) PURE;
625 STDMETHOD (GetAssemblyRefProps) (THIS_ mdAssemblyRef mdar, const void **ppbPublicKeyOrToken, ULONG *pcbPublicKeyOrToken, LPWSTR szName, ULONG cchName, ULONG *pchName, ASSEMBLYMETADATA *pMetaData, const void **ppbHashValue, ULONG *pcbHashValue, DWORD *pdwAssemblyRefFlags) PURE;
626 STDMETHOD (GetFileProps) (THIS_ mdFile mdf, LPWSTR szName, ULONG cchName, ULONG *pchName, const void **ppbHashValue, ULONG *pcbHashValue, DWORD *pdwFileFlags) PURE;
627 STDMETHOD (GetExportedTypeProps) (THIS_ mdExportedType mdct, LPWSTR szName, ULONG cchName, ULONG *pchName, mdToken *ptkImplementation, mdTypeDef *ptkTypeDef, DWORD *pdwExportedTypeFlags) PURE;
628 STDMETHOD (GetManifestResourceProps) (THIS_ mdManifestResource mdmr, LPWSTR szName, ULONG cchName, ULONG *pchName, mdToken *ptkImplementation, DWORD *pdwOffset, DWORD *pdwResourceFlags) PURE;
629 STDMETHOD (EnumAssemblyRefs) (THIS_ HCORENUM *phEnum, mdAssemblyRef rAssemblyRefs[], ULONG cMax, ULONG *pcTokens) PURE;
630 STDMETHOD (EnumFiles) (THIS_ HCORENUM *phEnum, mdFile rFiles[], ULONG cMax, ULONG *pcTokens) PURE;
631 STDMETHOD (EnumExportedTypes) (THIS_ HCORENUM *phEnum, mdExportedType rExportedTypes[], ULONG cMax, ULONG *pcTokens) PURE;
632 STDMETHOD (EnumManifestResources) (THIS_ HCORENUM *phEnum, mdManifestResource rManifestResources[], ULONG cMax, ULONG *pcTokens) PURE;
633 STDMETHOD (GetAssemblyFromScope) (THIS_ mdAssembly *ptkAssembly) PURE;
634 STDMETHOD (FindExportedTypeByName) (THIS_ LPCWSTR szName, mdToken mdtExportedType, mdExportedType *ptkExportedType) PURE;
635 STDMETHOD (FindManifestResourceByName) (THIS_ LPCWSTR szName, mdManifestResource *ptkManifestResource) PURE;
636 STDMETHOD_ (void, CloseEnum) (THIS_ HCORENUM hEnum) PURE;
637 STDMETHOD (FindAssembliesByName) (THIS_ LPCWSTR szAppBase, LPCWSTR szPrivateBin, LPCWSTR szAssemblyName, IUnknown *ppIUnk[], ULONG cMax, ULONG *pcAssemblies) PURE;
638 };
639
640 typedef enum {
641 ValidatorModuleTypeInvalid = 0x0,
642 ValidatorModuleTypeMin = 0x00000001,
643 ValidatorModuleTypePE = 0x00000001,
644 ValidatorModuleTypeObj = 0x00000002,
645 ValidatorModuleTypeEnc = 0x00000003,
646 ValidatorModuleTypeIncr = 0x00000004,
647 ValidatorModuleTypeMax = 0x00000004,
648 } CorValidatorModuleType;
649
650#undef INTERFACE
651#define INTERFACE IMetaDataValidate
652 DECLARE_INTERFACE_ (IMetaDataValidate, IUnknown) {
653#ifndef __cplusplus
654 /* IUnknown methods */
655 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
656 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
657 STDMETHOD_(ULONG, Release)(THIS) PURE;
658#endif
659 /* IMetaDataValidate */
660 STDMETHOD (ValidatorInit) (THIS_ DWORD dwModuleType, IUnknown *pUnk) PURE;
661 STDMETHOD (ValidateMetaData) (THIS) PURE;
662 };
663
664#undef INTERFACE
665#define INTERFACE IMetaDataDispenserEx
666 DECLARE_INTERFACE_ (IMetaDataDispenserEx, IMetaDataDispenser) {
667#ifndef __cplusplus
668 /* IUnknown methods */
669 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
670 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
671 STDMETHOD_(ULONG, Release)(THIS) PURE;
672
673 /* IMetaDataDispenser */
674 STDMETHOD (DefineScope) (THIS_ REFCLSID rclsid, DWORD dwCreateFlags, REFIID riid, IUnknown **ppIUnk) PURE;
675 STDMETHOD (OpenScope) (THIS_ LPCWSTR szScope, DWORD dwOpenFlags, REFIID riid, IUnknown **ppIUnk) PURE;
676 STDMETHOD (OpenScopeOnMemory) (THIS_ LPCVOID pData, ULONG cbData, DWORD dwOpenFlags, REFIID riid, IUnknown **ppIUnk) PURE;
677#endif
678 /* IMetaDataDispenserEx */
679 STDMETHOD (SetOption) (THIS_ REFGUID optionid, const VARIANT *value) PURE;
680 STDMETHOD (GetOption) (THIS_ REFGUID optionid, VARIANT *pvalue) PURE;
681 STDMETHOD (OpenScopeOnITypeInfo) (THIS_ ITypeInfo *pITI, DWORD dwOpenFlags, REFIID riid, IUnknown **ppIUnk) PURE;
682 STDMETHOD (GetCORSystemDirectory) (THIS_ LPWSTR szBuffer, DWORD cchBuffer, DWORD *pchBuffer) PURE;
683 STDMETHOD (FindAssembly) (THIS_ LPCWSTR szAppBase, LPCWSTR szPrivateBin, LPCWSTR szGlobalBin, LPCWSTR szAssemblyName, LPCWSTR szName, ULONG cchName, ULONG *pcName) PURE;
684 STDMETHOD (FindAssemblyModule) (THIS_ LPCWSTR szAppBase, LPCWSTR szPrivateBin, LPCWSTR szGlobalBin, LPCWSTR szAssemblyName, LPCWSTR szModuleName, LPWSTR szName, ULONG cchName, ULONG *pcName) PURE;
685 };
686
687#undef INTERFACE
688#define INTERFACE ICeeGen
689 DECLARE_INTERFACE_ (ICeeGen, IUnknown) {
690#ifndef __cplusplus
691 /* IUnknown methods */
692 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
693 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
694 STDMETHOD_(ULONG, Release)(THIS) PURE;
695#endif
696 /* ICeeGen */
697 STDMETHOD (EmitString) (THIS_ LPWSTR lpString, ULONG *RVA) PURE;
698 STDMETHOD (GetString) (THIS_ ULONG RVA, LPWSTR *lpString) PURE;
699 STDMETHOD (AllocateMethodBuffer) (THIS_ ULONG cchBuffer, UCHAR **lpBuffer, ULONG *RVA) PURE;
700 STDMETHOD (GetMethodBuffer) (THIS_ ULONG RVA, UCHAR **lpBuffer) PURE;
701 STDMETHOD (GetIMapTokenIface) (THIS_ IUnknown **pIMapToken) PURE;
702 STDMETHOD (GenerateCeeFile) (THIS) PURE;
703 STDMETHOD (GetIlSection) (THIS_ HCEESECTION *section) PURE;
704 STDMETHOD (GetStringSection) (THIS_ HCEESECTION *section) PURE;
705 STDMETHOD (AddSectionReloc) (THIS_ HCEESECTION section, ULONG offset, HCEESECTION relativeTo, CeeSectionRelocType relocType) PURE;
706 STDMETHOD (GetSectionCreate) (THIS_ const char *name, DWORD flags, HCEESECTION *section) PURE;
707 STDMETHOD (GetSectionDataLen) (THIS_ HCEESECTION section, ULONG *dataLen) PURE;
708 STDMETHOD (GetSectionBlock) (THIS_ HCEESECTION section, ULONG len, ULONG align
709#ifdef __cplusplus
710 = 1
711#endif
712 , void **ppBytes
713#ifdef __cplusplus
714 = 0
715#endif
716 ) PURE;
717 STDMETHOD (TruncateSection) (THIS_ HCEESECTION section, ULONG len) PURE;
718 STDMETHOD (GenerateCeeMemoryImage) (THIS_ void **ppImage) PURE;
719 STDMETHOD (ComputePointer) (THIS_ HCEESECTION section, ULONG RVA, UCHAR **lpBuffer) PURE;
720 };
721
722#undef INTERFACE
723#define INTERFACE IMetaDataTables
724 DECLARE_INTERFACE_ (IMetaDataTables, IUnknown) {
725#ifndef __cplusplus
726 /* IUnknown methods */
727 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
728 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
729 STDMETHOD_(ULONG, Release)(THIS) PURE;
730#endif
731 /* IMetaDataTables */
732 STDMETHOD (GetStringHeapSize) (THIS_ ULONG *pcbStrings) PURE;
733 STDMETHOD (GetBlobHeapSize) (THIS_ ULONG *pcbBlobs) PURE;
734 STDMETHOD (GetGuidHeapSize) (THIS_ ULONG *pcbGuids) PURE;
735 STDMETHOD (GetUserStringHeapSize) (THIS_ ULONG *pcbBlobs) PURE;
736 STDMETHOD (GetNumTables) (THIS_ ULONG *pcTables) PURE;
737 STDMETHOD (GetTableIndex) (THIS_ ULONG token, ULONG *pixTbl) PURE;
738 STDMETHOD (GetTableInfo) (THIS_ ULONG ixTbl, ULONG *pcbRow, ULONG *pcRows, ULONG *pcCols, ULONG *piKey, const char **ppName) PURE;
739 STDMETHOD (GetColumnInfo) (THIS_ ULONG ixTbl, ULONG ixCol, ULONG *poCol, ULONG *pcbCol, ULONG *pType, const char **ppName) PURE;
740 STDMETHOD (GetCodedTokenInfo) (THIS_ ULONG ixCdTkn, ULONG *pcTokens, ULONG **ppTokens, const char **ppName) PURE;
741 STDMETHOD (GetRow) (THIS_ ULONG ixTbl, ULONG rid, void **ppRow) PURE;
742 STDMETHOD (GetColumn) (THIS_ ULONG ixTbl, ULONG ixCol, ULONG rid, ULONG *pVal) PURE;
743 STDMETHOD (GetString) (THIS_ ULONG ixString, const char **ppString) PURE;
744 STDMETHOD (GetBlob) (THIS_ ULONG ixBlob, ULONG *pcbData, const void **ppData) PURE;
745 STDMETHOD (GetGuid) (THIS_ ULONG ixGuid, const GUID **ppGUID) PURE;
746 STDMETHOD (GetUserString) (THIS_ ULONG ixUserString, ULONG *pcbData, const void **ppData) PURE;
747 STDMETHOD (GetNextString) (THIS_ ULONG ixString, ULONG *pNext) PURE;
748 STDMETHOD (GetNextBlob) (THIS_ ULONG ixBlob, ULONG *pNext) PURE;
749 STDMETHOD (GetNextGuid) (THIS_ ULONG ixGuid, ULONG *pNext) PURE;
750 STDMETHOD (GetNextUserString) (THIS_ ULONG ixUserString, ULONG *pNext) PURE;
751 };
752
753#undef INTERFACE
754#define INTERFACE IMetaDataTables2
755 DECLARE_INTERFACE_ (IMetaDataTables2, IMetaDataTables) {
756#ifndef __cplusplus
757 /* IUnknown methods */
758 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
759 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
760 STDMETHOD_(ULONG, Release)(THIS) PURE;
761
762 /* IMetaDataTables */
763 STDMETHOD (GetStringHeapSize) (THIS_ ULONG *pcbStrings) PURE;
764 STDMETHOD (GetBlobHeapSize) (THIS_ ULONG *pcbBlobs) PURE;
765 STDMETHOD (GetGuidHeapSize) (THIS_ ULONG *pcbGuids) PURE;
766 STDMETHOD (GetUserStringHeapSize) (THIS_ ULONG *pcbBlobs) PURE;
767 STDMETHOD (GetNumTables) (THIS_ ULONG *pcTables) PURE;
768 STDMETHOD (GetTableIndex) (THIS_ ULONG token, ULONG *pixTbl) PURE;
769 STDMETHOD (GetTableInfo) (THIS_ ULONG ixTbl, ULONG *pcbRow, ULONG *pcRows, ULONG *pcCols, ULONG *piKey, const char **ppName) PURE;
770 STDMETHOD (GetColumnInfo) (THIS_ ULONG ixTbl, ULONG ixCol, ULONG *poCol, ULONG *pcbCol, ULONG *pType, const char **ppName) PURE;
771 STDMETHOD (GetCodedTokenInfo) (THIS_ ULONG ixCdTkn, ULONG *pcTokens, ULONG **ppTokens, const char **ppName) PURE;
772 STDMETHOD (GetRow) (THIS_ ULONG ixTbl, ULONG rid, void **ppRow) PURE;
773 STDMETHOD (GetColumn) (THIS_ ULONG ixTbl, ULONG ixCol, ULONG rid, ULONG *pVal) PURE;
774 STDMETHOD (GetString) (THIS_ ULONG ixString, const char **ppString) PURE;
775 STDMETHOD (GetBlob) (THIS_ ULONG ixBlob, ULONG *pcbData, const void **ppData) PURE;
776 STDMETHOD (GetGuid) (THIS_ ULONG ixGuid, const GUID **ppGUID) PURE;
777 STDMETHOD (GetUserString) (THIS_ ULONG ixUserString, ULONG *pcbData, const void **ppData) PURE;
778 STDMETHOD (GetNextString) (THIS_ ULONG ixString, ULONG *pNext) PURE;
779 STDMETHOD (GetNextBlob) (THIS_ ULONG ixBlob, ULONG *pNext) PURE;
780 STDMETHOD (GetNextGuid) (THIS_ ULONG ixGuid, ULONG *pNext) PURE;
781 STDMETHOD (GetNextUserString) (THIS_ ULONG ixUserString, ULONG *pNext) PURE;
782#endif
783 /* IMetaDataTables2 */
784 STDMETHOD (GetMetaDataStorage) (THIS_ const void **ppvMd, ULONG *pcbMd) PURE;
785 STDMETHOD (GetMetaDataStreamInfo) (THIS_ ULONG ix, const char **ppchName, const void **ppv, ULONG *pcb) PURE;
786 };
787
788#undef INTERFACE
789#define INTERFACE IMetaDataInfo
790 DECLARE_INTERFACE_ (IMetaDataInfo, IUnknown) {
791#ifndef __cplusplus
792 /* IUnknown methods */
793 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
794 STDMETHOD_(ULONG, AddRef)(THIS) PURE;
795 STDMETHOD_(ULONG, Release)(THIS) PURE;
796#endif
797 /* IMetaDataInfo */
798 STDMETHOD (GetFileMapping) (THIS_ const void **ppvData, ULONGLONG *pcbData, DWORD *pdwMappingType) PURE;
799 };
800
801#ifdef __cplusplus
802}
803
804enum {
805 SIGN_MASK_ONEBYTE = 0xffffffc0,
806 SIGN_MASK_TWOBYTE = 0xffffe000,
807 SIGN_MASK_FOURBYTE = 0xf0000000,
808};
809
810extern const mdToken __declspec (selectany) g_tkCorEncodeToken[4] = { mdtTypeDef, mdtTypeRef, mdtTypeSpec, mdtBaseType };
811
812FORCEINLINE int CorIsPrimitiveType (CorElementType et) {
813 return (et < ELEMENT_TYPE_PTR || et == ELEMENT_TYPE_I || et == ELEMENT_TYPE_U);
814}
815
816FORCEINLINE int CorIsModifierElementType (CorElementType et) {
817 return ((et == ELEMENT_TYPE_PTR || et == ELEMENT_TYPE_BYREF) ? 1 : (et & ELEMENT_TYPE_MODIFIER));
818}
819
820FORCEINLINE ULONG CorSigUncompressedDataSize (PCCOR_SIGNATURE d) {
821 return ((d[0] & 0x80) == 0 ? 1 : ((d[0] & 0x40) == 0 ? 2 : 4));
822}
823
824inline ULONG CorSigUncompressBigData (PCCOR_SIGNATURE &d) {
825 ULONG r;
826
827 if ((d[0] & 0xc0) == 0x80) {
828 r = (((ULONG) (d[0] & 0x3f)) << 8) | (ULONG) d[1];
829 d += 2;
830 }
831 else {
832 r = (((ULONG) (d[0] & 0x1f)) << 24) | (((ULONG) d[1]) << 16) | (((ULONG) d[2]) << 8) | ((ULONG) d[3]);
833 d += 4;
834 }
835 return r;
836}
837
838FORCEINLINE ULONG CorSigUncompressData (PCCOR_SIGNATURE &d) {
839 return (((d[0] & 0x80) == 0) ? *d++ : CorSigUncompressBigData (d));
840}
841
842FORCEINLINE ULONG CorSigUncompressCallingConv (PCCOR_SIGNATURE &d) { return *d++; }
843
844FORCEINLINE HRESULT CorSigUncompressCallingConv (PCCOR_SIGNATURE d, DWORD len, ULONG *pu) {
845 *pu = (len > 0 ? *d : 0);
846 return (len > 0 ? S_OK : META_E_BAD_SIGNATURE);
847}
848
849FORCEINLINE CorElementType CorSigUncompressElementType (PCCOR_SIGNATURE &d) { return (CorElementType) *d++; }
850
851inline HRESULT CorSigUncompressData (PCCOR_SIGNATURE d, DWORD len, ULONG *po, ULONG *plen) {
852 const BYTE *pb = reinterpret_cast<BYTE const *> (d);
853
854 if ((*pb & 0x80) == 0) {
855 if (len < 1) { *po = 0; *plen = 0; return META_E_BAD_SIGNATURE; }
856 *po = *pb;
857 *plen = 1;
858 } else if ((*pb & 0xc0) == 0x80) {
859 if (len < 2) { *po = 0; *plen = 0; return META_E_BAD_SIGNATURE; }
860 *po = (ULONG) (((pb[0] & 0x3f) << 8 | pb[1]));
861 *plen = 2;
862 } else if ((*pb & 0xe0) == 0xc0) {
863 if (len < 4) { *po = 0; *plen = 0; return META_E_BAD_SIGNATURE; }
864 *po = (ULONG) (((pb[0] & 0x1f) << 24 | pb[1] << 16 | pb[2] << 8 | pb[3]));
865 *plen = 4;
866 } else {
867 *po = 0; *plen = 0; return META_E_BAD_SIGNATURE;
868 }
869
870 return S_OK;
871}
872
873inline ULONG CorSigUncompressData (PCCOR_SIGNATURE d, ULONG *po) {
874 ULONG sz = 0;
875
876 if (FAILED (CorSigUncompressData (d, 0xff, po, &sz))) {
877 *po = 0;
878 return (ULONG)-1;
879 }
880
881 return sz;
882}
883
884inline mdToken CorSigUncompressToken (PCCOR_SIGNATURE &d) {
885 mdToken tk = CorSigUncompressData (d);
886
887 return TokenFromRid (tk >> 2, g_tkCorEncodeToken[tk & 0x3]);
888}
889
890inline ULONG CorSigUncompressToken (PCCOR_SIGNATURE d, mdToken *ptok) {
891 mdToken tk;
892 ULONG sz;
893
894 sz = CorSigUncompressData (d, (ULONG *) &tk);
895 *ptok = TokenFromRid (tk >> 2, g_tkCorEncodeToken[tk & 0x3]);
896
897 return sz;
898}
899
900inline HRESULT CorSigUncompressToken (PCCOR_SIGNATURE d, DWORD len, mdToken *t, DWORD *tlen) {
901 mdToken tk;
902 HRESULT hr = CorSigUncompressData (d, len, (ULONG *) &tk, tlen);
903
904 if (SUCCEEDED (hr)) {
905 tk = TokenFromRid (tk >> 2, g_tkCorEncodeToken[tk & 0x3]);
906 *t = tk;
907 }
908 else
909 *t = mdTokenNil;
910
911 return hr;
912}
913
914inline ULONG CorSigUncompressSignedInt (PCCOR_SIGNATURE d, int *pi) {
915 ULONG i, sz, iData;
916
917 if ((sz = CorSigUncompressData (d, &i)) == (ULONG) -1)
918 return sz;
919
920 if ((i & 1) == 0) {
921 *pi = (int) (i >> 1);
922 return sz;
923 }
924 i = i >> 1;
925 i |= (sz == 1 ? SIGN_MASK_ONEBYTE : (sz == 2 ? SIGN_MASK_TWOBYTE : SIGN_MASK_FOURBYTE));
926
927 *pi = (int) i;
928
929 return sz;
930}
931
932inline ULONG CorSigUncompressElementType (PCCOR_SIGNATURE d, CorElementType *et) {
933 *et = (CorElementType) (*d & 0x7f);
934 return 1;
935}
936
937inline ULONG CorSigCompressData (ULONG len, void *p) {
938 BYTE *pb = reinterpret_cast<BYTE *> (p);
939
940 if (len <= 0x7f) {
941 *pb = BYTE (len);
942 return 1;
943 }
944 if (len <= 0x3fff) {
945 pb[0] = BYTE ((len >> 8) | 0x80);
946 pb[1] = BYTE (len & 0xff);
947 return 2;
948 }
949 if (len <= 0x1fffffff) {
950 pb[0] = BYTE ((len >> 24) | 0xc0);
951 pb[1] = BYTE ((len >> 16) & 0xff);
952 pb[2] = BYTE ((len >> 8) & 0xff);
953 pb[3] = BYTE (len & 0xff);
954 return 4;
955 }
956 return (ULONG) -1;
957}
958
959inline ULONG CorSigCompressToken (mdToken tk, void *p) {
960 RID rid = RidFromToken (tk);
961 ULONG32 t = TypeFromToken (tk);
962
963 if (rid > 0x3ffffff)
964 return (ULONG) -1;
965 rid = (rid << 2);
966 if (t == g_tkCorEncodeToken[1])
967 rid |= 0x1;
968 else if (t == g_tkCorEncodeToken[2])
969 rid |= 0x2;
970 else if (t == g_tkCorEncodeToken[3])
971 rid |= 0x3;
972 return CorSigCompressData ((ULONG)rid, p);
973}
974
975inline ULONG CorSigCompressSignedInt (int i, void *p) {
976 BYTE *pb = reinterpret_cast<BYTE *> (p);
977
978 if ((i & SIGN_MASK_ONEBYTE) == 0 || (i & SIGN_MASK_ONEBYTE) == SIGN_MASK_ONEBYTE) {
979 i = (int) ((i & ~SIGN_MASK_ONEBYTE) << 1 | (i < 0 ? 1 : 0));
980 *pb = BYTE (i);
981 return 1;
982 }
983 else if ((i & SIGN_MASK_TWOBYTE) == 0 || (i & SIGN_MASK_TWOBYTE) == SIGN_MASK_TWOBYTE) {
984 i = (int) ((i & ~SIGN_MASK_TWOBYTE) << 1 | (i < 0 ? 1 : 0));
985 pb[0] = BYTE ((i >> 8) | 0x80);
986 pb[1] = BYTE (i & 0xff);
987 return 2;
988 } else if ((i & SIGN_MASK_FOURBYTE) == 0 || (i & SIGN_MASK_FOURBYTE) == SIGN_MASK_FOURBYTE) {
989 i = (int) ((i & ~SIGN_MASK_FOURBYTE) << 1 | (i < 0 ? 1 : 0));
990 pb[0] = BYTE ((i >> 24) | 0xc0);
991 pb[1] = BYTE ((i >> 16) & 0xff);
992 pb[2] = BYTE ((i >> 8) & 0xff);
993 pb[3] = BYTE (i & 0xff);
994 return 4;
995 }
996
997 return (ULONG)-1;
998}
999
1000inline ULONG CorSigCompressElementType (CorElementType et, void *d) {
1001 *((BYTE *) d) = BYTE (et);
1002 return 1;
1003}
1004
1005inline ULONG CorSigCompressPointer (void *p, void *d) {
1006 *((void **) d) = p;
1007 return (ULONG) sizeof (void *);
1008}
1009
1010inline ULONG CorSigUncompressPointer (PCCOR_SIGNATURE d, void **pptr) {
1011 *pptr = *(void **) d;
1012 return sizeof (*pptr);
1013}
1014#endif
1015
1016#endif
Note: See TracBrowser for help on using the repository browser.