1// Licensed to the .NET Foundation under one or more agreements.
2// The .NET Foundation licenses this file to you under the MIT license.
3// See the LICENSE file in the project root for more information.
4//*****************************************************************************
5// MetaModelColumnDefs.h -- Table definitions for MetaData.
6//
7
8//
9//*****************************************************************************
10
11#if METAMODEL_MAJOR_VER != 2
12#if METAMODEL_MAJOR_VER != 1
13#error "METAMODEL_MAJOR_VER other than 1 or 2 is not implemented"
14#endif
15#endif
16 //
17 // These are used by #defining appropriately, then #including this file.
18 //
19 //-------------------------------------------------------------------------
20 //Module
21 SCHEMA_TABLE_START(Module)
22 SCHEMA_ITEM(Module, USHORT, Generation)
23 SCHEMA_ITEM_STRING(Module, Name)
24 SCHEMA_ITEM_GUID(Module, Mvid)
25 SCHEMA_ITEM_GUID(Module, EncId)
26 SCHEMA_ITEM_GUID(Module, EncBaseId)
27 SCHEMA_TABLE_END(Module)
28
29 //-------------------------------------------------------------------------
30 //TypeRef
31 SCHEMA_TABLE_START(TypeRef)
32 SCHEMA_ITEM_CDTKN(TypeRef, ResolutionScope, ResolutionScope)
33 SCHEMA_ITEM_STRING(TypeRef, Name)
34 SCHEMA_ITEM_STRING(TypeRef, Namespace)
35 SCHEMA_TABLE_END(TypeRef)
36
37 //-------------------------------------------------------------------------
38 // TypeDef
39 SCHEMA_TABLE_START(TypeDef)
40 SCHEMA_ITEM(TypeDef, ULONG, Flags)
41 SCHEMA_ITEM_STRING(TypeDef, Name)
42 SCHEMA_ITEM_STRING(TypeDef, Namespace)
43 SCHEMA_ITEM_CDTKN(TypeDef, Extends, TypeDefOrRef)
44 SCHEMA_ITEM_RID(TypeDef, FieldList, Field)
45 SCHEMA_ITEM_RID(TypeDef, MethodList, Method)
46 SCHEMA_TABLE_END(TypeDef)
47
48 //-------------------------------------------------------------------------
49 //FieldPtr
50 SCHEMA_TABLE_START(FieldPtr)
51 SCHEMA_ITEM_NOFIXED()
52 SCHEMA_ITEM_RID(FieldPtr, Field, Field)
53 SCHEMA_TABLE_END(FieldPtr)
54
55 //-------------------------------------------------------------------------
56 //Field
57 SCHEMA_TABLE_START(Field)
58 SCHEMA_ITEM(Field, USHORT, Flags)
59 SCHEMA_ITEM_STRING(Field,Name)
60 SCHEMA_ITEM_BLOB(Field,Signature)
61 SCHEMA_TABLE_END(Field)
62
63 //-------------------------------------------------------------------------
64 //MethodPtr
65 SCHEMA_TABLE_START(MethodPtr)
66 SCHEMA_ITEM_NOFIXED()
67 SCHEMA_ITEM_RID(MethodPtr, Method, Method)
68 SCHEMA_TABLE_END(MethodPtr)
69
70 //-------------------------------------------------------------------------
71 //Method
72 SCHEMA_TABLE_START(Method)
73 SCHEMA_ITEM(Method, ULONG, RVA)
74 SCHEMA_ITEM(Method, USHORT, ImplFlags)
75 SCHEMA_ITEM(Method, USHORT, Flags)
76 SCHEMA_ITEM_STRING(Method,Name)
77 SCHEMA_ITEM_BLOB(Method,Signature)
78 SCHEMA_ITEM_RID(Method,ParamList,Param)
79 SCHEMA_TABLE_END(Method)
80
81 //-------------------------------------------------------------------------
82 //ParamPtr
83 SCHEMA_TABLE_START(ParamPtr)
84 SCHEMA_ITEM_NOFIXED()
85 SCHEMA_ITEM_RID(ParamPtr, Param, Param)
86 SCHEMA_TABLE_END(ParamPtr)
87
88 //-------------------------------------------------------------------------
89 // Param
90 SCHEMA_TABLE_START(Param)
91 SCHEMA_ITEM(Param, USHORT, Flags)
92 SCHEMA_ITEM(Param, USHORT, Sequence)
93 SCHEMA_ITEM_STRING(Param,Name)
94 SCHEMA_TABLE_END(Param)
95
96 //-------------------------------------------------------------------------
97 //InterfaceImpl
98 SCHEMA_TABLE_START(InterfaceImpl)
99 SCHEMA_ITEM_RID(InterfaceImpl,Class,TypeDef)
100 SCHEMA_ITEM_CDTKN(InterfaceImpl,Interface,TypeDefOrRef)
101 SCHEMA_TABLE_END(InterfaceImpl)
102
103 //-------------------------------------------------------------------------
104 //MemberRef
105 SCHEMA_TABLE_START(MemberRef)
106 SCHEMA_ITEM_NOFIXED()
107 SCHEMA_ITEM_CDTKN(MemberRef,Class,MemberRefParent)
108 SCHEMA_ITEM_STRING(MemberRef,Name)
109 SCHEMA_ITEM_BLOB(MemberRef,Signature)
110 SCHEMA_TABLE_END(MemberRef)
111
112 //-------------------------------------------------------------------------
113 //Constant
114 SCHEMA_TABLE_START(Constant)
115 SCHEMA_ITEM(Constant, BYTE, Type)
116 SCHEMA_ITEM_CDTKN(Constant,Parent,HasConstant)
117 SCHEMA_ITEM_BLOB(Constant,Value)
118 SCHEMA_TABLE_END(Constant)
119
120 //-------------------------------------------------------------------------
121 //CustomAttribute
122 SCHEMA_TABLE_START(CustomAttribute)
123 SCHEMA_ITEM_NOFIXED()
124 SCHEMA_ITEM_CDTKN(CustomAttribute,Parent,HasCustomAttribute)
125 SCHEMA_ITEM_CDTKN(CustomAttribute,Type,CustomAttributeType)
126 SCHEMA_ITEM_BLOB(CustomAttribute,Value)
127 SCHEMA_TABLE_END(CustomAttribute)
128
129 //-------------------------------------------------------------------------
130 //FieldMarshal
131 SCHEMA_TABLE_START(FieldMarshal)
132 SCHEMA_ITEM_NOFIXED()
133 SCHEMA_ITEM_CDTKN(FieldMarshal,Parent,HasFieldMarshal)
134 SCHEMA_ITEM_BLOB(FieldMarshal,NativeType)
135 SCHEMA_TABLE_END(FieldMarshal)
136
137 //-------------------------------------------------------------------------
138 //DeclSecurity
139 SCHEMA_TABLE_START(DeclSecurity)
140 SCHEMA_ITEM(DeclSecurity, SHORT, Action)
141 SCHEMA_ITEM_CDTKN(DeclSecurity,Parent,HasDeclSecurity)
142 SCHEMA_ITEM_BLOB(DeclSecurity,PermissionSet)
143 SCHEMA_TABLE_END(DeclSecurity)
144
145 //-------------------------------------------------------------------------
146 //ClassLayout
147 SCHEMA_TABLE_START(ClassLayout)
148 SCHEMA_ITEM(ClassLayout, USHORT, PackingSize)
149 SCHEMA_ITEM(ClassLayout, ULONG, ClassSize)
150 SCHEMA_ITEM_RID(ClassLayout,Parent,TypeDef)
151 SCHEMA_TABLE_END(ClassLayout)
152
153 //-------------------------------------------------------------------------
154 //FieldLayout
155 SCHEMA_TABLE_START(FieldLayout)
156 SCHEMA_ITEM(FieldLayout, ULONG, OffSet)
157 SCHEMA_ITEM_RID(FieldLayout, Field, Field)
158 SCHEMA_TABLE_END(FieldLayout)
159
160 //-------------------------------------------------------------------------
161 //StandAloneSig
162 SCHEMA_TABLE_START(StandAloneSig)
163 SCHEMA_ITEM_NOFIXED()
164 SCHEMA_ITEM_BLOB(StandAloneSig,Signature)
165 SCHEMA_TABLE_END(StandAloneSig)
166
167 //-------------------------------------------------------------------------
168 //EventMap
169 SCHEMA_TABLE_START(EventMap)
170 SCHEMA_ITEM_NOFIXED()
171 SCHEMA_ITEM_RID(EventMap,Parent,TypeDef)
172 SCHEMA_ITEM_RID(EventMap,EventList,Event)
173 SCHEMA_TABLE_END(EventMap)
174
175 //-------------------------------------------------------------------------
176 //EventPtr
177 SCHEMA_TABLE_START(EventPtr)
178 SCHEMA_ITEM_NOFIXED()
179 SCHEMA_ITEM_RID(EventPtr, Event, Event)
180 SCHEMA_TABLE_END(EventPtr)
181
182 //-------------------------------------------------------------------------
183 //Event
184 SCHEMA_TABLE_START(Event)
185 SCHEMA_ITEM(Event, USHORT, EventFlags)
186 SCHEMA_ITEM_STRING(Event,Name)
187 SCHEMA_ITEM_CDTKN(Event,EventType,TypeDefOrRef)
188 SCHEMA_TABLE_END(Event)
189
190 //-------------------------------------------------------------------------
191 //PropertyMap
192 SCHEMA_TABLE_START(PropertyMap)
193 SCHEMA_ITEM_NOFIXED()
194 SCHEMA_ITEM_RID(PropertyMap,Parent,TypeDef)
195 SCHEMA_ITEM_RID(PropertyMap,PropertyList,Property)
196 SCHEMA_TABLE_END(PropertyMap)
197
198 //-------------------------------------------------------------------------
199 //PropertyPtr
200 SCHEMA_TABLE_START(PropertyPtr)
201 SCHEMA_ITEM_NOFIXED()
202 SCHEMA_ITEM_RID(PropertyPtr, Property, Property)
203 SCHEMA_TABLE_END(PropertyPtr)
204
205 //-------------------------------------------------------------------------
206 //Property
207 SCHEMA_TABLE_START(Property)
208 SCHEMA_ITEM(Property, USHORT, PropFlags)
209 SCHEMA_ITEM_STRING(Property,Name)
210 SCHEMA_ITEM_BLOB(Property,Type)
211 SCHEMA_TABLE_END(Property)
212
213 //-------------------------------------------------------------------------
214 //MethodSemantics
215 SCHEMA_TABLE_START(MethodSemantics)
216 SCHEMA_ITEM(MethodSemantics, USHORT, Semantic)
217 SCHEMA_ITEM_RID(MethodSemantics,Method,Method)
218 SCHEMA_ITEM_CDTKN(MethodSemantics,Association,HasSemantic)
219 SCHEMA_TABLE_END(MethodSemantics)
220
221 //-------------------------------------------------------------------------
222 //MethodImpl
223 SCHEMA_TABLE_START(MethodImpl)
224 SCHEMA_ITEM_RID(MethodImpl,Class,TypeDef)
225 SCHEMA_ITEM_CDTKN(MethodImpl,MethodBody,MethodDefOrRef)
226 SCHEMA_ITEM_CDTKN(MethodImpl, MethodDeclaration, MethodDefOrRef)
227 SCHEMA_TABLE_END(MethodImpl)
228
229 //-------------------------------------------------------------------------
230 //ModuleRef
231 SCHEMA_TABLE_START(ModuleRef)
232 SCHEMA_ITEM_NOFIXED()
233 SCHEMA_ITEM_STRING(ModuleRef, Name)
234 SCHEMA_TABLE_END(ModuleRef)
235
236 //-------------------------------------------------------------------------
237 // TypeSpec
238 SCHEMA_TABLE_START(TypeSpec)
239 SCHEMA_ITEM_NOFIXED()
240 SCHEMA_ITEM_BLOB(TypeSpec,Signature)
241 SCHEMA_TABLE_END(TypeSpec)
242
243 //-------------------------------------------------------------------------
244 // ENCLog
245 SCHEMA_TABLE_START(ENCLog)
246 SCHEMA_ITEM(ENCLog, ULONG, Token)
247 SCHEMA_ITEM(ENCLog, ULONG, FuncCode)
248 SCHEMA_TABLE_END(ENCLog)
249
250 //-------------------------------------------------------------------------
251 // ImplMap
252 SCHEMA_TABLE_START(ImplMap)
253 SCHEMA_ITEM(ImplMap, USHORT, MappingFlags)
254 SCHEMA_ITEM_CDTKN(ImplMap, MemberForwarded, MemberForwarded)
255 SCHEMA_ITEM_STRING(ImplMap, ImportName)
256 SCHEMA_ITEM_RID(ImplMap, ImportScope, ModuleRef)
257 SCHEMA_TABLE_END(ImplMap)
258
259 //-------------------------------------------------------------------------
260 // ENCMap
261 SCHEMA_TABLE_START(ENCMap)
262 SCHEMA_ITEM(ENCMap, ULONG, Token)
263 SCHEMA_TABLE_END(ENCMap)
264
265 //-------------------------------------------------------------------------
266 // FieldRVA
267 SCHEMA_TABLE_START(FieldRVA)
268 SCHEMA_ITEM(FieldRVA, ULONG, RVA)
269 SCHEMA_ITEM_RID(FieldRVA, Field, Field)
270 SCHEMA_TABLE_END(FieldRVA)
271
272 //-------------------------------------------------------------------------
273 // Assembly
274 SCHEMA_TABLE_START(Assembly)
275 SCHEMA_ITEM(Assembly, ULONG, HashAlgId)
276 SCHEMA_ITEM(Assembly, USHORT, MajorVersion)
277 SCHEMA_ITEM(Assembly, USHORT, MinorVersion)
278 SCHEMA_ITEM(Assembly, USHORT, BuildNumber)
279 SCHEMA_ITEM(Assembly, USHORT, RevisionNumber)
280 SCHEMA_ITEM(Assembly, ULONG, Flags)
281 SCHEMA_ITEM_BLOB(Assembly, PublicKey)
282 SCHEMA_ITEM_STRING(Assembly, Name)
283 SCHEMA_ITEM_STRING(Assembly, Locale)
284 SCHEMA_TABLE_END(Assembly)
285
286 //-------------------------------------------------------------------------
287 // AssemblyProcessor
288 SCHEMA_TABLE_START(AssemblyProcessor)
289 SCHEMA_ITEM(AssemblyProcessor, ULONG, Processor)
290 SCHEMA_TABLE_END(AssemblyProcessor)
291
292 //-------------------------------------------------------------------------
293 // AssemblyOS
294 SCHEMA_TABLE_START(AssemblyOS)
295 SCHEMA_ITEM(AssemblyOS, ULONG, OSPlatformId)
296 SCHEMA_ITEM(AssemblyOS, ULONG, OSMajorVersion)
297 SCHEMA_ITEM(AssemblyOS, ULONG, OSMinorVersion)
298 SCHEMA_TABLE_END(AssemblyOS)
299
300 //-------------------------------------------------------------------------
301 // AssemblyRef
302 SCHEMA_TABLE_START(AssemblyRef)
303 SCHEMA_ITEM(AssemblyRef, USHORT, MajorVersion)
304 SCHEMA_ITEM(AssemblyRef, USHORT, MinorVersion)
305 SCHEMA_ITEM(AssemblyRef, USHORT, BuildNumber)
306 SCHEMA_ITEM(AssemblyRef, USHORT, RevisionNumber)
307 SCHEMA_ITEM(AssemblyRef, ULONG, Flags)
308 SCHEMA_ITEM_BLOB(AssemblyRef, PublicKeyOrToken)
309 SCHEMA_ITEM_STRING(AssemblyRef, Name)
310 SCHEMA_ITEM_STRING(AssemblyRef, Locale)
311 SCHEMA_ITEM_BLOB(AssemblyRef, HashValue)
312 SCHEMA_TABLE_END(AssemblyRef)
313
314 //-------------------------------------------------------------------------
315 // AssemblyRefProcessor
316 SCHEMA_TABLE_START(AssemblyRefProcessor)
317 SCHEMA_ITEM(AssemblyRefProcessor, ULONG, Processor)
318 SCHEMA_ITEM_RID(AssemblyRefProcessor, AssemblyRef, AssemblyRef)
319 SCHEMA_TABLE_END(AssemblyRefProcessor)
320
321 //-------------------------------------------------------------------------
322 // AssemblyRefOS
323 SCHEMA_TABLE_START(AssemblyRefOS)
324 SCHEMA_ITEM(AssemblyRefOS, ULONG, OSPlatformId)
325 SCHEMA_ITEM(AssemblyRefOS, ULONG, OSMajorVersion)
326 SCHEMA_ITEM(AssemblyRefOS, ULONG, OSMinorVersion)
327 SCHEMA_ITEM_RID(AssemblyRefOS, AssemblyRef, AssemblyRef)
328 SCHEMA_TABLE_END(AssemblyRefOS)
329
330 //-------------------------------------------------------------------------
331 // File
332 SCHEMA_TABLE_START(File)
333 SCHEMA_ITEM(File, ULONG, Flags)
334 SCHEMA_ITEM_STRING(File, Name)
335 SCHEMA_ITEM_BLOB(File, HashValue)
336 SCHEMA_TABLE_END(File)
337
338 //-------------------------------------------------------------------------
339 // ExportedType
340 SCHEMA_TABLE_START(ExportedType)
341 SCHEMA_ITEM(ExportedType, ULONG, Flags)
342 SCHEMA_ITEM(ExportedType, ULONG, TypeDefId)
343 SCHEMA_ITEM_STRING(ExportedType, TypeName)
344 SCHEMA_ITEM_STRING(ExportedType, TypeNamespace)
345 SCHEMA_ITEM_CDTKN(ExportedType, Implementation, Implementation)
346 SCHEMA_TABLE_END(ExportedType)
347
348 //-------------------------------------------------------------------------
349 // ManifestResource
350 SCHEMA_TABLE_START(ManifestResource)
351 SCHEMA_ITEM(ManifestResource, ULONG, Offset)
352 SCHEMA_ITEM(ManifestResource, ULONG, Flags)
353 SCHEMA_ITEM_STRING(ManifestResource, Name)
354 SCHEMA_ITEM_CDTKN(ManifestResource, Implementation, Implementation)
355 SCHEMA_TABLE_END(ManifestResource)
356
357 //-------------------------------------------------------------------------
358 // NestedClass
359 SCHEMA_TABLE_START(NestedClass)
360 SCHEMA_ITEM_RID(NestedClass, NestedClass, TypeDef)
361 SCHEMA_ITEM_RID(NestedClass, EnclosingClass, TypeDef)
362 SCHEMA_TABLE_END(NestedClass)
363
364
365 //-------------------------------------------------------------------------
366 // GenericParam
367 SCHEMA_TABLE_START(GenericParam)
368 SCHEMA_ITEM(GenericParam, USHORT, Number)
369 SCHEMA_ITEM(GenericParam, USHORT, Flags)
370 SCHEMA_ITEM_CDTKN(GenericParam, Owner, TypeOrMethodDef)
371 SCHEMA_ITEM_STRING(GenericParam, Name)
372 SCHEMA_TABLE_END(GenericParam)
373
374 //-------------------------------------------------------------------------
375 // Transitional table for Metadata v1.1 for GenericParam
376 SCHEMA_TABLE_START(GenericParamV1_1)
377 SCHEMA_ITEM(GenericParam, USHORT, Number)
378 SCHEMA_ITEM(GenericParam, USHORT, Flags)
379 SCHEMA_ITEM_CDTKN(GenericParam, Owner, TypeOrMethodDef)
380 SCHEMA_ITEM_STRING(GenericParam, Name)
381 SCHEMA_ITEM_CDTKN(GenericParam, Kind, TypeDefOrRef)
382 SCHEMA_TABLE_END(GenericParam)
383
384
385
386 //-------------------------------------------------------------------------
387 //MethodSpec
388 SCHEMA_TABLE_START(MethodSpec)
389 SCHEMA_ITEM_NOFIXED()
390 SCHEMA_ITEM_CDTKN(MethodSpec, Method, MethodDefOrRef)
391 SCHEMA_ITEM_BLOB(MethodSpec, Instantiation)
392 SCHEMA_TABLE_END(MethodSpec)
393
394 //-------------------------------------------------------------------------
395 // GenericParamConstraint
396 SCHEMA_TABLE_START(GenericParamConstraint)
397 SCHEMA_ITEM_RID(GenericParamConstraint, Owner, GenericParam)
398 SCHEMA_ITEM_CDTKN(GenericParamConstraint, Constraint, TypeDefOrRef)
399 SCHEMA_TABLE_END(GenericParamConstraint)
400
401// eof ------------------------------------------------------------------------
402