You've already forked linux-packaging-mono
							
							
		
			
				
	
	
		
			1313 lines
		
	
	
		
			35 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			1313 lines
		
	
	
		
			35 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <?xml version="1.0" encoding="utf-8"?><span>
 | |
| <html xmlns="http://www.w3.org/1999/xhtml">
 | |
| <head>
 | |
|    <title>mono-api-metadata.html</title>
 | |
|    <style type="text/css">
 | |
| 
 | |
| 
 | |
|    h3 { 
 | |
|        font-size: 18px;
 | |
|        padding-bottom: 4pt;
 | |
|        border-bottom: 2px solid #dddddd;
 | |
|    }
 | |
|        
 | |
|    .api {
 | |
|      border: 1px solid;
 | |
|      padding: 10pt;
 | |
|      margin: 10pt;
 | |
|    } 
 | |
| 
 | |
|    .api-entry { 
 | |
|        border-bottom: none;
 | |
|        font-size: 18px;
 | |
|    }
 | |
| 
 | |
|    .prototype {
 | |
|      border: 1px solid;
 | |
|      background-color: #f2f2f2;
 | |
|      padding: 5pt;
 | |
|      margin-top: 5pt;
 | |
|      margin-bottom: 5pt;  
 | |
|    } 
 | |
| 
 | |
|    .header {
 | |
|      border: 1px solid;
 | |
|      padding: 0 0 5pt 5pt;
 | |
|      margin: 10pt;
 | |
|      white-space: pre;
 | |
|        font-family: monospace;
 | |
|    }
 | |
|     
 | |
|    .code {
 | |
|      border: 1px solid;
 | |
|      padding: 0 0 5pt 5pt;
 | |
|      margin: 10pt;
 | |
|      white-space: pre;
 | |
|        font-family: monospace;
 | |
|    }
 | |
|    
 | |
| 
 | |
| </style>
 | |
| </head>
 | |
| <body>
 | |
| <h1>Metadata Reading</h1>
 | |
| 
 | |
| 	<p />The Metadata API gives developers low-level access to the
 | |
| 	information encoded in CLI modules: type and
 | |
| 	methods definitions encoded in metadata as well as access to
 | |
| 	the CIL code and embedded resources.
 | |
| 
 | |
| 	<p />Managed developers access this information using either the
 | |
| 	System.Reflection API or a library
 | |
| 	like <a href="http://www.mono-project.com/Cecil">Cecil</a>.
 | |
| 
 | |
| 	<p />To start using the Metadata API it is necessary
 | |
| 	to <a href="mono-api-assembly.html#cil_assembly_load">open an
 | |
| 	assembly</a> or a CIL image (a .dll or .exe file) using one of
 | |
| 	the
 | |
| 	<a href="mono-api-image.html#cil_image_open">CIL image
 | |
| 	opening</a> API calls.
 | |
| 
 | |
| <h2>Metadata Heaps</h2>
 | |
| 
 | |
| 	<p />ECMA CLI images contain four heaps that store different
 | |
| 	kinds of information, these are:
 | |
| 
 | |
| 	<ul>
 | |
| 		<li>GUID heap (called #GUID) contains 128-bit GUIDs,
 | |
| 		you can get pointer to a GUID value by
 | |
| 		calling <a href="#api:mono_metadata_guid_heap">mono_metadata_guid_heap</a>.
 | |
| 
 | |
| 		<li>User string heap (called #US), it contains user
 | |
| 		visible strings, you can fetch a string from this heap
 | |
| 		by calling
 | |
| 		<a href="#api:mono_metadata_user_string">mono_metadata_user_string</a>.
 | |
| 
 | |
| 		<li>Blob heap (called #blob), it contains binary
 | |
| 		blobs of data, you can get a blob
 | |
| 		by <a href="#api:mono_metadata_blob_heap">mono_metadata_blob_heap</a>.
 | |
| 		You can determine the size of the blob using
 | |
| 		the <a href="#api:mono_metadata_decode_blob_size">mono_metadata_decode_blob_size</a>. 
 | |
| 	
 | |
| 	</li></li></li></ul>
 | |
| 
 | |
| 	<p />The ECMA file format also has an extra section called the
 | |
| 	"#~" stream, this stream is the one that holds the metadata
 | |
| 	tables.   There is a high-level API to get access to the
 | |
| 	contents of this API, described in the
 | |
| 	section <a href="#metadata-tables">Metadata Tables</a>.
 | |
| 	
 | |
|  <a name="api:mono_metadata_guid_heap"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_guid_heap</div>
 | |
| 
 | |
|     <div class="prototype">const char *
 | |
| mono_metadata_guid_heap (MonoImage *meta, guint32 index)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>meta:</i></dt><dd> metadata context</dd><dt><i>index:</i></dt><dd> index into the guid heap.</dd></blockquote>
 | |
| <b>Returns</b>
 | |
| <blockquote>	  an in-memory pointer to the <i>index</i> in the guid heap.
 | |
| </blockquote>
 | |
| 
 | |
| </div> <a name="api:mono_metadata_string_heap"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_string_heap</div>
 | |
| 
 | |
|     <div class="prototype">const char *
 | |
| mono_metadata_string_heap (MonoImage *meta, guint32 index)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>meta:</i></dt><dd> metadata context</dd><dt><i>index:</i></dt><dd> index into the string heap.</dd></blockquote>
 | |
| <b>Returns</b>
 | |
| <blockquote>	  an in-memory pointer to the <i>index</i> in the string heap.
 | |
| </blockquote>
 | |
| 
 | |
| </div> <a name="api:mono_metadata_blob_heap"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_blob_heap</div>
 | |
| 
 | |
|     <div class="prototype">const char *
 | |
| mono_metadata_blob_heap (MonoImage *meta, guint32 index)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>meta:</i></dt><dd> metadata context</dd><dt><i>index:</i></dt><dd> index into the blob.</dd></blockquote>
 | |
| <b>Returns</b>
 | |
| <blockquote>	  an in-memory pointer to the <i>index</i> in the Blob heap.
 | |
| </blockquote>
 | |
| 
 | |
| </div> <a name="api:mono_metadata_user_string"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_user_string</div>
 | |
| 
 | |
|     <div class="prototype">const char *
 | |
| mono_metadata_user_string (MonoImage *meta, guint32 index)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>meta:</i></dt><dd> metadata context</dd><dt><i>index:</i></dt><dd> index into the user string heap.</dd></blockquote>
 | |
| <b>Returns</b>
 | |
| <blockquote>	  an in-memory pointer to the <i>index</i> in the user string heap ("<i>US</i>").
 | |
| </blockquote>
 | |
| 
 | |
| </div> <a name="api:mono_metadata_decode_blob_size"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_decode_blob_size</div>
 | |
| 
 | |
|     <div class="prototype">guint32
 | |
| mono_metadata_decode_blob_size (const char *xptr, const char **rptr)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>ptr:</i></dt><dd> pointer to a blob object</dd><dt><i>rptr:</i></dt><dd> the new position of the pointer</dd></blockquote>
 | |
| <b>Returns</b>
 | |
| <blockquote>	  the size of the blob object
 | |
| </blockquote>
 | |
| <b>Remarks</b>
 | |
| <p />	 
 | |
| 	 This decodes a compressed size as described by 23.1.4 (a blob or user string object)
 | |
| 	
 | |
| 
 | |
| 
 | |
| <a name="metadata-tables"></a>
 | |
| </div><h2>Metadata Tables</h2>
 | |
| 
 | |
| 	<p />Metadata is encoded in a number of tables included on every
 | |
| 	CIL image.   These tables contain type definitions, member
 | |
| 	definitions and so on, these constants are defined in the ECMA 335
 | |
| 	specification Partition II section 22.   The following table
 | |
| 	shows the C constants defined in the Mono runtime and how they
 | |
| 	map to the equivalent ECMA CLI metadata table:
 | |
| 
 | |
| 	<center>
 | |
| 	<table border="1">
 | |
| 	  <thead>
 | |
| 	    <td>
 | |
| 	       <b>ECMA CLI Table Name</b>
 | |
| 	    </td>
 | |
| 	    <td>
 | |
| 	    <b>C Constant Name</b>
 | |
| 	    </td>
 | |
| 	    <td>
 | |
| 	       <b>Table Schema (Array Size + Columns Constants)</b>
 | |
| 	    </td>
 | |
| 	  </thead>
 | |
| <td>Assembly</td><td>MONO_TABLE_ASSEMBLY</td><td>
 | |
| Array size: 
 | |
| MONO_ASSEMBLY_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_ASSEMBLY_HASH_ALG
 | |
| 	<li>MONO_ASSEMBLY_MAJOR_VERSION
 | |
| 	<li>MONO_ASSEMBLY_MINOR_VERSION
 | |
| 	<li>MONO_ASSEMBLY_BUILD_NUMBER
 | |
| 	<li>MONO_ASSEMBLY_REV_NUMBER
 | |
| 	<li>MONO_ASSEMBLY_FLAGS
 | |
| 	<li>MONO_ASSEMBLY_PUBLIC_KEY
 | |
| 	<li>MONO_ASSEMBLY_NAME
 | |
| 	<li>MONO_ASSEMBLY_CULTURE
 | |
| </li></li></li></li></li></li></li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>AssemblyOS</td><td>MONO_TABLE_ASSEMBLYOS</td><td>
 | |
| Array size: 
 | |
| MONO_ASSEMBLYOS_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_ASSEMBLYOS_PLATFORM
 | |
| 	<li>MONO_ASSEMBLYOS_MAJOR_VERSION
 | |
| 	<li>MONO_ASSEMBLYOS_MINOR_VERSION
 | |
| </li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>AssemblyProcessor</td><td>MONO_TABLE_ASSEMBLYPROCESSOR</td><td>Array
 | |
| size: MONO_ASSEMBLYPROCESSOR_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_ASSEMBLY_PROCESSOR
 | |
| </li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>AssemblyRef</td><td>MONO_TABLE_ASSEMBLYREF</td><td>
 | |
| Array size: 
 | |
| MONO_ASSEMBLYREF_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_ASSEMBLYREF_MAJOR_VERSION
 | |
| 	<li>MONO_ASSEMBLYREF_MINOR_VERSION
 | |
| 	<li>MONO_ASSEMBLYREF_BUILD_NUMBER
 | |
| 	<li>MONO_ASSEMBLYREF_REV_NUMBER
 | |
| 	<li>MONO_ASSEMBLYREF_FLAGS
 | |
| 	<li>MONO_ASSEMBLYREF_PUBLIC_KEY
 | |
| 	<li>MONO_ASSEMBLYREF_NAME
 | |
| 	<li>MONO_ASSEMBLYREF_CULTURE
 | |
| 	<li>MONO_ASSEMBLYREF_HASH_VALUE
 | |
| </li></li></li></li></li></li></li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>AssemblyRefProcessor</td><td>MONO_TABLE_ASSEMBLYREFPROCESSOR</td><td>Array
 | |
| size: MONO_ASSEMBLYREFPROC_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_ASSEMBLYREFPROC_PROCESSOR
 | |
| 	<li>MONO_ASSEMBLYREFPROC_ASSEMBLYREF
 | |
| </li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>AssemblyRefOS</td><td>MONO_TABLE_ASSEMBLYREFOS</td><td>
 | |
| Array size: 
 | |
| 	<li>MONO_ASSEMBLYREFOS_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_ASSEMBLYREFOS_PLATFORM
 | |
| 	<li>MONO_ASSEMBLYREFOS_MAJOR_VERSION
 | |
| 	<li>MONO_ASSEMBLYREFOS_MINOR_VERSION
 | |
| 	<li>MONO_ASSEMBLYREFOS_ASSEMBLYREF
 | |
| </li></li></li></li></ul>
 | |
| </li></td>
 | |
| 
 | |
| 
 | |
| <td>ClassLayout</td><td>MONO_TABLE_CLASSLAYOUT</td><td>
 | |
| Array size: 
 | |
| MONO_CLASSLAYOUT_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_CLASS_LAYOUT_PACKING_SIZE
 | |
| 	<li>MONO_CLASS_LAYOUT_CLASS_SIZE
 | |
| 	<li>MONO_CLASS_LAYOUT_PARENT
 | |
| </li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>Constant</td><td>MONO_TABLE_CONSTANT</td><td>
 | |
| Array size: 
 | |
| MONO_CONSTANT_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_CONSTANT_TYPE
 | |
| 	<li>MONO_CONSTANT_PADDING
 | |
| 	<li>MONO_CONSTANT_PARENT
 | |
| 	<li>MONO_CONSTANT_VALUE
 | |
| </li></li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>CustomAttribute</td><td>MONO_TABLE_CUSTOMATTRIBUTE</td><td>
 | |
| Array size:
 | |
| MONO_CUSTOM_ATTR_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_CUSTOM_ATTR_PARENT
 | |
| 	<li>MONO_CUSTOM_ATTR_TYPE
 | |
| 	<li>MONO_CUSTOM_ATTR_VALUE
 | |
| </li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>DeclSecurity</td><td>MONO_TABLE_DECLSECURITY</td><td>
 | |
| Array size: 
 | |
| MONO_DECL_SECURITY_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_DECL_SECURITY_ACTION
 | |
| 	<li>MONO_DECL_SECURITY_PARENT
 | |
| 	<li>MONO_DECL_SECURITY_PERMISSIONSET
 | |
| </li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>EventMap</td><td>MONO_TABLE_EVENTMAP</td><td>
 | |
| Array size: 
 | |
| MONO_EVENT_MAP_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_EVENT_MAP_PARENT
 | |
| 	<li>MONO_EVENT_MAP_EVENTLIST
 | |
| </li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>EventPtr</td><td>MONO_TABLE_EVENT_POINTER</td><td>
 | |
| Array size: 
 | |
| MONO_EVENT_POINTER_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_EVENT_POINTER_EVENT
 | |
| </li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>Event</td><td>MONO_TABLE_EVENT</td><td>
 | |
| Array size:  MONO_EVENT_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_EVENT_FLAGS
 | |
| 	<li>MONO_EVENT_NAME
 | |
| 	<li>MONO_EVENT_TYPE
 | |
| </li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>ExportedType</td><td>MONO_TABLE_EXPORTEDTYPE</td><td>
 | |
| Array size: 
 | |
| MONO_EXPORTEDTYPE_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_EXP_TYPE_FLAGS
 | |
| 	<li>MONO_EXP_TYPE_TYPEDEF
 | |
| 	<li>MONO_EXP_TYPE_NAME
 | |
| 	<li>MONO_EXP_TYPE_NAMESPACE
 | |
| 	<li>MONO_EXP_TYPE_IMPLEMENTATION
 | |
| </li></li></li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>Field</td><td>MONO_TABLE_FIELD</td><td>
 | |
| Array size:  MONO_FIELD_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_FIELD_FLAGS
 | |
| 	<li>MONO_FIELD_NAME
 | |
| 	<li>MONO_FIELD_SIGNATURE
 | |
| </li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>FieldLayoutt</td><td>MONO_TABLE_FIELDLAYOUT</td><td>
 | |
| Array size: 
 | |
| MONO_FIELDLAYOUT_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_FIELD_LAYOUT_OFFSET
 | |
| 	<li>MONO_FIELD_LAYOUT_FIELD
 | |
| </li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>FieldMarshal</td><td>MONO_TABLE_FIELDMARSHAL</td><td>
 | |
| Array size: 
 | |
| MONO_FIELD_MARSHAL_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_FIELD_MARSHAL_PARENT
 | |
| 	<li>MONO_FIELD_MARSHAL_NATIVE_TYPE
 | |
| </li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>FieldPtr</td><td>MONO_TABLE_FIELD_POINTER</td><td>
 | |
| Array size: 
 | |
| MONO_FIELD_POINTER_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_FIELD_POINTER_FIELD
 | |
| </li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>FieldRVA</td><td>MONO_TABLE_FIELDRVA</td><td>
 | |
| Array size: 
 | |
| MONO_FIELDRVA_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_FIELD_RVA_RVA
 | |
| 	<li>MONO_FIELD_RVA_FIELD
 | |
| </li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>File</td><td>MONO_TABLE_FILE</td><td>
 | |
| Array size:  MONO_FILE_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_FILE_FLAGS
 | |
| 	<li>MONO_FILE_NAME
 | |
| 	<li>MONO_FILE_HASH_VALUE
 | |
| </li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>GenericParam</td><td>MONO_TABLE_GENERICPARAM</td><td>
 | |
| Array size: 
 | |
| MONO_GENERICPARAM_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_GENERICPARAM_NUMBER
 | |
| 	<li>MONO_GENERICPARAM_FLAGS
 | |
| 	<li>MONO_GENERICPARAM_OWNER
 | |
| 	<li>MONO_GENERICPARAM_NAME
 | |
| </li></li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>GenericParamConstraint</td><td>MONO_TABLE_GENERICPARAMCONSTRAINT</td><td>Array
 | |
| size: MONO_GENERICPARAMCONSTRAINT_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_GENPARCONSTRAINT_GENERICPAR
 | |
| 	<li>MONO_GENPARCONSTRAINT_CONSTRAINT
 | |
| </li></li></ul>
 | |
| </td>
 | |
| 
 | |
| <tr>
 | |
| <td>ImplMap</td><td>MONO_TABLE_IMPLMAP</td><td>
 | |
| Array size: 
 | |
| MONO_IMPLMAP_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_IMPLMAP_FLAGS
 | |
| 	<li>MONO_IMPLMAP_MEMBER
 | |
| 	<li>MONO_IMPLMAP_NAME
 | |
| 	<li>MONO_IMPLMAP_SCOPE
 | |
| </li></li></li></li></ul>
 | |
| </td>
 | |
| </tr>
 | |
| 
 | |
| 
 | |
| <td>InterfaceImpl</td><td>MONO_TABLE_INTERFACEIMPL</td><td>
 | |
| Array size: 
 | |
| 	<li>MONO_INTERFACEIMPL_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_INTERFACEIMPL_CLASS
 | |
| 	<li>MONO_INTERFACEIMPL_INTERFACE
 | |
| </li></li></ul>
 | |
| </li></td>
 | |
| 
 | |
| 
 | |
| 
 | |
| <td>ManifestResource</td><td>MONO_TABLE_MANIFESTRESOURCE</td><td>Array
 | |
| size: MONO_MANIFESTRESOURCE_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_MANIFEST_OFFSET
 | |
| 	<li>MONO_MANIFEST_FLAGS
 | |
| 	<li>MONO_MANIFEST_NAME
 | |
| 	<li>MONO_MANIFEST_IMPLEMENTATION
 | |
| </li></li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <tr>
 | |
| <td>MemberRef</td><td>MONO_TABLE_MEMBERREF</td><td>
 | |
| Array size: 
 | |
| MONO_MEMBERREF_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_MEMBERREF_CLASS
 | |
| 	<li>MONO_MEMBERREF_NAME
 | |
| 	<li>MONO_MEMBERREF_SIGNATURE
 | |
| </li></li></li></ul>
 | |
| </td>
 | |
| </tr>
 | |
| 
 | |
| <td>MethodImpl</td><td>MONO_TABLE_METHODIMPL</td><td>
 | |
| Array size: 
 | |
| MONO_METHODIMPL_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_METHODIMPL_CLASS
 | |
| 	<li>MONO_METHODIMPL_BODY
 | |
| 	<li>MONO_METHODIMPL_DECLARATION
 | |
| </li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| 
 | |
| <td>MethodSpec</td><td>MONO_TABLE_METHODSPEC</td><td>
 | |
| Array size: 
 | |
| MONO_METHODSPEC_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_METHODSPEC_METHOD
 | |
| 	<li>MONO_METHODSPEC_SIGNATURE
 | |
| </li></li></ul>
 | |
| </td>
 | |
| 
 | |
| <tr>
 | |
| <td>MethodSemantics</td><td>MONO_TABLE_METHODSEMANTICS</td><td>Array
 | |
| size: MONO_METHOD_SEMA_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_METHOD_SEMA_SEMANTICS
 | |
| 	<li>MONO_METHOD_SEMA_METHOD
 | |
| 	<li>MONO_METHOD_SEMA_ASSOCIATION
 | |
| </li></li></li></ul>
 | |
| </td>
 | |
| </tr>
 | |
| 
 | |
| <td>Moduleref</td><td>MONO_TABLE_MODULEREF</td><td>
 | |
| Array size: 
 | |
| MONO_MODULEREF_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_MODULEREF_NAME
 | |
| </li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <tr>
 | |
| <td>Module</td><td>MONO_TABLE_MODULE</td><td>
 | |
| Array size: 
 | |
| MONO_MODULE_SIZE
 | |
| <br />
 | |
| Columns:
 | |
| <ul>
 | |
| 	<li>MONO_MODULE_GENERATION
 | |
| 	<li>MONO_MODULE_NAME
 | |
| 	<li>MONO_MODULE_MVID
 | |
| 	<li>MONO_MODULE_ENC
 | |
| 	<li>MONO_MODULE_ENCBASE
 | |
| </li></li></li></li></li></ul>
 | |
| </td>
 | |
| </tr>
 | |
| 
 | |
| <td>TypeRef</td><td>MONO_TABLE_TYPEREF</td><td>
 | |
| Array size: 
 | |
| MONO_TYPEREF_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_TYPEREF_SCOPE
 | |
| 	<li>MONO_TYPEREF_NAME
 | |
| 	<li>MONO_TYPEREF_NAMESPACE
 | |
| </li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <tr>
 | |
| <td>MethodPtr</td><td>MONO_TABLE_METHOD_POINTER</td><td>
 | |
| Array size: 
 | |
| MONO_METHOD_POINTER_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_METHOD_POINTER_METHOD
 | |
| </li></ul>
 | |
| </td>
 | |
| </tr>
 | |
| 
 | |
| <td>Method</td><td>MONO_TABLE_METHOD</td><td>
 | |
| Array size: 
 | |
| MONO_METHOD_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_METHOD_RVA
 | |
| 	<li>MONO_METHOD_IMPLFLAGS
 | |
| 	<li>MONO_METHOD_FLAGS
 | |
| 	<li>MONO_METHOD_NAME
 | |
| 	<li>MONO_METHOD_SIGNATURE
 | |
| 	<li>MONO_METHOD_PARAMLIST
 | |
| </li></li></li></li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <tr>
 | |
| <td>NestedClass</td><td>MONO_TABLE_NESTEDCLASS</td><td>
 | |
| Array size: 
 | |
| MONO_NESTEDCLASS_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_NESTED_CLASS_NESTED
 | |
| 	<li>MONO_NESTED_CLASS_ENCLOSING
 | |
| </li></li></ul>
 | |
| </td>
 | |
| </tr>
 | |
| 
 | |
| <tr>
 | |
| <td>ParamPtr</td><td>MONO_TABLE_PARAM_POINTER</td><td>
 | |
| Array size: 
 | |
| MONO_PARAM_POINTER_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_PARAM_POINTER_PARAM
 | |
| </li></ul>
 | |
| </td>
 | |
| </tr>
 | |
| 
 | |
| <td>Param</td><td>MONO_TABLE_PARAM</td><td>
 | |
| Array size:  MONO_PARAM_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_PARAM_FLAGS
 | |
| 	<li>MONO_PARAM_SEQUENCE
 | |
| 	<li>MONO_PARAM_NAME
 | |
| </li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>PropertyMap</td><td>MONO_TABLE_PROPERTYMAP</td><td>
 | |
| Array size: 
 | |
| MONO_PROPERTY_MAP_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_PROPERTY_MAP_PARENT
 | |
| 	<li>MONO_PROPERTY_MAP_PROPERTY_LIST
 | |
| </li></li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>PropertyPtr</td><td>MONO_TABLE_PROPERTY_POINTER</td><td>Array
 | |
| size: MONO_PROPERTY_POINTER_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_PROPERTY_POINTER_PROPERTY
 | |
| </li></ul>
 | |
| </td>
 | |
| 
 | |
| 
 | |
| <td>Property</td><td>MONO_TABLE_PROPERTY</td><td>
 | |
| Array size: 
 | |
| MONO_PROPERTY_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_PROPERTY_FLAGS
 | |
| 	<li>MONO_PROPERTY_NAME
 | |
| 	<li>MONO_PROPERTY_TYPE
 | |
| </li></li></li></ul>
 | |
| </td>
 | |
| 
 | |
| <tr>
 | |
| <td>StandaloneSig</td><td>MONO_TABLE_STANDALONESIG</td><td>
 | |
| Array size: 
 | |
| 	<li>MONO_STAND_ALONE_SIGNATURE_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_STAND_ALONE_SIGNATURE
 | |
| </li></ul>
 | |
| </li></td>
 | |
| </tr>
 | |
| 
 | |
| <tr>
 | |
| <td>TypeDef</td><td>MONO_TABLE_TYPEDEF</td><td>
 | |
| Array size: 
 | |
| MONO_TYPEDEF_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_TYPEDEF_FLAGS
 | |
| 	<li>MONO_TYPEDEF_NAME
 | |
| 	<li>MONO_TYPEDEF_NAMESPACE
 | |
| 	<li>MONO_TYPEDEF_EXTENDS
 | |
| 	<li>MONO_TYPEDEF_FIELD_LIST
 | |
| 	<li>MONO_TYPEDEF_METHOD_LIST
 | |
| </li></li></li></li></li></li></ul>
 | |
| </td>
 | |
| </tr>
 | |
| 
 | |
| <tr>
 | |
| <td>TypeSpec</td><td>MONO_TABLE_TYPESPEC</td><td>
 | |
| Array size: 
 | |
| MONO_TYPESPEC_SIZE
 | |
| <ul>
 | |
| 	<li>MONO_TYPESPEC_SIGNATURE
 | |
| </li></ul>
 | |
| </td>
 | |
| </tr>
 | |
| 
 | |
| 	</table>
 | |
| 	</center>
 | |
| 
 | |
| 	<p />Each table can contain zero or more rows, you must call the
 | |
| 	<a href="#api:mono_metadata_table_rows">mono_metadata_table_rows</a>
 | |
| 	to obtain the number of rows in a table, and then you can
 | |
| 	extract individual row values by using
 | |
| 	the <a href="#api:mono_metadata_decode_row">mono_metadata_decode_row</a>
 | |
| 	or
 | |
| 	the <a href="#api:mono_metadata_decode_row_col">mono_metadata_decode_row_col</a>.
 | |
| 	When decoding rows you must provide an guint32 array large
 | |
| 	enough to hold as many columns as the table contains.
 | |
| 	
 | |
| 	<p />The metadata tables are stored in the MonoImage, you obtain
 | |
| 	a pointer to the MonoTableInfo by calling
 | |
| 	the <a href="#api:mono_image_get_table_info">mono_image_get_table_info</a>
 | |
| 	and then you can scan those tables, for example:
 | |
| 
 | |
| 	<pre class="prettyprint">
 | |
| 	/*
 | |
| 	 * Dumps a few fields from the AssemblyRef table
 | |
| 	 */
 | |
| 	void DumpAssemblyRefs (MonoImage *image)
 | |
| 	{
 | |
| 		/* Get a pointer to the AssemblyRef metadata table */
 | |
| 		MonoTableInfo *t = mono_image_get_table_info (image, MONO_TABLE_ASSEMBLYREF);
 | |
| 
 | |
| 		/* Fetch the number of rows available in the table */
 | |
| 		int rows = mono_table_info_get_rows (t);
 | |
| 		int i;
 | |
| 
 | |
| 		/* For each row, print some of its values */
 | |
| 		for (i = 0; i < rows; i++){
 | |
| 			/* Space where we extract one row from the metadata table */
 | |
| 			guint32 cols [MONO_ASSEMBLYREF_SIZE];
 | |
| 
 | |
| 			/* Extract the row into the array cols */
 | |
| 			mono_metadata_decode_row (t, i, cols, MONO_ASSEMBLYREF_SIZE);
 | |
| 
 | |
| 			fprintf (output, "%d: Version=%d.%d.%d.%d\n\tName=%s\n", i + 1,
 | |
|                         	cols [MONO_ASSEMBLYREF_MAJOR_VERSION],
 | |
|                         	cols [MONO_ASSEMBLYREF_MINOR_VERSION],
 | |
|                         	cols [MONO_ASSEMBLYREF_BUILD_NUMBER],
 | |
|                         	cols [MONO_ASSEMBLYREF_REV_NUMBER],
 | |
|                         	mono_metadata_string_heap (image, cols [MONO_ASSEMBLYREF_NAME]));
 | |
| 		}
 | |
| 	}
 | |
| 	</pre>
 | |
| 
 | |
| 	<p />The above program shows the following output when ran on
 | |
| 	the C# compiler:
 | |
| 
 | |
| 	<pre>
 | |
| 	1: Version=1.0.5000.0
 | |
| 		Name=mscorlib
 | |
| 	2: Version=1.0.5000.0
 | |
| 		Name=System
 | |
| 	3: Version=1.0.5000.0
 | |
| 		Name=System.Xml
 | |
| 	</pre>
 | |
| 
 | |
| 	<p />
 | |
| 
 | |
| <h3>Metadata Tables API</h3>
 | |
| 
 | |
| 	<p />These are the APIs for dealing with tables:
 | |
| 
 | |
|  <a name="api:mono_image_get_table_info"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_image_get_table_info</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_image_get_table_info</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_image_get_table_rows"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_image_get_table_rows</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_image_get_table_rows</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_get_table"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_get_table</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_get_table</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_decode_row_col"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_decode_row_col</div>
 | |
| 
 | |
|     <div class="prototype">guint32
 | |
| mono_metadata_decode_row_col (const MonoTableInfo *t, int idx, guint col)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>t:</i></dt><dd> table to extract information from.</dd><dt><i>idx:</i></dt><dd> index for row in table.</dd><dt><i>col:</i></dt><dd> column in the row.</dd></blockquote>
 | |
| <b>Remarks</b>
 | |
| <p />	 
 | |
| 	 This function returns the value of column <i>col</i> from the <i>idx</i>
 | |
| 	 row in the table <i>t</i>.
 | |
| 
 | |
| </div> <a name="api:mono_metadata_decode_row"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_decode_row</div>
 | |
| 
 | |
|     <div class="prototype">void
 | |
| mono_metadata_decode_row (const MonoTableInfo *t, int idx, guint32 *res, int res_size)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>t:</i></dt><dd> table to extract information from.</dd><dt><i>idx:</i></dt><dd> index in table.</dd><dt><i>res:</i></dt><dd> array of <i>res_size</i> cols to store the results in</dd></blockquote>
 | |
| <b>Remarks</b>
 | |
| <p />	 
 | |
| 	 This decompresses the metadata element <i>idx</i> in table <i>t</i>
 | |
| 	 into the guint32 <i>res</i> array that has res_size elements
 | |
| 
 | |
| </div> <a name="api:mono_metadata_compute_size"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_compute_size</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_compute_size</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_custom_attrs_from_index"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_custom_attrs_from_index</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_custom_attrs_from_index</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_decode_signed_value"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_decode_signed_value</div>
 | |
| 
 | |
|     <div class="prototype">gint32
 | |
| mono_metadata_decode_signed_value (const char *ptr, const char **rptr)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>ptr:</i></dt><dd> pointer to decode from</dd><dt><i>rptr:</i></dt><dd> the new position of the pointer</dd></blockquote>
 | |
| <b>Returns</b>
 | |
| <blockquote>	  the decoded value
 | |
| </blockquote>
 | |
| <b>Remarks</b>
 | |
| <p />	 
 | |
| 	 This routine decompresses 32-bit signed values
 | |
| 	 (not specified in the spec)
 | |
| 	
 | |
| 
 | |
| </div> <a name="api:mono_metadata_decode_value"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_decode_value</div>
 | |
| 
 | |
|     <div class="prototype">guint32
 | |
| mono_metadata_decode_value (const char *_ptr, const char **rptr)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>ptr:</i></dt><dd> pointer to decode from</dd><dt><i>rptr:</i></dt><dd> the new position of the pointer</dd></blockquote>
 | |
| <b>Returns</b>
 | |
| <blockquote>	  the decoded value
 | |
| </blockquote>
 | |
| <b>Remarks</b>
 | |
| <p />	 
 | |
| 	 This routine decompresses 32-bit values as specified in the "Blob and
 | |
| 	 Signature" section (22.2)
 | |
| 	
 | |
| 
 | |
| </div> <a name="api:mono_metadata_encode_value"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_encode_value</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_encode_value</div>
 | |
| <p />
 | |
| 
 | |
| 	
 | |
| </div><h2>Metadata access API</h2>
 | |
| 
 | |
| 	<p />This is the low-level API for accessing the metadata
 | |
| 	images.
 | |
| 	
 | |
|  <a name="api:mono_cli_rva_image_map"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_cli_rva_image_map</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_cli_rva_image_map</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_pe_file_open"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_pe_file_open</div>
 | |
| 
 | |
|     <div class="prototype">MonoImage*
 | |
| mono_pe_file_open (const char *fname, MonoImageOpenStatus *status)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>fname:</i></dt><dd> filename that points to the module we want to open</dd><dt><i>status:</i></dt><dd> An error condition is returned in this field</dd></blockquote>
 | |
| <b>Returns</b>
 | |
| <blockquote>	  An open image of type %MonoImage or NULL on error.  if
 | |
| 
 | |
| 	 NULL, then check the value of <i>status</i> for details on the error.
 | |
| 	 This variant for mono_image_open DOES NOT SET UP CLI METADATA.
 | |
| 	 It's just a PE file loader, used for FileVersionInfo.  It also does
 | |
| 	 not use the image cache.</blockquote>
 | |
| 
 | |
| </div> <a name="api:mono_metadata_events_from_typedef"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_events_from_typedef</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_events_from_typedef</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_field_info"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_field_info</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_field_info</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_free_array"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_free_array</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_free_array</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_free_marshal_spec"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_free_marshal_spec</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_free_marshal_spec</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_free_mh"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_free_mh</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_free_mh</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_free_type"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_free_type</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_free_type</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_get_constant_index"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_get_constant_index</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_get_constant_index</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_get_marshal_info"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_get_marshal_info</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_get_marshal_info</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_implmap_from_method"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_implmap_from_method</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_implmap_from_method</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_interfaces_from_typedef"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_interfaces_from_typedef</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_interfaces_from_typedef</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_locate"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_locate</div>
 | |
| 
 | |
|     <div class="prototype">const char *
 | |
| mono_metadata_locate (MonoImage *meta, int table, int idx)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>meta:</i></dt><dd> metadata context</dd><dt><i>table:</i></dt><dd> table code.</dd><dt><i>idx:</i></dt><dd> index of element to retrieve from <i>table</i>.</dd></blockquote>
 | |
| <b>Returns</b>
 | |
| <blockquote>	  a pointer to the <i>idx</i> element in the metadata table
 | |
| 
 | |
| 	 whose code is <i>table</i>.</blockquote>
 | |
| 
 | |
| </div> <a name="api:mono_metadata_locate_token"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_locate_token</div>
 | |
| 
 | |
|     <div class="prototype">const char *
 | |
| mono_metadata_locate_token (MonoImage *meta, guint32 token)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>meta:</i></dt><dd> metadata context</dd><dt><i>token:</i></dt><dd> metadata token</dd></blockquote>
 | |
| <b>Returns</b>
 | |
| <blockquote>	  a pointer to the data in the metadata represented by the
 | |
| 
 | |
| 	 token <i>token</i>.</blockquote>
 | |
| 
 | |
| </div> <a name="api:mono_metadata_methods_from_event"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_methods_from_event</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_methods_from_event</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_methods_from_property"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_methods_from_property</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_methods_from_property</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_nested_in_typedef"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_nested_in_typedef</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_nested_in_typedef</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_nesting_typedef"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_nesting_typedef</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_nesting_typedef</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_packing_from_typedef"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_packing_from_typedef</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_packing_from_typedef</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_properties_from_typedef"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_properties_from_typedef</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_properties_from_typedef</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_token_from_dor"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_token_from_dor</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_token_from_dor</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_typedef_from_field"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_typedef_from_field</div>
 | |
| 
 | |
|     <div class="prototype">guint32
 | |
| mono_metadata_typedef_from_field (MonoImage *meta, guint32 index)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>meta:</i></dt><dd> metadata context</dd><dt><i>index:</i></dt><dd> FieldDef token</dd></blockquote>
 | |
| <b>Returns</b>
 | |
| <blockquote>	  the 1-based index into the TypeDef table of the type that
 | |
| 
 | |
| 	 declared the field described by <i>index</i>, or 0 if not found.</blockquote>
 | |
| 
 | |
| </div> <a name="api:mono_metadata_typedef_from_method"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_typedef_from_method</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_typedef_from_method</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_type_equal"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_type_equal</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_type_equal</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_type_hash"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_type_hash</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_type_hash</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_declsec_from_index"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_declsec_from_index</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_declsec_from_index</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_free_method_signature"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_free_method_signature</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_free_method_signature</div>
 | |
| <p />
 | |
| 
 | |
| 
 | |
| </div><h3>Retrieving Objects from Tokens</h3>
 | |
| 
 | |
|  <a name="api:mono_metadata_parse_custom_mod"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_parse_custom_mod</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_parse_custom_mod</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_parse_field_type"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_parse_field_type</div>
 | |
| 
 | |
|     <div class="prototype">MonoType*
 | |
| mono_metadata_parse_field_type (MonoImage *m, short field_flags, const char *ptr, const char **rptr)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>m:</i></dt><dd> metadata context to extract information from</dd><dt><i>ptr:</i></dt><dd> pointer to the field signature</dd><dt><i>rptr:</i></dt><dd> pointer updated to match the end of the decoded stream</dd></blockquote>
 | |
| <b>Returns</b>
 | |
| <blockquote>	  The MonoType that was extracted from <i>ptr</i>.
 | |
| </blockquote>
 | |
| <b>Remarks</b>
 | |
| <p />	 
 | |
| 	 Parses the field signature, and returns the type information for it. 
 | |
| 	
 | |
| 
 | |
| </div> <a name="api:mono_metadata_parse_marshal_spec"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_parse_marshal_spec</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_parse_marshal_spec</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_parse_method_signature_full"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_parse_method_signature_full</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_parse_method_signature_full</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_parse_method_signature"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_parse_method_signature</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_parse_method_signature</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_parse_mh_full"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_parse_mh_full</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_parse_mh_full</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_parse_mh"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_parse_mh</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_parse_mh</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_parse_param"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_parse_param</div>
 | |
| 
 | |
|     <div class="prototype">MonoType*
 | |
| mono_metadata_parse_param (MonoImage *m, const char *ptr, const char **rptr)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>m:</i></dt><dd> metadata context to extract information from</dd><dt><i>ptr:</i></dt><dd> pointer to the param signature</dd><dt><i>rptr:</i></dt><dd> pointer updated to match the end of the decoded stream</dd></blockquote>
 | |
| <b>Returns</b>
 | |
| <blockquote>	  The MonoType that was extracted from <i>ptr</i>.
 | |
| </blockquote>
 | |
| <b>Remarks</b>
 | |
| <p />	 
 | |
| 	 Parses the param signature, and returns the type information for it. 
 | |
| 	
 | |
| 
 | |
| </div> <a name="api:mono_metadata_parse_signature"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_parse_signature</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_parse_signature</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_parse_typedef_or_ref"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_parse_typedef_or_ref</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_parse_typedef_or_ref</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_parse_type_full"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_parse_type_full</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_parse_type_full</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_parse_type"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_parse_type</div>
 | |
| 
 | |
|     <div class="prototype">static MonoType*
 | |
| mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container, MonoParseTypeMode mode,
 | |
| 								   short opt_attrs, gboolean transient, const char *ptr, const char **rptr)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>m:</i></dt><dd> metadata context</dd><dt><i>mode:</i></dt><dd> king of type that may be found at <i>ptr</i></dd><dt><i>opt_attrs:</i></dt><dd> optional attributes to store in the returned type</dd><dt><i>ptr:</i></dt><dd> pointer to the type representation</dd><dt><i>rptr:</i></dt><dd> pointer updated to match the end of the decoded stream</dd><dt><i>transient:</i></dt><dd> whenever to allocate the result from the heap or from a mempool</dd></blockquote>
 | |
| <b>Returns</b>
 | |
| <blockquote>	  a <i>MonoType</i> structure representing the decoded type.
 | |
| </blockquote>
 | |
| <b>Remarks</b>
 | |
| <p />	 <p />
 | |
| 
 | |
| 	 Decode a compressed type description found at <i>ptr</i> in <i>m</i>.
 | |
| 	 <i>mode</i> can be one of MONO_PARSE_MOD_TYPE, MONO_PARSE_PARAM, MONO_PARSE_RET,
 | |
| 	 MONO_PARSE_FIELD, MONO_PARSE_LOCAL, MONO_PARSE_TYPE.
 | |
| 	 This function can be used to decode type descriptions in method signatures,
 | |
| 	 field signatures, locals signatures etc.
 | |
| 	
 | |
| 	 To parse a generic type, `generic_container' points to the current class'es
 | |
| 	 (the `generic_container' field in the MonoClass) or the current generic method's
 | |
| 	 (stored in image->property_hash) generic container.
 | |
| 	 When we encounter any MONO_TYPE_VAR or MONO_TYPE_MVAR's, they're looked up in
 | |
| 	 this MonoGenericContainer.
 | |
| 	
 | |
| 	 LOCKING: Acquires the loader lock.
 | |
| 	
 | |
| 
 | |
| 
 | |
| </div><h2>Generics Support</h2>
 | |
| 
 | |
|  <a name="api:mono_metadata_generic_class_is_valuetype"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_generic_class_is_valuetype</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_generic_class_is_valuetype</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_inflate_generic_inst"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_inflate_generic_inst</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_inflate_generic_inst</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_metadata_load_generic_params"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_metadata_load_generic_params</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_metadata_load_generic_params</div>
 | |
| <p />
 | |
| 
 | |
| 
 | |
| </div><h2>Tokens</h2>
 | |
| 
 | |
|  <a name="api:mono_ldtoken"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_ldtoken</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_ldtoken</div>
 | |
| <p />
 | |
| 
 | |
| </div> <a name="api:mono_ldstr"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_ldstr</div>
 | |
| 
 | |
|     <div class="prototype">MonoString*
 | |
| mono_ldstr (MonoDomain *domain, MonoImage *image, guint32 idx)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>domain:</i></dt><dd> the domain where the string will be used.</dd><dt><i>image:</i></dt><dd> a metadata context</dd><dt><i>idx:</i></dt><dd> index into the user string table.</dd></blockquote>
 | |
| <b>Returns</b>
 | |
| <blockquote>	  a loaded string from the <i>image</i>/<i>idx</i> combination.
 | |
| </blockquote>
 | |
| <b>Remarks</b>
 | |
| <p />	 <p />
 | |
| 
 | |
| 	 Implementation for the ldstr opcode.
 | |
| 
 | |
| </div> <a name="api:mono_exception_from_token"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_exception_from_token</div>
 | |
| 
 | |
|     <div class="prototype">MonoException*
 | |
| mono_exception_from_token (MonoImage *image, guint32 token)
 | |
| 
 | |
| </div>
 | |
| <p />
 | |
| <b>Parameters</b>
 | |
| <blockquote><dt><i>image:</i></dt><dd> the Mono image where to look for the class</dd><dt><i>token:</i></dt><dd> The type token of the class</dd></blockquote>
 | |
| <b>Returns</b>
 | |
| <blockquote>	  the initialized exception instance.
 | |
| </blockquote>
 | |
| <b>Remarks</b>
 | |
| <p />	 
 | |
| 	 Creates an exception of the type given by <i>token</i>.
 | |
| 	
 | |
| 
 | |
| 
 | |
| </div><h2>OpCodes</h2>
 | |
| 
 | |
|  <a name="api:mono_opcode_name"></a>
 | |
|  <div class="api">
 | |
|     <div class="api-entry">mono_opcode_name</div>
 | |
| 
 | |
|     <div class="prototype">Prototype: mono_opcode_name</div>
 | |
| <p />
 | |
| 
 | |
| </div></body>
 | |
| </html>
 | |
| </span> |