Metadata Logical Layout (Sections 21 and 22)


As stated earlier in this chapter, sections 21 and 22 of Partition II describe the logical layout, in detail, of the metadata. Section 22 describes the other structures required in the tables, and section 21 describes, as informative material, the rules for ensuring that metadata emitted into any PE file is valid. These rules are listed as informative rather than normative (part of the standard) because the standardizing body felt that the rules could be deduced from the table schemata, and standards avoid duplicating material. However, deducing those rules would be time-consuming, and their inclusion here greatly simplifies development of a validation mechanism.

The metadata validation rules in the standard are informative rather than normative because they can, in principle, be deduced from other information in the standard. However, the authors of the standard realized that this is both difficult and susceptible to error, so they provide, for your information, their understanding of what those rules are.

Verification ensures type safety according to a strict set of rules, as has been discussed previously. Validation, in contrast, ensures that the bits in a module constitute legal CLI code. If Common Intermediate Language code is not valid, the standard makes no statement on how it will execute it essentially contains nonsense, and running it will produce unpredictable results. For more information, see Partition II, section 21.1.

The layout of the tables is very complex, so Chris King, of Microsoft, spent the time and energy to create a diagram that provides a map to the layout, which is shown in Figure 4-1.

Figure 4.1. Metadata Tables

Notes:

• A table that is highlighted with a stippled bar is actually an extra, infrequently used column on another table, which is pointed to in the diagram.

• In the column names, boldface indicates a field that points to another metadata table, and non-boldface indicates a field that points to a stand-alone metadata table or to a Blob, Guid, or String heap as indicated.

• Bold arrows point to a run of rows in the indicated table; non-bold arrows, to a single row.

• In the Assembly and AssemblyRef tables, the entry "Version" actually represents the four version-related columns MajorVersion, MinorVersion, BuildNumber, and RevisionNumber.

• Abbreviations: CI = coded index; bh = Blob heap; gh = Guid heap; sh = String heap

graphics/04fig01.jpg

graphics/04fig01a.jpg



The Common Language Infrastructure Annotated Standard (Microsoft. NET Development Series)
The Common Language Infrastructure Annotated Standard (Microsoft. NET Development Series)
ISBN: N/A
EAN: N/A
Year: 2002
Pages: 121

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net