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)); }
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)); }
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)); }
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)); }
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))); }
private static void OnDecodeIpcMsgRevokedCb(IntPtr userData) { var tcs = BindingUtils.FromHandlePtr <TaskCompletionSource <IpcMsg> >(userData); tcs.SetResult(new RevokedIpcMsg()); }
private static void OnDecodeIpcMsgShareMdataCb(IntPtr userData, uint reqId) { var tcs = BindingUtils.FromHandlePtr <TaskCompletionSource <IpcMsg> >(userData); tcs.SetResult(new ShareMDataIpcMsg(reqId)); }
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)); }
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)))); }
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)); }