[Mono-bugs] [Bug 53700][Maj] New - Marshaling a Unicode StringBuilder does not work

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 1 Feb 2004 09:13:05 -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 jordi@ximian.com.


--- shadow/53700	2004-02-01 09:13:05.000000000 -0500
+++ shadow/53700.tmp.10418	2004-02-01 09:13:05.000000000 -0500
@@ -0,0 +1,52 @@
+Bug#: 53700
+Product: Mono/Class Libraries
+Version: unspecified
+OS Details: Windows XP SP1
+Status: NEW   
+Severity: Unknown
+Priority: Major
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jordi@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: Marshaling a Unicode StringBuilder does not work
+Marshalling StringBuilder as Unicode parameter does not work. It works for
+ANSI calls but not for Unicode. Platform Windows XP SP1.
+Running the attached example under Microsoft .Net 1.1 produces the
+following output:
+Font Family Handle->116098752
+FontFamily->Ok - Courier New
+The same example under Mono HEAD produces:
+Font Family Handle->26117824
+FontFamily->Ok - C
+It seems that the string is marshalled as an ANSI string. The API call that
+is not properly marshaled is:
+[DllImport ("gdiplus.dll", CharSet=CharSet.Unicode)]
+internal static extern Status GdipGetFamilyName(IntPtr family,
+StringBuilder fName, int language);