コード例 #1
0
        /// <summary>
        /// Return a handle for the peer
        /// </summary>
        public Allocation *Peer(out bool marshall)
        {
            DeliveryImpl di = EndpointDeliveryImpl;

            VTable.Assert(di != null);
            return(di.Peer(out marshall));
        }
コード例 #2
0
        /// <summary>
        /// Transfer any contents that needs to be adjusted from the transferee to the target
        /// endpoint.
        /// </summary>
        // TODO: change "ref EndpointCore" to "EndpointCore"
        public static void TransferContentOwnership(
            ref EndpointCore transferee,
            ref EndpointCore target)
        {
            // TODO MAKE THIS APROPRIATE TO BOTH SINGLE AND PAGED IMPLS
            DeliveryImpl transfereeDi = transferee.EndpointDeliveryImpl;

            // XXX BUG? BUG? BUG?
            //   targetDi = transferee.EndpointDeliveryImpl
            // should be:
            //   targetDi = target.EndpointDeliveryImpl
            DeliveryImpl targetDi = transferee.EndpointDeliveryImpl;

            VTable.Assert((transfereeDi != null) && (targetDi != null));
            //Monitoring.Log(Monitoring.Provider.ChannelService,
            //               (ushort)ChannelServiceEvent.TransferContentOwnership, 0,
            //               (uint)transfereeDi.ProcessId,
            //               (uint)targetDi.ProcessId,
            //               (uint)transfereeDi.ChannelId,
            //               (uint)targetDi.ChannelId,
            //               (uint)targetDi.Peer.ChannelId);
            int toProcessId = targetDi.ProcessId;

            transfereeDi.ProcessId = toProcessId;
            DelegationState newstate = transfereeDi.OwnerDelegationState;

            transfereeDi.OwnerPrincipalHandle =
                TransferPrincipal(transfereeDi.OwnerPrincipalHandle, toProcessId, ref newstate);
            transfereeDi.OwnerDelegationState = newstate;
            Allocation *transfereePeerAllocation = transfereeDi.Peer();

            // also transfer the peer allocation
            Allocation.SetOwnerProcessId(transfereePeerAllocation, toProcessId);
        }