sizeof(TEEC_SharedMemory));
tmpSharedMem[i]->size = operation->params[i].tmpref.size;
tmpSharedMem[i]->buffer = operation->params[i].tmpref.buffer;
+ if (type == TEEC_MEMREF_TEMP_INPUT) {
+ tmpSharedMem[i]->flags = TEEC_MEM_INPUT;
+ } else if (type == TEEC_MEMREF_TEMP_OUTPUT) {
+ tmpSharedMem[i]->flags = TEEC_MEM_OUTPUT;
+ } else if (type == TEEC_MEMREF_TEMP_INOUT) {
+ tmpSharedMem[i]->flags = TEEC_MEM_INPUT | TEEC_MEM_OUTPUT;
+ }
+
result = TEEC_RegisterSharedMemory(
((TEEC_SessionImp*)session->imp)->context, tmpSharedMem[i]);
if (result != TEEC_SUCCESS) {
}
return result;
}
- if (type == TEEC_MEMREF_TEMP_INPUT) {
- tmpSharedMem[i]->flags = TEEC_MEM_INPUT;
- memcpy(((TEEC_SharedMemoryImp*)tmpSharedMem[i]->imp)->allocPtr,
- tmpSharedMem[i]->buffer, tmpSharedMem[i]->size);
- } else if (type == TEEC_MEMREF_TEMP_OUTPUT)
- tmpSharedMem[i]->flags = TEEC_MEM_OUTPUT;
- else {
- tmpSharedMem[i]->flags = TEEC_MEM_INPUT | TEEC_MEM_OUTPUT;
+
+ if (type & TEEC_MEMREF_TEMP_INPUT) {
memcpy(((TEEC_SharedMemoryImp*)tmpSharedMem[i]->imp)->allocPtr,
tmpSharedMem[i]->buffer, tmpSharedMem[i]->size);
}