So I profiled my structures using the JNA toString(Debug); and there are differences in the bytes JNA allocates
SHIPDeviceInfo
32 Bit: 276 bytes
64 Bit: 288 bytes
SHIPUSBCommPort
32bit: 16 bytes
64 Bit: 24 bytes
SHIPBridgeSNFields
32 Bit: 8 bytes
64 Bit: 8 byes
SHIP_SN
32 bit: 96 bytes
64 bit: 96 bytes
The two classes that resized between 32 bit and 64 bit both used HANDLE and ShipDeviceInfo used WINUSB_INTERFACE_HANDLE. I suspect that my issue resolves around these two variables types.
The native headers for those look as such:
Native:
struct _SHIP_DevInfo {
char devicePath[256];
SHIP_Device_Type devType;
SHIP_Bool devFound;
HANDLE deviceHandle;
WINUSB_INTERFACE_HANDLE winUSBHandle;
UCHAR deviceSpeed;
UCHAR bulkInPipe;
UCHAR bulkOutPipe;
UCHAR interruptPipe;
};
typedef struct _SHIP_DevInfo SHIP_DevInfo;
Java
public class SHIPDeviceInfo extends Structure {
public byte[] devicePath = new byte[SHIPFlashProgrammerJNA.SHIP_BUFFER_LENGTH];
public byte devType;
public boolean devFound;
public HANDLE deviceHandle;
public SHIPFlashProgrammerJNA.WINUSB_INTERFACE_HANDLE winUSBHandle;
public byte deviceSpeed;
public byte bulkInPipe;
public byte bulkOutPipe;
public byte interruptPipe;
public SHIPDeviceInfo() {
super();
}
@Override
protected List getFieldOrder() {
return Arrays.asList("devicePath", "devType", "devFound", "deviceHandle", "winUSBHandle", "deviceSpeed", "bulkInPipe", "bulkOutPipe", "interruptPipe");
}
public SHIPDeviceInfo(byte[] devicePath, byte devType, boolean devFound, HANDLE deviceHandle, WINUSB_INTERFACE_HANDLE winUSBHandle, byte deviceSpeed, byte bulkInPipe, byte bulkOutPipe, byte interruptPipe) {
super();
if (this.devicePath.length != devicePath.length) {
throw new IllegalArgumentException(String.format("Device Path array must be %d in length", SHIPFlashProgrammerJNA.SHIP_BUFFER_LENGTH));
}
this.devicePath = devicePath;
this.devType = devType;
this.devFound = devFound;
this.deviceHandle = deviceHandle;
this.winUSBHandle = winUSBHandle;
this.deviceSpeed = deviceSpeed;
this.bulkInPipe = bulkInPipe;
this.bulkOutPipe = bulkOutPipe;
this.interruptPipe = interruptPipe;
}
}
Native
struct _SHIP_USBCommPort {
char devicePath[14];
SHIP_Bool devFound;
HANDLE deviceHandle;
};
typedef struct _SHIP_USBCommPort SHIP_USBCommPort;
Java
public class SHIPUSBCommPort extends Structure {
public byte[] devicePath = new byte[SHIPFlashProgrammerJNA.SHIP_COM_PORT_NAME_LENGTH];
public boolean devFound;
public HANDLE deviceHandle;
public SHIPUSBCommPort() {
super();
}
@Override
protected List getFieldOrder() {
return Arrays.asList("devicePath", "devFound", "deviceHandle");
}
public SHIPUSBCommPort(byte[] devivePath, boolean devFound, HANDLE deviceHandle) {
super();
if (this.devicePath.length != devicePath.length) {
throw new IllegalArgumentException(String.format("Device Path array must be %d in length", SHIPFlashProgrammerJNA.SHIP_COM_PORT_NAME_LENGTH));
}
this.devicePath = devivePath;
this.devFound = devFound;
this.deviceHandle = deviceHandle;
}
}
These variables are defines as such:
public class WINUSB_INTERFACE_HANDLE extends PointerType{
public WINUSB_INTERFACE_HANDLE(){
super();
}
public WINUSB_INTERFACE_HANDLE(Pointer p){
super(p);
}
}
public class HANDLE extends PointerType{
public HANDLE(){
super();
}
public HANDLE(Pointer p){
super(p);