[Mono-dev] ARM PInvoke issue when using long

D M dm_mono_dev at yahoo.com
Tue Nov 7 19:32:14 EST 2006


Hi,

It seems there is an issue with mono PInvoke on a 32 bit ARM platform.
If I have a native method declared as:

[DllImport("MyDll")]
static extern long Test1(int n1, long n2, long n3, int n4, long n5);

extern "C"
long long Test1(int n1, long long n2, long long n3, int n4, long long n5)
{
    printf("Test1 %d,%lld,%lld,%d,%lld\n",
            n1,
            n2,
            n3,
            n4,
            n5);

    return 12345;
}
and I invoke with the following parameters:

Test1(1, 2, 3, 4, 5);

the result is:

Test1 1,2,12884901888,0,21474836484

12884901888 = 0x300000000
21474836484 = 0x500000004

Dan

 
---------------------------------
Get your email and see which of your friends are online - Right on the  new Yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061107/c835c072/attachment.html 


More information about the Mono-devel-list mailing list