my native code is:
int xlSetApplConfig(
char *appName,
unsigned int appChannel,
unsigned int hwType,
unsigned int hwIndex,
unsigned int hwChannel,
unsigned int busType)
I tried to express appName with a Pointer in Java like this:
//integers..
byte[] appnamebyte = new String("JEdit").getBytes();
Pointer appname = new Memory(appnamebyte.length);
appname.write(0, appnamebyte, 0, appnamebyte.length);
int status = dll.INSTANCE.xlOpenPort(portHandle, appname, channelMask, permissionMask,
rxQueueSize,
xlInterfaceVersion, busType);
the function is writing the byte array to the registry or somewhere and with a other Tool(given one) I can read the value.
If I start my code there is no error but the appname is not allways correct. Sometimes there are more charcacters than i want("JEdit ?78ê").
Maybe somehow more memory than I want is allocated.
I also tried to pass an normal byte[] but with the same problem