[Mono-bugs] [Bug 70864][Blo] Changed - problems returning small structs from delegates on windows

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 19 Feb 2005 04:57:57 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by ddmk@r66.ru.

http://bugzilla.ximian.com/show_bug.cgi?id=70864

--- shadow/70864	2005-02-18 17:46:34.000000000 -0500
+++ shadow/70864.tmp.30684	2005-02-19 04:57:57.000000000 -0500
@@ -155,6 +155,97 @@
 ------- Additional Comments From vargaz@gmail.com  2005-02-18 16:56 -------
 This is because mono returns the struct on the stack, and expects the
 caller to pass a pointer to the return area, while the code generated
 by VC++ returns the struct in a register. So this is a bug and it will
 be fixed. As for the function pointer problem, please attach a testcase.
 
+
+------- Additional Comments From ddmk@r66.ru  2005-02-19 04:57 -------
+Sorry I can't include test case
+The application is too big... 
+
+//the function that present in error message is 
+[DllImport(dll_name)]static internal extern void  Set_Basic_Functions
+(int ver,NetF t,SerializationWrappers t2,StreamWrappers t3,int 
+version);
+
+No native code is executed for this function (mono faults on 
+wrapping functin tables(structutes) NetF SerializationWrappers 
+StreamWrappers )
+
+NetF contains 39 function pointers (delegates ):
+public delegate void 	T01();
+public delegate void 	T02(IntPtr exc);
+public delegate IntPtr 	T03();
+public delegate void  	T04(IntPtr obj);
+public delegate IntPtr 	T05(IntPtr a);
+public delegate IntPtr 	T06(IntPtr a);
+public delegate void 	T07(IntPtr a);
+public delegate void 	T08(IntPtr a);
+public delegate void 	T09(IntPtr a);
+public delegate void 	T10(IntPtr a);
+public delegate void	T11(string s,int line);
+public delegate void 	T12(string s,int line);
+public delegate int 	T13(int type,PLUGIN_UNIQUE_ID Uniq,int 
+version,int flags);
+public delegate IntPtr 	T14(PLUGIN_ID TypeID);
+public delegate IntPtr 	T15(PLUGIN_ID TypeID,int usr1,int 
+usr2,string usr3,IntPtr usr4);
+public delegate int 	T16(INTERFACE_ID ID,INTERFACE_UNIQUE_ID 
+Uniq);
+public delegate void 	T17(PLUGIN_ID PID,int flags);
+public delegate int 	T18(PLUGIN_ID PID,INTERFACE_ID IID);
+public delegate int 	T19(PLUGIN_ID TypeID,int usr1,int 
+usr2,string usr3,IntPtr usr4);
+public delegate int 	T20(IntPtr obj,int usr1,int usr2,string 
+usr3);
+public delegate string 	T21(PLUGIN_ID TypeID);
+public delegate string 	T22(PLUGIN_ID TypeID);
+public delegate string 	T23(PLUGIN_ID TypeID);
+public delegate string 	T24(PLUGIN_ID TypeID);
+public delegate string 	T25(PLUGIN_ID TypeID);
+public delegate string 	T26(INTERFACE_ID IID);
+public delegate void 	T27(IntPtr obj);
+public delegate IntPtr 	T28(IntPtr obj);
+public delegate IntPtr 	T29(IntPtr obj);
+public delegate void 	T30(IntPtr ar);
+public delegate void 	T31( IntPtr ar,int size);
+public delegate void 	T32(IntPtr ar,int size);
+public delegate IntPtr 	T33();
+public delegate IntPtr 	T34();
+public delegate IntPtr 	T35();
+public delegate IntPtr 	T36();
+public delegate IntPtr 	T37();
+public delegate IntPtr 	T38();
+public delegate IntPtr 	T39();
+//and fields of them of course.
+
+
+
+SerializationWrappers contains 8 function pointers 
+
+StreamWrappers contains 9 function pointers 
+
+
+This functions calls works correctly :
+
+[DllImport(dll_name)]static internal extern void  Set_Basic_Functions
+(SerializationWrappers t2,StreamWrappers t3);
+
+[DllImport(dll_name)]static internal extern void  Set_Basic_Functions
+(NetF t);
+
+But this function calls failed on mono 1.1.4 (but works on 1.1.3)
+
+[DllImport(dll_name)]static internal extern void  Set_Basic_Functions
+(NetF t,StreamWrappers t3);
+
+[DllImport(dll_name)]static internal extern void  Set_Basic_Functions
+(NetF t,SerializationWrappers t2);
+
+
+
+Can you say that's changes since 1.1.3 in code that performs 
+function tables wrapping ? 
+
+THIS BUG introduced in 1.1.4!.
+