Merge pull request #820 from brendanzagaeski/master
[mono.git] / mcs / class / corlib / System.Runtime.Remoting.Proxies / RealProxy.cs
index 9cf9c4be2d3a40973e6c8390359c3ea3ec707d4a..d430e9ccc1d505f0815f4d5c0100f7bf8d9d60d8 100644 (file)
@@ -45,6 +45,7 @@ using System.Runtime.InteropServices;
 namespace System.Runtime.Remoting.Proxies
 {
 #pragma warning disable 169, 649
+       [StructLayout (LayoutKind.Sequential)]
        internal class TransparentProxy {
                public RealProxy _rp;
                IntPtr _class;
@@ -53,6 +54,7 @@ namespace System.Runtime.Remoting.Proxies
 #pragma warning restore 169, 649
        
        [ComVisible (true)]
+       [StructLayout (LayoutKind.Sequential)]
        public abstract class RealProxy {
                // other classes visible to the runtime 
                // derive from this class so keep these locals
@@ -162,11 +164,7 @@ namespace System.Runtime.Remoting.Proxies
                        MonoMethodMessage mMsg = (MonoMethodMessage) msg;
                        mMsg.LogicalCallContext = CallContext.CreateLogicalCallContext (true);
                        CallType call_type = mMsg.CallType;
-#if MOONLIGHT
-                       bool is_remproxy = false;
-#else
                        bool is_remproxy = (rp is RemotingProxy);
-#endif
 
                        out_args = null;
                        IMethodReturnMessage res_msg = null;
@@ -181,11 +179,9 @@ namespace System.Runtime.Remoting.Proxies
                        // Check for constructor msg
                        if (mMsg.MethodBase.IsConstructor) 
                        {
-#if !MOONLIGHT
                                if (is_remproxy) 
                                        res_msg = (IMethodReturnMessage) (rp as RemotingProxy).ActivateRemoteObject ((IMethodMessage) msg);
                                else 
-#endif
                                        msg = new ConstructionCall (rp.GetProxiedType ());
                        }
                                
@@ -222,7 +218,7 @@ namespace System.Runtime.Remoting.Proxies
                        }
                        
                        if (res_msg.LogicalCallContext != null && res_msg.LogicalCallContext.HasInfo)
-                               CallContext.UpdateCurrentCallContext (res_msg.LogicalCallContext);
+                               CallContext.UpdateCurrentLogicalCallContext (res_msg.LogicalCallContext);
 
                        exc = res_msg.Exception;