mscorlib(4.0.0.0) API with additions
RealProxy.cs
2 using System.Reflection;
11 using System.Security;
14 using System.Threading;
15 
17 {
19  [SecurityCritical]
20  [ComVisible(true)]
21  [SecurityPermission(SecurityAction.InheritanceDemand, Flags = SecurityPermissionFlag.Infrastructure)]
22  public abstract class RealProxy
23  {
24  private object _tp;
25 
26  private object _identity;
27 
28  private MarshalByRefObject _serverObject;
29 
30  private RealProxyFlags _flags;
31 
32  internal GCHandle _srvIdentity;
33 
34  internal int _optFlags;
35 
36  internal int _domainID;
37 
38  private static IntPtr _defaultStub;
39 
40  private static IntPtr _defaultStubValue;
41 
42  private static object _defaultStubData;
43 
44  internal bool Initialized
45  {
46  get
47  {
48  return (_flags & RealProxyFlags.Initialized) == RealProxyFlags.Initialized;
49  }
50  set
51  {
52  if (value)
53  {
54  _flags |= RealProxyFlags.Initialized;
55  }
56  else
57  {
58  _flags &= ~RealProxyFlags.Initialized;
59  }
60  }
61  }
62 
63  internal MarshalByRefObject UnwrappedServerObject => _serverObject;
64 
65  internal virtual Identity IdentityObject
66  {
67  [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
68  get
69  {
70  return (Identity)_identity;
71  }
72  set
73  {
74  _identity = value;
75  }
76  }
77 
78  [SecuritySafeCritical]
79  static RealProxy()
80  {
81  _defaultStub = GetDefaultStub();
82  _defaultStubValue = new IntPtr(-1);
83  _defaultStubData = _defaultStubValue;
84  }
85 
90  [SecurityCritical]
91  protected RealProxy(Type classToProxy)
92  : this(classToProxy, (IntPtr)0, null)
93  {
94  }
95 
102  [SecurityCritical]
103  protected RealProxy(Type classToProxy, IntPtr stub, object stubData)
104  {
105  if (!classToProxy.IsMarshalByRef && !classToProxy.IsInterface)
106  {
107  throw new ArgumentException(Environment.GetResourceString("Remoting_Proxy_ProxyTypeIsNotMBR"));
108  }
109  if ((IntPtr)0 == stub)
110  {
111  stub = _defaultStub;
112  stubData = _defaultStubData;
113  }
114  _tp = null;
115  if (stubData == null)
116  {
117  throw new ArgumentNullException("stubdata");
118  }
119  _tp = RemotingServices.CreateTransparentProxy(this, classToProxy, stub, stubData);
120  RemotingProxy remotingProxy = this as RemotingProxy;
121  if (remotingProxy != null)
122  {
123  _flags |= RealProxyFlags.RemotingProxy;
124  }
125  }
126 
127  internal bool IsRemotingProxy()
128  {
129  return (_flags & RealProxyFlags.RemotingProxy) == RealProxyFlags.RemotingProxy;
130  }
131 
136  [SecurityCritical]
137  [ComVisible(true)]
139  {
140  IConstructionReturnMessage result = null;
141  if (_serverObject == null)
142  {
143  Type proxiedType = GetProxiedType();
144  if (ctorMsg != null && ctorMsg.ActivationType != proxiedType)
145  {
146  throw new RemotingException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_Proxy_BadTypeForActivation"), proxiedType.FullName, ctorMsg.ActivationType));
147  }
148  _serverObject = RemotingServices.AllocateUninitializedObject(proxiedType);
149  SetContextForDefaultStub();
151  IMethodReturnMessage methodReturnMessage = null;
152  Exception ex = null;
153  if (ctorMsg != null)
154  {
155  methodReturnMessage = RemotingServices.ExecuteMessage(marshalByRefObject, ctorMsg);
156  ex = methodReturnMessage.Exception;
157  }
158  else
159  {
160  try
161  {
162  RemotingServices.CallDefaultCtor(marshalByRefObject);
163  }
164  catch (Exception ex2)
165  {
166  ex = ex2;
167  }
168  }
169  if (ex == null)
170  {
171  object[] array = methodReturnMessage?.OutArgs;
172  int outArgsCount = (array != null) ? array.Length : 0;
173  LogicalCallContext callCtx = methodReturnMessage?.LogicalCallContext;
174  result = new ConstructorReturnMessage(marshalByRefObject, array, outArgsCount, callCtx, ctorMsg);
175  SetupIdentity();
176  if (IsRemotingProxy())
177  {
178  ((RemotingProxy)this).Initialized = true;
179  }
180  }
181  else
182  {
183  result = new ConstructorReturnMessage(ex, ctorMsg);
184  }
185  }
186  return result;
187  }
188 
192  [SecurityCritical]
194  {
195  return UnwrappedServerObject;
196  }
197 
201  [SecurityCritical]
203  {
204  object transparentProxy = GetTransparentProxy();
205  if (transparentProxy != null)
206  {
207  RemotingServices.ResetInterfaceCache(transparentProxy);
208  }
209  MarshalByRefObject serverObject = _serverObject;
210  _serverObject = null;
211  serverObject.__ResetServerIdentity();
212  return serverObject;
213  }
214 
218  [SecurityCritical]
220  {
221  object transparentProxy = GetTransparentProxy();
222  if (transparentProxy != null)
223  {
224  RemotingServices.ResetInterfaceCache(transparentProxy);
225  }
226  AttachServerHelper(s);
227  }
228 
229  [SecurityCritical]
230  private void SetupIdentity()
231  {
232  if (_identity == null)
233  {
234  _identity = IdentityHolder.FindOrCreateServerIdentity(_serverObject, null, 0);
235  ((Identity)_identity).RaceSetTransparentProxy(GetTransparentProxy());
236  }
237  }
238 
239  [SecurityCritical]
240  private void SetContextForDefaultStub()
241  {
242  if (GetStub() == _defaultStub)
243  {
244  object stubData = GetStubData(this);
245  if (stubData is IntPtr && ((IntPtr)stubData).Equals(_defaultStubValue))
246  {
247  SetStubData(this, Thread.CurrentContext.InternalContextID);
248  }
249  }
250  }
251 
252  [SecurityCritical]
253  internal bool DoContextsMatch()
254  {
255  bool result = false;
256  if (GetStub() == _defaultStub)
257  {
258  object stubData = GetStubData(this);
259  if (stubData is IntPtr && ((IntPtr)stubData).Equals(Thread.CurrentContext.InternalContextID))
260  {
261  result = true;
262  }
263  }
264  return result;
265  }
266 
267  [SecurityCritical]
268  internal void AttachServerHelper(MarshalByRefObject s)
269  {
270  if (s == null || _serverObject != null)
271  {
272  throw new ArgumentException(Environment.GetResourceString("ArgumentNull_Generic"), "s");
273  }
274  _serverObject = s;
275  SetupIdentity();
276  }
277 
278  [MethodImpl(MethodImplOptions.InternalCall)]
279  private extern IntPtr GetStub();
280 
285  [MethodImpl(MethodImplOptions.InternalCall)]
286  [SecurityCritical]
287  public static extern void SetStubData(RealProxy rp, object stubData);
288 
289  internal void SetSrvInfo(GCHandle srvIdentity, int domainID)
290  {
291  _srvIdentity = srvIdentity;
292  _domainID = domainID;
293  }
294 
299  [MethodImpl(MethodImplOptions.InternalCall)]
300  [SecurityCritical]
301  public static extern object GetStubData(RealProxy rp);
302 
303  [MethodImpl(MethodImplOptions.InternalCall)]
304  private static extern IntPtr GetDefaultStub();
305 
308  [MethodImpl(MethodImplOptions.InternalCall)]
309  [SecurityCritical]
310  public extern Type GetProxiedType();
311 
315  public abstract IMessage Invoke(IMessage msg);
316 
320  [SecurityCritical]
321  public virtual ObjRef CreateObjRef(Type requestedType)
322  {
323  if (_identity == null)
324  {
325  throw new RemotingException(Environment.GetResourceString("Remoting_NoIdentityEntry"));
326  }
327  return new ObjRef((MarshalByRefObject)GetTransparentProxy(), requestedType);
328  }
329 
335  [SecurityCritical]
336  public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
337  {
338  object transparentProxy = GetTransparentProxy();
339  RemotingServices.GetObjectData(transparentProxy, info, context);
340  }
341 
342  [SecurityCritical]
343  private static void HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
344  {
345  IMethodReturnMessage methodReturnMessage = retMsg as IMethodReturnMessage;
346  if (retMsg == null || methodReturnMessage == null)
347  {
348  throw new RemotingException(Environment.GetResourceString("Remoting_Message_BadType"));
349  }
350  Exception exception = methodReturnMessage.Exception;
351  if (exception != null)
352  {
353  throw exception.PrepForRemoting();
354  }
355  if (!(retMsg is StackBasedReturnMessage))
356  {
357  if (reqMsg is Message)
358  {
359  PropagateOutParameters(reqMsg, methodReturnMessage.Args, methodReturnMessage.ReturnValue);
360  }
361  else if (reqMsg is ConstructorCallMessage)
362  {
363  PropagateOutParameters(reqMsg, methodReturnMessage.Args, null);
364  }
365  }
366  }
367 
368  [SecurityCritical]
369  internal static void PropagateOutParameters(IMessage msg, object[] outArgs, object returnValue)
370  {
371  Message message = msg as Message;
372  if (message == null)
373  {
374  ConstructorCallMessage constructorCallMessage = msg as ConstructorCallMessage;
375  if (constructorCallMessage != null)
376  {
377  message = constructorCallMessage.GetMessage();
378  }
379  }
380  if (message == null)
381  {
382  throw new ArgumentException(Environment.GetResourceString("Remoting_Proxy_ExpectedOriginalMessage"));
383  }
384  MethodBase methodBase = message.GetMethodBase();
385  RemotingMethodCachedData reflectionCachedData = InternalRemotingServices.GetReflectionCachedData(methodBase);
386  if (outArgs != null && outArgs.Length != 0)
387  {
388  object[] args = message.Args;
389  ParameterInfo[] parameters = reflectionCachedData.Parameters;
390  int[] marshalRequestArgMap = reflectionCachedData.MarshalRequestArgMap;
391  foreach (int num in marshalRequestArgMap)
392  {
393  ParameterInfo parameterInfo = parameters[num];
394  if (parameterInfo.IsIn && parameterInfo.ParameterType.IsByRef && !parameterInfo.IsOut)
395  {
396  outArgs[num] = args[num];
397  }
398  }
399  if (reflectionCachedData.NonRefOutArgMap.Length != 0)
400  {
401  int[] nonRefOutArgMap = reflectionCachedData.NonRefOutArgMap;
402  foreach (int num2 in nonRefOutArgMap)
403  {
404  Array array = args[num2] as Array;
405  if (array != null)
406  {
407  Array.Copy((Array)outArgs[num2], array, array.Length);
408  }
409  }
410  }
411  int[] outRefArgMap = reflectionCachedData.OutRefArgMap;
412  if (outRefArgMap.Length != 0)
413  {
414  int[] array2 = outRefArgMap;
415  foreach (int num3 in array2)
416  {
417  ValidateReturnArg(outArgs[num3], parameters[num3].ParameterType);
418  }
419  }
420  }
421  int callType = message.GetCallType();
422  if ((callType & 0xF) != 1)
423  {
424  Type returnType = reflectionCachedData.ReturnType;
425  if (returnType != null)
426  {
427  ValidateReturnArg(returnValue, returnType);
428  }
429  }
430  message.PropagateOutParameters(outArgs, returnValue);
431  }
432 
433  private static void ValidateReturnArg(object arg, Type paramType)
434  {
435  if (paramType.IsByRef)
436  {
437  paramType = paramType.GetElementType();
438  }
439  if (paramType.IsValueType)
440  {
441  if (arg == null)
442  {
443  if (!paramType.IsGenericType || !(paramType.GetGenericTypeDefinition() == typeof(Nullable<>)))
444  {
445  throw new RemotingException(Environment.GetResourceString("Remoting_Proxy_ReturnValueTypeCannotBeNull"));
446  }
447  }
448  else if (!paramType.IsInstanceOfType(arg))
449  {
450  throw new InvalidCastException(Environment.GetResourceString("Remoting_Proxy_BadReturnType"));
451  }
452  }
453  else if (arg != null && !paramType.IsInstanceOfType(arg))
454  {
455  throw new InvalidCastException(Environment.GetResourceString("Remoting_Proxy_BadReturnType"));
456  }
457  }
458 
459  [SecurityCritical]
460  internal static IMessage EndInvokeHelper(Message reqMsg, bool bProxyCase)
461  {
462  AsyncResult asyncResult = reqMsg.GetAsyncResult() as AsyncResult;
463  IMessage result = null;
464  if (asyncResult == null)
465  {
466  throw new RemotingException(Environment.GetResourceString("Remoting_Message_BadAsyncResult"));
467  }
468  if (asyncResult.AsyncDelegate != reqMsg.GetThisPtr())
469  {
470  throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_MismatchedAsyncResult"));
471  }
472  if (!asyncResult.IsCompleted)
473  {
474  asyncResult.AsyncWaitHandle.WaitOne(-1, Thread.CurrentContext.IsThreadPoolAware);
475  }
476  lock (asyncResult)
477  {
478  if (asyncResult.EndInvokeCalled)
479  {
480  throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EndInvokeCalledMultiple"));
481  }
482  asyncResult.EndInvokeCalled = true;
483  IMethodReturnMessage methodReturnMessage = (IMethodReturnMessage)asyncResult.GetReplyMessage();
484  if (!bProxyCase)
485  {
486  Exception exception = methodReturnMessage.Exception;
487  if (exception != null)
488  {
489  throw exception.PrepForRemoting();
490  }
491  reqMsg.PropagateOutParameters(methodReturnMessage.Args, methodReturnMessage.ReturnValue);
492  }
493  else
494  {
495  result = methodReturnMessage;
496  }
497  Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext.Merge(methodReturnMessage.LogicalCallContext);
498  return result;
499  }
500  }
501 
506  [SecurityCritical]
507  public virtual IntPtr GetCOMIUnknown(bool fIsMarshalled)
508  {
510  }
511 
514  public virtual void SetCOMIUnknown(IntPtr i)
515  {
516  }
517 
521  public virtual IntPtr SupportsInterface(ref Guid iid)
522  {
523  return IntPtr.Zero;
524  }
525 
528  public virtual object GetTransparentProxy()
529  {
530  return _tp;
531  }
532 
533  [SecurityCritical]
534  private void PrivateInvoke(ref MessageData msgData, int type)
535  {
536  IMessage message = null;
537  IMessage message2 = null;
538  int num = -1;
539  RemotingProxy remotingProxy = null;
540  if (1 == type)
541  {
542  Message message3 = new Message();
543  message3.InitFields(msgData);
544  message = message3;
545  num = message3.GetCallType();
546  }
547  else if (2 == type)
548  {
549  num = 0;
550  remotingProxy = (this as RemotingProxy);
551  ConstructorCallMessage constructorCallMessage = null;
552  bool flag = false;
553  if (!IsRemotingProxy())
554  {
555  constructorCallMessage = new ConstructorCallMessage(null, null, null, (RuntimeType)GetProxiedType());
556  }
557  else
558  {
559  constructorCallMessage = remotingProxy.ConstructorMessage;
560  Identity identityObject = remotingProxy.IdentityObject;
561  if (identityObject != null)
562  {
563  flag = identityObject.IsWellKnown();
564  }
565  }
566  if ((constructorCallMessage == null) | flag)
567  {
568  constructorCallMessage = new ConstructorCallMessage(null, null, null, (RuntimeType)GetProxiedType());
569  constructorCallMessage.SetFrame(msgData);
570  message = constructorCallMessage;
571  if (flag)
572  {
573  remotingProxy.ConstructorMessage = null;
574  if (constructorCallMessage.ArgCount != 0)
575  {
576  throw new RemotingException(Environment.GetResourceString("Remoting_Activation_WellKnownCTOR"));
577  }
578  }
579  message2 = new ConstructorReturnMessage((MarshalByRefObject)GetTransparentProxy(), null, 0, null, constructorCallMessage);
580  }
581  else
582  {
583  constructorCallMessage.SetFrame(msgData);
584  message = constructorCallMessage;
585  }
586  }
587  ChannelServices.IncrementRemoteCalls();
588  if (!IsRemotingProxy() && (num & 2) == 2)
589  {
590  Message reqMsg = message as Message;
591  message2 = EndInvokeHelper(reqMsg, bProxyCase: true);
592  }
593  if (message2 == null)
594  {
595  LogicalCallContext logicalCallContext = null;
596  Thread currentThread = Thread.CurrentThread;
597  logicalCallContext = currentThread.GetMutableExecutionContext().LogicalCallContext;
598  SetCallContextInMessage(message, num, logicalCallContext);
599  logicalCallContext.PropagateOutgoingHeadersToMessage(message);
600  message2 = Invoke(message);
601  ReturnCallContextToThread(currentThread, message2, num, logicalCallContext);
602  Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext.PropagateIncomingHeadersToCallContext(message2);
603  }
604  if (!IsRemotingProxy() && (num & 1) == 1)
605  {
606  Message message4 = message as Message;
607  AsyncResult asyncResult = new AsyncResult(message4);
608  asyncResult.SyncProcessMessage(message2);
609  message2 = new ReturnMessage(asyncResult, null, 0, null, message4);
610  }
611  HandleReturnMessage(message, message2);
612  if (2 != type)
613  {
614  return;
615  }
616  MarshalByRefObject marshalByRefObject = null;
617  IConstructionReturnMessage constructionReturnMessage = message2 as IConstructionReturnMessage;
618  if (constructionReturnMessage == null)
619  {
620  throw new RemotingException(Environment.GetResourceString("Remoting_Proxy_BadReturnTypeForActivation"));
621  }
622  ConstructorReturnMessage constructorReturnMessage = constructionReturnMessage as ConstructorReturnMessage;
623  if (constructorReturnMessage != null)
624  {
625  marshalByRefObject = (MarshalByRefObject)constructorReturnMessage.GetObject();
626  if (marshalByRefObject == null)
627  {
628  throw new RemotingException(Environment.GetResourceString("Remoting_Activation_NullReturnValue"));
629  }
630  }
631  else
632  {
633  marshalByRefObject = (MarshalByRefObject)RemotingServices.InternalUnmarshal((ObjRef)constructionReturnMessage.ReturnValue, GetTransparentProxy(), fRefine: true);
634  if (marshalByRefObject == null)
635  {
636  throw new RemotingException(Environment.GetResourceString("Remoting_Activation_NullFromInternalUnmarshal"));
637  }
638  }
639  if (marshalByRefObject != (MarshalByRefObject)GetTransparentProxy())
640  {
641  throw new RemotingException(Environment.GetResourceString("Remoting_Activation_InconsistentState"));
642  }
643  if (IsRemotingProxy())
644  {
645  remotingProxy.ConstructorMessage = null;
646  }
647  }
648 
649  private void SetCallContextInMessage(IMessage reqMsg, int msgFlags, LogicalCallContext cctx)
650  {
651  Message message = reqMsg as Message;
652  if (msgFlags == 0)
653  {
654  if (message != null)
655  {
656  message.SetLogicalCallContext(cctx);
657  }
658  else
659  {
660  ((ConstructorCallMessage)reqMsg).SetLogicalCallContext(cctx);
661  }
662  }
663  }
664 
665  [SecurityCritical]
666  private void ReturnCallContextToThread(Thread currentThread, IMessage retMsg, int msgFlags, LogicalCallContext currCtx)
667  {
668  if (msgFlags != 0 || retMsg == null)
669  {
670  return;
671  }
672  IMethodReturnMessage methodReturnMessage = retMsg as IMethodReturnMessage;
673  if (methodReturnMessage == null)
674  {
675  return;
676  }
677  LogicalCallContext logicalCallContext = methodReturnMessage.LogicalCallContext;
678  if (logicalCallContext == null)
679  {
680  currentThread.GetMutableExecutionContext().LogicalCallContext = currCtx;
681  }
682  else
683  {
684  if (methodReturnMessage is StackBasedReturnMessage)
685  {
686  return;
687  }
688  ExecutionContext mutableExecutionContext = currentThread.GetMutableExecutionContext();
689  LogicalCallContext logicalCallContext2 = mutableExecutionContext.LogicalCallContext;
690  mutableExecutionContext.LogicalCallContext = logicalCallContext;
691  if (logicalCallContext2 != logicalCallContext)
692  {
693  IPrincipal principal = logicalCallContext2.Principal;
694  if (principal != null)
695  {
696  logicalCallContext.Principal = principal;
697  }
698  }
699  }
700  }
701 
702  [SecurityCritical]
703  internal virtual void Wrap()
704  {
705  ServerIdentity serverIdentity = _identity as ServerIdentity;
706  if (serverIdentity != null && this is RemotingProxy)
707  {
708  SetStubData(this, serverIdentity.ServerContext.InternalContextID);
709  }
710  }
711 
713  protected RealProxy()
714  {
715  }
716  }
717 }
static Thread CurrentThread
Gets the currently running thread.
Definition: Thread.cs:134
Discovers the attributes of a parameter and provides access to parameter metadata.
object ReturnValue
Gets the return value of the method call.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Describes a set of security permissions applied to code. This class cannot be inherited.
RealProxy(Type classToProxy, IntPtr stub, object stubData)
Initializes a new instance of the T:System.Runtime.Remoting.Proxies.RealProxy class.
Definition: RealProxy.cs:103
Holds a message returned in response to a method call on a remote object.
RealProxy(Type classToProxy)
Initializes a new instance of the T:System.Runtime.Remoting.Proxies.RealProxy class that represents a...
Definition: RealProxy.cs:91
RealProxy()
Initializes a new instance of the T:System.Runtime.Remoting.Proxies.RealProxy class with default valu...
Definition: RealProxy.cs:713
abstract string FullName
Gets the fully qualified name of the type, including its namespace but not its assembly.
Definition: Type.cs:153
Defines the method call return message interface.
Represents the construction call request of an object.
Defines the basic functionality of a principal object.
Definition: IPrincipal.cs:8
static void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
Serializes the specified marshal by reference object into the provided T:System.Runtime....
virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Adds the transparent proxy of the object represented by the current instance of T:System....
Definition: RealProxy.cs:336
bool IsInterface
Gets a value indicating whether the T:System.Type is an interface; that is, not a class or a value ty...
Definition: Type.cs:426
Provides base functionality for proxies.
Definition: RealProxy.cs:22
virtual IMessage GetReplyMessage()
Gets the response message for the asynchronous call.
Definition: AsyncResult.cs:147
Definition: __Canon.cs:3
MarshalByRefObject GetUnwrappedServer()
Returns the server object that is represented by the current proxy instance.
Definition: RealProxy.cs:193
Stores all relevant information required to generate a proxy in order to communicate with a remote ob...
Definition: ObjRef.cs:19
bool IsIn
Gets a value indicating whether this is an input parameter.
void AttachServer(MarshalByRefObject s)
Attaches the current proxy instance to the specified remote T:System.MarshalByRefObject.
Definition: RealProxy.cs:219
static IMethodReturnMessage ExecuteMessage(MarshalByRefObject target, IMethodCallMessage reqMsg)
Connects to the specified remote object, and executes the provided T:System.Runtime....
Describes the source and destination of a given serialized stream, and provides an additional caller-...
virtual bool WaitOne(int millisecondsTimeout, bool exitContext)
Blocks the current thread until the current T:System.Threading.WaitHandle receives a signal,...
Definition: WaitHandle.cs:162
virtual bool IsCompleted
Gets a value indicating whether the server has completed the call.
Definition: AsyncResult.cs:30
Cer
Specifies a method's behavior when called within a constrained execution region.
Definition: Cer.cs:5
Type ActivationType
Gets the type of the remote object to activate.
SecurityAction
Specifies the security actions that can be performed using declarative security.
Identifies a T:System.Runtime.Remoting.Messaging.IMethodReturnMessage that is returned after attempti...
Provides information about, and means to manipulate, the current environment and platform....
Definition: Environment.cs:21
Represents a globally unique identifier (GUID).To browse the .NET Framework source code for this type...
Definition: Guid.cs:14
Manages the execution context for the current thread. This class cannot be inherited.
Encapsulates the results of an asynchronous operation on a delegate.
Definition: AsyncResult.cs:9
static object GetStubData(RealProxy rp)
Retrieves stub data that is stored for the specified proxy.
LogicalCallContext LogicalCallContext
Gets the T:System.Runtime.Remoting.Messaging.LogicalCallContext for the current method call.
object [] OutArgs
Returns the specified argument marked as a ref or an out parameter.
A platform-specific type that is used to represent a pointer or a handle.
Definition: IntPtr.cs:14
object [] Args
Gets an array of arguments passed to the method.
virtual IntPtr GetCOMIUnknown(bool fIsMarshalled)
Requests an unmanaged reference to the object represented by the current proxy instance.
Definition: RealProxy.cs:507
Provides static methods to aid with remoting channel registration, resolution, and URL discovery....
Represents type declarations: class types, interface types, array types, value types,...
Definition: Type.cs:18
Provides information about methods and constructors.
Definition: MethodBase.cs:19
Provides a way to access a managed object from unmanaged memory.
Definition: GCHandle.cs:10
MethodImplOptions
Defines the details of how a method is implemented.
static void SetStubData(RealProxy rp, object stubData)
Sets the stub data for the specified proxy.
Indicates that data in the pipe is transmitted and read as a stream of messages.
virtual object GetTransparentProxy()
Returns the transparent proxy for the current instance of T:System.Runtime.Remoting....
Definition: RealProxy.cs:528
Provides a set of properties that are carried with the execution code path during remote method calls...
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
virtual IMessage SyncProcessMessage(IMessage msg)
Synchronously processes a response message returned by a method call on a remote object.
Definition: AsyncResult.cs:111
Contains communication data sent between cooperating message sinks.
Definition: IMessage.cs:9
static CultureInfo CurrentCulture
Gets or sets the T:System.Globalization.CultureInfo object that represents the culture used by the cu...
Definition: CultureInfo.cs:120
The exception that is thrown when one of the arguments provided to a method is not valid.
virtual WaitHandle AsyncWaitHandle
Gets a T:System.Threading.WaitHandle that encapsulates Win32 synchronization handles,...
Definition: AsyncResult.cs:63
virtual IntPtr SupportsInterface(ref Guid iid)
Requests a COM interface with the specified ID.
Definition: RealProxy.cs:521
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
Definition: Exception.cs:22
static readonly IntPtr Zero
A read-only field that represents a pointer or handle that has been initialized to zero.
Definition: IntPtr.cs:20
bool IsMarshalByRef
Gets a value indicating whether the T:System.Type is marshaled by reference.
Definition: Type.cs:728
bool IsOut
Gets a value indicating whether this is an output parameter.
virtual object AsyncDelegate
Gets the delegate object on which the asynchronous call was invoked.
Definition: AsyncResult.cs:34
virtual Type ParameterType
Gets the Type of this parameter.
abstract IMessage Invoke(IMessage msg)
When overridden in a derived class, invokes the method that is specified in the provided T:System....
Consistency
Specifies a reliability contract.
Definition: Consistency.cs:5
bool EndInvokeCalled
Gets or sets a value indicating whether EndInvoke has been called on the current T:System....
Definition: AsyncResult.cs:49
virtual void SetCOMIUnknown(IntPtr i)
Stores an unmanaged proxy of the object that is represented by the current instance.
Definition: RealProxy.cs:514
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16
bool IsByRef
Gets a value indicating whether the T:System.Type is passed by reference.
Definition: Type.cs:664
SecurityPermissionFlag
Specifies access flags for the security permission object.
Provides several methods for using and publishing remoted objects and proxies. This class cannot be i...
Type GetProxiedType()
Returns the T:System.Type of the object that the current instance of T:System.Runtime....
IConstructionReturnMessage InitializeServerObject(IConstructionCallMessage ctorMsg)
Initializes a new instance of the object T:System.Type of the remote object that the current instance...
Definition: RealProxy.cs:138
static Context CurrentContext
Gets the current context in which the thread is executing.
Definition: Thread.cs:285
The exception that is thrown when something has gone wrong during remoting.
MarshalByRefObject DetachServer()
Detaches the current proxy instance from the remote server object that it represents.
Definition: RealProxy.cs:202
Exception Exception
Gets the exception thrown during the method call.
virtual ObjRef CreateObjRef(Type requestedType)
Creates an T:System.Runtime.Remoting.ObjRef for the specified object type, and registers it with the ...
Definition: RealProxy.cs:321
Enables access to objects across application domain boundaries in applications that support remoting.
Creates and controls a thread, sets its priority, and gets its status.
Definition: Thread.cs:18