This commit is contained in:
niko
2026-06-04 11:42:34 +02:00
parent f39ba70a9f
commit e720b98cd1
7488 changed files with 2493818 additions and 0 deletions
@@ -0,0 +1,66 @@
using System;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Activation;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Contexts;
namespace System.Runtime.Remoting.Proxies
{
/// <summary>Indicates that an object type requires a custom proxy.</summary>
// Token: 0x02000431 RID: 1073
[AttributeUsage(AttributeTargets.Class)]
[ComVisible(true)]
public class ProxyAttribute : Attribute, IContextAttribute
{
/// <summary>Creates either an uninitialized <see cref="T:System.MarshalByRefObject" /> or a transparent proxy, depending on whether the specified type can exist in the current context.</summary>
/// <returns>An uninitialized <see cref="T:System.MarshalByRefObject" /> or a transparent proxy.</returns>
/// <param name="serverType">The object type to create an instance of. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence, Infrastructure" />
/// </PermissionSet>
// Token: 0x0600297D RID: 10621 RVA: 0x00085504 File Offset: 0x00083704
public virtual MarshalByRefObject CreateInstance(Type serverType)
{
RemotingProxy remotingProxy = new RemotingProxy(serverType, ChannelServices.CrossContextUrl, null);
return (MarshalByRefObject)remotingProxy.GetTransparentProxy();
}
/// <summary>Creates an instance of a remoting proxy for a remote object described by the specified <see cref="T:System.Runtime.Remoting.ObjRef" />, and located on the server.</summary>
/// <returns>The new instance of remoting proxy for the remote object that is described in the specified <see cref="T:System.Runtime.Remoting.ObjRef" />.</returns>
/// <param name="objRef">The object reference to the remote object for which to create a proxy. </param>
/// <param name="serverType">The type of the server where the remote object is located. </param>
/// <param name="serverObject">The server object. </param>
/// <param name="serverContext">The context in which the server object is located. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x0600297E RID: 10622 RVA: 0x0008552C File Offset: 0x0008372C
public virtual RealProxy CreateProxy(ObjRef objRef, Type serverType, object serverObject, Context serverContext)
{
return RemotingServices.GetRealProxy(RemotingServices.GetProxyForRemoteObject(objRef, serverType));
}
/// <summary>Gets properties for a new context.</summary>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x0600297F RID: 10623 RVA: 0x0008553C File Offset: 0x0008373C
[ComVisible(true)]
public void GetPropertiesForNewContext(IConstructionCallMessage msg)
{
}
/// <summary>Checks the specified context.</summary>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x06002980 RID: 10624 RVA: 0x00085540 File Offset: 0x00083740
[ComVisible(true)]
public bool IsContextOK(Context ctx, IConstructionCallMessage msg)
{
return true;
}
}
}
@@ -0,0 +1,453 @@
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Activation;
using System.Runtime.Remoting.Contexts;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Serialization;
namespace System.Runtime.Remoting.Proxies
{
/// <summary>Provides base functionality for proxies.</summary>
// Token: 0x02000433 RID: 1075
[ComVisible(true)]
public abstract class RealProxy
{
/// <summary>Initializes a new instance of the <see cref="T:System.Runtime.Remoting.Proxies.RealProxy" /> class with default values.</summary>
// Token: 0x06002982 RID: 10626 RVA: 0x0008554C File Offset: 0x0008374C
protected RealProxy()
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Runtime.Remoting.Proxies.RealProxy" /> class that represents a remote object of the specified <see cref="T:System.Type" />.</summary>
/// <param name="classToProxy">The <see cref="T:System.Type" /> of the remote object for which to create a proxy. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="classToProxy" /> is not an interface, and is not derived from <see cref="T:System.MarshalByRefObject" />. </exception>
// Token: 0x06002983 RID: 10627 RVA: 0x0008555C File Offset: 0x0008375C
protected RealProxy(Type classToProxy)
: this(classToProxy, IntPtr.Zero, null)
{
}
// Token: 0x06002984 RID: 10628 RVA: 0x0008556C File Offset: 0x0008376C
internal RealProxy(Type classToProxy, ClientIdentity identity)
: this(classToProxy, IntPtr.Zero, null)
{
this._objectIdentity = identity;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Runtime.Remoting.Proxies.RealProxy" /> class.</summary>
/// <param name="classToProxy">The <see cref="T:System.Type" /> of the remote object for which to create a proxy. </param>
/// <param name="stub">A stub to associate with the new proxy instance. </param>
/// <param name="stubData">The stub data to set for the specified stub and the new proxy instance. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="classToProxy" /> is not an interface, and is not derived from <see cref="T:System.MarshalByRefObject" />. </exception>
// Token: 0x06002985 RID: 10629 RVA: 0x00085584 File Offset: 0x00083784
protected RealProxy(Type classToProxy, IntPtr stub, object stubData)
{
if (!classToProxy.IsMarshalByRef && !classToProxy.IsInterface)
{
throw new ArgumentException("object must be MarshalByRef");
}
this.class_to_proxy = classToProxy;
if (stub != IntPtr.Zero)
{
throw new NotSupportedException("stub is not used in Mono");
}
}
// Token: 0x06002986 RID: 10630
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern Type InternalGetProxyType(object transparentProxy);
/// <summary>Returns the <see cref="T:System.Type" /> of the object that the current instance of <see cref="T:System.Runtime.Remoting.Proxies.RealProxy" /> represents.</summary>
/// <returns>The <see cref="T:System.Type" /> of the object that the current instance of <see cref="T:System.Runtime.Remoting.Proxies.RealProxy" /> represents.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x06002987 RID: 10631 RVA: 0x000855E4 File Offset: 0x000837E4
public Type GetProxiedType()
{
if (this._objTP != null)
{
return RealProxy.InternalGetProxyType(this._objTP);
}
if (this.class_to_proxy.IsInterface)
{
return typeof(MarshalByRefObject);
}
return this.class_to_proxy;
}
/// <summary>Creates an <see cref="T:System.Runtime.Remoting.ObjRef" /> for the specified object type, and registers it with the remoting infrastructure as a client-activated object.</summary>
/// <returns>A new instance of <see cref="T:System.Runtime.Remoting.ObjRef" /> that is created for the specified type.</returns>
/// <param name="requestedType">The object type that an <see cref="T:System.Runtime.Remoting.ObjRef" /> is created for. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x06002988 RID: 10632 RVA: 0x0008562C File Offset: 0x0008382C
public virtual ObjRef CreateObjRef(Type requestedType)
{
return RemotingServices.Marshal((MarshalByRefObject)this.GetTransparentProxy(), null, requestedType);
}
/// <summary>Adds the transparent proxy of the object represented by the current instance of <see cref="T:System.Runtime.Remoting.Proxies.RealProxy" /> to the specified <see cref="T:System.Runtime.Serialization.SerializationInfo" />.</summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> into which the transparent proxy is serialized. </param>
/// <param name="context">The source and destination of the serialization. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> or <paramref name="context" /> parameter is null. </exception>
/// <exception cref="T:System.Security.SecurityException">The immediate caller does not have SerializationFormatter permission. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x06002989 RID: 10633 RVA: 0x00085640 File Offset: 0x00083840
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
object transparentProxy = this.GetTransparentProxy();
RemotingServices.GetObjectData(transparentProxy, info, context);
}
// Token: 0x1700083D RID: 2109
// (get) Token: 0x0600298A RID: 10634 RVA: 0x0008565C File Offset: 0x0008385C
// (set) Token: 0x0600298B RID: 10635 RVA: 0x00085664 File Offset: 0x00083864
internal Identity ObjectIdentity
{
get
{
return this._objectIdentity;
}
set
{
this._objectIdentity = value;
}
}
/// <summary>Requests an unmanaged reference to the object represented by the current proxy instance.</summary>
/// <returns>A pointer to a COM Callable Wrapper if the object reference is requested for communication with unmanaged objects in the current process through COM, or a pointer to a cached or newly generated IUnknown COM interface if the object reference is requested for marshaling to a remote location.</returns>
/// <param name="fIsMarshalled">true if the object reference is requested for marshaling to a remote location; false if the object reference is requested for communication with unmanaged objects in the current process through COM. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x0600298C RID: 10636 RVA: 0x00085670 File Offset: 0x00083870
[MonoTODO]
public virtual IntPtr GetCOMIUnknown(bool fIsMarshalled)
{
throw new NotImplementedException();
}
/// <summary>Stores an unmanaged proxy of the object that is represented by the current instance.</summary>
/// <param name="i">A pointer to the IUnknown interface for the object that is represented by the current proxy instance. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x0600298D RID: 10637 RVA: 0x00085678 File Offset: 0x00083878
[MonoTODO]
public virtual void SetCOMIUnknown(IntPtr i)
{
throw new NotImplementedException();
}
/// <summary>Requests a COM interface with the specified ID.</summary>
/// <returns>A pointer to the requested interface.</returns>
/// <param name="iid">A reference to the requested interface. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x0600298E RID: 10638 RVA: 0x00085680 File Offset: 0x00083880
[MonoTODO]
public virtual IntPtr SupportsInterface(ref Guid iid)
{
throw new NotImplementedException();
}
/// <summary>Retrieves stub data that is stored for the specified proxy.</summary>
/// <returns>Stub data for the specified proxy.</returns>
/// <param name="rp">The proxy for which stub data is requested. </param>
/// <exception cref="T:System.Security.SecurityException">The immediate caller does not have UnmanagedCode permission. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x0600298F RID: 10639 RVA: 0x00085688 File Offset: 0x00083888
public static object GetStubData(RealProxy rp)
{
return rp._stubData;
}
/// <summary>Sets the stub data for the specified proxy.</summary>
/// <param name="rp">The proxy for which to set stub data. </param>
/// <param name="stubData">The new stub data. </param>
/// <exception cref="T:System.Security.SecurityException">The immediate caller does not have UnmanagedCode permission. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, Infrastructure" />
/// </PermissionSet>
// Token: 0x06002990 RID: 10640 RVA: 0x00085690 File Offset: 0x00083890
public static void SetStubData(RealProxy rp, object stubData)
{
rp._stubData = stubData;
}
/// <summary>When overridden in a derived class, invokes the method that is specified in the provided <see cref="T:System.Runtime.Remoting.Messaging.IMessage" /> on the remote object that is represented by the current instance.</summary>
/// <returns>The message returned by the invoked method, containing the return value and any out or ref parameters.</returns>
/// <param name="msg">A <see cref="T:System.Runtime.Remoting.Messaging.IMessage" /> that contains a <see cref="T:System.Collections.IDictionary" /> of information about the method call. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x06002991 RID: 10641
public abstract IMessage Invoke(IMessage msg);
// Token: 0x06002992 RID: 10642 RVA: 0x0008569C File Offset: 0x0008389C
internal static object PrivateInvoke(RealProxy rp, IMessage msg, out Exception exc, out object[] out_args)
{
MonoMethodMessage monoMethodMessage = (MonoMethodMessage)msg;
monoMethodMessage.LogicalCallContext = CallContext.CreateLogicalCallContext(true);
CallType callType = monoMethodMessage.CallType;
bool flag = rp is RemotingProxy;
out_args = null;
IMethodReturnMessage methodReturnMessage = null;
if (callType == CallType.BeginInvoke)
{
monoMethodMessage.AsyncResult.CallMessage = monoMethodMessage;
}
if (callType == CallType.EndInvoke)
{
methodReturnMessage = (IMethodReturnMessage)monoMethodMessage.AsyncResult.EndInvoke();
}
if (monoMethodMessage.MethodBase.IsConstructor)
{
if (flag)
{
methodReturnMessage = (IMethodReturnMessage)(rp as RemotingProxy).ActivateRemoteObject((IMethodMessage)msg);
}
else
{
msg = new ConstructionCall(rp.GetProxiedType());
}
}
if (methodReturnMessage == null)
{
bool flag2 = false;
try
{
methodReturnMessage = (IMethodReturnMessage)rp.Invoke(msg);
}
catch (Exception ex)
{
flag2 = true;
if (callType != CallType.BeginInvoke)
{
throw;
}
monoMethodMessage.AsyncResult.SyncProcessMessage(new ReturnMessage(ex, msg as IMethodCallMessage));
methodReturnMessage = new ReturnMessage(null, null, 0, null, msg as IMethodCallMessage);
}
if (!flag && callType == CallType.BeginInvoke && !flag2)
{
IMessage message = monoMethodMessage.AsyncResult.SyncProcessMessage(methodReturnMessage);
out_args = methodReturnMessage.OutArgs;
methodReturnMessage = new ReturnMessage(message, null, 0, null, methodReturnMessage as IMethodCallMessage);
}
}
if (methodReturnMessage.LogicalCallContext != null && methodReturnMessage.LogicalCallContext.HasInfo)
{
CallContext.UpdateCurrentCallContext(methodReturnMessage.LogicalCallContext);
}
exc = methodReturnMessage.Exception;
if (exc != null)
{
out_args = null;
throw exc.FixRemotingException();
}
if (methodReturnMessage is IConstructionReturnMessage)
{
if (out_args == null)
{
out_args = methodReturnMessage.OutArgs;
}
}
else if (monoMethodMessage.CallType != CallType.BeginInvoke)
{
if (monoMethodMessage.CallType == CallType.Sync)
{
out_args = RealProxy.ProcessResponse(methodReturnMessage, monoMethodMessage);
}
else if (monoMethodMessage.CallType == CallType.EndInvoke)
{
out_args = RealProxy.ProcessResponse(methodReturnMessage, monoMethodMessage.AsyncResult.CallMessage);
}
else if (out_args == null)
{
out_args = methodReturnMessage.OutArgs;
}
}
return methodReturnMessage.ReturnValue;
}
// Token: 0x06002993 RID: 10643
[MethodImpl(MethodImplOptions.InternalCall)]
internal virtual extern object InternalGetTransparentProxy(string className);
/// <summary>Returns the transparent proxy for the current instance of <see cref="T:System.Runtime.Remoting.Proxies.RealProxy" />.</summary>
/// <returns>The transparent proxy for the current proxy instance.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x06002994 RID: 10644 RVA: 0x000858B4 File Offset: 0x00083AB4
public virtual object GetTransparentProxy()
{
if (this._objTP == null)
{
IRemotingTypeInfo remotingTypeInfo = this as IRemotingTypeInfo;
string text;
if (remotingTypeInfo != null)
{
text = remotingTypeInfo.TypeName;
if (text == null || text == typeof(MarshalByRefObject).AssemblyQualifiedName)
{
text = this.class_to_proxy.AssemblyQualifiedName;
}
}
else
{
text = this.class_to_proxy.AssemblyQualifiedName;
}
this._objTP = this.InternalGetTransparentProxy(text);
}
return this._objTP;
}
/// <summary>Initializes a new instance of the object <see cref="T:System.Type" /> of the remote object that the current instance of <see cref="T:System.Runtime.Remoting.Proxies.RealProxy" /> represents with the specified <see cref="T:System.Runtime.Remoting.Activation.IConstructionCallMessage" />.</summary>
/// <returns>The result of the construction request.</returns>
/// <param name="ctorMsg">A construction call message that contains the constructor parameters for the new instance of the remote object that is represented by the current <see cref="T:System.Runtime.Remoting.Proxies.RealProxy" />. Can be null. </param>
/// <exception cref="T:System.Security.SecurityException">The immediate caller does not have UnmanagedCode permission. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, Infrastructure" />
/// </PermissionSet>
// Token: 0x06002995 RID: 10645 RVA: 0x00085930 File Offset: 0x00083B30
[MonoTODO]
[ComVisible(true)]
public IConstructionReturnMessage InitializeServerObject(IConstructionCallMessage ctorMsg)
{
throw new NotImplementedException();
}
/// <summary>Attaches the current proxy instance to the specified remote <see cref="T:System.MarshalByRefObject" />.</summary>
/// <param name="s">The <see cref="T:System.MarshalByRefObject" /> that the current proxy instance represents. </param>
/// <exception cref="T:System.Security.SecurityException">The immediate caller does not have UnmanagedCode permission. </exception>
// Token: 0x06002996 RID: 10646 RVA: 0x00085938 File Offset: 0x00083B38
protected void AttachServer(MarshalByRefObject s)
{
this._server = s;
}
/// <summary>Detaches the current proxy instance from the remote server object that it represents.</summary>
/// <returns>The detached server object.</returns>
/// <exception cref="T:System.Security.SecurityException">The immediate caller does not have UnmanagedCode permission. </exception>
// Token: 0x06002997 RID: 10647 RVA: 0x00085944 File Offset: 0x00083B44
protected MarshalByRefObject DetachServer()
{
MarshalByRefObject server = this._server;
this._server = null;
return server;
}
/// <summary>Returns the server object that is represented by the current proxy instance.</summary>
/// <returns>The server object that is represented by the current proxy instance.</returns>
/// <exception cref="T:System.Security.SecurityException">The immediate caller does not have UnmanagedCode permission. </exception>
// Token: 0x06002998 RID: 10648 RVA: 0x00085960 File Offset: 0x00083B60
protected MarshalByRefObject GetUnwrappedServer()
{
return this._server;
}
// Token: 0x06002999 RID: 10649 RVA: 0x00085968 File Offset: 0x00083B68
internal void SetTargetDomain(int domainId)
{
this._targetDomainId = domainId;
}
// Token: 0x0600299A RID: 10650 RVA: 0x00085974 File Offset: 0x00083B74
internal object GetAppDomainTarget()
{
if (this._server == null)
{
ClientActivatedIdentity clientActivatedIdentity = RemotingServices.GetIdentityForUri(this._targetUri) as ClientActivatedIdentity;
if (clientActivatedIdentity == null)
{
throw new RemotingException("Server for uri '" + this._targetUri + "' not found");
}
this._server = clientActivatedIdentity.GetServerObject();
}
return this._server;
}
// Token: 0x0600299B RID: 10651 RVA: 0x000859D0 File Offset: 0x00083BD0
private static object[] ProcessResponse(IMethodReturnMessage mrm, MonoMethodMessage call)
{
MethodInfo methodInfo = (MethodInfo)call.MethodBase;
if (mrm.ReturnValue != null && !methodInfo.ReturnType.IsInstanceOfType(mrm.ReturnValue))
{
throw new InvalidCastException("Return value has an invalid type");
}
int num;
if (call.NeedsOutProcessing(out num))
{
ParameterInfo[] parameters = methodInfo.GetParameters();
object[] array = new object[num];
int num2 = 0;
foreach (ParameterInfo parameterInfo in parameters)
{
if (parameterInfo.IsOut && !parameterInfo.ParameterType.IsByRef)
{
object obj = ((parameterInfo.Position >= mrm.ArgCount) ? null : mrm.GetArg(parameterInfo.Position));
if (obj != null)
{
object arg = call.GetArg(parameterInfo.Position);
if (arg == null)
{
throw new RemotingException("Unexpected null value in local out parameter '" + parameterInfo.Name + "'");
}
RemotingServices.UpdateOutArgObject(parameterInfo, arg, obj);
}
}
else if (parameterInfo.ParameterType.IsByRef)
{
object obj2 = ((parameterInfo.Position >= mrm.ArgCount) ? null : mrm.GetArg(parameterInfo.Position));
if (obj2 != null && !parameterInfo.ParameterType.GetElementType().IsInstanceOfType(obj2))
{
throw new InvalidCastException("Return argument '" + parameterInfo.Name + "' has an invalid type");
}
array[num2++] = obj2;
}
}
return array;
}
return new object[0];
}
// Token: 0x04000FF5 RID: 4085
private Type class_to_proxy;
// Token: 0x04000FF6 RID: 4086
internal Context _targetContext;
// Token: 0x04000FF7 RID: 4087
private MarshalByRefObject _server;
// Token: 0x04000FF8 RID: 4088
private int _targetDomainId = -1;
// Token: 0x04000FF9 RID: 4089
internal string _targetUri;
// Token: 0x04000FFA RID: 4090
internal Identity _objectIdentity;
// Token: 0x04000FFB RID: 4091
private object _objTP;
// Token: 0x04000FFC RID: 4092
private object _stubData;
}
}
@@ -0,0 +1,191 @@
using System;
using System.Reflection;
using System.Runtime.Remoting.Activation;
using System.Runtime.Remoting.Messaging;
using System.Threading;
namespace System.Runtime.Remoting.Proxies
{
// Token: 0x02000434 RID: 1076
internal class RemotingProxy : RealProxy, IRemotingTypeInfo
{
// Token: 0x0600299C RID: 10652 RVA: 0x00085B6C File Offset: 0x00083D6C
internal RemotingProxy(Type type, ClientIdentity identity)
: base(type, identity)
{
this._sink = identity.ChannelSink;
this._hasEnvoySink = false;
this._targetUri = identity.TargetUri;
}
// Token: 0x0600299D RID: 10653 RVA: 0x00085B98 File Offset: 0x00083D98
internal RemotingProxy(Type type, string activationUrl, object[] activationAttributes)
: base(type)
{
this._hasEnvoySink = false;
this._ctorCall = ActivationServices.CreateConstructionCall(type, activationUrl, activationAttributes);
}
// Token: 0x0600299F RID: 10655 RVA: 0x00085BF8 File Offset: 0x00083DF8
public override IMessage Invoke(IMessage request)
{
IMethodCallMessage methodCallMessage = request as IMethodCallMessage;
if (methodCallMessage != null)
{
if (methodCallMessage.MethodBase == RemotingProxy._cache_GetHashCodeMethod)
{
return new MethodResponse(base.ObjectIdentity.GetHashCode(), null, null, methodCallMessage);
}
if (methodCallMessage.MethodBase == RemotingProxy._cache_GetTypeMethod)
{
return new MethodResponse(base.GetProxiedType(), null, null, methodCallMessage);
}
}
IInternalMessage internalMessage = request as IInternalMessage;
if (internalMessage != null)
{
if (internalMessage.Uri == null)
{
internalMessage.Uri = this._targetUri;
}
internalMessage.TargetIdentity = this._objectIdentity;
}
this._objectIdentity.NotifyClientDynamicSinks(true, request, true, false);
IMessageSink messageSink;
if (Thread.CurrentContext.HasExitSinks && !this._hasEnvoySink)
{
messageSink = Thread.CurrentContext.GetClientContextSinkChain();
}
else
{
messageSink = this._sink;
}
MonoMethodMessage monoMethodMessage = request as MonoMethodMessage;
IMessage message;
if (monoMethodMessage == null || monoMethodMessage.CallType == CallType.Sync)
{
message = messageSink.SyncProcessMessage(request);
}
else
{
AsyncResult asyncResult = monoMethodMessage.AsyncResult;
IMessageCtrl messageCtrl = messageSink.AsyncProcessMessage(request, asyncResult);
if (asyncResult != null)
{
asyncResult.SetMessageCtrl(messageCtrl);
}
message = new ReturnMessage(null, new object[0], 0, null, monoMethodMessage);
}
this._objectIdentity.NotifyClientDynamicSinks(false, request, true, false);
return message;
}
// Token: 0x060029A0 RID: 10656 RVA: 0x00085D38 File Offset: 0x00083F38
internal void AttachIdentity(Identity identity)
{
this._objectIdentity = identity;
if (identity is ClientActivatedIdentity)
{
ClientActivatedIdentity clientActivatedIdentity = (ClientActivatedIdentity)identity;
this._targetContext = clientActivatedIdentity.Context;
base.AttachServer(clientActivatedIdentity.GetServerObject());
clientActivatedIdentity.SetClientProxy((MarshalByRefObject)this.GetTransparentProxy());
}
if (identity is ClientIdentity)
{
((ClientIdentity)identity).ClientProxy = (MarshalByRefObject)this.GetTransparentProxy();
this._targetUri = ((ClientIdentity)identity).TargetUri;
}
else
{
this._targetUri = identity.ObjectUri;
}
if (this._objectIdentity.EnvoySink != null)
{
this._sink = this._objectIdentity.EnvoySink;
this._hasEnvoySink = true;
}
else
{
this._sink = this._objectIdentity.ChannelSink;
}
this._ctorCall = null;
}
// Token: 0x060029A1 RID: 10657 RVA: 0x00085E10 File Offset: 0x00084010
internal IMessage ActivateRemoteObject(IMethodMessage request)
{
if (this._ctorCall == null)
{
return new ConstructionResponse(this, null, (IMethodCallMessage)request);
}
this._ctorCall.CopyFrom(request);
return ActivationServices.Activate(this, this._ctorCall);
}
// Token: 0x1700083E RID: 2110
// (get) Token: 0x060029A2 RID: 10658 RVA: 0x00085E44 File Offset: 0x00084044
// (set) Token: 0x060029A3 RID: 10659 RVA: 0x00085E90 File Offset: 0x00084090
public string TypeName
{
get
{
if (this._objectIdentity is ClientIdentity)
{
ObjRef objRef = this._objectIdentity.CreateObjRef(null);
if (objRef.TypeInfo != null)
{
return objRef.TypeInfo.TypeName;
}
}
return base.GetProxiedType().AssemblyQualifiedName;
}
set
{
throw new NotSupportedException();
}
}
// Token: 0x060029A4 RID: 10660 RVA: 0x00085E98 File Offset: 0x00084098
public bool CanCastTo(Type fromType, object o)
{
if (this._objectIdentity is ClientIdentity)
{
ObjRef objRef = this._objectIdentity.CreateObjRef(null);
if (objRef.IsReferenceToWellKnow && (fromType.IsInterface || base.GetProxiedType() == typeof(MarshalByRefObject)))
{
return true;
}
if (objRef.TypeInfo != null)
{
return objRef.TypeInfo.CanCastTo(fromType, o);
}
}
return fromType.IsAssignableFrom(base.GetProxiedType());
}
// Token: 0x060029A5 RID: 10661 RVA: 0x00085F14 File Offset: 0x00084114
~RemotingProxy()
{
if (this._objectIdentity != null && !(this._objectIdentity is ClientActivatedIdentity))
{
RemotingServices.DisposeIdentity(this._objectIdentity);
}
}
// Token: 0x04000FFD RID: 4093
private static MethodInfo _cache_GetTypeMethod = typeof(object).GetMethod("GetType");
// Token: 0x04000FFE RID: 4094
private static MethodInfo _cache_GetHashCodeMethod = typeof(object).GetMethod("GetHashCode");
// Token: 0x04000FFF RID: 4095
private IMessageSink _sink;
// Token: 0x04001000 RID: 4096
private bool _hasEnvoySink;
// Token: 0x04001001 RID: 4097
private ConstructionCall _ctorCall;
}
}
@@ -0,0 +1,17 @@
using System;
namespace System.Runtime.Remoting.Proxies
{
// Token: 0x02000432 RID: 1074
internal class TransparentProxy
{
// Token: 0x04000FF2 RID: 4082
public RealProxy _rp;
// Token: 0x04000FF3 RID: 4083
private IntPtr _class;
// Token: 0x04000FF4 RID: 4084
private bool _custom_type_info;
}
}