private static void OnFfiFetchFailedCb(IntPtr userData, IntPtr result)
        {
            var tcs       = BindingUtils.FromHandlePtr <TaskCompletionSource <ISafeData> >(userData);
            var ffiResult = Marshal.PtrToStructure <FfiResult>(result);

            tcs.SetResult(new SafeDataFetchFailed(ffiResult.ErrorCode, ffiResult.Description));
        }
Example #2
0
        private static void OnFfiResultIpcReqErrorCb(IntPtr userData, IntPtr result, string msg)
        {
            var tcs       = BindingUtils.FromHandlePtr <TaskCompletionSource <IpcReq> >(userData);
            var ffiResult = Marshal.PtrToStructure <FfiResult>(result);

            tcs.SetResult(new IpcReqError(ffiResult.ErrorCode, ffiResult.Description, msg));
        }
Example #3
0
        private static void OnDecodeIpcMsgErrCb(IntPtr userData, IntPtr result, uint reqId)
        {
            var res = Marshal.PtrToStructure <FfiResult>(result);
            var tcs = BindingUtils.FromHandlePtr <TaskCompletionSource <IpcMsg> >(userData);

            tcs.SetException(new IpcMsgException(reqId, res.ErrorCode, res.Description));
        }
Example #4
0
        private static void OnDecodeIpcReqShareMDataCb(IntPtr userData, uint reqId, IntPtr authReq, IntPtr metadataPtr, UIntPtr metadataLen)
        {
            var tcs                  = BindingUtils.FromHandlePtr <TaskCompletionSource <IpcReq> >(userData);
            var shareMdReq           = new ShareMDataReq(Marshal.PtrToStructure <ShareMDataReqNative>(authReq));
            var metadataResponseList = BindingUtils.CopyToObjectList <MetadataResponse>(metadataPtr, (int)metadataLen);

            tcs.SetResult(new ShareMDataIpcReq(reqId, shareMdReq, metadataResponseList));
        }
Example #5
0
        private static void OnDecodeIpcMsgAuthCb(IntPtr userData, uint reqId, IntPtr authGranted)
        {
            var tcs = BindingUtils.FromHandlePtr <TaskCompletionSource <IpcMsg> >(userData);

            tcs.SetResult(
                new AuthIpcMsg(
                    reqId,
                    new AuthGranted(Marshal.PtrToStructure <AuthGrantedNative>(authGranted))));
        }
        private static void OnFfiResultSafeCb(IntPtr userData, IntPtr result, IntPtr app)
        {
            var action = BindingUtils.FromHandlePtr <Action <FfiResult, IntPtr, GCHandle> >(userData, false);

            action(Marshal.PtrToStructure <FfiResult>(result), app, GCHandle.FromIntPtr(userData));
        }
        private static void OnFfiResultFilesContainerCb(IntPtr userData, IntPtr filesContainer)
        {
            var tcs = BindingUtils.FromHandlePtr <TaskCompletionSource <ISafeData> >(userData);

            tcs.SetResult(new FilesContainer(Marshal.PtrToStructure <FilesContainerNative>(filesContainer)));
        }
        private static void OnFfiResultSafeKeyCb(IntPtr userData, IntPtr safeKey)
        {
            var tcs = BindingUtils.FromHandlePtr <TaskCompletionSource <ISafeData> >(userData);

            tcs.SetResult(new SafeKey(Marshal.PtrToStructure <SafeKeyNative>(safeKey)));
        }
        private static void OnFfiResultWalletCb(IntPtr userData, IntPtr wallet)
        {
            var tcs = BindingUtils.FromHandlePtr <TaskCompletionSource <ISafeData> >(userData);

            tcs.SetResult(new Wallet(Marshal.PtrToStructure <WalletNative>(wallet)));
        }
        private static void OnFfiResultPublishedImmutableDataCb(IntPtr userData, IntPtr publishedImmutableData)
        {
            var tcs = BindingUtils.FromHandlePtr <TaskCompletionSource <ISafeData> >(userData);

            tcs.SetResult(new PublishedImmutableData(Marshal.PtrToStructure <PublishedImmutableDataNative>(publishedImmutableData)));
        }
Example #11
0
        private static void OnDecodeIpcMsgRevokedCb(IntPtr userData)
        {
            var tcs = BindingUtils.FromHandlePtr <TaskCompletionSource <IpcMsg> >(userData);

            tcs.SetResult(new RevokedIpcMsg());
        }
Example #12
0
        private static void OnDecodeIpcMsgShareMdataCb(IntPtr userData, uint reqId)
        {
            var tcs = BindingUtils.FromHandlePtr <TaskCompletionSource <IpcMsg> >(userData);

            tcs.SetResult(new ShareMDataIpcMsg(reqId));
        }
Example #13
0
        private static void OnDecodeIpcMsgUnregisteredCb(IntPtr userData, uint reqId, IntPtr serialisedCfgPtr, UIntPtr serialisedCfgLen)
        {
            var tcs = BindingUtils.FromHandlePtr <TaskCompletionSource <IpcMsg> >(userData);

            tcs.SetResult(new UnregisteredIpcMsg(reqId, serialisedCfgPtr, serialisedCfgLen));
        }
Example #14
0
        private static void OnDecodeIpcReqContainersCb(IntPtr userData, uint reqId, IntPtr authReq)
        {
            var tcs = BindingUtils.FromHandlePtr <TaskCompletionSource <IpcReq> >(userData);

            tcs.SetResult(new ContainersIpcReq(reqId, new ContainersReq(Marshal.PtrToStructure <ContainersReqNative>(authReq))));
        }
Example #15
0
        private static void OnDecodeIpcReqUnregisteredCb(IntPtr userData, uint reqId, IntPtr extraData, UIntPtr size)
        {
            var tcs = BindingUtils.FromHandlePtr <TaskCompletionSource <IpcReq> >(userData);

            tcs.SetResult(new UnregisteredIpcReq(reqId, extraData, (ulong)size));
        }