You've already forked linux-packaging-mono
Imported Upstream version 4.3.2.467
Former-commit-id: 9c2cb47f45fa221e661ab616387c9cda183f283d
This commit is contained in:
@@ -198,7 +198,6 @@ namespace System.Runtime.Remoting.Activation {
|
||||
return retObj;
|
||||
}
|
||||
|
||||
#if FEATURE_COMINTEROP
|
||||
[System.Security.SecurityCritical] // auto-generated
|
||||
private static MarshalByRefObject CreateObjectForCom(
|
||||
RuntimeType serverType, Object[] props, bool bNewObj)
|
||||
@@ -230,7 +229,6 @@ namespace System.Runtime.Remoting.Activation {
|
||||
Contract.Assert(null != retObj, "null != retObj");
|
||||
return retObj;
|
||||
}
|
||||
#endif // FEATURE_COMINTEROP
|
||||
|
||||
// For types with no proxy attribute, we take the default route of
|
||||
// querying attributes if the current context is suitable for
|
||||
|
||||
@@ -127,9 +127,9 @@ namespace System.Runtime.Remoting.Messaging{
|
||||
}
|
||||
}
|
||||
|
||||
// <STRIP>For callContexts we intend to expose only name, value dictionary
|
||||
// type of behavior for now. We will re-consider if we need to expose
|
||||
// the other functions above for Beta-2.</STRIP>
|
||||
// <
|
||||
|
||||
|
||||
[System.Security.SecurityCritical] // auto-generated
|
||||
public static Object GetData(String name)
|
||||
{
|
||||
@@ -644,7 +644,7 @@ namespace System.Runtime.Remoting.Messaging{
|
||||
}
|
||||
return currentPrincipal;
|
||||
}
|
||||
#if FEATURE_REMOTING
|
||||
|
||||
// Takes outgoing headers and inserts them
|
||||
[System.Security.SecurityCritical] // auto-generated
|
||||
internal void PropagateOutgoingHeadersToMessage(IMessage msg)
|
||||
@@ -672,7 +672,7 @@ namespace System.Runtime.Remoting.Messaging{
|
||||
}
|
||||
}
|
||||
} // PropagateOutgoingHeadersToMessage
|
||||
#endif
|
||||
|
||||
// Retrieve key to use for header.
|
||||
internal static String GetPropertyKeyForHeader(Header header)
|
||||
{
|
||||
@@ -685,7 +685,6 @@ namespace System.Runtime.Remoting.Messaging{
|
||||
return header.Name;
|
||||
} // GetPropertyKeyForHeader
|
||||
|
||||
#if FEATURE_REMOTING
|
||||
// Take headers out of message and stores them in call context
|
||||
[System.Security.SecurityCritical] // auto-generated
|
||||
internal void PropagateIncomingHeadersToCallContext(IMessage msg)
|
||||
@@ -747,7 +746,6 @@ namespace System.Runtime.Remoting.Messaging{
|
||||
_recvHeaders = headers;
|
||||
_sendHeaders = null;
|
||||
} // PropagateIncomingHeadersToCallContext
|
||||
#endif // FEATURE_REMOTING
|
||||
} // class LogicalCallContext
|
||||
|
||||
|
||||
|
||||
@@ -1191,9 +1191,9 @@ namespace System.Runtime.Remoting.Channels {
|
||||
|
||||
|
||||
// This list should be considered immutable once created.
|
||||
// <STRIP>Ideally, this class would encapsulate more functionality, but
|
||||
// to help minimize the number of changes in the RTM tree, only
|
||||
// a small amount of code has been moved here.</STRIP>
|
||||
// <
|
||||
|
||||
|
||||
internal class RegisteredChannelList
|
||||
{
|
||||
private RegisteredChannel[] _channels;
|
||||
|
||||
@@ -1592,7 +1592,11 @@ namespace System.Runtime.Remoting {
|
||||
// type, and forwards incoming messages to the actual proxy.
|
||||
RedirectionProxy redirectedProxy = new RedirectionProxy(obj, serverType);
|
||||
redirectedProxy.ObjectMode = mode;
|
||||
RemotingServices.MarshalInternal(redirectedProxy, URI, serverType);
|
||||
|
||||
// DevDiv 720951 and 911924:
|
||||
// 'isInitializing' is propagated into the new ServerIdentity so that other concurrent
|
||||
// operations that find it in URITable do not use it prematurely.
|
||||
RemotingServices.MarshalInternal(redirectedProxy, URI, serverType, updateChannelData: true, isInitializing: true);
|
||||
|
||||
srvID = (ServerIdentity)IdentityHolder.ResolveIdentity(URI);
|
||||
Contract.Assert(null != srvID, "null != srvID");
|
||||
@@ -1608,7 +1612,9 @@ namespace System.Runtime.Remoting {
|
||||
// recreated when an RPC server not available is thrown
|
||||
// if dllhost.exe is killed.
|
||||
ComRedirectionProxy comRedirectedProxy = new ComRedirectionProxy(obj, serverType);
|
||||
RemotingServices.MarshalInternal(comRedirectedProxy, URI, serverType);
|
||||
|
||||
// DevDiv 720951 and 911924: isInitializing = true
|
||||
RemotingServices.MarshalInternal(comRedirectedProxy, URI, serverType, updateChannelData: true, isInitializing: true);
|
||||
|
||||
srvID = (ServerIdentity)IdentityHolder.ResolveIdentity(URI);
|
||||
Contract.Assert(null != srvID, "null != srvID");
|
||||
@@ -1628,8 +1634,9 @@ namespace System.Runtime.Remoting {
|
||||
"Remoting_WellKnown_CtorCantMarshal"),
|
||||
URI));
|
||||
}
|
||||
|
||||
RemotingServices.MarshalInternal(obj, URI, serverType);
|
||||
|
||||
// DevDiv 720951 and 911924: isInitializing = true
|
||||
RemotingServices.MarshalInternal(obj, URI, serverType, updateChannelData: true, isInitializing: true);
|
||||
|
||||
srvID = (ServerIdentity)IdentityHolder.ResolveIdentity(URI);
|
||||
Contract.Assert(null != srvID, "null != srvID");
|
||||
@@ -1646,12 +1653,31 @@ namespace System.Runtime.Remoting {
|
||||
srvID.SetSingletonObjectMode();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
// DevDiv 720951 and 911924:
|
||||
// An exception thrown in the scope of this attempt to create a
|
||||
// new ServerIdentity may leave a ServerIdentity instance in the
|
||||
// URITable that has not been properly initialized. This condition
|
||||
// has been true for all versions of the framework but was first
|
||||
// recognized in making this fix in 4.5.3. Ideally, a damaged
|
||||
// ServerIdentity should be removed from URITable. But due to risk
|
||||
// and lack of customer reports of a problem, we chose not to fix it.
|
||||
throw;
|
||||
}
|
||||
finally {
|
||||
|
||||
// DevDiv 720951 and 911924:
|
||||
// This flag is cleared only after the new ServerIdentity is completely
|
||||
// initialized and ready for use. It is done here in the 'finally' to
|
||||
// ensure all exit paths reset the flag, including exceptions.
|
||||
if (srvID != null)
|
||||
{
|
||||
srvID.IsInitializing = false;
|
||||
}
|
||||
|
||||
SecurityPermission.RevertAssert();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,8 +139,6 @@ namespace System.Runtime.Remoting {
|
||||
return (String.CompareOrdinal(s1, 0, prefix, 0, prefix.Length) == 0);
|
||||
} // StringStartsWith
|
||||
|
||||
|
||||
|
||||
// DISCONNECTED_FULL denotes that the object is disconnected
|
||||
// from both local & remote (x-appdomain & higher) clients
|
||||
|
||||
@@ -177,6 +175,9 @@ namespace System.Runtime.Remoting {
|
||||
// Lease for object
|
||||
internal Lease _lease;
|
||||
|
||||
// Set when Identity is initializing and not yet ready for use.
|
||||
private volatile bool _initializing;
|
||||
|
||||
internal static String ProcessGuid {get {return ProcessIDGuid;}}
|
||||
|
||||
private static int GetNextSeqNum()
|
||||
@@ -233,6 +234,15 @@ namespace System.Runtime.Remoting {
|
||||
}
|
||||
}
|
||||
|
||||
internal bool IsInitializing {
|
||||
get {
|
||||
return (_initializing);
|
||||
}
|
||||
set {
|
||||
_initializing = value;
|
||||
}
|
||||
}
|
||||
|
||||
internal bool IsWellKnown()
|
||||
{
|
||||
return (_flags&IDFLG_WELLKNOWN) == IDFLG_WELLKNOWN;
|
||||
|
||||
@@ -28,13 +28,19 @@ namespace System.Runtime.Remoting {
|
||||
internal struct IdOps
|
||||
{
|
||||
internal const int None = 0x00000000;
|
||||
internal const int GenerateURI = 0x00000001;
|
||||
internal const int StrongIdentity = 0x00000002;
|
||||
internal const int GenerateURI = 0x00000001;
|
||||
internal const int StrongIdentity = 0x00000002;
|
||||
internal const int IsInitializing = 0x00000004; // Identity has not been fully initialized yet
|
||||
|
||||
internal static bool bStrongIdentity(int flags)
|
||||
{
|
||||
return (flags&StrongIdentity)!=0;
|
||||
}
|
||||
|
||||
internal static bool bIsInitializing(int flags)
|
||||
{
|
||||
return (flags & IsInitializing) != 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Internal enum to specify options for SetIdentity
|
||||
@@ -201,7 +207,16 @@ namespace System.Runtime.Remoting {
|
||||
Identity id = CasualResolveReference(URITable[MakeURIKeyNoLower(uri)]);
|
||||
if (id == null) {
|
||||
id = CasualResolveReference(URITable[MakeURIKey(uri)]);
|
||||
if(id == null)
|
||||
|
||||
// DevDiv 720951 and 911924:
|
||||
// CreateWellKnownObject inserts the Identity into the URITable before
|
||||
// it is fully initialized. This can cause a race condition if another
|
||||
// concurrent operation re-enters this code and attempts to use it.
|
||||
// If we discover this situation, behave as if it is not in the URITable.
|
||||
// This falls into the code below to call CreateWellKnownObject again.
|
||||
// That method operates under a lock and will not return until it
|
||||
// has been fully initialized. It will not create or initialize twice.
|
||||
if (id == null || id.IsInitializing)
|
||||
{
|
||||
// Check if this a well-known object which needs to be faulted in
|
||||
id = RemotingConfigHandler.CreateWellKnownObject(uri);
|
||||
@@ -290,6 +305,16 @@ namespace System.Runtime.Remoting {
|
||||
srvID = (ServerIdentity) rp.IdentityObject;
|
||||
}
|
||||
|
||||
// DevDiv 720951 and 911924:
|
||||
// CreateWellKnownObject creates a ServerIdentity and places it in URITable
|
||||
// before it is fully initialized. This transient flag is set to to prevent
|
||||
// other concurrent operations from using it. CreateWellKnownObject is the
|
||||
// only code path that sets this flag, and by default it is false.
|
||||
if (IdOps.bIsInitializing(flags))
|
||||
{
|
||||
srvID.IsInitializing = true;
|
||||
}
|
||||
|
||||
Message.DebugOut("Created ServerIdentity \n");
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ namespace System.Runtime.Remoting.Messaging {
|
||||
using System.Runtime.Remoting;
|
||||
using System.Security.Permissions;
|
||||
using System;
|
||||
// <
|
||||
|
||||
// <TODO>Change this back to internal when the classes implementing this interface
|
||||
// are also made internal TarunA 12/16/99</TODO>
|
||||
internal interface IInternalMessage
|
||||
{
|
||||
ServerIdentity ServerIdentityObject
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
//
|
||||
// Contents: Interface for Lease
|
||||
//
|
||||
// History: 1/5/00 <EMAIL>[....]</EMAIL> Created
|
||||
// History: 1/5/00 <EMAIL>pdejong</EMAIL> Created
|
||||
//
|
||||
//+----------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
//
|
||||
// Contents: Interface for Sponsors
|
||||
//
|
||||
// History: 1/5/00 <EMAIL>[....]</EMAIL> Created
|
||||
// History: 1/5/00 <EMAIL>pdejong</EMAIL> Created
|
||||
//
|
||||
//+----------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
//
|
||||
// Contents: Lease States
|
||||
//
|
||||
// History: 1/5/00 <EMAIL>[....]</EMAIL> Created
|
||||
// History: 1/5/00 <EMAIL>pdejong</EMAIL> Created
|
||||
//
|
||||
//+----------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -632,9 +632,9 @@ namespace System.Runtime.Remoting {
|
||||
if (oldChannelData == null)
|
||||
return oldChannelInfo;
|
||||
|
||||
// <STRIP>This will work for the IIS scenario since the machine name + application name
|
||||
// will differentiate the url. If we generalize this mechanism in the future,
|
||||
// we should only [....] the url if the ObjRef is from the current appdomain.</STRIP>
|
||||
// <
|
||||
|
||||
|
||||
String[] bashInfo = (String[])CallContext.GetData("__bashChannelUrl");
|
||||
if (bashInfo == null)
|
||||
return oldChannelInfo;
|
||||
@@ -759,7 +759,6 @@ namespace System.Runtime.Remoting {
|
||||
[System.Security.SecurityCritical] // auto-generated
|
||||
private Object GetCustomMarshaledCOMObject(Object ret)
|
||||
{
|
||||
#if FEATURE_COMINTEROP
|
||||
// Some special work we need to do for __COMObject
|
||||
// (Note that we use typeInfo to detect this case instead of
|
||||
// calling GetType on 'ret' so as to not refine the proxy)
|
||||
@@ -817,7 +816,6 @@ namespace System.Runtime.Remoting {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // FEATURE_COMINTEROP
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -997,7 +995,6 @@ namespace System.Runtime.Remoting {
|
||||
requestedType.ToString())); ;
|
||||
}
|
||||
|
||||
#if FEATURE_COMINTEROP
|
||||
// Create the type info
|
||||
if(serverType.IsCOMObject)
|
||||
{
|
||||
@@ -1006,7 +1003,6 @@ namespace System.Runtime.Remoting {
|
||||
TypeInfo = (IRemotingTypeInfo) dt;
|
||||
}
|
||||
else
|
||||
#endif // FEATURE_COMINTEROP
|
||||
{
|
||||
RemotingTypeCachedData cache = (RemotingTypeCachedData)
|
||||
InternalRemotingServices.GetReflectionCachedData(typeOfObj);
|
||||
|
||||
@@ -641,7 +641,6 @@ namespace System.Runtime.Remoting.Proxies {
|
||||
return retMsg;
|
||||
} // EndInvokeHelper
|
||||
|
||||
#if FEATURE_COMINTEROP
|
||||
// itnerop methods
|
||||
[System.Security.SecurityCritical] // auto-generated
|
||||
public virtual IntPtr GetCOMIUnknown(bool fIsMarshalled)
|
||||
@@ -659,7 +658,6 @@ namespace System.Runtime.Remoting.Proxies {
|
||||
{
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
#endif // FEATURE_COMINTEROP
|
||||
|
||||
// Method used for traversing back to the TP
|
||||
public virtual Object GetTransparentProxy()
|
||||
|
||||
@@ -689,8 +689,8 @@ namespace System.Runtime.Remoting.Activation {
|
||||
|
||||
private static void ReportError(String errorStr, RemotingXmlConfigFileData configData)
|
||||
{
|
||||
// <STRIP>NOTE: In the future, this might log all errors to the configData object
|
||||
// instead of throwing immediately.</STRIP>
|
||||
// <
|
||||
|
||||
|
||||
throw new RemotingException(errorStr);
|
||||
} // ReportError
|
||||
|
||||
@@ -588,7 +588,6 @@ namespace System.Runtime.Remoting.Proxies {
|
||||
}
|
||||
}
|
||||
|
||||
#if FEATURE_COMINTEROP
|
||||
// interop methods
|
||||
[System.Security.SecurityCritical]
|
||||
public override IntPtr GetCOMIUnknown(bool fIsBeingMarshalled)
|
||||
@@ -634,7 +633,6 @@ namespace System.Runtime.Remoting.Proxies {
|
||||
{
|
||||
// for now ignore this
|
||||
}
|
||||
#endif // FEATURE_COMINTEROP
|
||||
|
||||
// Check whether we can cast the transparent proxy to the given type
|
||||
[System.Security.SecurityCritical]
|
||||
|
||||
@@ -1 +1 @@
|
||||
c27996c8c867346379764d3e161afd4262203ee1
|
||||
13b799dbbfe12d46f80cf1d56d12b9ec26e0b23a
|
||||
Reference in New Issue
Block a user