[Mono-bugs] [Bug 72625][Min] New - Missing check marshaling pointers

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 15 Feb 2005 17:49:34 -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=72625

--- shadow/72625	2005-02-15 17:49:34.000000000 -0500
+++ shadow/72625.tmp.32216	2005-02-15 17:49:34.000000000 -0500
@@ -0,0 +1,41 @@
+Bug#: 72625
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gonzalo@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Missing check marshaling pointers
+
+Compile the attached test case with 'mcs -unsafe tc.cs' and run.
+
+Expected results:
+Unhandled Exception:
+System.Runtime.InteropServices.MarshalDirectiveException: Can not marshal
+parameter #2: Pointers can not reference marshaled structures. Use byref
+instead.
+   at System.WindowsConsoleDriver.printf(String handle, CharInfo* buffer)
+   at System.WindowsConsoleDriver.MoveBufferArea(Int32 sourceLeft, Int32
+sourceTop, Int32 sourceWidth, Int32 sourceHeight, Int32 targetLeft, Int32
+targetTop, Char sourceChar)
+   at System.WindowsConsoleDriver.Main()
+
+Actual results:
+Unhandled Exception: System.DllNotFoundException: c
+in <0x00049> (wrapper managed-to-native) System.WindowsConsoleDriver:printf
+(string,System.CharInfo*)
+in <0x0003b> System.WindowsConsoleDriver:MoveBufferArea
+(int,int,int,int,int,in,char)
+in <0x00032> System.WindowsConsoleDriver:Main ()
+
+Note that if the library/function is found, mono just works as if I used
+'void *' instead of 'CharInfo *'.