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 [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=79312 --- shadow/79312 2006-09-06 22:06:17.000000000 -0400 +++ shadow/79312.tmp.27929 2006-09-06 22:06:17.000000000 -0400 @@ -0,0 +1,62 @@ +Bug#: 79312 +Product: Mono: Runtime +Version: 1.1 +OS: +OS Details: Mac OSX 10.4.7, G4 +Status: NEW +Resolution: +Severity: +Priority: Major +Component: interop +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: returning a struct by value giving unexpected results + +Description of Problem: +- Declaring an Invoke/P function that returns a struct does not return the +correct values. + +Steps to reproduce the problem: +- Here's the code: + +$ cat q.cs +using System; +using System.Runtime.InteropServices; + +public struct INT { + public int h; +} + +public struct HI { + public const string LIB = +"/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/HIToolbox"; + + public static void Main() { + int a = GetCurrentEventLoop1(); + INT b = GetCurrentEventLoop2(); + Console.WriteLine("{0:x} {1:x}", a, b.h); + } + + [DllImport(LIB, EntryPoint="GetCurrentEventLoop")] + public static extern int GetCurrentEventLoop1(); + + [DllImport(LIB, EntryPoint="GetCurrentEventLoop")] + public static extern INT GetCurrentEventLoop2(); + +} + +Actual Results: + +$ mcs -warn:4 -t:exe -out:q.exe q.cs +$ mono q.exe +77629a0b e214c9f1 + +Expected Results: +- The two values should match + +How often does this happen? +- Always _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
