Esempio n. 1
0
        internal override void OnDispose(RemotePtr remotePtr)
        {
            var call = new CfxApiReleaseRemoteCall();

            call.nativePtr = remotePtr.ptr;
            try {
                call.RequestExecution(remotePtr.connection);
            } catch {
                // if the remote process is gone do nothing
            }
        }
Esempio n. 2
0
        internal static CfrResponse Wrap(RemotePtr remotePtr)
        {
            if (remotePtr == RemotePtr.Zero)
            {
                return(null);
            }
            var  weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache;
            bool isNew     = false;
            var  wrapper   = (CfrResponse)weakCache.GetOrAdd(remotePtr.ptr, () => {
                isNew = true;
                return(new CfrResponse(remotePtr));
            });

            if (!isNew)
            {
                var call = new CfxApiReleaseRemoteCall();
                call.nativePtr = remotePtr.ptr;
                call.RequestExecution(remotePtr.connection);
            }
            return(wrapper);
        }