2 using System.Runtime.InteropServices;
3 using System.Threading;
4 using System.Threading.Tasks;
6 using Tizen.Security.TEEC;
10 Guid ta_uuid = new Guid();
11 Context ctx = new Context(null);
14 ctx.OpenSession(ta_uuid);
17 CancellationTokenSource token = new CancellationTokenSource();
18 Task<Session> ses_task = ctx.OpenSessionAsync(ta_uuid, token.Token);
19 ses = ses_task.Result;
22 IntPtr buf = Marshal.AllocHGlobal(20*1024);
23 SharedMemory shm = ctx.RegisterSharedMemory(buf, 20*1024, SharedMemoryFlags.Input|SharedMemoryFlags.Output);
24 ctx.ReleaseSharedMemory(shm);
25 Marshal.FreeHGlobal(buf);
27 shm = ctx.AllocateSharedMemory(10*1024, SharedMemoryFlags.Input);
28 ctx.ReleaseSharedMemory(shm);