I have a strage issue with the function with reference to typedef unsigned __int64 EntityNumber;
input parameter.
Library is x64, OS is Windows 10.
If I pass NativeLongByReference, the output buffer has only 4 bytes, so my number is broken if it exceeds 32-bit. I checked it with dump and it indeed contains half of 64-bit Long
If I pass DoubleByReference I can get my Long with doubleByReference.pointer.getLong(0)
.
While this hack works, I wonder, what's problem with Long if both OSes are 64-bit?
long TRANS2QUIK_API __stdcall TRANS2QUIK_SEND_SYNC_TRANSACTION (LPSTR lpstTransactionString, long* pnReplyCode, PDWORD pdwTransId, EntityNumber* pnOrderNum, LPSTR lpstrResultMessage, DWORD dwResultMessageSize, long* pnExtendedErrorCode, LPSTR lpstErrorMessage, DWORD dwErrorMessageSize);
and JNA interface
NativeLong TRANS2QUIK_SEND_SYNC_TRANSACTION(
String lpstTransactionString,
NativeLongByReference pnReplyCode,
NativeLongByReference pdwTransId,
DoubleByReference pdOrderNum, <- hack!
byte[] lpstrResultMessage,
int dwResultMessageSize,
NativeLongByReference pnExtendedErrorCode,
byte[] lpstrErrorMessage,
int dwErrorMessageSize
);
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.4+11)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.4+11, mixed mode)