Merge pull request #901 from Blewzman/FixAggregateExceptionGetBaseException
[mono.git] / mcs / class / corlib / System.Runtime.Remoting.Proxies / RealProxy.cs
index c504001d602df8363dda90099010ce4e4496f4d5..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
@@ -216,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;
 
@@ -225,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);
                        }