Bug 316312 (MONO68786) - Problem marshaling a class from a delegate to unmanged caller
Summary: Problem marshaling a class from a delegate to unmanged caller
Status: RESOLVED INVALID
Alias: MONO68786
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Critical
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords: interop
Depends on:
Blocks:
 
Reported: 2004-10-26 03:28 UTC by James Fehlig
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
C# test code to demonstrate marshaling problem (1.20 KB, text/plain)
2004-10-26 03:29 UTC, Thomas Wiest
Details
Native lib code that demonstrates marshaling problem (957 bytes, text/plain)
2004-10-26 03:30 UTC, Thomas Wiest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:57:10 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".