internal static CfrSchemeRegistrar Wrap(IntPtr proxyId) { if (proxyId == IntPtr.Zero) { return(null); } var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache; lock (weakCache) { var cfrObj = (CfrSchemeRegistrar)weakCache.Get(proxyId); if (cfrObj == null) { cfrObj = new CfrSchemeRegistrar(proxyId); weakCache.Add(proxyId, cfrObj); } return(cfrObj); } }
internal static CfrSchemeRegistrar Wrap(RemotePtr remotePtr) { if (remotePtr == RemotePtr.Zero) { return(null); } var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache; lock (weakCache) { var cfrObj = (CfrSchemeRegistrar)weakCache.Get(remotePtr.ptr); if (cfrObj == null) { cfrObj = new CfrSchemeRegistrar(remotePtr); weakCache.Add(remotePtr.ptr, cfrObj); } return(cfrObj); } }