Exemplo n.º 1
0
void *CScriptClass::GetMethodThunk(const char *methodName, int numParams)
{
	MonoMethod *pMethod = GetMonoMethod(methodName, numParams);
	if(pMethod)
		return mono_method_get_unmanaged_thunk(pMethod);
	else
		g_pScriptSystem->GetCorlibAssembly()->GetException("System", "MissingMethodException", "Failed to locate method %s in class %s", methodName, GetName())->Throw();

	return nullptr;
}
Exemplo n.º 2
0
/**
 * Returns the unmanaged thunk for the given @method_name method
 * descriptor.
 */
void *sp_get_method_thunk(const char *method_name)
{
	MonoMethodDesc *method_desc;
	MonoMethod *method;
	
	/* Create a MonoMethodDesc for the supplied method_name. */
	method_desc = mono_method_desc_new(method_name, 1);
	if (method_desc == NULL) {
		printf("error: unable to create method desc\n");
		_exit(0);
	}
	
	/* Try and find the method in the loaded assembly image. */
	method = mono_method_desc_search_in_image(method_desc, m_image);
	if (method == NULL) {
		printf("error: unable to find method\n");
		_exit(0);
	}

	/* Return the unmanaged thunk for the method. */
	return mono_method_get_unmanaged_thunk(method);
}
Exemplo n.º 3
0
void *GDMonoMethod::get_thunk() {
	return mono_method_get_unmanaged_thunk(mono_method);
}
Exemplo n.º 4
0
	void* MonoMethod::getThunk() const
	{
		return mono_method_get_unmanaged_thunk(mMethod);
	}
Exemplo n.º 5
0
void *CScriptMethod::GetMethodThunk()
{
	return mono_method_get_unmanaged_thunk(m_pMonoMethod);
}