[Mono-bugs] [Bug 55385][Min] New - Marshal.SizeOf does not fail like MS

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 9 Mar 2004 16:05:21 -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 gonzalo@ximian.com.

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

--- shadow/55385	2004-03-09 16:05:21.000000000 -0500
+++ shadow/55385.tmp.7356	2004-03-09 16:05:21.000000000 -0500
@@ -0,0 +1,41 @@
+Bug#: 55385
+Product: Mono: Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gonzalo@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Marshal.SizeOf does not fail like MS
+
+Compile and run:
+-----
+using System;
+using System.Runtime.InteropServices;
+ 
+class T
+{
+        static void Main ()
+        {
+                Console.WriteLine (Marshal.SizeOf (typeof (object)));
+        }
+}
+----
+
+Actual results:
+0
+
+Expected results:
+Unhandled Exception: System.ArgumentException: Type System.Object can not
+be marshaled as an unmanaged structure; no meaningful size or offset can be
+computed.
+   at System.Runtime.InteropServices.Marshal.SizeOf(Type t)
+   at T.Main()