The primary problem is the memory layout in the different runtime, so my first and hard coded advice is to use only native values (int, double and char) in such structures. You cant transfer objects!!!
The second is to transfer read-only, that mean that each runtime copies the values one by one.
Read my article
for such interfaces und dig into the source. You havent provided enough details of your structure.