public static ObjRef GetObjRefForProxy(MarshalByRefObject obj)
{
ObjRef objRef = null;
if (!IsTransparentProxy(obj))
{
throw new RemotingException(
Environment.GetResourceString(
"Remoting_Proxy_BadType"));
}
RealProxy rp = GetRealProxy(obj);
Identity id = rp.IdentityObject;
if (null != id)
{
objRef = id.ObjectRef;
}
return objRef;
}