From e65283afde6e9911ea84c9c81b9917d32df7dcfe Mon Sep 17 00:00:00 2001 From: Dongsun Lee Date: Fri, 1 Sep 2017 16:01:11 +0900 Subject: [PATCH] Copy data between shared memory and user data array Change-Id: Icd98852c1d8e59a6d7b8cf73e7cdca65da73a36d Signed-off-by: Dongsun Lee --- src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs b/src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs index b61527e..91030d4 100644 --- a/src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs +++ b/src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; +using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; @@ -137,7 +138,7 @@ namespace Tizen.Security.TEEC public void SetData(byte[] data, int dstOffs) { if ((shm.flags & (uint)SharedMemoryFlags.Output) == 0) throw new InvalidOperationException("No write access"); - //TODO copy data into shared memory starting at given offset + Marshal.Copy(data, 0, shm.buffer + dstOffs, data.Length); } /// /// This function makes a copy and is designed for convenient operations on small buffers. @@ -150,7 +151,7 @@ namespace Tizen.Security.TEEC public void GetData(byte[] data, int srcOffs) { if ((shm.flags & (uint)SharedMemoryFlags.Input) == 0) throw new InvalidOperationException("No read access"); - //TODO copy data from shared memory starting at given offset + Marshal.Copy(shm.buffer + srcOffs, data, 0, data.Length); } }; -- 2.7.4