Merge pull request #820 from brendanzagaeski/master
[mono.git] / mcs / class / corlib / System.Runtime.Remoting.Proxies / RealProxy.cs
index 0f95a9c2e905a3a5207a6c35d1226d9f59bcce71..d430e9ccc1d505f0815f4d5c0100f7bf8d9d60d8 100644 (file)
@@ -40,14 +40,12 @@ using System.Runtime.Remoting.Activation;
 using System.Runtime.Remoting.Contexts;
 using System.Runtime.CompilerServices;
 using System.Runtime.Serialization;
-
-#if NET_2_0
 using System.Runtime.InteropServices;
-#endif
 
 namespace System.Runtime.Remoting.Proxies
 {
 #pragma warning disable 169, 649
+       [StructLayout (LayoutKind.Sequential)]
        internal class TransparentProxy {
                public RealProxy _rp;
                IntPtr _class;
@@ -55,9 +53,8 @@ namespace System.Runtime.Remoting.Proxies
        }
 #pragma warning restore 169, 649
        
-#if NET_2_0
        [ComVisible (true)]
-#endif
+       [StructLayout (LayoutKind.Sequential)]
        public abstract class RealProxy {
                // other classes visible to the runtime 
                // derive from this class so keep these locals
@@ -221,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;
 
@@ -230,10 +227,13 @@ namespace System.Runtime.Remoting.Proxies
                                out_args = null;
                                throw exc.FixRemotingException();
                        }
-                       else if (res_msg is IConstructionReturnMessage || mMsg.CallType == CallType.BeginInvoke) {
+                       else if (res_msg is IConstructionReturnMessage) {
                                if (out_args == null)
                                        out_args = res_msg.OutArgs;
                        }
+                       else if (mMsg.CallType == CallType.BeginInvoke) {
+                               // We don't have OutArgs in this case.
+                       }
                        else if (mMsg.CallType == CallType.Sync) {
                                out_args = ProcessResponse (res_msg, mMsg);
                        }
@@ -272,9 +272,7 @@ namespace System.Runtime.Remoting.Proxies
                }
 
                [MonoTODO]
-#if NET_2_0
                [ComVisible (true)]
-#endif
                public IConstructionReturnMessage InitializeServerObject(IConstructionCallMessage ctorMsg)
                {
                        throw new NotImplementedException();