static MediaStreamSource FromIntPtr (IntPtr instance) { // centralize the calls to [SecurityCritical] code here return (MediaStreamSource) GCHandle.FromIntPtr (instance).Target; }