/*
* mono_metadata_parse_signature:
* @image: metadata context
- * @toke: metadata token
+ * @token: metadata token
*
* Decode a method signature stored in the STANDALONESIG table
*
{
MonoError error;
MonoMethodSignature *ret;
+ ret = mono_metadata_parse_signature_checked (image, token, &error);
+ mono_error_cleanup (&error);
+ return ret;
+}
+
+/*
+ * mono_metadata_parse_signature_checked:
+ * @image: metadata context
+ * @token: metadata token
+ * @error: set on error
+ *
+ * Decode a method signature stored in the STANDALONESIG table
+ *
+ * Returns: a MonoMethodSignature describing the signature. On failure
+ * returns NULL and sets @error.
+ */
+MonoMethodSignature*
+mono_metadata_parse_signature_checked (MonoImage *image, guint32 token, MonoError *error)
+{
+
+ mono_error_init (error);
MonoTableInfo *tables = image->tables;
guint32 idx = mono_metadata_token_index (token);
guint32 sig;
const char *ptr;
if (image_is_dynamic (image)) {
- ret = (MonoMethodSignature *)mono_lookup_dynamic_token (image, token, NULL, &error);
- mono_error_raise_exception (&error); /* FIXME don't raise here */
- return ret;
+ return (MonoMethodSignature *)mono_lookup_dynamic_token (image, token, NULL, error);
}
g_assert (mono_metadata_token_table(token) == MONO_TABLE_STANDALONESIG);
ptr = mono_metadata_blob_heap (image, sig);
mono_metadata_decode_blob_size (ptr, &ptr);
- ret = mono_metadata_parse_method_signature_full (image, NULL, 0, ptr, NULL, &error);
- mono_error_cleanup (&error); /*FIXME don't swallow the error message*/
- return ret;
+ return mono_metadata_parse_method_signature_full (image, NULL, 0, ptr, NULL, error);
}
/*
if (method->signature)
mono_metadata_free_inflated_signature (method->signature);
+ if (method->wrapper_type)
+ g_free (((MonoMethodWrapper*)method)->method_data);
+
g_free (method);
}
free_generic_class (MonoGenericClass *gclass)
{
/* The gclass itself is allocated from the image set mempool */
- if (gclass->is_dynamic)
- mono_reflection_free_dynamic_generic_class (gclass);
if (gclass->cached_class && gclass->cached_class->interface_id)
mono_unload_interface_id (gclass->cached_class);
}
return gclass;
}
- if (is_dynamic) {
- MonoDynamicGenericClass *dgclass = mono_image_set_new0 (set, MonoDynamicGenericClass, 1);
- gclass = &dgclass->generic_class;
+ gclass = mono_image_set_new0 (set, MonoGenericClass, 1);
+ if (is_dynamic)
gclass->is_dynamic = 1;
- } else {
- gclass = mono_image_set_new0 (set, MonoGenericClass, 1);
- }
gclass->is_tb_open = is_tb_open;
gclass->container_class = container_class;
case MONO_NATIVE_TBSTR:
*conv = MONO_MARSHAL_CONV_STR_TBSTR;
return MONO_NATIVE_TBSTR;
+ case MONO_NATIVE_UTF8STR:
+ *conv = MONO_MARSHAL_CONV_STR_LPTSTR;
+ return MONO_NATIVE_UTF8STR;
case MONO_NATIVE_BYVALTSTR:
if (unicode)
*conv = MONO_MARSHAL_CONV_STR_BYVALWSTR;
guid[10], guid[11], guid[12], guid[13], guid[14], guid[15]);
}
+/**
+ * mono_guid_to_string_minimal:
+ *
+ * Converts a 16 byte Microsoft GUID to lower case no '-' representation..
+ */
+char *
+mono_guid_to_string_minimal (const guint8 *guid)
+{
+ return g_strdup_printf ("%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
+ guid[3], guid[2], guid[1], guid[0],
+ guid[5], guid[4],
+ guid[7], guid[6],
+ guid[8], guid[9],
+ guid[10], guid[11], guid[12], guid[13], guid[14], guid[15]);
+}
static gboolean
get_constraints (MonoImage *image, int owner, MonoClass ***constraints, MonoGenericContainer *container, MonoError *error)
{
!mono_metadata_generic_class_is_valuetype (type->data.generic_class))));
}
+mono_bool
+mono_type_is_generic_parameter (MonoType *type)
+{
+ return !type->byref && (type->type == MONO_TYPE_VAR || type->type == MONO_TYPE_MVAR);
+}
+
/**
* mono_signature_get_return_type:
* @sig: the method signature inspected