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; }
/** * 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); }
void *GDMonoMethod::get_thunk() { return mono_method_get_unmanaged_thunk(mono_method); }
void* MonoMethod::getThunk() const { return mono_method_get_unmanaged_thunk(mMethod); }
void *CScriptMethod::GetMethodThunk() { return mono_method_get_unmanaged_thunk(m_pMonoMethod); }