13 messages in net.java.dev.jna.usersRe: [jna-users] "Can't determine size...
FromSent OnAttachments
Zsolt KútiMay 11, 2009 12:18 pm 
Timothy WallMay 11, 2009 12:22 pm 
Zsolt KútiMay 11, 2009 12:46 pm 
Timothy WallMay 11, 2009 1:06 pm 
Zsolt KútiMay 14, 2009 1:30 pm 
Timothy WallMay 14, 2009 1:58 pm 
Zsolt KútiMay 16, 2009 12:19 pm 
Timothy WallMay 16, 2009 6:42 pm 
Zsolt KútiMay 17, 2009 10:32 am 
Timothy WallMay 17, 2009 10:41 am 
Zsolt KútiMay 17, 2009 11:08 am 
Timothy WallMay 17, 2009 12:47 pm 
Zsolt KútiMay 18, 2009 10:33 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:Re: [jna-users] "Can't determine size of nested structure"Actions...
From:Timothy Wall (twal@dev.java.net)
Date:May 11, 2009 12:22:41 pm
List:net.java.dev.jna.users

If a structure member is empty there is no need to define it. It's probably defined on the native side in order to perform some address/ offset calculation on the empty field.

On May 11, 2009, at 3:19 PM, Zsolt Kúti wrote:

Hello,

A function's parameter is a struct that contains another struct as its member. This member struct is an empty one, containing no members.

At initalization of the corresponding Structure object I get this:

java.lang.IllegalArgumentException: Can't determine size of nested structure: Structure class hu.tinca.jburn.lib.Libburn $burn_drive has unknown size (ensure all fields are public) at com.sun.jna.Structure.calculateSize(Structure.java:905) at com.sun.jna.Structure.allocateMemory(Structure.java:228) at com.sun.jna.Structure.<init>(Structure.java:145) at com.sun.jna.Structure.<init>(Structure.java:135) at com.sun.jna.Structure.<init>(Structure.java:131) at com.sun.jna.Structure.<init>(Structure.java:127)

How can I use such an empty struct?