ef583813eb
Former-commit-id: 943baa9f16a098c33e129777827f3a9d20da00d6
1447 lines
54 KiB
HTML
1447 lines
54 KiB
HTML
<?xml version="1.0" encoding="us-ascii"?>
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>mono-api-methods.html</title>
|
|
<style type="text/css">
|
|
.mapi-docs {
|
|
line-height: 1.5;
|
|
padding-left: 2em;
|
|
padding-right: 2em;
|
|
}
|
|
.mapi-docs p {
|
|
max-width: 60em;
|
|
}
|
|
.mapi-docs .mapi-body {
|
|
max-width: 60em;
|
|
}
|
|
.mapi-docs code {
|
|
border: 1px solid rgba(214,214,214,1);
|
|
background-color: rgba(249,249,249,1);
|
|
padding: 0.1em 0.5em;
|
|
}
|
|
.mapi-description code {
|
|
font-family: "Consolas", "Courier", monospace;
|
|
border: 1px solid rgba(214,214,214,1);
|
|
background-color: rgba(249,249,249,1);
|
|
padding: 0.1em 0.2em;
|
|
}
|
|
|
|
.mapi-header {
|
|
padding: 0 0 5pt 5pt;
|
|
margin: 10pt;
|
|
white-space: pre;
|
|
font-family: monospace;
|
|
border: 1px solid rgba(233,233,233,1);
|
|
background-color: rgba(249,249,249,1);
|
|
}
|
|
|
|
.mapi-code {
|
|
padding: 5pt 5pt;
|
|
margin: 10pt;
|
|
white-space: pre;
|
|
font-family: monospace;
|
|
border: 1px solid rgba(233,233,233,1);
|
|
background-color: rgba(249,249,249,1);
|
|
}
|
|
|
|
.mapi-code:first-line {
|
|
line-height: 0px;
|
|
}
|
|
|
|
.mapi-codeblock {
|
|
display: block;
|
|
padding: 5pt 5pt;
|
|
margin: 10pt;
|
|
white-space: pre;
|
|
font-family: monospace;
|
|
border: 1px solid rgba(233,233,233,1);
|
|
background-color: rgba(249,249,249,1);
|
|
}
|
|
|
|
.mapi-entry code {
|
|
border: none;
|
|
background-color: transparent;
|
|
}
|
|
|
|
.mapi-parameters {
|
|
border-collapse: collapse;
|
|
border-spacing: 0;
|
|
empty-cells: hide;
|
|
border: 0;
|
|
margin: 5px 0 26px;
|
|
}
|
|
|
|
.mapi-parameters td {
|
|
border: 1px solid rgba(214,214,214,1);
|
|
border-left-style: none;
|
|
padding: 5px 25px 5px 10px;
|
|
}
|
|
|
|
.mapi-parameters tr>td:last-child {
|
|
border-right: 0;
|
|
}
|
|
|
|
.mapi-parameters td:first-of-type {
|
|
text-align: right;
|
|
padding: 7px;
|
|
vertical-align: top;
|
|
word-break: normal;
|
|
width: 40px;
|
|
}
|
|
|
|
.mapi-parameters tr:last-child>td {
|
|
border-bottom: 0;
|
|
}
|
|
|
|
.mapi-parameters tr:first-child>td {
|
|
border-top: 0;
|
|
}
|
|
|
|
.mapi-parameters tr td:first-of-type {
|
|
text-align: right;
|
|
padding: 7px;
|
|
vertical-align: top;
|
|
word-break: normal;
|
|
width: 40px;
|
|
}
|
|
|
|
.mapi {
|
|
left: -25px;
|
|
margin: 0;
|
|
padding: 13px 25px 0;
|
|
position: relative;
|
|
width: 100%;
|
|
}
|
|
|
|
.mapi-description {
|
|
background: rgba(249,249,249,1);
|
|
border-bottom: 1px solid rgba(233,233,233,1);
|
|
left: -25px;
|
|
margin: 0;
|
|
padding: 13px 25px 0;
|
|
position: relative;
|
|
width: 100%;
|
|
}
|
|
|
|
.mapi-entry {
|
|
background: transparent;
|
|
}
|
|
|
|
.mapi-docs {
|
|
}
|
|
|
|
.mapi-prototype {
|
|
border-left: 5px solid rgba(205,233,244,1);
|
|
padding: .5em;
|
|
margin-top: 5pt;
|
|
margin-bottom: 5pt;
|
|
font-family: "Consolas", "Courier", monospace;
|
|
display: block;
|
|
overflow: auto;
|
|
background-color: #f9f9f9;
|
|
}
|
|
|
|
.mapi-declaration {
|
|
margin-top: 21px;
|
|
}
|
|
|
|
.mapi-section {
|
|
font-size: smaller;
|
|
font-weight: bold;
|
|
margin-top: 21px;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.mapi-strike {
|
|
text-decoration: line-through;
|
|
}
|
|
|
|
.mapi-deprecated {
|
|
color: red;
|
|
}
|
|
|
|
.mapi-ptr-container {
|
|
background: white;
|
|
border-bottom: 1px solid rgba(233,233,233,1);
|
|
left: -25px;
|
|
padding-left: 25px;
|
|
padding-right: 25px;
|
|
padding-bottom: 13px;
|
|
position: relative;
|
|
width: 100%;
|
|
}
|
|
|
|
.mapi-ptr {
|
|
background: rgba(249,249,249,1);
|
|
border-left: 1px solid rgba(233,233,233,1);
|
|
border-top: 1px solid rgba(233,233,233,1);
|
|
height: 12px;
|
|
left: 37px;
|
|
top: -7px;
|
|
-webkit-transform: rotate(45deg);
|
|
-moz-transform: rotate(45deg);
|
|
-o-transform: rotate(45deg);
|
|
transform: rotate(45deg);
|
|
position: absolute;
|
|
width: 12px;
|
|
}
|
|
|
|
.mapi-height-container {
|
|
left: -25px;
|
|
padding: 0 25px;
|
|
position: relative;
|
|
width: 100%;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="mapi-docs">
|
|
<h2>Methods</h2>
|
|
|
|
<p />Methods are represented by the <code>MonoMethod*</code>
|
|
instances. Various APIs surface these instances, but usually
|
|
you will use the <a href="#method-desc">method description</a>
|
|
API to get a handle to a Mono Method. You can <a href="method-invoking">invoke</a> those methods from C,
|
|
or you can probe <a href="method-working">probe various properties</a> of a method, and in particular
|
|
its <a href="method-signature">method signature</a> or get
|
|
some <a href="method-header">low-level information</a> about them.
|
|
|
|
<p />The following code snippet from the Mono runtime shows you
|
|
how to create a managed <code>System.Version</code> instance
|
|
with four integers by looking up the constructor in the
|
|
managed implementation of System.Version, creating an instance
|
|
of the object, and then invoking the constructor on it.
|
|
|
|
<div class="mapi-header">
|
|
MonoObject*
|
|
create_version (MonoDomain *domain, guint32 major, guint32 minor, guint32 build, guint32 revision)
|
|
{
|
|
MonoClass *System_Version;
|
|
MonoMethod *create_version;
|
|
MonoError error;
|
|
MonoObject *result;
|
|
gpointer args [4];
|
|
|
|
System_Version = mono_class_from_name (mono_defaults.corlib, "System", "Version");
|
|
|
|
// Create a method description that we use to search for the
|
|
// constructor method
|
|
MonoMethodDesc *desc = mono_method_desc_new (":.ctor(int,int,int,int)", FALSE);
|
|
create_version = mono_method_desc_search_in_class (desc, System_Version);
|
|
mono_method_desc_free (desc);
|
|
|
|
// Setup the parameters to pass.
|
|
args [0] = &major;
|
|
args [1] = &minor;
|
|
args [2] = &build;
|
|
args [3] = &revision;
|
|
|
|
// Create the object instance
|
|
result = mono_object_new_checked (domain, System_Version, &error);
|
|
|
|
// Raise an exception in case of an error
|
|
mono_error_raise_exception (&error);
|
|
|
|
// Otherwise, invoke the constructor
|
|
mono_runtime_invoke (create_version, result, args, NULL);
|
|
|
|
// Return ther esult
|
|
return result;
|
|
}
|
|
|
|
</div>
|
|
|
|
<a name="method-desc"></a>
|
|
<h3>Method Descriptions</h3>
|
|
|
|
<p />Methods are represented by the <code>MonoMethod*</code>
|
|
instances. To simplify the process of getting
|
|
a <code>MonoMethod*</code>, you use Method Descriptors, which
|
|
are C-strings that describe the method that you are looking
|
|
for, and then you perform a search in either
|
|
a <a href="mono-api-type.html">type</a>, or a
|
|
loaded <a href="mono-api-image.html">image</a>.
|
|
|
|
|
|
<p />To describe a method, you use the Method Description API.
|
|
Method descriptions are used to locate a method in the
|
|
executing program. They can either be fully specified, that
|
|
is, they would include the namespace, class, method name and
|
|
all of its arguments or they omit the namespace and arguments
|
|
and even use wildcard matches for the class name and method names.
|
|
|
|
<p />You use the fully specified version to identify a
|
|
particular method, or you can use the partial version to find
|
|
a method or a family of methods in the code.
|
|
|
|
<p />Method descriptions are typically created from a C string
|
|
representation, and take the following form:
|
|
|
|
<p /><code>[namespace.]classname:methodname[(args...)]</code>
|
|
|
|
<p />Both classname and methodname can contain the '*' character
|
|
which can be used to match anything. Arguments are separated
|
|
by commas.
|
|
|
|
<p />You can use the type shortcuts to match the fully qualified
|
|
parameter types. The supported type shortcuts are:
|
|
<code>char</code>,
|
|
<code>bool</code>,
|
|
<code>byte</code>,
|
|
<code>sbyte</code>,
|
|
<code>uint16</code>,
|
|
<code>int16</code>,
|
|
<code>uint</code>,
|
|
<code>int</code>,
|
|
<code>ulong</code>,
|
|
<code>long</code>,
|
|
<code>uintptr</code>,
|
|
<code>intptr</code>,
|
|
<code>single</code>,
|
|
<code>double</code>,
|
|
<code>string</code> and
|
|
<code>object</code>.
|
|
|
|
<p />The type parameters can use the "&" and "*" type modifiers.
|
|
|
|
<p />Examples of method descriptions:
|
|
<ul>
|
|
<li>"Monitor:Exit": matches classes and methods called "Monitor.Exit"
|
|
<li>"Monitor:enter_with_atomic_var(object,bool&)":
|
|
matches a method in the class Monitor with two
|
|
specific type parameters.
|
|
<li>":.ctor(int,int,int,int)": matches constructors
|
|
that take four integers.
|
|
<li>"System.Globalization.CultureInfo:CreateCulture(string,bool)":
|
|
matches the CreateCultureMethod that takes a string
|
|
and a boolean on the System.Globalization.CultureInfo class.
|
|
</li></li></li></li></ul>
|
|
|
|
<p />You can
|
|
then <a href="api:mono_method_desc_search_in_image">search for
|
|
methods in MonoImages</a>
|
|
or <a href="api:mono_method_desc_search_in_class">search for
|
|
methods in classes</a>.
|
|
|
|
<a name="api:mono_method_desc_new"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_desc_new</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoMethodDesc*
|
|
mono_method_desc_new (const char *name, gboolean include_namespace)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>name</i></td><td> the method name.</td></tr><tr><td><i>include_namespace</i></td><td> whether the name includes a namespace or not.</td></tr></tbody></table> <div class="mapi-section">Return value</div>
|
|
<div> a parsed representation of the method description.
|
|
</div>
|
|
<div class="mapi-section">Description</div>
|
|
<div>
|
|
<p />
|
|
Creates a method description for <i>name</i>, which conforms to the following
|
|
specification:
|
|
<p />
|
|
<code>[namespace.]classname:methodname[(args...)]</code>
|
|
<p />
|
|
in all the loaded assemblies.
|
|
<p />
|
|
Both classname and methodname can contain <code>*</code> which matches anything.
|
|
<p /></div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_desc_free"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_desc_free</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">void
|
|
mono_method_desc_free (MonoMethodDesc *desc)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>desc</i></td><td> method description to be released</td></tr></tbody></table> <div class="mapi-section">Description</div>
|
|
<div>
|
|
Releases the <code>MonoMethodDesc</code> object <i>desc</i>.</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_desc_from_method"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_desc_from_method</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoMethodDesc*
|
|
mono_method_desc_from_method (MonoMethod *method)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_desc_full_match"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_desc_full_match</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">gboolean
|
|
mono_method_desc_full_match (MonoMethodDesc *desc, MonoMethod *method)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>desc</i></td><td> A method description that you created with mono_method_desc_new</td></tr><tr><td><i>method</i></td><td> a MonoMethod instance that you want to match against</td></tr></tbody></table> <div class="mapi-section">Return value</div>
|
|
<div> <code>TRUE</code> if the specified method matches the specified description, <code>FALSE</code> otherwise.
|
|
</div>
|
|
<div class="mapi-section">Description</div>
|
|
<div>
|
|
<p />
|
|
This method is used to check whether the method matches the provided
|
|
description, by making sure that the method matches both the class and the method parameters.
|
|
<p /></div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_desc_match"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_desc_match</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">gboolean
|
|
mono_method_desc_match (MonoMethodDesc *desc, MonoMethod *method)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>desc</i></td><td> <code>MonoMethoDescription</code></td></tr><tr><td><i>method</i></td><td> <code>MonoMethod</code> to test</td></tr></tbody></table> <div class="mapi-section">Return value</div>
|
|
<div> <code>TRUE</code> if the method matches the description, <code>FALSE</code> otherwise.
|
|
</div>
|
|
<div class="mapi-section">Description</div>
|
|
<div>
|
|
<p />
|
|
Determines whether the specified <i>method</i> matches the provided <i>desc</i> description.
|
|
<p />
|
|
namespace and class are supposed to match already if this function is used.</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_desc_search_in_class"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_desc_search_in_class</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoMethod*
|
|
mono_method_desc_search_in_class (MonoMethodDesc *desc, MonoClass *klass)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_desc_search_in_image"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_desc_search_in_image</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoMethod*
|
|
mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
|
|
<a name="method-working"></a>
|
|
<h3>Working with Methods</h3>
|
|
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_full_name"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_full_name</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">char*
|
|
mono_method_full_name (MonoMethod *method, gboolean signature)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_get_class"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_get_class</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoClass*
|
|
mono_method_get_class (MonoMethod *method)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_get_flags"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_get_flags</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">guint32
|
|
mono_method_get_flags (MonoMethod *method, guint32 *iflags)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_get_last_managed"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_get_last_managed</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoMethod*
|
|
mono_method_get_last_managed (void)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_get_marshal_info"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_get_marshal_info</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">void
|
|
mono_method_get_marshal_info (MonoMethod *method, MonoMarshalSpec **mspecs)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_get_name"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_get_name</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">const char*
|
|
mono_method_get_name (MonoMethod *method)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_get_object"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_get_object</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoReflectionMethod*
|
|
mono_method_get_object (MonoDomain *domain, MonoMethod *method, MonoClass *refclass)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>domain</i></td><td> an app domain</td></tr><tr><td><i>method</i></td><td> a method</td></tr><tr><td><i>refclass</i></td><td> the reflected type (can be <code>NULL</code>)</td></tr></tbody></table> <div class="mapi-section">Return value</div>
|
|
<div> A <code>System.Reflection.MonoMethod</code> object representing the method <i>method</i>.
|
|
</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_get_param_names"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_get_param_names</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">void
|
|
mono_method_get_param_names (MonoMethod *method, const char **names)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_get_param_token"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_get_param_token</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">guint32
|
|
mono_method_get_param_token (MonoMethod *method, int index)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_get_signature"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_get_signature</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoMethodSignature*
|
|
mono_method_get_signature (MonoMethod *method, MonoImage *image, guint32 token)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Description</div>
|
|
<div>
|
|
<i>token</i> is the method_ref/def/spec token used in a call IL instruction.
|
|
\deprecated use the <code>_checked</code> variant
|
|
Notes: runtime code MUST not use this function</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_get_index"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_get_index</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">guint32
|
|
mono_method_get_index (MonoMethod *method)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Description</div>
|
|
<div>
|
|
Find the method index in the metadata <code>MethodDef</code> table.</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_get_signature_full"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_get_signature_full</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoMethodSignature*
|
|
mono_method_get_signature_full (MonoMethod *method, MonoImage *image, guint32 token, MonoGenericContext *context)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Description</div>
|
|
<div>
|
|
<i>token</i> is the method ref/def/spec token used in a <code>call</code> IL instruction.
|
|
\deprecated use the <code>_checked</code> variant
|
|
Notes: runtime code MUST not use this function</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_get_token"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_get_token</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">guint32
|
|
mono_method_get_token (MonoMethod *method)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_get_unmanaged_thunk"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_get_unmanaged_thunk</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">gpointer
|
|
mono_method_get_unmanaged_thunk (MonoMethod *method)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>method</i></td><td> method to generate a thunk for.</td></tr></tbody></table> <div class="mapi-section">Description</div>
|
|
<div>
|
|
<p />
|
|
Returns an <code>unmanaged->managed</code> thunk that can be used to call
|
|
a managed method directly from C.
|
|
<p />
|
|
The thunk's C signature closely matches the managed signature:
|
|
<p />
|
|
C#: <code>public bool Equals (object obj);</code>
|
|
<p />
|
|
C: <code>typedef MonoBoolean (*Equals)(MonoObject*, MonoObject*, MonoException**);</code>
|
|
<p />
|
|
The 1st (<code>this</code>) parameter must not be used with static methods:
|
|
<p />
|
|
C#: <code>public static bool ReferenceEquals (object a, object b);</code>
|
|
<p />
|
|
C: <code>typedef MonoBoolean (*ReferenceEquals)(MonoObject*, MonoObject*, MonoException**);</code>
|
|
<p />
|
|
The last argument must be a non-null <code>MonoException*</code> pointer.
|
|
It has "out" semantics. After invoking the thunk, <code>*ex</code> will be <code>NULL</code> if no
|
|
exception has been thrown in managed code. Otherwise it will point
|
|
to the <code>MonoException*</code> caught by the thunk. In this case, the result of
|
|
the thunk is undefined:
|
|
<p />
|
|
<pre>
|
|
MonoMethod *method = ... // MonoMethod* of System.Object.Equals
|
|
<p />
|
|
MonoException *ex = <code>NULL</code>;
|
|
<p />
|
|
Equals func = mono_method_get_unmanaged_thunk (method);
|
|
<p />
|
|
MonoBoolean res = func (thisObj, objToCompare, &ex);
|
|
<p />
|
|
if (ex) {
|
|
<p />
|
|
// handle exception
|
|
<p />
|
|
}
|
|
</pre>
|
|
<p />
|
|
The calling convention of the thunk matches the platform's default
|
|
convention. This means that under Windows, C declarations must
|
|
contain the <code>__stdcall</code> attribute:
|
|
<p />
|
|
C: <code>typedef MonoBoolean (__stdcall *Equals)(MonoObject*, MonoObject*, MonoException**);</code>
|
|
<p />
|
|
LIMITATIONS
|
|
<p />
|
|
Value type arguments and return values are treated as they were objects:
|
|
<p />
|
|
C#: <code>public static Rectangle Intersect (Rectangle a, Rectangle b);</code>
|
|
C: <code>typedef MonoObject* (*Intersect)(MonoObject*, MonoObject*, MonoException**);</code>
|
|
<p />
|
|
Arguments must be properly boxed upon trunk's invocation, while return
|
|
values must be unboxed.</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_has_marshal_info"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_has_marshal_info</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">gboolean
|
|
mono_method_has_marshal_info (MonoMethod *method)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_verify"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_verify</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">GSList*
|
|
mono_method_verify (MonoMethod *method, int level)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Description</div>
|
|
<div>
|
|
Verify types for opcodes.</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
|
|
<a name="method-invoking"></a>
|
|
<h3>Invoking Methods</h3>
|
|
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_runtime_invoke"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_runtime_invoke</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoObject*
|
|
mono_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>method</i></td><td> method to invoke</td></tr><tr><td><i>obj</i></td><td> object instance</td></tr><tr><td><i>params</i></td><td> arguments to the method</td></tr><tr><td><i>exc</i></td><td> exception information.</td></tr></tbody></table> <div class="mapi-section">Description</div>
|
|
<div>
|
|
Invokes the method represented by <i>method</i> on the object <i>obj</i>.
|
|
<i>obj</i> is the <code>this</code> pointer, it should be <code>NULL</code> for static
|
|
methods, a <code>MonoObject*</code> for object instances and a pointer to
|
|
the value type for value types.
|
|
<p />
|
|
The params array contains the arguments to the method with the
|
|
same convention: <code>MonoObject*</code> pointers for object instances and
|
|
pointers to the value type otherwise.
|
|
<p />
|
|
From unmanaged code you'll usually use the
|
|
<code>mono_runtime_invoke</code> variant.
|
|
<p />
|
|
Note that this function doesn't handle virtual methods for
|
|
you, it will exec the exact method you pass: we still need to
|
|
expose a function to lookup the derived class implementation
|
|
of a virtual method (there are examples of this in the code,
|
|
though).
|
|
<p />
|
|
You can pass <code>NULL</code> as the <i>exc</i> argument if you don't want to
|
|
catch exceptions, otherwise, <code>*exc</code> will be set to the exception
|
|
thrown, if any. if an exception is thrown, you can't use the
|
|
<code>MonoObject*</code> result from the function.
|
|
<p />
|
|
If the method returns a value type, it is boxed in an object
|
|
reference.</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
|
|
If you want to invoke generic methods, you must call the method on the
|
|
"inflated" class, which you can obtain from the
|
|
<tt>mono_object_get_class()</tt>
|
|
|
|
<div class="mapi-code">
|
|
MonoClass *clazz;
|
|
MonoMethod *method;
|
|
|
|
clazz = mono_object_get_class (obj);
|
|
|
|
/*
|
|
* If there are more Add methods declared, you
|
|
* may use mono_method_desc_search_in_class (clazz, ":Add(T)"),
|
|
* you must substitute ":Add(T)" with the correct type, for example
|
|
* for List<int>, you would use ":Add(int)".
|
|
*/
|
|
method = mono_class_get_method_from_name (clazz, "Add", 1);
|
|
mono_runtime_invoke (method, obj, args, &exception);
|
|
</div>
|
|
|
|
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_runtime_invoke_array"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_runtime_invoke_array</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoObject*
|
|
mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params,
|
|
MonoObject **exc)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>method</i></td><td> method to invoke</td></tr><tr><td><i>obj</i></td><td> object instance</td></tr><tr><td><i>params</i></td><td> arguments to the method</td></tr><tr><td><i>exc</i></td><td> exception information.</td></tr></tbody></table> <div class="mapi-section">Description</div>
|
|
<div>
|
|
Invokes the method represented by <i>method</i> on the object <i>obj</i>.
|
|
<p />
|
|
<i>obj</i> is the <code>this</code> pointer, it should be <code>NULL</code> for static
|
|
methods, a <code>MonoObject*</code> for object instances and a pointer to
|
|
the value type for value types.
|
|
<p />
|
|
The <i>params</i> array contains the arguments to the method with the
|
|
same convention: <code>MonoObject*</code> pointers for object instances and
|
|
pointers to the value type otherwise. The <code>_invoke_array</code>
|
|
variant takes a C# <code>object[]</code> as the params argument (<code>MonoArray*)</code>:
|
|
in this case the value types are boxed inside the
|
|
respective reference representation.
|
|
<p />
|
|
From unmanaged code you'll usually use the
|
|
mono_runtime_invoke_checked() variant.
|
|
<p />
|
|
Note that this function doesn't handle virtual methods for
|
|
you, it will exec the exact method you pass: we still need to
|
|
expose a function to lookup the derived class implementation
|
|
of a virtual method (there are examples of this in the code,
|
|
though).
|
|
<p />
|
|
You can pass <code>NULL</code> as the <i>exc</i> argument if you don't want to
|
|
catch exceptions, otherwise, <code>*exc</code> will be set to the exception
|
|
thrown, if any. if an exception is thrown, you can't use the
|
|
<code>MonoObject*</code> result from the function.
|
|
<p />
|
|
If the method returns a value type, it is boxed in an object
|
|
reference.</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_runtime_delegate_invoke"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_runtime_delegate_invoke</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoObject*
|
|
mono_runtime_delegate_invoke (MonoObject *delegate, void **params, MonoObject **exc)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>delegate</i></td><td> pointer to a delegate object.</td></tr><tr><td><i>params</i></td><td> parameters for the delegate.</td></tr><tr><td><i>exc</i></td><td> Pointer to the exception result.</td></tr></tbody></table> <div class="mapi-section">Description</div>
|
|
<div>
|
|
<p />
|
|
Invokes the delegate method <i>delegate</i> with the parameters provided.
|
|
<p />
|
|
You can pass <code>NULL</code> as the <i>exc</i> argument if you don't want to
|
|
catch exceptions, otherwise, <code>*exc</code> will be set to the exception
|
|
thrown, if any. if an exception is thrown, you can't use the
|
|
<code>MonoObject*</code> result from the function.</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_body_get_object"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_body_get_object</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoReflectionMethodBody*
|
|
mono_method_body_get_object (MonoDomain *domain, MonoMethod *method)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>domain</i></td><td> an app domain</td></tr><tr><td><i>method</i></td><td> a method</td></tr></tbody></table> <div class="mapi-section">Return value</div>
|
|
<div> A <code>System.Reflection.MethodBody/RuntimeMethodBody</code> object representing the method <i>method</i>.
|
|
</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
|
|
<a name="method-signature"></a>
|
|
<h3>Method Signatures</h3>
|
|
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_signature"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_signature</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoMethodSignature*
|
|
mono_method_signature (MonoMethod *m)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Return value</div>
|
|
<div> the signature of the method <i>m</i>. On failure, returns <code>NULL</code>.
|
|
</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_signature_explicit_this"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_signature_explicit_this</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">gboolean
|
|
mono_signature_explicit_this (MonoMethodSignature *sig)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>sig</i></td><td> the method signature inspected</td></tr></tbody></table> <div class="mapi-section">Return value</div>
|
|
<div> <code>TRUE</code> if this the method signature <i>sig</i> has an explicit
|
|
|
|
instance argument. <code>FALSE</code> otherwise.</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_signature_get_call_conv"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_signature_get_call_conv</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">guint32
|
|
mono_signature_get_call_conv (MonoMethodSignature *sig)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>sig</i></td><td> the method signature inspected</td></tr></tbody></table> <div class="mapi-section">Return value</div>
|
|
<div> the call convention of the method signature <i>sig</i>.
|
|
</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_signature_get_desc"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_signature_get_desc</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">char*
|
|
mono_signature_get_desc (MonoMethodSignature *sig, gboolean include_namespace)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_signature_get_param_count"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_signature_get_param_count</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">guint32
|
|
mono_signature_get_param_count (MonoMethodSignature *sig)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>sig</i></td><td> the method signature inspected</td></tr></tbody></table> <div class="mapi-section">Return value</div>
|
|
<div> the number of parameters in the method signature <i>sig</i>.
|
|
</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_signature_get_params"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_signature_get_params</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoType*
|
|
mono_signature_get_params (MonoMethodSignature *sig, gpointer *iter)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>sig</i></td><td> the method signature inspected</td></tr><tr><td><i>iter</i></td><td> pointer to an iterator</td></tr></tbody></table> <div class="mapi-section">Return value</div>
|
|
<div> the next parameter type of the method signature <i>sig</i>,
|
|
|
|
<code>NULL</code> when finished.</div>
|
|
<div class="mapi-section">Description</div>
|
|
<div>
|
|
Iterates over the parameters for the method signature <i>sig</i>.
|
|
A <code>void*</code> pointer must be initialized to <code>NULL</code> to start the iteration
|
|
and its address is passed to this function repeteadly until it returns
|
|
<code>NULL</code>.</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_signature_get_return_type"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_signature_get_return_type</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoType*
|
|
mono_signature_get_return_type (MonoMethodSignature *sig)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>sig</i></td><td> the method signature inspected</td></tr></tbody></table> <div class="mapi-section">Return value</div>
|
|
<div> the return type of the method signature <i>sig</i>
|
|
</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_signature_hash"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_signature_hash</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">guint
|
|
mono_signature_hash (MonoMethodSignature *sig)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_signature_is_instance"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_signature_is_instance</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">gboolean
|
|
mono_signature_is_instance (MonoMethodSignature *sig)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>sig</i></td><td> the method signature inspected</td></tr></tbody></table> <div class="mapi-section">Return value</div>
|
|
<div> <code>TRUE</code> if this the method signature <i>sig</i> has an implicit
|
|
|
|
first instance argument. <code>FALSE</code> otherwise.</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_signature_param_is_out"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_signature_param_is_out</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">mono_bool
|
|
mono_signature_param_is_out (MonoMethodSignature *sig, int param_num)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>sig</i></td><td> the method signature inspected</td></tr><tr><td><i>param_num</i></td><td> the 0-based index of the inspected parameter</td></tr></tbody></table> <div class="mapi-section">Return value</div>
|
|
<div> <code>TRUE</code> if the parameter is an out parameter, <code>FALSE</code>
|
|
|
|
otherwise.</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_signature_vararg_start"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_signature_vararg_start</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">int
|
|
mono_signature_vararg_start (MonoMethodSignature *sig)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>sig</i></td><td> the method signature inspected</td></tr></tbody></table> <div class="mapi-section">Return value</div>
|
|
<div> the number of the first vararg parameter in the
|
|
|
|
method signature \param sig. <code>-1</code> if this is not a vararg signature.</div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_param_get_objects"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_param_get_objects</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoArray*
|
|
mono_param_get_objects (MonoDomain *domain, MonoMethod *method)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_get_method_full"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_get_method_full</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoMethod*
|
|
mono_get_method_full (MonoImage *image, guint32 token, MonoClass *klass,
|
|
MonoGenericContext *context)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_get_method"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_get_method</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoMethod*
|
|
mono_get_method (MonoImage *image, guint32 token, MonoClass *klass)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
|
|
<a name="method-header"></a>
|
|
<h3>Methods Header Operations</h3>
|
|
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_get_header"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_get_header</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoMethodHeader*
|
|
mono_method_get_header (MonoMethod *method)
|
|
|
|
</div>
|
|
<p />
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_header_get_clauses"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_header_get_clauses</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">int
|
|
mono_method_header_get_clauses (MonoMethodHeader *header, MonoMethod *method, gpointer *iter, MonoExceptionClause *clause)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>header</i></td><td> a <code>MonoMethodHeader</code> pointer</td></tr><tr><td><i>method</i></td><td> <code>MonoMethod</code> the header belongs to</td></tr><tr><td><i>iter</i></td><td> pointer to a iterator</td></tr><tr><td><i>clause</i></td><td> pointer to a <code>MonoExceptionClause</code> structure which will be filled with the info</td></tr></tbody></table> <div class="mapi-section">Return value</div>
|
|
<div> <code>TRUE</code> if clause was filled with info, <code>FALSE</code> if there are no more exception
|
|
|
|
clauses.</div>
|
|
<div class="mapi-section">Description</div>
|
|
<div>
|
|
<p />
|
|
Get the info about the exception clauses in the method. Set <code>*iter</code> to <code>NULL</code> to
|
|
initiate the iteration, then call the method repeatedly until it returns <code>FALSE</code>.
|
|
At each iteration, the structure pointed to by clause if filled with the
|
|
exception clause information.
|
|
<p /></div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_header_get_code"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_header_get_code</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">const unsigned char*
|
|
mono_method_header_get_code (MonoMethodHeader *header, guint32* code_size, guint32* max_stack)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>header</i></td><td> a <code>MonoMethodHeader</code> pointer</td></tr><tr><td><i>code_size</i></td><td> memory location for returning the code size</td></tr><tr><td><i>max_stack</i></td><td> memory location for returning the max stack</td></tr></tbody></table> <div class="mapi-section">Return value</div>
|
|
<div> pointer to the IL code represented by the method header.
|
|
</div>
|
|
<div class="mapi-section">Description</div>
|
|
<div>
|
|
<p />
|
|
Method header accessor to retreive info about the IL code properties:
|
|
a pointer to the IL code itself, the size of the code and the max number
|
|
of stack slots used by the code.
|
|
<p /></div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|
|
</div> <!-- class=mapi -->
|
|
|
|
<a name="api:mono_method_header_get_locals"></a>
|
|
<div class="mapi">
|
|
<div class="mapi-entry "><code>mono_method_header_get_locals</code></div>
|
|
<div class="mapi-height-container">
|
|
<div class="mapi-ptr-container"></div>
|
|
<div class="mapi-description">
|
|
<div class="mapi-ptr"></div>
|
|
|
|
<div class="mapi-declaration mapi-section">Syntax</div>
|
|
<div class="mapi-prototype">MonoType*
|
|
mono_method_header_get_locals (MonoMethodHeader *header, guint32* num_locals, gboolean *init_locals)
|
|
|
|
</div>
|
|
<p />
|
|
<div class="mapi-section">Parameters</div>
|
|
<table class="mapi-parameters"><tbody><tr><td><i>header</i></td><td> a <code>MonoMethodHeader</code> pointer</td></tr><tr><td><i>num_locals</i></td><td> memory location for returning the number of local variables</td></tr><tr><td><i>init_locals</i></td><td> memory location for returning the init_locals flag</td></tr></tbody></table> <div class="mapi-section">Return value</div>
|
|
<div> pointer to an array of types of the local variables
|
|
</div>
|
|
<div class="mapi-section">Description</div>
|
|
<div>
|
|
<p />
|
|
Method header accessor to retreive info about the local variables:
|
|
an array of local types, the number of locals and whether the locals
|
|
are supposed to be initialized to 0 on method entry
|
|
<p /></div>
|
|
</div><!--mapi-description -->
|
|
</div><!--height container -->
|