[System.Security.SecurityCritical] // auto-generated internal void DoCallBackGeneric( IntPtr targetCtxID, CrossContextDelegate deleg) { TransitionCall msgCall = new TransitionCall(targetCtxID, deleg); Message.PropagateCallContextFromThreadToMessage(msgCall); //DBG Console.WriteLine("CallBackGeneric starting!"); IMessage retMsg = this.GetClientContextChain().SyncProcessMessage(msgCall); if (null != retMsg) { Message.PropagateCallContextFromMessageToThread(retMsg); } IMethodReturnMessage msg = retMsg as IMethodReturnMessage; if (null != msg) { if (msg.Exception != null) throw msg.Exception; } //DBG Console.WriteLine("CallBackGeneric finished!"); }
internal void DoCallBackGeneric(IntPtr targetCtxID, CrossContextDelegate deleg) { TransitionCall msg = new TransitionCall(targetCtxID, deleg); Message.PropagateCallContextFromThreadToMessage(msg); IMessage message = this.GetClientContextChain().SyncProcessMessage(msg); if (message != null) { Message.PropagateCallContextFromMessageToThread(message); } IMethodReturnMessage message2 = message as IMethodReturnMessage; if ((message2 != null) && (message2.Exception != null)) { throw message2.Exception; } }
[System.Security.SecurityCritical] // auto-generated internal static void DoCallBackFromEE( IntPtr targetCtxID, IntPtr privateData, int targetDomainID) { Contract.Assert(targetCtxID != IntPtr.Zero, "Bad transition context"); /*DBG Console.WriteLine("private DoCallBackFromEE: targetCtx: " + Int32.Format(targetCtxID,"x") + " PvtData: " + Int32.Format(privateData,"x"));DBG*/ if (targetDomainID == 0) { CallBackHelper cb = new CallBackHelper( privateData, true /*fromEE*/, targetDomainID); CrossContextDelegate ctxDel = new CrossContextDelegate(cb.Func); Thread.CurrentContext.DoCallBackGeneric(targetCtxID, ctxDel); } else { // for x-appdomain calls, we can't pass a delegate since that // would require us to deserialize it on the other side which // is not allowed for non-public methods. TransitionCall msgCall = new TransitionCall(targetCtxID, privateData, targetDomainID); Message.PropagateCallContextFromThreadToMessage(msgCall); //DBG Console.WriteLine("CallBackGeneric starting!"); IMessage retMsg = Thread.CurrentContext.GetClientContextChain().SyncProcessMessage(msgCall); Message.PropagateCallContextFromMessageToThread(retMsg); IMethodReturnMessage msg = retMsg as IMethodReturnMessage; if (null != msg) { if (msg.Exception != null) throw msg.Exception; } } } // DoCallBackFromEE
internal static void DoCallBackFromEE(IntPtr targetCtxID, IntPtr privateData, int targetDomainID) { if (targetDomainID == 0) { CallBackHelper helper = new CallBackHelper(privateData, true, targetDomainID); CrossContextDelegate deleg = new CrossContextDelegate(helper.Func); Thread.CurrentContext.DoCallBackGeneric(targetCtxID, deleg); } else { TransitionCall msg = new TransitionCall(targetCtxID, privateData, targetDomainID); Message.PropagateCallContextFromThreadToMessage(msg); IMessage message = Thread.CurrentContext.GetClientContextChain().SyncProcessMessage(msg); Message.PropagateCallContextFromMessageToThread(message); IMethodReturnMessage message2 = message as IMethodReturnMessage; if ((message2 != null) && (message2.Exception != null)) { throw message2.Exception; } } }