Imported Upstream version 4.2.0.179

Former-commit-id: 4610231f55806d2a05ed69e5ff3faa7336cc1479
This commit is contained in:
Xamarin Public Jenkins
2015-08-26 07:17:56 -04:00
committed by Jo Shields
parent aa7da660d6
commit c042cd0c52
7507 changed files with 90259 additions and 657307 deletions

View File

@ -109,6 +109,12 @@ namespace System.Runtime.Remoting
[ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern static bool IsTransparentProxy (object proxy);
internal static bool ProxyCheckCast (RealProxy rp, RuntimeType castType)
{
// TODO: What should it do?
return true;
}
#endif
internal static IMethodReturnMessage InternalExecuteMessage (
@ -136,7 +142,7 @@ namespace System.Runtime.Remoting
method = gmd.MakeGenericMethod (genericArguments);
}
object oldContext = CallContext.SetCurrentCallContext (reqMsg.LogicalCallContext);
var oldContext = CallContext.SetLogicalCallContext (reqMsg.LogicalCallContext);
try
{
@ -162,14 +168,15 @@ namespace System.Runtime.Remoting
returnArgs [n++] = null;
}
result = new ReturnMessage (rval, returnArgs, n, ExecutionContext.CreateLogicalCallContext (true), reqMsg);
var latestCallContext = Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext;
result = new ReturnMessage (rval, returnArgs, n, latestCallContext, reqMsg);
}
catch (Exception e)
{
result = new ReturnMessage (e, reqMsg);
}
CallContext.RestoreCallContext (oldContext);
CallContext.SetLogicalCallContext (oldContext);
return result;
}
@ -763,11 +770,11 @@ namespace System.Runtime.Remoting
[SecurityPermission (SecurityAction.Assert, SerializationFormatter = true)] // FIXME: to be reviewed
internal static byte[] SerializeCallData (object obj)
{
LogicalCallContext ctx = ExecutionContext.CreateLogicalCallContext (false);
if (ctx != null) {
var ctx = Thread.CurrentThread.GetExecutionContextReader().LogicalCallContext;
if (!ctx.IsNull) {
CACD cad = new CACD ();
cad.d = obj;
cad.c = ctx;
cad.c = ctx.Clone ();
obj = cad;
}
@ -789,7 +796,10 @@ namespace System.Runtime.Remoting
if (obj is CACD) {
CACD cad = (CACD) obj;
obj = cad.d;
CallContext.UpdateCurrentLogicalCallContext ((LogicalCallContext) cad.c);
var lcc = (LogicalCallContext) cad.c;
if (lcc.HasInfo)
Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext.Merge (lcc);
}
return obj;
}