JNA: how to deal with unkown structs?
问题 If I'm not mistaken, a JNA Structure builds the struct by relying on the public fields of its corresponding Java class, which should extend Structure . My problem is that I need to pass a struct whose declaration is not known beforehand (let's say it's known at runtime). I just have a list of Object s, which the C library expects as a (reference to a) struct. Can I still use the Structure class or must I build a Memory object by hand, dealing with sizes, alignments/packing myself? For example