Hi Nick,
The basic problem is that you can’t use REFERENCE the way you are trying to. REFERENCE creates an opaque reference to an object. So you can pass it over IPC, but you can’t dereference it on the other side. Say you had some sort of account database stored in one service in memory. You could expose a LookupByName() function that returns a REFERENCE to the use that is found and then you could have other functions GetName(), GetBirthday(), etc. that take a reference as a parameter to specify the user to look at.
For your use case, I think you will need to define a number of OUT parameters for every data element you would like to return. Another option is to use the file descriptor support and stream the data across, but that’s a bit more complicated.