private static HandleReturnMessage ( IMessage reqMsg, IMessage retMsg ) : void | ||
reqMsg | IMessage | |
retMsg | IMessage | |
return | void |
private void PrivateInvoke(ref MessageData msgData, int type) { IMessage message1 = (IMessage)null; CallType callType = (CallType)type; IMessage message2 = (IMessage)null; int msgFlags = -1; RemotingProxy remotingProxy = (RemotingProxy)null; if (CallType.MethodCall == callType) { Message message3 = new Message(); MessageData msgData1 = msgData; message3.InitFields(msgData1); message1 = (IMessage)message3; msgFlags = message3.GetCallType(); } else if (CallType.ConstructorCall == callType) { msgFlags = 0; remotingProxy = this as RemotingProxy; bool flag = false; ConstructorCallMessage constructorCallMessage1; if (!this.IsRemotingProxy()) { constructorCallMessage1 = new ConstructorCallMessage((object[])null, (object[])null, (object[])null, (RuntimeType)this.GetProxiedType()); } else { constructorCallMessage1 = remotingProxy.ConstructorMessage; Identity identityObject = remotingProxy.IdentityObject; if (identityObject != null) { flag = identityObject.IsWellKnown(); } } if (constructorCallMessage1 == null | flag) { ConstructorCallMessage constructorCallMessage2 = new ConstructorCallMessage((object[])null, (object[])null, (object[])null, (RuntimeType)this.GetProxiedType()); constructorCallMessage2.SetFrame(msgData); message1 = (IMessage)constructorCallMessage2; if (flag) { remotingProxy.ConstructorMessage = (ConstructorCallMessage)null; if (constructorCallMessage2.ArgCount != 0) { throw new RemotingException(Environment.GetResourceString("Remoting_Activation_WellKnownCTOR")); } } message2 = (IMessage) new ConstructorReturnMessage((MarshalByRefObject)this.GetTransparentProxy(), (object[])null, 0, (LogicalCallContext)null, (IConstructionCallMessage)constructorCallMessage2); } else { constructorCallMessage1.SetFrame(msgData); message1 = (IMessage)constructorCallMessage1; } } ChannelServices.IncrementRemoteCalls(); if (!this.IsRemotingProxy() && (msgFlags & 2) == 2) { message2 = RealProxy.EndInvokeHelper(message1 as Message, true); } if (message2 == null) { Thread currentThread = Thread.CurrentThread; LogicalCallContext logicalCallContext = currentThread.GetMutableExecutionContext().LogicalCallContext; this.SetCallContextInMessage(message1, msgFlags, logicalCallContext); logicalCallContext.PropagateOutgoingHeadersToMessage(message1); message2 = this.Invoke(message1); this.ReturnCallContextToThread(currentThread, message2, msgFlags, logicalCallContext); Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext.PropagateIncomingHeadersToCallContext(message2); } if (!this.IsRemotingProxy() && (msgFlags & 1) == 1) { Message m = message1 as Message; AsyncResult asyncResult = new AsyncResult(m); IMessage msg = message2; asyncResult.SyncProcessMessage(msg); // ISSUE: variable of the null type __Null local1 = null; int outArgsCount = 0; // ISSUE: variable of the null type __Null local2 = null; Message message3 = m; message2 = (IMessage) new ReturnMessage((object)asyncResult, (object[])local1, outArgsCount, (LogicalCallContext)local2, (IMethodCallMessage)message3); } RealProxy.HandleReturnMessage(message1, message2); if (CallType.ConstructorCall != callType) { return; } IConstructionReturnMessage constructionReturnMessage = message2 as IConstructionReturnMessage; if (constructionReturnMessage == null) { throw new RemotingException(Environment.GetResourceString("Remoting_Proxy_BadReturnTypeForActivation")); } ConstructorReturnMessage constructorReturnMessage = constructionReturnMessage as ConstructorReturnMessage; MarshalByRefObject marshalByRefObject; if (constructorReturnMessage != null) { marshalByRefObject = (MarshalByRefObject)constructorReturnMessage.GetObject(); if (marshalByRefObject == null) { throw new RemotingException(Environment.GetResourceString("Remoting_Activation_NullReturnValue")); } } else { marshalByRefObject = (MarshalByRefObject)RemotingServices.InternalUnmarshal((ObjRef)constructionReturnMessage.ReturnValue, this.GetTransparentProxy(), true); if (marshalByRefObject == null) { throw new RemotingException(Environment.GetResourceString("Remoting_Activation_NullFromInternalUnmarshal")); } } if (marshalByRefObject != (MarshalByRefObject)this.GetTransparentProxy()) { throw new RemotingException(Environment.GetResourceString("Remoting_Activation_InconsistentState")); } if (!this.IsRemotingProxy()) { return; } remotingProxy.ConstructorMessage = (ConstructorCallMessage)null; }
private void PrivateInvoke(ref MessageData msgData, int type) { IMessage message = null; IMessage message2 = null; int num = -1; RemotingProxy remotingProxy = null; if (1 == type) { Message message3 = new Message(); message3.InitFields(msgData); message = message3; num = message3.GetCallType(); } else if (2 == type) { num = 0; remotingProxy = (this as RemotingProxy); bool flag = false; ConstructorCallMessage constructorCallMessage; if (!this.IsRemotingProxy()) { constructorCallMessage = new ConstructorCallMessage(null, null, null, (RuntimeType)this.GetProxiedType()); } else { constructorCallMessage = remotingProxy.ConstructorMessage; Identity identityObject = remotingProxy.IdentityObject; if (identityObject != null) { flag = identityObject.IsWellKnown(); } } if (constructorCallMessage == null || flag) { constructorCallMessage = new ConstructorCallMessage(null, null, null, (RuntimeType)this.GetProxiedType()); constructorCallMessage.SetFrame(msgData); message = constructorCallMessage; if (flag) { remotingProxy.ConstructorMessage = null; if (constructorCallMessage.ArgCount != 0) { throw new RemotingException(Environment.GetResourceString("Remoting_Activation_WellKnownCTOR")); } } message2 = new ConstructorReturnMessage((MarshalByRefObject)this.GetTransparentProxy(), null, 0, null, constructorCallMessage); } else { constructorCallMessage.SetFrame(msgData); message = constructorCallMessage; } } ChannelServices.IncrementRemoteCalls(); if (!this.IsRemotingProxy() && (num & 2) == 2) { Message reqMsg = message as Message; message2 = RealProxy.EndInvokeHelper(reqMsg, true); } if (message2 == null) { Thread currentThread = Thread.CurrentThread; LogicalCallContext logicalCallContext = currentThread.GetMutableExecutionContext().LogicalCallContext; this.SetCallContextInMessage(message, num, logicalCallContext); logicalCallContext.PropagateOutgoingHeadersToMessage(message); message2 = this.Invoke(message); this.ReturnCallContextToThread(currentThread, message2, num, logicalCallContext); Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext.PropagateIncomingHeadersToCallContext(message2); } if (!this.IsRemotingProxy() && (num & 1) == 1) { Message message4 = message as Message; AsyncResult asyncResult = new AsyncResult(message4); asyncResult.SyncProcessMessage(message2); message2 = new ReturnMessage(asyncResult, null, 0, null, message4); } RealProxy.HandleReturnMessage(message, message2); if (2 == type) { IConstructionReturnMessage constructionReturnMessage = message2 as IConstructionReturnMessage; if (constructionReturnMessage == null) { throw new RemotingException(Environment.GetResourceString("Remoting_Proxy_BadReturnTypeForActivation")); } ConstructorReturnMessage constructorReturnMessage = constructionReturnMessage as ConstructorReturnMessage; MarshalByRefObject marshalByRefObject; if (constructorReturnMessage != null) { marshalByRefObject = (MarshalByRefObject)constructorReturnMessage.GetObject(); if (marshalByRefObject == null) { throw new RemotingException(Environment.GetResourceString("Remoting_Activation_NullReturnValue")); } } else { marshalByRefObject = (MarshalByRefObject)RemotingServices.InternalUnmarshal((ObjRef)constructionReturnMessage.ReturnValue, this.GetTransparentProxy(), true); if (marshalByRefObject == null) { throw new RemotingException(Environment.GetResourceString("Remoting_Activation_NullFromInternalUnmarshal")); } } if (marshalByRefObject != (MarshalByRefObject)this.GetTransparentProxy()) { throw new RemotingException(Environment.GetResourceString("Remoting_Activation_InconsistentState")); } if (this.IsRemotingProxy()) { remotingProxy.ConstructorMessage = null; } } }