+ // Write changes to buffers
+ if( req->NParams - 2 != retCount ) {
+ fprintf(stderr, "syscalls.c: Return count inbalance (%i - 1 != exp %i) [Call %i]\n",
+ req->NParams, retCount, SyscallID);
+ exit(127);
+ }
+ retCount = 0;
+ for( i = 2; i < req->NParams; i ++ )
+ {
+ #if 0
+ int j;
+ printf("Return Data %i: (%i)", i, req->Params[i].Length);
+ for( j = 0; j < req->Params[i].Length; j ++ )
+ printf(" %02x", ((uint8_t*)dataPtr)[j]);
+ printf("\n");
+ #endif
+ assert( req->Params[i].Type == ARG_TYPE_DATA );
+ memcpy( retPtrs[retCount++], dataPtr, req->Params[i].Length );
+ dataPtr += req->Params[i].Length;
+ }