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

Submitter:  Marcus Urban <mathpup>
Submitted:  Sun 18 May 2003 05:57:12 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned 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>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2003-06-01 t3rmin4t0r Open/ClosedOpen None
2003-06-01 t3rmin4t0r StatusNone None

Back to the top

Powered by Savane 3.13-caa5.
Corresponding source code