[Mono-bugs] [Bug 33454][Wis] New - marshaling conversion 16 not implemented
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
7 Nov 2002 20:16:39 -0000
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 mathias.hasselmann@gmx.de.
http://bugzilla.ximian.com/show_bug.cgi?id=33454
--- shadow/33454 Thu Nov 7 15:16:39 2002
+++ shadow/33454.tmp.32645 Thu Nov 7 15:16:39 2002
@@ -0,0 +1,88 @@
+Bug#: 33454
+Product: Mono/Runtime
+Version: unspecified
+OS: Red Hat 7.3
+OS Details: 2.4.20-pre10acpi20021002
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: mathias.hasselmann@gmx.de
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: marshaling conversion 16 not implemented
+
+Following code compiles with mcs 0.16 but is not accepted by mono 0.16.
+Instead of running silently following error messages are generated:
+
+** (./HelloJava.exe:4507): WARNING **: marshaling conversion 16 not implemented
+
+** ERROR **: file marshal.c: line 624 (emit_ptr_to_str_conv): should not be
+reached
+aborting...
+./HelloJava: line 12: 4507 Trace/Breakpoint ausgelöst
+LD_LIBRARY_PATH="$(dirname
+$0):${JAVA_LIBDIR}:${JVM_LIBDIR}${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"
+MONO_PATH="${MONO_LIBDIR}${MONO_PATH:+:}${MONO_PATH}" mono "$0.exe" "$@"
+
+Problem appears to be that marshaling from JavaVMOption[] to
+UnmanagedType.LPArray doesn't work.
+
+namespace Mono.InteropServices.JNI
+{
+ using System;
+ using System.Runtime.InteropServices;
+
+ public enum JNIVersions : int
+ {
+ Version_1_1 = 0x00010001,
+ Version_1_2 = 0x00010002,
+ Version_1_4 = 0x00010004
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct JavaVMOption
+ {
+ public string OptionString;
+ public string ExtraInfo;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct JavaVMArguments
+ {
+ [MarshalAs(UnmanagedType.I4)]
+ public JNIVersions Version;
+
+ [MarshalAs(UnmanagedType.I4)]
+ public int OptionCount;
+
+ [MarshalAs(UnmanagedType.LPArray)]
+ public JavaVMOption[] Options;
+
+ [MarshalAs(UnmanagedType.U1)]
+ public bool IgnoreUnrecognized;
+ }
+
+ public class JavaVM
+ {
+ public JavaVM()
+ {
+ }
+
+ [DllImport("libjvm.so")]
+ extern static int JNI_GetDefaultJavaVMInitArgs(ref JavaVMArguments
+args);
+ }
+}
+
+public class HelloJava
+{
+ public static void Main()
+ {
+ JavaVM jvm = new JavaVM();
+ }
+}