The specific syntax used to annotate the method declarations will vary by language. This document gives examples using the VC7 syntax. However, it might be instructive to present a more general idea of just what any NGWS runtime enabled language will be (or need to be) supporting.
The key thing is the ability to annotate a method with information used by Platform Invocation Services to correctly marshal the data and call the appropriate underlying DLL entry point. A component or application developer will declare the method with a signature that consists solely of valid NGWS runtime managed data types. The developer will annotate that method to flag it as not having a local implementation but, rather, as having an unmanaged implementation that can be accessed via a call to an unmanaged API. Although a particular tool may provide some defaults and/or syntactic “sugar”, the annotations will consist of:
If any of the parameters is an unmanaged struct, additional information is required to correctly marshal the struct, preserving layout and alignment. In the NGWS runtime, the unmanaged struct is represented as an NGWS class (the language may elect not to expose this fact) that embodies the layout rules for the struct.