Yeah, but it's a mess.

Look up marshalling and structures. There's a bunch of fun hoops to jump through.