1 message in net.java.dev.jna.users[jna-users] Re: Issue with nested str...
FromSent OnAttachments
Timothy WallJun 21, 2008 4:14 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[jna-users] Re: Issue with nested structureActions...
From:Timothy Wall (twal@dev.java.net)
Date:Jun 21, 2008 4:14:04 am
List:net.java.dev.jna.users

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?