Imported Upstream version 6.4.0.137

Former-commit-id: 943baa9f16a098c33e129777827f3a9d20da00d6
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-07-26 19:53:28 +00:00
parent e9207cf623
commit ef583813eb
2712 changed files with 74169 additions and 40587 deletions

View File

@@ -56,8 +56,10 @@ public class AsyncResult : IAsyncResult, IMessageSink, IThreadPoolWorkItem {
long add_time;
#pragma warning restore 169, 414, 649
#if !DISABLE_REMOTING
// not part of MonoAsyncResult...
MonoMethodMessage call_message;
#endif
#pragma warning disable 0414
IMessageCtrl message_ctrl;
#pragma warning restore
@@ -173,11 +175,13 @@ public class AsyncResult : IAsyncResult, IMessageSink, IThreadPoolWorkItem {
return null;
}
#if !DISABLE_REMOTING
internal MonoMethodMessage CallMessage
{
get { return call_message; }
set { call_message = value; }
}
#endif
void IThreadPoolWorkItem.ExecuteWorkItem()
{

View File

@@ -431,7 +431,11 @@ namespace System.Runtime.Remoting.Messaging {
ArrayList ret = null;
if (null != _serializedArgs) {
object[] oret = (object[]) CADSerializer.DeserializeObject (new MemoryStream (_serializedArgs));
// Avoid cross domain refs between MemoryStream and _serializedArgs byte array
byte[] copyArray = new byte [_serializedArgs.Length];
Array.Copy (_serializedArgs, copyArray, _serializedArgs.Length);
object[] oret = (object[]) CADSerializer.DeserializeObject (new MemoryStream (copyArray));
ret = new ArrayList (oret);
_serializedArgs = null;
}
@@ -498,7 +502,11 @@ namespace System.Runtime.Remoting.Messaging {
ArrayList ret = null;
if (null != _serializedArgs) {
object[] oret = (object[]) CADSerializer.DeserializeObject (new MemoryStream (_serializedArgs));
// Avoid cross domain refs between MemoryStream and _serializedArgs byte array
byte[] copyArray = new byte [_serializedArgs.Length];
Array.Copy (_serializedArgs, copyArray, _serializedArgs.Length);
object[] oret = (object[]) CADSerializer.DeserializeObject (new MemoryStream (copyArray));
ret = new ArrayList (oret);
_serializedArgs = null;
}

View File

@@ -41,8 +41,11 @@ namespace System.Runtime.Remoting.Messaging {
[Serializable]
[StructLayout (LayoutKind.Sequential)]
internal class MonoMethodMessage : IMethodCallMessage, IMethodReturnMessage, IInternalMessage {
internal class MonoMethodMessage
#if !DISABLE_REMOTING
: IMethodCallMessage, IMethodReturnMessage, IInternalMessage
#endif
{
#pragma warning disable 649
#region keep in sync with MonoMessage in object-internals.h
RuntimeMethodInfo method;
@@ -59,12 +62,13 @@ namespace System.Runtime.Remoting.Messaging {
string uri;
#if !DISABLE_REMOTING
MCMDictionary properties;
Identity identity;
#endif
Type[] methodSignature;
Identity identity;
internal void InitMessage (RuntimeMethodInfo method, object [] out_args)
{
this.method = method;
@@ -132,8 +136,12 @@ namespace System.Runtime.Remoting.Messaging {
public IDictionary Properties {
get {
#if DISABLE_REMOTING
throw new PlatformNotSupportedException ();
#else
if (properties == null) properties = new MCMDictionary (this);
return properties;
#endif
}
}
@@ -365,6 +373,7 @@ namespace System.Runtime.Remoting.Messaging {
return null;
}
#if !DISABLE_REMOTING
Identity IInternalMessage.TargetIdentity
{
get { return identity; }
@@ -375,6 +384,7 @@ namespace System.Runtime.Remoting.Messaging {
{
return properties != null;
}
#endif
public bool IsAsync
{
@@ -392,8 +402,10 @@ namespace System.Runtime.Remoting.Messaging {
{
// FIXME: ideally, the OneWay type would be set by the runtime
#if !DISABLE_REMOTING
if (call_type == CallType.Sync && RemotingServices.IsOneWay (method))
call_type = CallType.OneWay;
#endif
return call_type;
}
}