Hey Philip,

On 4/30/09, Philip_L <[email protected]> wrote:
>  Is there any way to actually load the address of any given method at
>  runtime with Cecil and then use OpCodes.Calli to call the method
>  itself?
>
>  For example, let's say that I had a method called FastInvoke with the
>  following signature:
>
>  public object FastInvoke(object target, MethodInfo method, object[]
>  args);
>
>  ...does anyone know how to get the actual method pointer (that is, the
>  unsigned natural int) out of the method so that it can be used in a
>  Calli instruction?

MethodInfo method;

IntPtr pointer = method.MethodHandle.GetFunctionPointer ();

Is that what you want?

-- 
Jb Evain  <[email protected]>

--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---

Reply via email to