2 messages in net.java.dev.jna.usersRe: [jna-users] Mapping question Poin...
FromSent OnAttachments
Hendrik SalyFeb 10, 2009 9:10 am 
Timothy WallFeb 10, 2009 11:13 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] Mapping question PointerByReferenceActions...
From:Timothy Wall (twal@dev.java.net)
Date:Feb 10, 2009 11:13:59 am
List:net.java.dev.jna.users

On Feb 10, 2009, at 12:10 PM, Hendrik Saly wrote:

Hello,

is it correct to map a C function

C: int create_instance(INST_INIT *init, FDESC *fdesc);

- where INST_INIT is a typedef struct ... and - where FDESC is a typedef void *

to Java using JNA in that way:

Java: int create_instance(INST_INIT init, FDESC fdesc);

- where INST_INIT is a class that extends Structure with some public members and - where FDESC is a class that extends PointerByReference

I have expecially with FDESC some strange behaviours. Is FDESC (its a kind of "instance handle") correct mapped?

If you use a PointerByReference instance in the init function, your actual FDESC value will be in PointerByReference.getValue().