[System.Security.SecurityCritical] // auto-generated
internal static Identity CasualResolveIdentity(String uri)
{
if (uri == null)
{
return(null);
}
Identity id = CasualResolveReference(URITable[MakeURIKeyNoLower(uri)]);
if (id == null)
{
id = CasualResolveReference(URITable[MakeURIKey(uri)]);
// 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);
}
}
return(id);
} // CasualResolveIdentity