[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pnet-developers] [bug #20354] Problems with pinvoke declared to return
From: |
Radek Polak |
Subject: |
[Pnet-developers] [bug #20354] Problems with pinvoke declared to return struct |
Date: |
Thu, 05 Jul 2007 12:15:56 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en; rv:1.8.1.2) Gecko/20070220 Firefox/2.0.0.2 |
Update of bug #20354 (project dotgnu-pnet):
Status: None => Invalid
Open/Closed: Open => Closed
_______________________________________________________
Follow-up Comment #1:
It seems that the code works only on windows. On linux (even with mono) it
fails because of different calling conventions.
[13:47] <klausT|work> the pinvoked function doesn't return a struct
[13:51] <radekp> yep
[13:51] <klausT|work> does the function return an int or a boolean?
[13:51] <radekp> int
[13:52] <klausT|work> so you declared the return type in C# as int too?
[13:52] <radekp> if i declare return type as int it works
[13:53] <radekp> but if i declare it with return type as struct it fails
[13:53] <klausT|work> yes, of course it fails
[13:53] <radekp> on .NET it works on pnet no
[13:53] <klausT|work> because the signatures don't match
[13:54] <radekp> and on .NET they match?
[13:54] <klausT|work> on Windows you have usually the WINAPI/STDCALL calling
convention
[13:55] <klausT|work> the struct return value is handled different there
[13:55] <klausT|work> the callee pops the args from the stack and pushes the
return value
[13:57] <klausT|work> o no additional arg for the return value
[13:59] <radekp> so the conclusion is that the pinvoking is badly declared
and will work on windows only?
[14:01] <klausT|work> yes, if the c function returns an int the return value
in C# has to be int too
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?20354>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/