Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,87 @@
//
// System.Runtime.Remoting.Messaging.ArgInfo.cs
//
// Author: Lluis Sanchez Gual (lluis@ideary.com)
//
// 2003 (C) Lluis Sanchez Gual
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Reflection;
namespace System.Runtime.Remoting.Messaging
{
internal enum ArgInfoType : byte { In, Out };
internal class ArgInfo
{
int[] _paramMap;
int _inoutArgCount;
MethodBase _method;
public ArgInfo(MethodBase method, ArgInfoType type)
{
_method = method;
ParameterInfo[] parameters = _method.GetParameters();
_paramMap = new int[parameters.Length];
_inoutArgCount = 0;
if (type == ArgInfoType.In) {
for (int n=0; n<parameters.Length; n++)
if (!parameters[n].ParameterType.IsByRef) { _paramMap [_inoutArgCount++] = n; }
}
else {
for (int n=0; n<parameters.Length; n++)
if (parameters[n].ParameterType.IsByRef || parameters[n].IsOut)
{ _paramMap [_inoutArgCount++] = n; }
}
}
public int GetInOutArgIndex (int inoutArgNum)
{
return _paramMap[inoutArgNum];
}
public virtual string GetInOutArgName (int index)
{
return _method.GetParameters()[_paramMap[index]].Name;
}
public int GetInOutArgCount ()
{
return _inoutArgCount;
}
public object [] GetInOutArgs (object[] args)
{
object[] inoutArgs = new object[_inoutArgCount];
for (int n=0; n<_inoutArgCount; n++)
inoutArgs[n] = args[_paramMap[n]];
return inoutArgs;
}
}
}

View File

@@ -0,0 +1,189 @@
//
// System.Runtime.Remoting.Messaging/AsyncResult.cs
//
// Authors:
// Joe Shaw (joe@ximian.com)
// Martin Baulig (martin@gnome.org)
// Dietmar Maurer (dietmar@ximian.com)
// Duncan Mak (duncan@ximian.com)
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Threading;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace System.Runtime.Remoting.Messaging {
[System.Runtime.InteropServices.ComVisible (true)]
[StructLayout (LayoutKind.Sequential)]
public class AsyncResult : IAsyncResult, IMessageSink {
#pragma warning disable 169, 414, 649
object async_state;
WaitHandle handle;
object async_delegate;
IntPtr data;
object object_data;
bool sync_completed;
bool completed;
bool endinvoke_called;
object async_callback;
ExecutionContext current;
ExecutionContext original;
long add_time;
#pragma warning restore 169, 414, 649
// not part of MonoAsyncResult...
MonoMethodMessage call_message;
#pragma warning disable 0414
IMessageCtrl message_ctrl;
#pragma warning restore
IMessage reply_message;
internal AsyncResult ()
{
}
internal AsyncResult (WaitCallback cb, object state, bool capture_context)
{
async_state = state;
async_delegate = cb;
if (capture_context)
current = ExecutionContext.Capture ();
}
public virtual object AsyncState
{
get {
return async_state;
}
}
public virtual WaitHandle AsyncWaitHandle {
get {
lock (this) {
if (handle == null)
handle = new ManualResetEvent (completed);
return handle;
}
}
}
public virtual bool CompletedSynchronously
{
get {
return sync_completed;
}
}
public virtual bool IsCompleted
{
get {
return completed;
}
}
public bool EndInvokeCalled
{
get {
return endinvoke_called;
}
set {
endinvoke_called = value;
}
}
public virtual object AsyncDelegate
{
get {
return async_delegate;
}
}
public IMessageSink NextSink {
get {
return null;
}
}
public virtual IMessageCtrl AsyncProcessMessage (IMessage msg, IMessageSink replySink)
{
// Never called
throw new NotSupportedException ();
}
public virtual IMessage GetReplyMessage()
{
return reply_message;
}
public virtual void SetMessageCtrl (IMessageCtrl mc)
{
message_ctrl = mc;
}
internal void SetCompletedSynchronously (bool completed)
{
sync_completed = completed;
}
internal IMessage EndInvoke ()
{
lock (this) {
if (completed)
return reply_message;
}
AsyncWaitHandle.WaitOne ();
return reply_message;
}
public virtual IMessage SyncProcessMessage (IMessage msg)
{
reply_message = msg;
lock (this) {
completed = true;
if (handle != null)
((ManualResetEvent) AsyncWaitHandle).Set ();
}
if (async_callback != null) {
AsyncCallback ac = (AsyncCallback) async_callback;
ac (this);
}
return null;
}
internal MonoMethodMessage CallMessage
{
get { return call_message; }
set { call_message = value; }
}
}
}

View File

@@ -0,0 +1,483 @@
//
// System.Runtime.Remoting.Messaging.CADMessages.cs
//
// Author:
// Patrik Torstensson
//
// (C) Patrik Torstensson
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.IO;
using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Proxies;
namespace System.Runtime.Remoting.Messaging {
internal class CADArgHolder {
public int index;
public CADArgHolder (int i) {
index = i;
}
}
internal class CADObjRef {
ObjRef objref;
public int SourceDomain;
public CADObjRef (ObjRef o, int sourceDomain) {
objref = o;
SourceDomain = sourceDomain;
}
public string TypeName {
get { return objref.TypeInfo.TypeName; }
}
public string URI {
get { return objref.URI; }
}
}
internal class CADMessageBase {
protected object [] _args;
protected byte [] _serializedArgs = null;
protected int _propertyCount = 0;
protected CADArgHolder _callContext;
// Helper to marshal properties
internal static int MarshalProperties (IDictionary dict, ref ArrayList args) {
IDictionary serDict = dict;
int count = 0;
MethodDictionary msgDict = dict as MethodDictionary;
if (null != msgDict) {
if (msgDict.HasInternalProperties) {
serDict = msgDict.InternalProperties;
if (null != serDict) {
foreach (DictionaryEntry e in serDict) {
if (null == args)
args = new ArrayList();
args.Add(e);
count++;
}
}
}
} else {
if (null != dict) {
foreach (DictionaryEntry e in serDict) {
if (null == args)
args = new ArrayList();
args.Add(e);
count++;
}
}
}
return count;
}
internal static void UnmarshalProperties (IDictionary dict, int count, ArrayList args) {
for (int i = 0; i < count; i++) {
DictionaryEntry e = (DictionaryEntry) args [i];
dict [e.Key] = e.Value;
}
}
// We can ignore marshalling for string and primitive types
private static bool IsPossibleToIgnoreMarshal (object obj) {
Type objType = obj.GetType();
if (objType.IsPrimitive || objType == typeof(void))
return true;
if (objType.IsArray && objType.GetElementType().IsPrimitive && ((Array)obj).Rank == 1)
return true;
if (obj is string || obj is DateTime || obj is TimeSpan)
return true;
return false;
}
// Checks an argument if it's possible to pass without marshalling and
// if not it will be added to arguments to be serialized
protected object MarshalArgument (object arg, ref ArrayList args) {
if (null == arg)
return null;
if (IsPossibleToIgnoreMarshal (arg))
return arg;
MarshalByRefObject mbr = arg as MarshalByRefObject;
if (null != mbr)
{
if (RemotingServices.IsTransparentProxy(mbr)) {
// We don't deal with this case yet
}
else {
ObjRef objRef = RemotingServices.Marshal(mbr);
return new CADObjRef(objRef, System.Threading.Thread.GetDomainID());
}
}
if (null == args)
args = new ArrayList();
args.Add (arg);
// return position that the arg exists in the serialized list
return new CADArgHolder(args.Count - 1);
}
protected object UnmarshalArgument (object arg, ArrayList args) {
if (arg == null) return null;
// Check if argument is an holder (then we know that it's a serialized argument)
CADArgHolder holder = arg as CADArgHolder;
if (null != holder) {
return args [holder.index];
}
CADObjRef objref = arg as CADObjRef;
if (null != objref) {
string typeName = string.Copy (objref.TypeName);
string uri = string.Copy (objref.URI);
int domid = objref.SourceDomain;
ChannelInfo cinfo = new ChannelInfo (new CrossAppDomainData (domid));
ObjRef localRef = new ObjRef (typeName, uri, cinfo);
return RemotingServices.Unmarshal (localRef);
}
if (arg is Array)
{
Array argb = (Array)arg;
Array argn;
// We can't use Array.CreateInstance (arg.GetType().GetElementType()) because
// GetElementType() returns a type from the source domain.
switch (Type.GetTypeCode (arg.GetType().GetElementType()))
{
case TypeCode.Boolean: argn = new bool [argb.Length]; break;
case TypeCode.Byte: argn = new Byte [argb.Length]; break;
case TypeCode.Char: argn = new Char [argb.Length]; break;
case TypeCode.Decimal: argn = new Decimal [argb.Length]; break;
case TypeCode.Double: argn = new Double [argb.Length]; break;
case TypeCode.Int16: argn = new Int16 [argb.Length]; break;
case TypeCode.Int32: argn = new Int32 [argb.Length]; break;
case TypeCode.Int64: argn = new Int64 [argb.Length]; break;
case TypeCode.SByte: argn = new SByte [argb.Length]; break;
case TypeCode.Single: argn = new Single [argb.Length]; break;
case TypeCode.UInt16: argn = new UInt16 [argb.Length]; break;
case TypeCode.UInt32: argn = new UInt32 [argb.Length]; break;
case TypeCode.UInt64: argn = new UInt64 [argb.Length]; break;
default: throw new NotSupportedException ();
}
argb.CopyTo (argn, 0);
return argn;
}
switch (Type.GetTypeCode (arg.GetType()))
{
case TypeCode.Boolean: return (bool)arg;
case TypeCode.Byte: return (byte)arg;
case TypeCode.Char: return (char)arg;
case TypeCode.Decimal: return (decimal)arg;
case TypeCode.Double: return (double)arg;
case TypeCode.Int16: return (Int16)arg;
case TypeCode.Int32: return (Int32)arg;
case TypeCode.Int64: return (Int64)arg;
case TypeCode.SByte: return (SByte)arg;
case TypeCode.Single: return (Single)arg;
case TypeCode.UInt16: return (UInt16)arg;
case TypeCode.UInt32: return (UInt32)arg;
case TypeCode.UInt64: return (UInt64)arg;
case TypeCode.String: return string.Copy ((string) arg);
case TypeCode.DateTime: return new DateTime (((DateTime)arg).Ticks);
default:
if (arg is TimeSpan) return new TimeSpan (((TimeSpan)arg).Ticks);
if (arg is IntPtr) return (IntPtr) arg;
break;
}
throw new NotSupportedException ("Parameter of type " + arg.GetType () + " cannot be unmarshalled");
}
internal object [] MarshalArguments (object [] arguments, ref ArrayList args) {
object [] marshalledArgs = new object [arguments.Length];
int total = arguments.Length;
for (int i = 0; i < total; i++)
marshalledArgs [i] = MarshalArgument (arguments [i], ref args);
return marshalledArgs;
}
internal object [] UnmarshalArguments (object [] arguments, ArrayList args) {
object [] unmarshalledArgs = new object [arguments.Length];
int total = arguments.Length;
for (int i = 0; i < total; i++)
unmarshalledArgs [i] = UnmarshalArgument (arguments [i], args);
return unmarshalledArgs;
}
protected void SaveLogicalCallContext (IMethodMessage msg, ref ArrayList serializeList)
{
if (msg.LogicalCallContext != null && msg.LogicalCallContext.HasInfo)
{
if (serializeList == null)
serializeList = new ArrayList();
_callContext = new CADArgHolder (serializeList.Count);
serializeList.Add (msg.LogicalCallContext);
}
}
internal LogicalCallContext GetLogicalCallContext (ArrayList args)
{
if (null == _callContext)
return null;
return (LogicalCallContext) args [_callContext.index];
}
}
// Used when passing a IMethodCallMessage between appdomains
internal class CADMethodCallMessage : CADMessageBase {
string _uri;
internal RuntimeMethodHandle MethodHandle;
internal string FullTypeName;
internal string Uri {
get {
return _uri;
}
}
static internal CADMethodCallMessage Create (IMessage callMsg) {
IMethodCallMessage msg = callMsg as IMethodCallMessage;
if (null == msg)
return null;
return new CADMethodCallMessage (msg);
}
internal CADMethodCallMessage (IMethodCallMessage callMsg) {
_uri = callMsg.Uri;
MethodHandle = callMsg.MethodBase.MethodHandle;
FullTypeName = callMsg.MethodBase.DeclaringType.AssemblyQualifiedName;
ArrayList serializeList = null;
_propertyCount = MarshalProperties (callMsg.Properties, ref serializeList);
_args = MarshalArguments ( callMsg.Args, ref serializeList);
// Save callcontext
SaveLogicalCallContext (callMsg, ref serializeList);
// Serialize message data if needed
if (null != serializeList) {
MemoryStream stm = CADSerializer.SerializeObject (serializeList.ToArray());
_serializedArgs = stm.GetBuffer();
}
}
internal ArrayList GetArguments () {
ArrayList ret = null;
if (null != _serializedArgs) {
object[] oret = (object[]) CADSerializer.DeserializeObject (new MemoryStream (_serializedArgs));
ret = new ArrayList (oret);
_serializedArgs = null;
}
return ret;
}
internal object [] GetArgs (ArrayList args) {
return UnmarshalArguments (_args, args);
}
internal int PropertiesCount {
get {
return _propertyCount;
}
}
static Type [] GetSignature (MethodBase methodBase, bool load)
{
ParameterInfo[] pars = methodBase.GetParameters ();
Type[] signature = new Type [pars.Length];
for (int n=0; n<pars.Length; n++) {
// The parameter types may also be loaded from a different assembly, so we need
// to load them again
if (load)
signature [n] = Type.GetType (pars [n].ParameterType.AssemblyQualifiedName, true);
else
signature [n] = pars [n].ParameterType;
}
return signature;
}
internal MethodBase GetMethod ()
{
MethodBase methodBase = null;
Type tt = Type.GetType (FullTypeName, true);
if (tt.IsGenericType || tt.IsGenericTypeDefinition) {
methodBase = MethodBase.GetMethodFromHandleNoGenericCheck (MethodHandle);
} else {
methodBase = MethodBase.GetMethodFromHandle (MethodHandle);
}
if (tt != methodBase.DeclaringType) {
// The target domain has loaded the type from a different assembly.
// We need to locate the correct type and get the method from it
Type [] signature = GetSignature (methodBase, true);
if (methodBase.IsGenericMethod) {
MethodBase [] methods = tt.GetMethods (BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.Instance);
Type [] base_args = methodBase.GetGenericArguments ();
foreach (MethodBase method in methods) {
if (!method.IsGenericMethod || method.Name != methodBase.Name)
continue;
Type [] method_args = method.GetGenericArguments ();
if (base_args.Length != method_args.Length)
continue;
MethodInfo method_instance = ((MethodInfo) method).MakeGenericMethod (base_args);
Type [] base_sig = GetSignature (method_instance, false);
if (base_sig.Length != signature.Length) {
continue;
}
bool dont = false;
for (int i = base_sig.Length - 1; i >= 0; i--) {
if (base_sig [i] != signature [i]) {
dont = true;
break;
}
}
if (dont)
continue;
return method_instance;
}
return methodBase;
}
MethodBase mb = tt.GetMethod (methodBase.Name, BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.Instance, null, signature, null);
if (mb == null)
throw new RemotingException ("Method '" + methodBase.Name + "' not found in type '" + tt + "'");
return mb;
}
return methodBase;
}
}
// Used when passing a IMethodReturnMessage between appdomains
internal class CADMethodReturnMessage : CADMessageBase {
object _returnValue;
CADArgHolder _exception = null;
static internal CADMethodReturnMessage Create (IMessage callMsg) {
IMethodReturnMessage msg = callMsg as IMethodReturnMessage;
if (null == msg)
return null;
return new CADMethodReturnMessage (msg);
}
internal CADMethodReturnMessage(IMethodReturnMessage retMsg) {
ArrayList serializeList = null;
_propertyCount = MarshalProperties (retMsg.Properties, ref serializeList);
_returnValue = MarshalArgument ( retMsg.ReturnValue, ref serializeList);
_args = MarshalArguments ( retMsg.Args, ref serializeList);
if (null != retMsg.Exception) {
if (null == serializeList)
serializeList = new ArrayList();
_exception = new CADArgHolder (serializeList.Count);
serializeList.Add(retMsg.Exception);
}
// Save callcontext
SaveLogicalCallContext (retMsg, ref serializeList);
if (null != serializeList) {
MemoryStream stm = CADSerializer.SerializeObject (serializeList.ToArray());
_serializedArgs = stm.GetBuffer();
}
}
internal ArrayList GetArguments () {
ArrayList ret = null;
if (null != _serializedArgs) {
object[] oret = (object[]) CADSerializer.DeserializeObject (new MemoryStream (_serializedArgs));
ret = new ArrayList (oret);
_serializedArgs = null;
}
return ret;
}
internal object [] GetArgs (ArrayList args) {
return UnmarshalArguments (_args, args);
}
internal object GetReturnValue (ArrayList args) {
return UnmarshalArgument (_returnValue, args);
}
internal Exception GetException(ArrayList args) {
if (null == _exception)
return null;
return (Exception) args [_exception.index];
}
internal int PropertiesCount {
get {
return _propertyCount;
}
}
}
}

View File

@@ -0,0 +1,154 @@
//
// System.Runtime.Remoting.Messaging.CallContext.cs
//
// Authors: Jaime Anguiano Olarra (jaime@gnome.org)
// Lluis Sanchez Gual (lluis@ximian.com)
// Marek Safar (marek.safar@gmail.com)
//
// (c) 2002, Jaime Anguiano Olarra
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Threading;
using System.Collections;
using System.Collections.Generic;
namespace System.Runtime.Remoting.Messaging
{
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public sealed class CallContext
{
[ThreadStatic] static Header [] Headers;
[ThreadStatic] static object hostContext;
private CallContext ()
{
}
public static object HostContext {
get { return hostContext; }
set { hostContext = value; }
}
public static void FreeNamedDataSlot (string name)
{
ExecutionContext.FreeNamedDataSlot (name);
}
public static object GetData (string name)
{
var value = LogicalGetData (name);
if (value == null)
Datastore.TryGetValue (name, out value);
return value;
}
public static void SetData (string name, object data)
{
if (data is ILogicalThreadAffinative) {
LogicalSetData (name, data);
} else {
LogicalContext.FreeNamedDataSlot (name);
Datastore [name] = data;
}
}
public static object LogicalGetData (string name)
{
return LogicalContext.GetData (name);
}
public static void LogicalSetData (string name, object data)
{
Datastore.Remove (name);
LogicalContext.SetData (name, data);
}
public static Header[] GetHeaders ()
{
return Headers;
}
public static void SetHeaders (Header[] headers)
{
Headers = headers;
}
internal static object SetCurrentCallContext (LogicalCallContext ctx)
{
object oldData = new object[] { Datastore, LogicalContext.Datastore };
Hashtable logicalDatastore;
if (ctx != null && ctx.HasInfo)
logicalDatastore = (Hashtable) ctx.Datastore.Clone ();
else
logicalDatastore = null;
LogicalContext.Datastore = logicalDatastore;
return oldData;
}
internal static void UpdateCurrentLogicalCallContext (LogicalCallContext ctx)
{
Hashtable data = ctx.Datastore;
if (data == null)
return;
foreach (DictionaryEntry entry in data)
LogicalSetData ((string)entry.Key, entry.Value);
}
internal static void RestoreCallContext (object oldContext)
{
object[] contextArray = (object[])oldContext;
ExecutionContext.DataStore = (Dictionary<string, object>)contextArray [0];
LogicalContext.Datastore = (Hashtable)contextArray [1];
}
static Dictionary<string, object> Datastore {
get {
return ExecutionContext.DataStore;
}
}
static LogicalCallContext LogicalContext {
get {
return ExecutionContext.LogicalCallContext;
}
}
static ExecutionContext ExecutionContext {
get {
return ExecutionContext.Current;
}
}
}
[System.Runtime.InteropServices.ComVisible (true)]
public interface ILogicalThreadAffinative
{
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,126 @@
//
// System.Runtime.Remoting.Messaging.ClientContextTerminatorSink.cs
//
// Author: Lluis Sanchez Gual (lluis@ideary.com)
//
// (C) 2003, Lluis Sanchez Gual
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Activation;
using System.Runtime.Remoting.Contexts;
namespace System.Runtime.Remoting.Messaging
{
internal class ClientContextTerminatorSink: IMessageSink
{
Context _context;
public ClientContextTerminatorSink(Context ctx)
{
_context = ctx;
}
public IMessage SyncProcessMessage (IMessage msg)
{
IMessage res;
Context.NotifyGlobalDynamicSinks (true, msg, true, false);
_context.NotifyDynamicSinks (true, msg, true, false);
if (msg is IConstructionCallMessage)
{
res = ActivationServices.RemoteActivate ((IConstructionCallMessage)msg);
}
else
{
Identity identity = RemotingServices.GetMessageTargetIdentity (msg);
res = identity.ChannelSink.SyncProcessMessage (msg);
}
Context.NotifyGlobalDynamicSinks (false, msg, true, false);
_context.NotifyDynamicSinks (false, msg, true, false);
return res;
}
public IMessageCtrl AsyncProcessMessage (IMessage msg, IMessageSink replySink)
{
if (_context.HasDynamicSinks || Context.HasGlobalDynamicSinks)
{
Context.NotifyGlobalDynamicSinks (true, msg, true, true);
_context.NotifyDynamicSinks (true, msg, true, true);
// replySink is null when calling a one way method
if (replySink != null) replySink = new ClientContextReplySink (_context, replySink);
}
Identity identity = RemotingServices.GetMessageTargetIdentity (msg);
IMessageCtrl res = identity.ChannelSink.AsyncProcessMessage (msg, replySink);
if (replySink == null && (_context.HasDynamicSinks || Context.HasGlobalDynamicSinks))
{
Context.NotifyGlobalDynamicSinks (false, msg, true, true);
_context.NotifyDynamicSinks (false, msg, true, true);
}
return res;
}
public IMessageSink NextSink
{
get { return null; }
}
}
class ClientContextReplySink: IMessageSink
{
IMessageSink _replySink;
Context _context;
public ClientContextReplySink (Context ctx, IMessageSink replySink)
{
_replySink = replySink;
_context = ctx;
}
public IMessage SyncProcessMessage (IMessage msg)
{
Context.NotifyGlobalDynamicSinks (false, msg, true, true);
_context.NotifyDynamicSinks (false, msg, true, true);
return _replySink.SyncProcessMessage (msg);
}
public IMessageCtrl AsyncProcessMessage (IMessage msg, IMessageSink replySink)
{
throw new NotSupportedException ();
}
public IMessageSink NextSink
{
get { return _replySink; }
}
}
}

View File

@@ -0,0 +1,165 @@
//
// System.Runtime.Remoting.Messaging.ConstructionCall.cs
//
// Author: Lluis Sanchez Gual (lluis@ideary.com)
//
// (C) 2003, Lluis Sanchez Gual
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Threading;
using System.Collections;
using System.Runtime.Remoting.Activation;
using System.Runtime.Serialization;
using System.Runtime.Remoting.Contexts;
using System.Runtime.Remoting.Proxies;
namespace System.Runtime.Remoting.Messaging
{
[Serializable] [CLSCompliant (false)]
[System.Runtime.InteropServices.ComVisible (true)]
public class ConstructionCall: MethodCall, IConstructionCallMessage
{
IActivator _activator;
object[] _activationAttributes;
IList _contextProperties;
Type _activationType;
string _activationTypeName;
bool _isContextOk;
[NonSerialized] RemotingProxy _sourceProxy;
public ConstructionCall (IMessage m): base (m)
{
_activationTypeName = TypeName;
_isContextOk = true;
}
internal ConstructionCall (Type type)
{
_activationType = type;
_activationTypeName = type.AssemblyQualifiedName;
_isContextOk = true;
}
public ConstructionCall (Header[] headers): base (headers)
{
}
internal ConstructionCall (SerializationInfo info, StreamingContext context): base (info, context)
{
}
internal override void InitDictionary()
{
ConstructionCallDictionary props = new ConstructionCallDictionary (this);
ExternalProperties = props;
InternalProperties = props.GetInternalProperties();
}
internal bool IsContextOk
{
get { return _isContextOk; }
set { _isContextOk = value; }
}
public Type ActivationType
{
get
{
if (_activationType == null) _activationType = Type.GetType (_activationTypeName);
return _activationType;
}
}
public string ActivationTypeName
{
get { return _activationTypeName; }
}
public IActivator Activator
{
get { return _activator; }
set { _activator = value; }
}
public object [] CallSiteActivationAttributes
{
get { return _activationAttributes; }
}
internal void SetActivationAttributes (object [] attributes)
{
_activationAttributes = attributes;
}
public IList ContextProperties
{
get
{
if (_contextProperties == null) _contextProperties = new ArrayList ();
return _contextProperties;
}
}
internal override void InitMethodProperty(string key, object value)
{
switch (key)
{
case "__Activator" : _activator = (IActivator) value; return;
case "__CallSiteActivationAttributes" : _activationAttributes = (object[]) value; return;
case "__ActivationType" : _activationType = (Type) value; return;
case "__ContextProperties" : _contextProperties = (IList) value; return;
case "__ActivationTypeName" : _activationTypeName = (string) value; return;
default: base.InitMethodProperty (key, value); return;
}
}
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
base.GetObjectData (info, context);
IList props = _contextProperties;
if (props != null && props.Count == 0) props = null;
info.AddValue ("__Activator", _activator);
info.AddValue ("__CallSiteActivationAttributes", _activationAttributes);
info.AddValue ("__ActivationType", null);
info.AddValue ("__ContextProperties", props);
info.AddValue ("__ActivationTypeName", _activationTypeName);
}
public override IDictionary Properties
{
get { return base.Properties; }
}
internal RemotingProxy SourceProxy
{
get { return _sourceProxy; }
set {_sourceProxy = value; }
}
}
}

View File

@@ -0,0 +1,74 @@
//
// System.Runtime.Remoting.Messaging.ConstructionCallDictionary.cs
//
// Author: Lluis Sanchez Gual (lluis@ideary.com)
//
// (C) 2003, Lluis Sanchez Gual
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Runtime.Remoting.Activation;
namespace System.Runtime.Remoting.Messaging
{
class ConstructionCallDictionary : MethodDictionary
{
public static string[] InternalKeys = new string[] {"__Uri", "__MethodName", "__TypeName", "__MethodSignature", "__Args", "__CallContext", "__CallSiteActivationAttributes", "__ActivationType", "__ContextProperties", "__Activator", "__ActivationTypeName"};
public ConstructionCallDictionary(IConstructionCallMessage message) : base (message)
{
MethodKeys = InternalKeys;
}
protected override object GetMethodProperty (string key)
{
switch (key)
{
case "__Activator" : return ((IConstructionCallMessage)_message).Activator;
case "__CallSiteActivationAttributes" : return ((IConstructionCallMessage)_message).CallSiteActivationAttributes;
case "__ActivationType" : return ((IConstructionCallMessage)_message).ActivationType;
case "__ContextProperties" : return ((IConstructionCallMessage)_message).ContextProperties;
case "__ActivationTypeName" : return ((IConstructionCallMessage)_message).ActivationTypeName;
default : return base.GetMethodProperty (key);
}
}
protected override void SetMethodProperty (string key, object value)
{
switch (key)
{
case "__Activator": ((IConstructionCallMessage)_message).Activator = (IActivator) value; break;
case "__CallSiteActivationAttributes":
case "__ActivationType":
case "__ContextProperties":
case "__ActivationTypeName": throw new ArgumentException ("key was invalid");
default: base.SetMethodProperty (key, value); break;
}
}
}
}

View File

@@ -0,0 +1,66 @@
//
// System.Runtime.Remoting.Messaging.ConstructionResponse.cs
//
// Author: Lluis Sanchez Gual (lluis@ideary.com)
//
// (C) 2003, Lluis Sanchez Gual
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.Runtime.Remoting.Activation;
using System.Runtime.Serialization;
namespace System.Runtime.Remoting.Messaging
{
[Serializable] [CLSCompliant (false)]
[System.Runtime.InteropServices.ComVisible (true)]
public class ConstructionResponse: MethodResponse, IConstructionReturnMessage
{
public ConstructionResponse (Header[] h, IMethodCallMessage mcm)
: base (h, mcm)
{
}
internal ConstructionResponse(object resultObject, LogicalCallContext callCtx, IMethodCallMessage msg)
: base (resultObject, null, callCtx, msg)
{
}
internal ConstructionResponse (Exception e, IMethodCallMessage msg): base (e, msg)
{
}
internal ConstructionResponse (SerializationInfo info, StreamingContext context): base (info, context)
{
}
public override IDictionary Properties
{
get { return base.Properties; }
}
}
}

View File

@@ -0,0 +1,57 @@
//
// System.Runtime.Remoting.Messaging.EnvoyTerminatorSink.cs
//
// Author: Lluis Sanchez Gual (lluis@ideary.com)
//
// (C) 2003, Lluis Sanchez Gual
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Threading;
namespace System.Runtime.Remoting.Messaging
{
[Serializable]
internal class EnvoyTerminatorSink: IMessageSink
{
public static EnvoyTerminatorSink Instance = new EnvoyTerminatorSink();
public IMessage SyncProcessMessage (IMessage msg)
{
return Thread.CurrentContext.GetClientContextSinkChain ().SyncProcessMessage (msg);
}
public IMessageCtrl AsyncProcessMessage (IMessage msg, IMessageSink replySink)
{
return Thread.CurrentContext.GetClientContextSinkChain ().AsyncProcessMessage (msg, replySink);
}
public IMessageSink NextSink
{
get { return null; }
}
}
}

View File

@@ -0,0 +1,144 @@
//
// System.Runtime.Remoting.Messaging.ErrorMessage.cs
//
// Author:
// Patrik Torstensson
//
// (C) Ximian, Inc. http://www.ximian.com
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.Reflection;
namespace System.Runtime.Remoting.Messaging {
// simple message to avoid serialization of crap data
[Serializable]
internal class ErrorMessage : IMethodCallMessage
{
string _uri = "Exception";
public ErrorMessage()
{
}
public int ArgCount {
get {
return 0;
}
}
public object [] Args {
get {
return null;
}
}
public bool HasVarArgs {
get {
return false;
}
}
public MethodBase MethodBase {
get {
return null;
}
}
public string MethodName {
get {
return "unknown";
}
}
public object MethodSignature {
get {
return null;
}
}
public virtual IDictionary Properties {
get {
return null;
}
}
public string TypeName {
get {
return "unknown";
}
}
public string Uri {
get {
return _uri;
}
set {
_uri = value;
}
}
public object GetArg (int arg_num)
{
return null;
}
public string GetArgName (int arg_num)
{
return "unknown";
}
public int InArgCount
{
get {
return 0;
}
}
public String GetInArgName(int index)
{
return null;
}
public Object GetInArg(int argNum)
{
return null;
}
public Object[] InArgs
{
get { return null; }
}
public LogicalCallContext LogicalCallContext
{
get { return null; }
}
}
}

View File

@@ -0,0 +1,67 @@
//
// System.Runtime.Remoting.Messaging.Header.cs
//
// Author:
// Dan Lewis (dihlewis@yahoo.co.uk)
//
// (C) 2002
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections;
namespace System.Runtime.Remoting.Messaging {
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public class Header {
public Header (string _Name, object _Value) :
this (_Name, _Value, true)
{
}
public Header (string _Name, object _Value, bool _MustUnderstand) :
this (_Name, _Value, _MustUnderstand, null)
{
}
public Header (string _Name, object _Value, bool _MustUnderstand, string _HeaderNamespace) {
this.Name = _Name;
this.Value = _Value;
this.MustUnderstand = _MustUnderstand;
this.HeaderNamespace = _HeaderNamespace;
}
// fields
public string HeaderNamespace;
public bool MustUnderstand;
public string Name;
public object Value;
}
}

View File

@@ -0,0 +1,36 @@
//
// System.Runtime.Remoting.Messaging.HeaderHandler.cs
//
// Author: Duncan Mak (duncan@ximian.com)
//
// (C) Copyright Ximian, Inc. 2002
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace System.Runtime.Remoting.Messaging {
[System.Runtime.InteropServices.ComVisible (true)]
public delegate object HeaderHandler (Header[] headers);
}

View File

@@ -0,0 +1,34 @@
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Runtime.Remoting;
namespace System.Runtime.Remoting.Messaging
{
internal interface IInternalMessage
{
Identity TargetIdentity { get; set; }
string Uri { get; set; }
}
}

View File

@@ -0,0 +1,44 @@
//
// System.Runtime.Remoting.Messaging.IMessage.cs
//
// Author:
// Miguel de Icaza (miguel@ximian.com)
//
// (C) Ximian, Inc. http://www.ximian.com
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections;
namespace System.Runtime.Remoting.Messaging {
[System.Runtime.InteropServices.ComVisible (true)]
public interface IMessage {
IDictionary Properties {
get;
}
}
}

View File

@@ -0,0 +1,42 @@
//
// System.Runtime.Remoting.Messaging.IMessageSink.cs
//
// Author:
// Piers Haken (piersh@friskit.com)
//
// (C) Ximian, Inc. http://www.ximian.com
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Runtime.Remoting;
namespace System.Runtime.Remoting.Messaging
{
[System.Runtime.InteropServices.ComVisible (true)]
public interface IMessageCtrl {
void Cancel (int msToCancel);
}
}

View File

@@ -0,0 +1,44 @@
//
// System.Runtime.Remoting.Messaging.IMessageSink.cs
//
// Author:
// Piers Haken (piersh@friskit.com)
//
// (C) Ximian, Inc. http://www.ximian.com
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Runtime.Remoting;
namespace System.Runtime.Remoting.Messaging
{
[System.Runtime.InteropServices.ComVisible (true)]
public interface IMessageSink {
IMessage SyncProcessMessage (IMessage msg);
IMessageCtrl AsyncProcessMessage (IMessage msg, IMessageSink replySink);
IMessageSink NextSink { get; }
}
}

View File

@@ -0,0 +1,52 @@
//
// System.Runtime.Remoting.Messaging.IMethodCallMessage.cs
//
// Author:
// Dietmar Maurer (dietmar@ximian.com)
//
// (C) Ximian, Inc. http://www.ximian.com
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Reflection;
namespace System.Runtime.Remoting.Messaging {
[System.Runtime.InteropServices.ComVisible (true)]
public interface IMethodCallMessage : IMethodMessage {
int InArgCount {
get;
}
object [] InArgs {
get;
}
object GetInArg (int argNum);
string GetInArgName (int index);
}
}

View File

@@ -0,0 +1,79 @@
//
// System.Runtime.Remoting.Messaging.IMethodMessage.cs
//
// Author:
// Miguel de Icaza (miguel@ximian.com)
//
// (C) Ximian, Inc. http://www.ximian.com
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Reflection;
namespace System.Runtime.Remoting.Messaging {
[System.Runtime.InteropServices.ComVisible (true)]
public interface IMethodMessage : IMessage {
int ArgCount {
get;
}
object [] Args {
get;
}
bool HasVarArgs {
get;
}
LogicalCallContext LogicalCallContext {
get;
}
MethodBase MethodBase {
get;
}
string MethodName {
get;
}
object MethodSignature {
get;
}
string TypeName {
get;
}
string Uri {
get;
}
object GetArg (int argNum);
string GetArgName (int index);
}
}

View File

@@ -0,0 +1,46 @@
//
// System.Runtime.Remoting.Messaging.IMethodReturnMessage.cs
//
// Author:
// Miguel de Icaza (miguel@ximian.com)
//
// (C) Ximian, Inc. http://www.ximian.com
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace System.Runtime.Remoting.Messaging {
[System.Runtime.InteropServices.ComVisible (true)]
public interface IMethodReturnMessage : IMethodMessage, IMessage {
Exception Exception { get; }
int OutArgCount { get; }
object [] OutArgs { get; }
object ReturnValue { get; }
object GetOutArg (int argNum);
string GetOutArgName (int index);
}
}

Some files were not shown because too many files have changed in this diff Show More