// // System.Runtime.Remoting.RemotingServices.cs // // Authors: // Dietmar Maurer (dietmar@ximian.com) // // (C) 2001 Ximian, Inc. http://www.ximian.com // using System; using System.Reflection; using System.Runtime.Remoting.Messaging; using System.Runtime.CompilerServices; namespace System.Runtime.Remoting { public sealed class RemotingServices { [MethodImplAttribute(MethodImplOptions.InternalCall)] internal extern static object InternalExecute (MonoMethod method, Object obj, Object[] parameters, out object [] out_args); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal extern static bool IsTransparentProxy (object proxy); public static IMethodReturnMessage ExecuteMessage ( MarshalByRefObject target, IMethodCallMessage reqMsg) { ReturnMessage result; MonoMethod method = (MonoMethod)reqMsg.MethodBase; try { object [] out_args; object rval = InternalExecute (method, target, reqMsg.Args, out out_args); result = new ReturnMessage (rval, out_args, out_args.Length, reqMsg.LogicalCallContext, reqMsg); } catch (Exception e) { result = new ReturnMessage (e, reqMsg); } return result; } } }