[Mono-bugs] [Bug 79117][Nor] New - Marshal.StringToHGlobalAuto & PtrToStringAuto not working as expected

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Aug 20 05:22:39 EDT 2006


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 gert.driesen at pandora.be.

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

--- shadow/79117	2006-08-20 05:22:39.000000000 -0400
+++ shadow/79117.tmp.858	2006-08-20 05:22:39.000000000 -0400
@@ -0,0 +1,52 @@
+Bug#: 79117
+Product: Mono: Runtime
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: interop
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Marshal.StringToHGlobalAuto & PtrToStringAuto not working as expected
+
+Mono's StringToHGlobalAuto and PtrToStringAuto methods of the Marshal 
+class do not work correctly when interacting with the win32 API.
+
+To reproduce:
+
+1. Extract the attached zip file.
+2. Compile test.cs.
+3. Run test.exe (on Windows).
+
+Expected result:
+
+The following text is output on the console:
+
+"389
+389
+Windows saved user drieseng registry while an application or service was 
+still using the registry during log off. The memory used by the user's 
+registry has not been freed. The registry will be unloaded when it is no 
+longer in use.
+
+This is often caused by services running as a user account, try 
+configuring the services to run in either the LocalService or 
+NetworkService account."
+
+Note: the first number is the number of bytes returned by the 
+FormatMessage API, while the second number is the length of the string 
+after converting the pointer to a managed string using 
+Marshal.PtrToStringAuto.
+
+Actual result:
+
+403
+1
+W


More information about the mono-bugs mailing list