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