示例#1
0
        [System.Security.SecurityCritical]  // auto-generated 
        internal TransitionCall(IntPtr targetCtxID, IntPtr eeData, int targetDomainID)
            { 
            Contract.Assert(targetCtxID != IntPtr.Zero, "bad target ctx for call back"); 
            Contract.Assert(targetDomainID !=0, "bad target ctx for call back");
 
            _sourceCtxID = Thread.CurrentContext.InternalContextID;
            _targetCtxID = targetCtxID;
            _delegate = null;
            _targetDomainID = targetDomainID; 
            _eeData = eeData;
 
 
            // In the cross domain case, the client side just has a base Identity
            // and the server domain has the Server identity. We fault in the latter 
            // when requested later.

            // We are going to a context in another app domain
            _srvID = null; 
            _ID = new Identity("TransitionCallURI", null);
 
                // Create the data needed for the channel sink creation 
            CrossAppDomainData data =
                new CrossAppDomainData(_targetCtxID, 
                    _targetDomainID,
                    Identity.ProcessGuid);
            String unUsed;
            IMessageSink channelSink = 
            CrossAppDomainChannel.AppDomainChannel.CreateMessageSink(
                null, //uri 
                data, //channelData 
                out unUsed);//out objURI
 
            Contract.Assert(channelSink != null, "X-domain transition failure");
            _ID.RaceSetChannelSink(channelSink);
        } // TransitionCall
示例#2
0
        [System.Security.SecurityCritical]  // auto-generated 
        internal TransitionCall( 
            IntPtr targetCtxID,
            CrossContextDelegate deleg) 
        {
            Contract.Assert(targetCtxID!=IntPtr.Zero, "bad target ctx for call back");
            _sourceCtxID = Thread.CurrentContext.InternalContextID;
            _targetCtxID = targetCtxID; 
            _delegate = deleg;
            _targetDomainID = 0; 
            _eeData = IntPtr.Zero; 

            // We are going to another context in the same app domain 
            _srvID = new ServerIdentity(
                null,
                Thread.GetContextInternal(_targetCtxID));
            _ID = _srvID; 
            _ID.RaceSetChannelSink(CrossContextChannel.MessageSink);
            _srvID.RaceSetServerObjectChain(this); 
 
            //DBG Console.WriteLine("### TransitionCall ctor: " + Int32.Format(_sourceCtxID,"x") + ":" + Int32.Format(_targetCtxID,"x"));
        } // TransitionCall