NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Unmanaged COM and Unmanaged Code

To enable seamless interoperability with Unmanaged COM, any type declaration (class or interface) is also required to carry a GUID. In addition, a class declaration is expected to carry a version number, and may identify a collection of interfaces that it raises as events (as a collection of type reference or definition metadata tokens). The metadata also provides a mechanism to preserve the order of slots in a vtable, including the ability to declare “placeholder methods” to match externally imposed layout requirements. For details, refer to the COM Interop specification.

It is possible to pass data from NGWS runtime managed code to unmanaged code. This always involves a transition from managed to unmanaged code, which has some runtime cost, but data can often be transferred without copying. When data must be reformatted the VES provides a reasonable set of default behavior, but it is possible to use metadata to explicitly require other forms of marshalling (i.e. reformatted copying). The metadata also allows access to unmanaged methods through pre-existing mechanisms (DLL imports by name and by EAT offset).