This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!
Data Copying
Whether or not data is copied during the marshaling process depends on the type of the data and it’s IN/OUT attributes.
- Formatted, Isomorphic classes - Regardless of the setting of the In and OUT attributes, a pointer to the actual class contents is passed and therefore it is as if the parameter had been marked IN/OUT.
- Formatted, Non-isomorphic – When a non-isomorphic class is marshaled as a pointer to a structure the callee receives a pointer to a copy of the structure. If the IN attribute is set, this copy is initialized (marshaling as necessary) with the instances state. If the OUT attribute is set, the state is copied (again marshaling as necessary) back in to the instance on return. If both IN/OUT is set, both copies occur.
- String – Strings can only be marshaled IN. When Strings are marshaled as LPWStrs (or LPTStrS on a Unicode platform) they are marshalled as Formatted, Isomorphic classes but should not be modified by the callee as strings are intended to be immutable in the Runtime.