How does marshalling work? - C#