

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
24 messages in net.java.dev.jna.usersRe: [jna-users] Re: Mapping Struct to...| From | Sent On | Attachments |
|---|---|---|
| thex...@email.com | Nov 1, 2008 1:46 am | |
| Timothy Wall | Nov 1, 2008 5:04 am | |
| thex...@email.com | Nov 1, 2008 8:40 am | |
| Timothy Wall | Nov 1, 2008 11:14 am | |
| Timothy Wall | Nov 1, 2008 11:17 am | |
| thex...@email.com | Nov 2, 2008 12:30 am | |
| Timothy Wall | Nov 2, 2008 7:42 am | |
| thex...@email.com | Nov 3, 2008 2:02 am | |
| Timothy Wall | Nov 3, 2008 3:49 am | |
| thex...@email.com | Nov 3, 2008 4:51 am | |
| Timothy Wall | Nov 3, 2008 6:22 am | |
| thex...@email.com | Nov 3, 2008 7:47 am | |
| Timothy Wall | Nov 3, 2008 8:21 am | |
| thex...@email.com | Nov 3, 2008 11:19 pm | |
| Timothy Wall | Nov 4, 2008 5:33 am | |
| Timothy Wall | Nov 4, 2008 5:34 am | |
| thex...@email.com | Nov 4, 2008 2:33 pm | |
| Timothy Wall | Nov 5, 2008 5:44 am | |
| thex...@email.com | Nov 5, 2008 8:15 am | |
| Timothy Wall | Nov 5, 2008 9:19 am | |
| thex...@email.com | Nov 5, 2008 3:22 pm | |
| Timothy Wall | Nov 5, 2008 7:00 pm | |
| thex...@email.com | Nov 6, 2008 3:36 am | |
| thex...@email.com | Nov 6, 2008 10:55 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [jna-users] Re: Mapping Struct to Java | Actions... |
|---|---|---|
| From: | thex...@email.com (thex...@email.com) | |
| Date: | Nov 3, 2008 4:51:19 am | |
| List: | net.java.dev.jna.users | |
Hi
The DLL won't carry any struct information. That's all generated by the compiler based on the header file.
Oh, I see now. Its a contract not a structure. Sign the wrong contract paragraphs and you get wrong results.
Not sure when I'll get the chance. It's straightforward to add a new JNA test to verify the behavior (including a native method that returns an int-sized struct, if there isn't one already). That might've been easier than writing a vc++ dll :)
I see. Any help I can offer you with it? Took a quick look at the tests in the repository: StructureByValueTest checks values with 8, 16, 32, 64 and 128 byte length.
PointerByReference is "void **", which you use if you're expecting the native code to provide you with a value (the native code writes a "void *" into the pointer-sized memory you provide). byte[] is if you're providing the native code with a buffer in which to write. Use the wrong one and you'll get an access violation.
Strangely the tests with that JNA definition using PointerByReference for returned a string worked without access violation as long as I didn't use the function returning the 4-byte-structure. But as said, gonna go change that anyway.
Regards, Armin
-- See Exclusive Video: Hollywood Life's 5th Annual Style Awards http://www.hollywoodlife.net/Awards.aspx?AwardsID=style2008







