I was searching for another issue concerning JNA and structs, and Google redirected me here. I hope this helps.
From JNA API
To pass a structure by value, first
define the structure, then define an
empty class from that which implements
Structure.ByValue. Use the ByValue
class as the argument or return type.
// Original C code
typedef struct _Point {
int x, y;
} Point;
Point translate(Point pt, int dx, int dy);
// Equivalent JNA mapping
class Point extends Structure {
public static class ByValue extends Point implements Structure.ByValue { }
public int x, y;
}
Point.ByValue translate(Point.ByValue pt, int x, int y);
...
Point.ByValue pt = new Point.ByValue();
Point result = translate(pt, 100, 100);