Bugzilla – Bug 316312
Problem marshaling a class from a delegate to unmanged caller
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by jfehlig@novell.com 2004-10-25 20:28:06 MST ---- Description of Problem: When marshaling a class containing two strings from a delegate to the unmanged caller of the delegate, only the first string in the class is properly marshaled. A test case depicting the behavior is attached. This test case executes as expected on .Net. Steps to reproduce the problem: 1. Build libtest.so using "gcc -shared -fpic -o libtest.so test.c" 2. Build test.exe using "mcs test.cs" 3. Run test.exe Actual Results: MANAGED: Registered callback with native library - now forcing the library to invoke the callback MANAGED: MyCallback called! NATIVE: cbFunc succeeded NATIVE: Results: User = rufas Passwd = MANAGED: Done...! Expected Results: MANAGED: Registered callback with native library - now forcing the library to invoke the callback MANAGED: MyCallback called! NATIVE: cbFunc succeeded NATIVE: Results: User = rufas Passwd = foobar MANAGED: Done...! How often does this happen? Always. Additional Information: This behavior is seen on 1.0.1, 1.0.2, and CVS HEAD. ---- Additional Comments From jfehlig@novell.com 2004-10-25 20:29:43 MST ---- Created an attachment (id=166959) C# test code to demonstrate marshaling problem ---- Additional Comments From jfehlig@novell.com 2004-10-25 20:30:57 MST ---- Created an attachment (id=166960) Native lib code that demonstrates marshaling problem ---- Additional Comments From lupus@ximian.com 2004-10-27 10:08:08 MST ---- You have the size wrong in the C# code: 521 instead of 512. Imported an attachment (id=166959) Imported an attachment (id=166960) Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>NLD</cf_op_sys_details> Unknown operating system unknown. Setting to default OS "Other".