Hi,
On Feb 1, 2008 6:47 PM, Timothy Wall <twal...@dev.java.net> wrote:
It looks like SVN rev 310 used plain data memory allocation for
callbacks, so that explains the issue. Current SVN rev is 478; 3.0.1
is the official release number. There's a tag and separate download
in the project files section.
Definitely upgrade. There have been numerous bug fixes and a few new
features since the build.xml version got bumped to 3.0. Especially
if you're using stdcall convention callbacks; there was a VM crash
fix for those.
I've tried to upgrade to latest jna version, but had to rollback because of
the following issue - when I run dll unit tests under new jna I got the
following dialog box:
---------------------------
Microsoft Visual C++ Runtime Library
---------------------------
Buffer overrun detected!
Program: C:\java\jdk1.5\jre\bin\java.exe
A buffer overrun has been detected which has corrupted the program's
internal state. The program cannot safely continue execution and must
now be terminated.
---------------------------
OK
---------------------------
Unfortunately I don't have further information as jvm terminates w/o any log
^(. So, I just don't know what is the reason for buffer overrun.
Another minor question regarding new jna is ... I have simple class for
typesafe ptr references (text follows). With old jna lib there was no need
for empty constructor in this class. Why I have to add one with new jna?
public class PtrByRef <PtrType extends PointerType> extends
PointerByReference {
private PtrType ptr_type;
/**
* required for com.sun.jna.NativeMappedConverter.defaultValue to work
*/
public PtrByRef() {
}
public PtrByRef(PtrType ptr_type) {
this.ptr_type = ptr_type;
}
public PtrType getPtr() {
Pointer p = getValue();
if (p == null)
return null;
ptr_type.setPointer(p);
return ptr_type;
}
}