Yes that is possible, but I'm not the one writing the called functions, and I'd like to make this as easy as possible for the users of my plugin. I rather not require the user to do a lot of deserialization and casting (actually that's the whole point of implementing RPCs; convenience for the user). The user should be able to freely choose a parameter list, and my plugin should take care that the right values are passed.

The method with casting the parameters to a LargeStruct seems best. What I do is cast the RPC function pointer (passed to C++ as a void*) to a "void (*func) (LargeStruct)", regardless of what parameter list it has (parameter list size must be <= sizeof(LargeStruct)). I then cast the serialized parameter data to a LargeStruct and call the function pointer with this LargeStruct as parameter. Lite-C interprets the parameter data as the original parameter list (not as a LargeStruct), but since the data in the LargeStruct "fits" the parameter list, it will result in correct values for the parameters. I'm not so worried about the performance issues of copying a whole LargeStruct (could even use several structs of increasing size) nor about the fact that parameter list size will be limited to sizeof(LargeStruct).. I am however worried that since the LargeStruct is often larger than the parameter list, I am copying to memory I do not own. Could you tell me if this is a risk, or is the memory past the end of the parameter list safe to write to?

The best solution would be to be able to pass a char array by value, because then I can use a fitting size parameter list for every registered RPC function. I read here that this can be done by making the parameter a "const char []", but it doesn't seem to work.. It's hard to find information about this on the web, but maybe you have an idea as to why this doesn't work/how to make it work.

Thanks