[Mono-bugs] [Bug 52834][Cri] New - mono windows version P/Invoke bug

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 13 Jan 2004 19:09:58 -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 liyul@hotmail.com.

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

--- shadow/52834	2004-01-13 19:09:58.000000000 -0500
+++ shadow/52834.tmp.8616	2004-01-13 19:09:58.000000000 -0500
@@ -0,0 +1,39 @@
+Bug#: 52834
+Product: Mono/Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Critical
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: liyul@hotmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mono windows version P/Invoke bug
+
+The mono runtime windows version P/Invoke use cdecl for winapi. Resulted in
+assembly not working with Microsoft implementations. 
+
+It is actually more tricky that appearance. Since Microsoft C# only
+supports stdcall in callback (Runtime and IL support it), so the code
+written for Microsoft runtime doesn't run on mono and vice versa.
+
+For example, mono SQliteClient use sqlite.dll, which uses cdecl for all
+export and callback functions. The assembly is not useable with Microsoft
+.net implementation and they appear to be wrong (all those call conventions
+are winapi).
+
+There's a related bug number 52831. The callback.il from "Inside Microsoft
+.net Assembler", allows Microsoft .net runtime to support cdecl callback.
+However, it cannot compile with mono ilasm. The one compiled by Microsoft
+ilasm crashes with mono 0.28 windows version with message:
+
+**ERROR**: Invalid IL code at IL0013 in .<Module>:print32(void*,int): call
+0x0a000001
+
+aborting...