// copied from ServicedComponentMarshaler above directly // IF YOU MAK ANY CHANGES TO THIS, KEEP THE OTHER COPY IN SYNC public override void GetObjectData(SerializationInfo info, StreamingContext context) { DBG.Info(DBG.SC, "FSCM: GetObjectData"); ComponentServices.InitializeRemotingChannels(); if (info == null) { throw new ArgumentNullException("info"); } // Check to see if this is a remoting channel, if so, then we // should use the standard objref marshal (cause we're going over SOAP // or another remoting channel). object oClientIsClr = CallContext.GetData("__ClientIsClr"); DBG.Info(DBG.SC, "FSCM: GetObjectData: oClientIsClr = " + oClientIsClr); bool bUseStandardObjRef = (oClientIsClr == null)?false:(bool)oClientIsClr; if (bUseStandardObjRef) { RemoteServicedComponentProxy rscp = _rp as RemoteServicedComponentProxy; if (rscp != null) { DBG.Info(DBG.SC, "FSCM: GetObjectData: intermediary objref"); ObjRef std = RemotingServices.Marshal((MarshalByRefObject)(rscp.RemotingIntermediary.GetTransparentProxy()), null, null); std.GetObjectData(info, context); } else { DBG.Info(DBG.SC, "FSCM: GetObjectData: Using standard objref"); base.GetObjectData(info, context); } } else { DBG.Info(DBG.SC, "FSCM: GetObjectData: Using custom objref"); base.GetObjectData(info, context); //*** base.GetObjectData sets the type to be itself // now wack the type to be us info.SetType(typeof(ServicedComponentMarshaler)); DBG.Assert(_rp != null, "_rp is null"); info.AddValue("servertype", _rp.GetProxiedType()); byte[] dcomBuffer = ComponentServices.GetDCOMBuffer((MarshalByRefObject)_rp.GetTransparentProxy()); DBG.Assert(dcomBuffer != null, "dcomBuffer is null"); if (dcomBuffer != null) { info.AddValue("dcomInfo", dcomBuffer); } } }
// We should never need to have a deserialization constructor, since // we never deserialize one of these guys. public override void GetObjectData(SerializationInfo info, StreamingContext ctx) { object oClientIsClr = CallContext.GetData("__ClientIsClr"); DBG.Info(DBG.SC, "SCM: GetObjectData: oClientIsClr = " + oClientIsClr); bool bUseStandardObjRef = (oClientIsClr == null)?false:(bool)oClientIsClr; if (bUseStandardObjRef) { base.GetObjectData(info, ctx); } else { _custom.GetObjectData(info, ctx); } }