488 lines
9.8 KiB
C#
488 lines
9.8 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Reflection;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace System.Runtime.Remoting.Messaging
|
|
{
|
|
// Token: 0x020003FE RID: 1022
|
|
[Serializable]
|
|
internal class MonoMethodMessage : IInternalMessage, IMessage, IMethodCallMessage, IMethodMessage, IMethodReturnMessage
|
|
{
|
|
// Token: 0x060027E1 RID: 10209 RVA: 0x00082D3C File Offset: 0x00080F3C
|
|
public MonoMethodMessage(MethodBase method, object[] out_args)
|
|
{
|
|
if (method != null)
|
|
{
|
|
this.InitMessage((MonoMethod)method, out_args);
|
|
}
|
|
else
|
|
{
|
|
this.args = null;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060027E2 RID: 10210 RVA: 0x00082D64 File Offset: 0x00080F64
|
|
public MonoMethodMessage(Type type, string method_name, object[] in_args)
|
|
{
|
|
MethodInfo methodInfo = type.GetMethod(method_name);
|
|
this.InitMessage((MonoMethod)methodInfo, null);
|
|
int num = in_args.Length;
|
|
for (int i = 0; i < num; i++)
|
|
{
|
|
this.args[i] = in_args[i];
|
|
}
|
|
}
|
|
|
|
// Token: 0x170007BF RID: 1983
|
|
// (get) Token: 0x060027E3 RID: 10211 RVA: 0x00082DB0 File Offset: 0x00080FB0
|
|
// (set) Token: 0x060027E4 RID: 10212 RVA: 0x00082DB8 File Offset: 0x00080FB8
|
|
Identity IInternalMessage.TargetIdentity
|
|
{
|
|
get
|
|
{
|
|
return this.identity;
|
|
}
|
|
set
|
|
{
|
|
this.identity = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060027E5 RID: 10213
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
internal extern void InitMessage(MonoMethod method, object[] out_args);
|
|
|
|
// Token: 0x170007C0 RID: 1984
|
|
// (get) Token: 0x060027E6 RID: 10214 RVA: 0x00082DC4 File Offset: 0x00080FC4
|
|
public IDictionary Properties
|
|
{
|
|
get
|
|
{
|
|
if (this.properties == null)
|
|
{
|
|
this.properties = new MethodCallDictionary(this);
|
|
}
|
|
return this.properties;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170007C1 RID: 1985
|
|
// (get) Token: 0x060027E7 RID: 10215 RVA: 0x00082DE4 File Offset: 0x00080FE4
|
|
public int ArgCount
|
|
{
|
|
get
|
|
{
|
|
if (this.CallType == CallType.EndInvoke)
|
|
{
|
|
return -1;
|
|
}
|
|
if (this.args == null)
|
|
{
|
|
return 0;
|
|
}
|
|
return this.args.Length;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170007C2 RID: 1986
|
|
// (get) Token: 0x060027E8 RID: 10216 RVA: 0x00082E0C File Offset: 0x0008100C
|
|
public object[] Args
|
|
{
|
|
get
|
|
{
|
|
return this.args;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170007C3 RID: 1987
|
|
// (get) Token: 0x060027E9 RID: 10217 RVA: 0x00082E14 File Offset: 0x00081014
|
|
public bool HasVarArgs
|
|
{
|
|
get
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170007C4 RID: 1988
|
|
// (get) Token: 0x060027EA RID: 10218 RVA: 0x00082E18 File Offset: 0x00081018
|
|
// (set) Token: 0x060027EB RID: 10219 RVA: 0x00082E20 File Offset: 0x00081020
|
|
public LogicalCallContext LogicalCallContext
|
|
{
|
|
get
|
|
{
|
|
return this.ctx;
|
|
}
|
|
set
|
|
{
|
|
this.ctx = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170007C5 RID: 1989
|
|
// (get) Token: 0x060027EC RID: 10220 RVA: 0x00082E2C File Offset: 0x0008102C
|
|
public MethodBase MethodBase
|
|
{
|
|
get
|
|
{
|
|
return this.method;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170007C6 RID: 1990
|
|
// (get) Token: 0x060027ED RID: 10221 RVA: 0x00082E34 File Offset: 0x00081034
|
|
public string MethodName
|
|
{
|
|
get
|
|
{
|
|
if (this.method == null)
|
|
{
|
|
return string.Empty;
|
|
}
|
|
return this.method.Name;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170007C7 RID: 1991
|
|
// (get) Token: 0x060027EE RID: 10222 RVA: 0x00082E54 File Offset: 0x00081054
|
|
public object MethodSignature
|
|
{
|
|
get
|
|
{
|
|
if (this.methodSignature == null)
|
|
{
|
|
ParameterInfo[] parameters = this.method.GetParameters();
|
|
this.methodSignature = new Type[parameters.Length];
|
|
for (int i = 0; i < parameters.Length; i++)
|
|
{
|
|
this.methodSignature[i] = parameters[i].ParameterType;
|
|
}
|
|
}
|
|
return this.methodSignature;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170007C8 RID: 1992
|
|
// (get) Token: 0x060027EF RID: 10223 RVA: 0x00082EB0 File Offset: 0x000810B0
|
|
public string TypeName
|
|
{
|
|
get
|
|
{
|
|
if (this.method == null)
|
|
{
|
|
return string.Empty;
|
|
}
|
|
return this.method.DeclaringType.AssemblyQualifiedName;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170007C9 RID: 1993
|
|
// (get) Token: 0x060027F0 RID: 10224 RVA: 0x00082ED4 File Offset: 0x000810D4
|
|
// (set) Token: 0x060027F1 RID: 10225 RVA: 0x00082EDC File Offset: 0x000810DC
|
|
public string Uri
|
|
{
|
|
get
|
|
{
|
|
return this.uri;
|
|
}
|
|
set
|
|
{
|
|
this.uri = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060027F2 RID: 10226 RVA: 0x00082EE8 File Offset: 0x000810E8
|
|
public object GetArg(int arg_num)
|
|
{
|
|
if (this.args == null)
|
|
{
|
|
return null;
|
|
}
|
|
return this.args[arg_num];
|
|
}
|
|
|
|
// Token: 0x060027F3 RID: 10227 RVA: 0x00082F00 File Offset: 0x00081100
|
|
public string GetArgName(int arg_num)
|
|
{
|
|
if (this.args == null)
|
|
{
|
|
return string.Empty;
|
|
}
|
|
return this.names[arg_num];
|
|
}
|
|
|
|
// Token: 0x170007CA RID: 1994
|
|
// (get) Token: 0x060027F4 RID: 10228 RVA: 0x00082F1C File Offset: 0x0008111C
|
|
public int InArgCount
|
|
{
|
|
get
|
|
{
|
|
if (this.CallType == CallType.EndInvoke)
|
|
{
|
|
return -1;
|
|
}
|
|
if (this.args == null)
|
|
{
|
|
return 0;
|
|
}
|
|
int num = 0;
|
|
foreach (byte b in this.arg_types)
|
|
{
|
|
if ((b & 1) != 0)
|
|
{
|
|
num++;
|
|
}
|
|
}
|
|
return num;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170007CB RID: 1995
|
|
// (get) Token: 0x060027F5 RID: 10229 RVA: 0x00082F74 File Offset: 0x00081174
|
|
public object[] InArgs
|
|
{
|
|
get
|
|
{
|
|
int inArgCount = this.InArgCount;
|
|
object[] array = new object[inArgCount];
|
|
int num2;
|
|
int num = (num2 = 0);
|
|
foreach (byte b in this.arg_types)
|
|
{
|
|
if ((b & 1) != 0)
|
|
{
|
|
array[num++] = this.args[num2];
|
|
}
|
|
num2++;
|
|
}
|
|
return array;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060027F6 RID: 10230 RVA: 0x00082FD8 File Offset: 0x000811D8
|
|
public object GetInArg(int arg_num)
|
|
{
|
|
int num = 0;
|
|
int num2 = 0;
|
|
foreach (byte b in this.arg_types)
|
|
{
|
|
if ((b & 1) != 0 && num2++ == arg_num)
|
|
{
|
|
return this.args[num];
|
|
}
|
|
num++;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
// Token: 0x060027F7 RID: 10231 RVA: 0x00083030 File Offset: 0x00081230
|
|
public string GetInArgName(int arg_num)
|
|
{
|
|
int num = 0;
|
|
int num2 = 0;
|
|
foreach (byte b in this.arg_types)
|
|
{
|
|
if ((b & 1) != 0 && num2++ == arg_num)
|
|
{
|
|
return this.names[num];
|
|
}
|
|
num++;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
// Token: 0x170007CC RID: 1996
|
|
// (get) Token: 0x060027F8 RID: 10232 RVA: 0x00083088 File Offset: 0x00081288
|
|
public Exception Exception
|
|
{
|
|
get
|
|
{
|
|
return this.exc;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170007CD RID: 1997
|
|
// (get) Token: 0x060027F9 RID: 10233 RVA: 0x00083090 File Offset: 0x00081290
|
|
public int OutArgCount
|
|
{
|
|
get
|
|
{
|
|
if (this.args == null)
|
|
{
|
|
return 0;
|
|
}
|
|
int num = 0;
|
|
foreach (byte b in this.arg_types)
|
|
{
|
|
if ((b & 2) != 0)
|
|
{
|
|
num++;
|
|
}
|
|
}
|
|
return num;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170007CE RID: 1998
|
|
// (get) Token: 0x060027FA RID: 10234 RVA: 0x000830D8 File Offset: 0x000812D8
|
|
public object[] OutArgs
|
|
{
|
|
get
|
|
{
|
|
if (this.args == null)
|
|
{
|
|
return null;
|
|
}
|
|
int outArgCount = this.OutArgCount;
|
|
object[] array = new object[outArgCount];
|
|
int num2;
|
|
int num = (num2 = 0);
|
|
foreach (byte b in this.arg_types)
|
|
{
|
|
if ((b & 2) != 0)
|
|
{
|
|
array[num++] = this.args[num2];
|
|
}
|
|
num2++;
|
|
}
|
|
return array;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170007CF RID: 1999
|
|
// (get) Token: 0x060027FB RID: 10235 RVA: 0x0008314C File Offset: 0x0008134C
|
|
public object ReturnValue
|
|
{
|
|
get
|
|
{
|
|
return this.rval;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060027FC RID: 10236 RVA: 0x00083154 File Offset: 0x00081354
|
|
public object GetOutArg(int arg_num)
|
|
{
|
|
int num = 0;
|
|
int num2 = 0;
|
|
foreach (byte b in this.arg_types)
|
|
{
|
|
if ((b & 2) != 0 && num2++ == arg_num)
|
|
{
|
|
return this.args[num];
|
|
}
|
|
num++;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
// Token: 0x060027FD RID: 10237 RVA: 0x000831AC File Offset: 0x000813AC
|
|
public string GetOutArgName(int arg_num)
|
|
{
|
|
int num = 0;
|
|
int num2 = 0;
|
|
foreach (byte b in this.arg_types)
|
|
{
|
|
if ((b & 2) != 0 && num2++ == arg_num)
|
|
{
|
|
return this.names[num];
|
|
}
|
|
num++;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
// Token: 0x170007D0 RID: 2000
|
|
// (get) Token: 0x060027FE RID: 10238 RVA: 0x00083204 File Offset: 0x00081404
|
|
public bool IsAsync
|
|
{
|
|
get
|
|
{
|
|
return this.asyncResult != null;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170007D1 RID: 2001
|
|
// (get) Token: 0x060027FF RID: 10239 RVA: 0x00083214 File Offset: 0x00081414
|
|
public AsyncResult AsyncResult
|
|
{
|
|
get
|
|
{
|
|
return this.asyncResult;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170007D2 RID: 2002
|
|
// (get) Token: 0x06002800 RID: 10240 RVA: 0x0008321C File Offset: 0x0008141C
|
|
internal CallType CallType
|
|
{
|
|
get
|
|
{
|
|
if (this.call_type == CallType.Sync && RemotingServices.IsOneWay(this.method))
|
|
{
|
|
this.call_type = CallType.OneWay;
|
|
}
|
|
return this.call_type;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002801 RID: 10241 RVA: 0x00083254 File Offset: 0x00081454
|
|
public bool NeedsOutProcessing(out int outCount)
|
|
{
|
|
bool flag = false;
|
|
outCount = 0;
|
|
foreach (byte b in this.arg_types)
|
|
{
|
|
if ((b & 2) != 0)
|
|
{
|
|
outCount++;
|
|
}
|
|
else if ((b & 4) != 0)
|
|
{
|
|
flag = true;
|
|
}
|
|
}
|
|
return outCount > 0 || flag;
|
|
}
|
|
|
|
// Token: 0x04000F7B RID: 3963
|
|
private MonoMethod method;
|
|
|
|
// Token: 0x04000F7C RID: 3964
|
|
private object[] args;
|
|
|
|
// Token: 0x04000F7D RID: 3965
|
|
private string[] names;
|
|
|
|
// Token: 0x04000F7E RID: 3966
|
|
private byte[] arg_types;
|
|
|
|
// Token: 0x04000F7F RID: 3967
|
|
public LogicalCallContext ctx;
|
|
|
|
// Token: 0x04000F80 RID: 3968
|
|
public object rval;
|
|
|
|
// Token: 0x04000F81 RID: 3969
|
|
public Exception exc;
|
|
|
|
// Token: 0x04000F82 RID: 3970
|
|
private AsyncResult asyncResult;
|
|
|
|
// Token: 0x04000F83 RID: 3971
|
|
private CallType call_type;
|
|
|
|
// Token: 0x04000F84 RID: 3972
|
|
private string uri;
|
|
|
|
// Token: 0x04000F85 RID: 3973
|
|
private MethodCallDictionary properties;
|
|
|
|
// Token: 0x04000F86 RID: 3974
|
|
private Type[] methodSignature;
|
|
|
|
// Token: 0x04000F87 RID: 3975
|
|
private Identity identity;
|
|
}
|
|
}
|