bugDotGNU Portable.NET - Bugs: bug #3668, Custom marshalers do not work...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #3668: Custom marshalers do not work properly

Submitted by:  Marcus Urban <mathpup>
Submitted on:  Sun 18 May 2003 05:57:12 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Sun 01 Jun 2003 07:45:53 PM UTC, comment #1:

It's fixed now or has been for a few days

Gopal.V <t3rmin4t0r>
Project Administrator
Sun 18 May 2003 05:57:12 AM UTC, original submission:

The bug report has more information than I would usually give because the topic is less likely to be familiar.

The documentation on implementing custom marshalers is quite vague, and further information is very scarce. However, I able to put together a trivial example of a custom marshaler to see if I could get it working.

The sample marshaler takes an Ansi C-string from unmanaged code and turns it into a C# string, placing asterisks around the string to differentiate this from the default marshaling.

The program creates a C# delegate that is indirectly invoked from unmanaged code, to test the marshaling.

With Rotor, I get the output "s = ABC".
With ilrun, I get "s = *v
xRÈC@*"

This might be bug in Marshal.PtrToStringAnsi() or in custom marshaling component of the runtime.

I'm attaching a test case.

1. Build a shared lib of invoke.cpp: cpp -shared -o libtest.so invoke.cpp
2. Build the C# test: cscc -o MyMarshal.exe MyMarshal.cs
3. Run the program: ilrun MyMarshal.exe

Marcus Urban <mathpup>

 

Attached Files
file #455:  invoke.cpp added by mathpup (263B - text/x-c++src - Test case)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sun 01 Jun 2003 07:45:53 PM UTCt3rmin4t0rOpen/ClosedOpen=>(Error - Not Found)
Sun 01 Jun 2003 07:45:51 PM UTCt3rmin4t0rStatusNone=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1