public Task <string> EncodeContainersRespAsync(IntPtr auth, ref ContainersReq req, uint reqId, bool isGranted) { var reqNative = req.ToNative(); var(ret, userData) = BindingUtils.PrepareTask <string>(); EncodeContainersRespNative(auth, ref reqNative, reqId, isGranted, userData, DelegateOnFfiResultStringCb); reqNative.Free(); return(ret); }
public MDataValueNative ToNative() { return(new MDataValueNative() { ContentPtr = BindingUtils.CopyFromByteList(Content), ContentLen = (UIntPtr)(Content?.Count ?? 0), EntryVersion = EntryVersion }); }
public AccessContainerEntryNative ToNative() { return(new AccessContainerEntryNative() { ContainersPtr = BindingUtils.CopyFromObjectList(Containers), ContainersLen = (UIntPtr)(Containers?.Count ?? 0), ContainersCap = UIntPtr.Zero }); }
public File(FileNative native) { Size = native.Size; CreatedSec = native.CreatedSec; CreatedNsec = native.CreatedNsec; ModifiedSec = native.ModifiedSec; ModifiedNsec = native.ModifiedNsec; UserMetadata = BindingUtils.CopyToByteList(native.UserMetadataPtr, (int)native.UserMetadataLen); DataMapName = native.DataMapName; }
public RegisteredAppNative ToNative() { return(new RegisteredAppNative() { AppInfo = AppInfo, ContainersPtr = BindingUtils.CopyFromObjectList(Containers), ContainersLen = (UIntPtr)(Containers?.Count ?? 0), ContainersCap = IntPtr.Zero }); }
public ShareMDataReqNative ToNative() { return(new ShareMDataReqNative() { App = App, MDataPtr = BindingUtils.CopyFromObjectList(MData), MDataLen = (UIntPtr)(MData?.Count ?? 0), MDataCap = UIntPtr.Zero }); }
public ContainersReqNative ToNative() { return(new ContainersReqNative() { App = App, ContainersPtr = BindingUtils.CopyFromObjectList(Containers), ContainersLen = (UIntPtr)(Containers?.Count ?? 0), ContainersCap = UIntPtr.Zero }); }
public AuthReq(AuthReqNative native) { App = native.App; AppContainer = native.AppContainer; AppPermissionTransferCoins = native.AppPermissionTransferCoins; AppPermissionPerformMutations = native.AppPermissionPerformMutations; AppPermissionGetBalance = native.AppPermissionGetBalance; Containers = BindingUtils.CopyToObjectList <ContainerPermissions>(native.ContainersPtr, (int)native.ContainersLen); }
internal AuthGrantedNative ToNative() { return(new AuthGrantedNative() { AppKeys = AppKeys.ToNative(), AccessContainerInfo = AccessContainerInfo, AccessContainerEntry = AccessContainerEntry.ToNative(), BootstrapConfigPtr = BindingUtils.CopyFromByteList(BootstrapConfig), BootstrapConfigLen = (UIntPtr)(BootstrapConfig?.Count ?? 0) }); }
private static void OnFfiResultAppExchangeInfoListCb( IntPtr userData, IntPtr result, IntPtr appExchangeInfoPtr, UIntPtr appExchangeInfoLen) { BindingUtils.CompleteTask( userData, Marshal.PtrToStructure <FfiResult>(result), () => BindingUtils.CopyToObjectList <AppExchangeInfo>(appExchangeInfoPtr, (int)appExchangeInfoLen)); }
internal AppKeysNative ToNative() { return(new AppKeysNative { FullIdPtr = BindingUtils.CopyFromByteList(FullId), FullIdLen = (UIntPtr)(FullId?.Count ?? 0), EncKey = EncKey, EncPublicKey = EncPublicKey, EncSecretKeyPtr = BindingUtils.CopyFromByteList(EncSecretKey), EncSecretKeyLen = (UIntPtr)(EncSecretKey?.Count ?? 0) }); }
// ReSharper disable once UnusedMember.Local private static void OnIpcReqEncodeCb(IntPtr userData, IntPtr result, string msg) { var tcs = BindingUtils.FromHandlePtr <TaskCompletionSource <string> >(userData); var ffiResult = Marshal.PtrToStructure <FfiResult>(result); if (ffiResult.ErrorCode != 0 && ffiResult.ErrorCode != -200) { Task.Run(() => { tcs.SetException(ffiResult.ToException()); }); return; } Task.Run(() => { tcs.SetResult(msg); }); }
public AuthReqNative ToNative() { return(new AuthReqNative() { App = App, AppContainer = AppContainer, AppPermissionTransferCoins = AppPermissionTransferCoins, AppPermissionPerformMutations = AppPermissionPerformMutations, AppPermissionGetBalance = AppPermissionGetBalance, ContainersPtr = BindingUtils.CopyFromObjectList(Containers), ContainersLen = (UIntPtr)(Containers?.Count ?? 0) }); }
public Task <IpcReq> DecodeIpcMessage(IntPtr authPtr, string msg) { var(task, userData) = BindingUtils.PrepareTask <IpcReq>(); AuthDecodeIpcMsgNative( authPtr, msg, userData, DelegateOnDecodeIpcReqAuthCb, DelegateOnDecodeIpcReqContainersCb, DelegateOnDecodeIpcReqUnregisteredCb, DelegateOnDecodeIpcReqShareMDataCb, DelegateOnFfiResultIpcReqErrorCb); return(task); }
public FileNative ToNative() { return(new FileNative() { Size = Size, CreatedSec = CreatedSec, CreatedNsec = CreatedNsec, ModifiedSec = ModifiedSec, ModifiedNsec = ModifiedNsec, UserMetadataPtr = BindingUtils.CopyFromByteList(UserMetadata), UserMetadataLen = (UIntPtr)(UserMetadata?.Count ?? 0), UserMetadataCap = UIntPtr.Zero, DataMapName = DataMapName }); }
// ReSharper disable once UnusedMember.Global internal void Free() { BindingUtils.FreeList(ref ContentPtr, ref ContentLen); }
public Task <IpcReq> UnRegisteredDecodeIpcMsgAsync(string msg) { var(task, userData) = BindingUtils.PrepareTask <IpcReq>(); AuthUnregisteredDecodeIpcMsgNative(msg, userData, DelegateOnDecodeIpcReqUnregisteredCb, DelegateOnFfiResultIpcReqErrorCb); return(task); }
// ReSharper disable once UnusedMember.Global public void Free() { AccessContainerEntry.Free(); BindingUtils.FreeList(ref BootstrapConfigPtr, ref BootstrapConfigLen); }
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)); }
public void Free() { BindingUtils.FreeList(ref ContainersPtr, ref ContainersLen); }
public AuthReq(AuthReqNative native) { App = native.App; AppContainer = native.AppContainer; Containers = BindingUtils.CopyToObjectList <ContainerPermissions>(native.ContainersPtr, (int)native.ContainersLen); }
public AccessContainerEntry(AccessContainerEntryNative native) { Containers = BindingUtils.CopyToObjectList <ContainerInfo>(native.ContainersPtr, (int)native.ContainersLen); }
public RegisteredApp(RegisteredAppNative native) { AppInfo = native.AppInfo; Containers = BindingUtils.CopyToObjectList <ContainerPermissions>(native.ContainersPtr, (int)native.ContainersLen); }
// ReSharper disable once UnusedMember.Global public void Free() { BindingUtils.FreeList(ref UserMetadataPtr, ref UserMetadataLen); }
internal void Free() { BindingUtils.FreeList(ref ContainersPtr, ref ContainersLen); }
// ReSharper disable once UnusedMember.Global public void Free() { BindingUtils.FreeList(ref ValPtr, ref ValLen); }
public MDataValue(MDataValueNative native) { Content = BindingUtils.CopyToByteList(native.ContentPtr, (int)native.ContentLen); EntryVersion = native.EntryVersion; }
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)))); }
public UnregisteredIpcReq(uint reqId, IntPtr extraDataPtr, ulong extraDataLength) { ReqId = reqId; ExtraData = BindingUtils.CopyToByteList(extraDataPtr, (int)extraDataLength); }
public MDataKey(MDataKeyNative native) { Val = BindingUtils.CopyToByteList(native.ValPtr, (int)native.ValLen); }