Reverse PInvoke and exception- January 28, 2008 PInvoke is managed code executing a native function pointer. And Reverse PInvoke is native code executing a managed delegate as a function pointer, mostly as a callback. When the native code executes the managed delegate function pointer, the call really calls into a CLR thunk. The thunk will do an AppDomain transition to the correct AppDomain, then invoke the delegate. If the managed delegate throws an unhandled exception in the callback, the exception will be raised as cross context...http://blogs.msdn.com/junfeng/archive/2008/01/28/reverse-p-invoke-and-exception.aspx |