Exemplo n.º 1
0
 public ShareMDataReqNative ToNative()
 {
     return(new ShareMDataReqNative()
     {
         App = App,
         MDataPtr = BindingUtils.CopyFromObjectList(MData),
         MDataLen = (UIntPtr)(MData?.Count ?? 0),
         MDataCap = UIntPtr.Zero
     });
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 public ContainersReqNative ToNative()
 {
     return(new ContainersReqNative()
     {
         App = App,
         ContainersPtr = BindingUtils.CopyFromObjectList(Containers),
         ContainersLen = (UIntPtr)(Containers?.Count ?? 0),
         ContainersCap = UIntPtr.Zero
     });
 }
Exemplo n.º 4
0
 public RegisteredAppNative ToNative()
 {
     return(new RegisteredAppNative()
     {
         AppInfo = AppInfo,
         ContainersPtr = BindingUtils.CopyFromObjectList(Containers),
         ContainersLen = (UIntPtr)(Containers?.Count ?? 0),
         ContainersCap = IntPtr.Zero
     });
 }
Exemplo n.º 5
0
 static void OnFfiResultAppExchangeInfoListCb(
     IntPtr userData,
     IntPtr result,
     IntPtr appExchangeInfoPtr,
     UIntPtr appExchangeInfoLen)
 {
     BindingUtils.CompleteTask(
         userData,
         Marshal.PtrToStructure <FfiResult>(result),
         () => BindingUtils.CopyToObjectList <AppExchangeInfo>(appExchangeInfoPtr, (int)appExchangeInfoLen));
 }
Exemplo n.º 6
0
 public AuthGrantedNative ToNative()
 {
     return(new AuthGrantedNative()
     {
         AppKeys = AppKeys,
         AccessContainerInfo = AccessContainerInfo,
         AccessContainerEntry = AccessContainerEntry.ToNative(),
         BootstrapConfigPtr = BindingUtils.CopyFromByteList(BootstrapConfig),
         BootstrapConfigLen = (UIntPtr)(BootstrapConfig?.Count ?? 0),
         BootstrapConfigCap = UIntPtr.Zero
     });
 }
Exemplo n.º 7
0
        // ReSharper disable once UnusedMember.Local
        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); });
        }
Exemplo n.º 8
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);
 }
Exemplo n.º 9
0
 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
     });
 }
Exemplo n.º 10
0
 public MDataKey(MDataKeyNative native)
 {
     Key = BindingUtils.CopyToByteList(native.KeyPtr, (int)native.KeyLen);
 }
Exemplo n.º 11
0
 // ReSharper disable once UnusedMember.Global
 internal void Free()
 {
     BindingUtils.FreeList(ref ContentPtr, ref ContentLen);
 }
Exemplo n.º 12
0
 public MDataValue(MDataValueNative native)
 {
     Content      = BindingUtils.CopyToByteList(native.ContentPtr, (int)native.ContentLen);
     EntryVersion = native.EntryVersion;
 }
Exemplo n.º 13
0
 public Task <IpcReq> UnRegisteredDecodeIpcMsgAsync(string msg)
 {
     var(task, userData) = BindingUtils.PrepareTask <IpcReq>();
     AuthUnregisteredDecodeIpcMsgNative(msg, userData, DelegateOnDecodeIpcReqUnregisteredCb, DelegateOnFfiResultIpcReqErrorCb);
     return(task);
 }
Exemplo n.º 14
0
 // ReSharper disable once UnusedMember.Global
 public void Free()
 {
     BindingUtils.FreeList(ref ContainersPtr, ref ContainersLen);
 }
Exemplo n.º 15
0
 public RegisteredApp(RegisteredAppNative native)
 {
     AppInfo    = native.AppInfo;
     Containers =
         BindingUtils.CopyToObjectList <ContainerPermissions>(native.ContainersPtr, (int)native.ContainersLen);
 }
Exemplo n.º 16
0
 public void Free()
 {
     BindingUtils.FreeList(ref MDataPtr, ref MDataLen);
 }
Exemplo n.º 17
0
 public Task AuthRmRevokedAppAsync(IntPtr auth, string appId)
 {
     var(ret, userData) = BindingUtils.PrepareTask();
     AuthRmRevokedAppNative(auth, appId, userData, DelegateOnFfiResultCb);
     return(ret);
 }
Exemplo n.º 18
0
 public ShareMDataReq(ShareMDataReqNative native)
 {
     App   = native.App;
     MData = BindingUtils.CopyToObjectList <ShareMData>(native.MDataPtr, (int)native.MDataLen);
 }
Exemplo n.º 19
0
        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));
        }
Exemplo n.º 20
0
 public ContainersReq(ContainersReqNative native)
 {
     App        = native.App;
     Containers =
         BindingUtils.CopyToObjectList <ContainerPermissions>(native.ContainersPtr, (int)native.ContainersLen);
 }
Exemplo n.º 21
0
        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))));
        }
Exemplo n.º 22
0
 // ReSharper disable once UnusedMember.Global
 public void Free()
 {
     BindingUtils.FreeList(ref KeyPtr, ref KeyLen);
 }
Exemplo n.º 23
0
 public Task AuthSetAdditionalSearchPathAsync(string newPath)
 {
     var(ret, userData) = BindingUtils.PrepareTask();
     AuthSetAdditionalSearchPathNative(newPath, userData, DelegateOnFfiResultCb);
     return(ret);
 }
Exemplo n.º 24
0
 public Task <AccountInfo> AuthAccountInfoAsync(IntPtr auth)
 {
     var(ret, userData) = BindingUtils.PrepareTask <AccountInfo>();
     AuthAccountInfoNative(auth, userData, DelegateOnFfiResultAccountInfoCb);
     return(ret);
 }
Exemplo n.º 25
0
 // ReSharper disable once UnusedMember.Global
 public void Free()
 {
     BindingUtils.FreeList(ref UserMetadataPtr, ref UserMetadataLen);
 }
Exemplo n.º 26
0
 // ReSharper disable once UnusedMember.Global
 public void Free()
 {
     AccessContainerEntry.Free();
     BindingUtils.FreeList(ref BootstrapConfigPtr, ref BootstrapConfigLen);
 }
Exemplo n.º 27
0
 public Task <string> AuthExeFileStemAsync()
 {
     var(ret, userData) = BindingUtils.PrepareTask <string>();
     AuthExeFileStemNative(userData, DelegateOnFfiResultStringCb);
     return(ret);
 }
Exemplo n.º 28
0
 public AccessContainerEntry(AccessContainerEntryNative native)
 {
     Containers = BindingUtils.CopyToObjectList <ContainerInfo>(native.ContainersPtr, (int)native.ContainersLen);
 }
Exemplo n.º 29
0
 public UnregisteredIpcReq(uint reqId, IntPtr extraDataPtr, ulong extraDataLength)
 {
     ReqId     = reqId;
     ExtraData = BindingUtils.CopyToByteList(extraDataPtr, (int)extraDataLength);
 }
Exemplo n.º 30
0
 internal void Free()
 {
     BindingUtils.FreeList(ref ContainersPtr, ref ContainersLen);
 }