24 messages in net.java.dev.jna.usersRe: [jna-users] Re: Mapping Struct to...
FromSent OnAttachments
thex...@email.comNov 1, 2008 1:46 am 
Timothy WallNov 1, 2008 5:04 am 
thex...@email.comNov 1, 2008 8:40 am 
Timothy WallNov 1, 2008 11:14 am 
Timothy WallNov 1, 2008 11:17 am 
thex...@email.comNov 2, 2008 12:30 am 
Timothy WallNov 2, 2008 7:42 am 
thex...@email.comNov 3, 2008 2:02 am 
Timothy WallNov 3, 2008 3:49 am 
thex...@email.comNov 3, 2008 4:51 am 
Timothy WallNov 3, 2008 6:22 am 
thex...@email.comNov 3, 2008 7:47 am 
Timothy WallNov 3, 2008 8:21 am 
thex...@email.comNov 3, 2008 11:19 pm 
Timothy WallNov 4, 2008 5:33 am 
Timothy WallNov 4, 2008 5:34 am 
thex...@email.comNov 4, 2008 2:33 pm 
Timothy WallNov 5, 2008 5:44 am 
thex...@email.comNov 5, 2008 8:15 am 
Timothy WallNov 5, 2008 9:19 am 
thex...@email.comNov 5, 2008 3:22 pm 
Timothy WallNov 5, 2008 7:00 pm 
thex...@email.comNov 6, 2008 3:36 am 
thex...@email.comNov 6, 2008 10:55 pm 
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] Re: Mapping Struct to JavaActions...
From:thex...@email.com (thex@email.com)
Date:Nov 3, 2008 7:47:40 am
List:net.java.dev.jna.users

Hi

I did a quick check (tests added to SVN) and there don't seem to be any issues with a 4-byte structure on w32. Maybe the C# trappings are doing something non-C, with the compiler doing some extra glue on the caller side.

Took the latest release of jna package and retried my example. Still getting
that Invalid memory access exception.

The dll I am using for this test is done with VC++ 2008 Express edition, its
pure C, no C# involved. The signature of the dll function looks appropriate according to depends.exe. When I change the signature of the JNA interface to receive an
int instead of a structure I get the value 639502258 (0x261e07b2). The structure contains in this order id (short), index (byte) and count (byte) from top to
bottom. The values I set in the dll are id=1970 (0x07b2), index=30 (0x1e) and count=38
(0x26). I did verify once more the INVENTORYITEM structure of C with the one from java
and they are equal. I'd gladly share my sources if that helps you in any way.

Let me state this to make things clear: I am not blaming JNA of doing something
bad. Its probably me, like usual. I appreciate your help very much. The only success
I got so far is to get an int instead of the struct that seems to contain proper data.

Regards, Armin