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!

Marshaling Delegates and Callbacks

A callback is simply a call, back into managed code, from an unmanaged function you called earlier, via PInvoke. If all the code were unmanaged, you would specify the callback as an argument, of type pointer-to-function. However, when the callback crosses the boundary between unmanaged and managed code, you must supply the callback as a Delegate.

PInvoke converts a delegate object into a callback thunk. Currently, the arguments to the delegate / callback are only permitted to be integers.