JNA passing pointer ByReference
jna, pass-by-reference, pointers
Solution
Use `NativeLong` (not `long`) to represent native `unsigned long`.
Problem
I'm calling a function from a DLL, using JNA, which needs an unsigned *short input argument ``` unsigned void my_function(unsigned long handle, unsigned short * serial); ``` I tried to pass serial as a `ShortByReference` ``` my_function(long handle, ShortByReference serial); ``` When I use it, `my_function` does the work, but serial is not retrieved (it stays at its initialisation value). I also tried ``` my_function(long handle, short[] serial); ``` but it does the same. How could i do it correctly? Thanks, Arn0.