Hey,

On Tue, Sep 21, 2010 at 10:19 PM, @lx <[email protected]> wrote:
> .method public hidebysig instance int32 Load(void* ptr, int32 arg1,
> void* arg2) cil managed
> {
>    .maxstack 3
>    .locals init (
>        [0] int32 num)
>    L_0000: ldarg.2
>    L_0001: ldarg.3
>    L_0002: ldarg.1
>    L_0003: calli method int32 *(int32, void*)
>    L_0008: ret
> }
>
> On the other side, a C++/CLI equivalent is :
> .method public hidebysig instance int32 Test(void* functionPtr, int32
> test1, void* test2) cil managed
> {
>    .maxstack 3
>    .locals (
>        [0] int32 num)
>    L_0000: ldarg.2
>    L_0001: ldarg.3
>    L_0002: ldarg.1
>    L_0003: calli method unmanaged stdcall int32
> modopt([mscorlib]System.Runtime.CompilerServices.CallConvStdcall)
> *(int32, void*)
>    L_0008: stloc.0
>    L_0009: ldloc.0
>    L_000a: ret
> }

Could you send me the assembly for that?

> How can I declare a CallSite to be unmanaged and forcing it to use
> stdcall calling convention with Mono.Cecil?

callsite.CallingConvention = MethodCallingConvention.StdCall;

I'm not sure about the unmanaged flag, please send me the assembly.

-- 
Jb Evain  <[email protected]>

-- 
--
mono-cecil

Reply via email to