JNA handles recursive Structure.write calls for ByReference structure
fields, but apparently not Structure.read. I don't recall if there's
a reason not to or if it's just an oversight. Please file an RFE on
the project issues page if you'd like to see this implemented.
(sorry for the delay, dev.java.net email address has been swallowing
mail for the last few weeks)
Subject: Issue with nested structure
Hi there.
I have a mapping scenario very much like the "Nested Structure
Definitions" in https://jna.dev.java.net/javadoc/overview-summary.html
, where I have a pointer to a structure within my containing
structure, and in which I used the ByReference tag to mark the nested
structure as a reference.
The problem I have, is that in JNA native function call, when the
containing structure is marshalled, only the containing structure is
serialized, and not the nested structure (its native memory block
remains uninitialized, with zeros). I ran it throught the debugger
with JNA's source code, and the write() method of the nested structure
is never called.
Is this normal behavior? Do I have to manually call the write() method
of the nested structures?