i have a problem passing a structure from Java to a C-DLL and vice versa.
The structure looks like this:
typedef struct Userdata
The called functions header looks like:
__declspec(dllexport) int __stdcall createUser (TUserData* userdata);
The DLL will be called from java with
f = new xFunction(dllName,
"int " + funcName + "(" + ccdefPackage +
Pointer arg1 = null;
arg1 = Pointer.createPointerTo(accountdata);
errVal = ( (Integer) f.invoke(arg1)).intValue();
accountData = (UserAccountStruct) arg1.deref();
After dereferencing the argument 1, the char- array has lost the last two charactes. The starting size is 16, after dereferencing the size of the array is 14.
Have anybody seen this before? How can i solve the problem?