// Patrik Torstensson
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004, 2006 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
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Diagnostics;
using System.Text;
using System.Reflection;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
using System.Runtime.Remoting.Services;
+using System.Security.Permissions;
#if NET_2_0
using System.Runtime.ConstrainedExecution;
public static bool IsObjectOutOfAppDomain(object tp)
{
+ MarshalByRefObject mbr = tp as MarshalByRefObject;
+
+ if (mbr == null)
+ return false;
+
// TODO: use internal call for better performance
- Identity ident = GetObjectIdentity((MarshalByRefObject)tp);
+ Identity ident = GetObjectIdentity (mbr);
return ident is ClientIdentity;
}
public static bool IsObjectOutOfContext(object tp)
{
+ MarshalByRefObject mbr = tp as MarshalByRefObject;
+
+ if (mbr == null)
+ return false;
+
// TODO: use internal call for better performance
- Identity ident = GetObjectIdentity((MarshalByRefObject)tp);
+ Identity ident = GetObjectIdentity (mbr);
if (ident == null) return false;
ServerIdentity sident = ident as ServerIdentity;
RemotingProxy proxy = new RemotingProxy (type, ChannelServices.CrossContextUrl, activationAttributes);
return proxy.GetTransparentProxy();
}
+
+ internal static object CreateClientProxyForComInterop (Type type)
+ {
+ Mono.Interop.ComInteropProxy proxy = new Mono.Interop.ComInteropProxy (type);
+ return proxy.GetTransparentProxy ();
+ }
internal static Identity GetIdentityForUri (string uri)
{
}
// This method is called by the runtime
+ [SecurityPermission (SecurityAction.Assert, SerializationFormatter = true)] // FIXME: to be reviewed
internal static byte[] SerializeCallData (object obj)
{
LogicalCallContext ctx = CallContext.CreateLogicalCallContext (false);
}
// This method is called by the runtime
+ [SecurityPermission (SecurityAction.Assert, SerializationFormatter = true)] // FIXME: to be reviewed
internal static object DeserializeCallData (byte[] array)
{
if (array == null) return null;
}
// This method is called by the runtime
+ [SecurityPermission (SecurityAction.Assert, SerializationFormatter = true)] // FIXME: to be reviewed
internal static byte[] SerializeExceptionData (Exception ex)
{
try {