Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java using JNA to access SiUSBXp.dll  RSS feed

 
ghazal ayoub
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can I use this (SiUSBXp.dll)functions in my java program using pointer or pointerByrefrence in JNA

SI_STATUS SI_Read (HANDLE Handle, LPVOID Buffer, DWORD NumBytesToRead,
DWORD *NumBytesReturned, OVERLAPPED* o = NULL)

SI_STATUS SI_Write (HANDLE Handle, LPVOID Buffer, DWORD NumBytesToWrite,
DWORD *NumBytesWritten, OVERLAPPED* o = NULL)



I try to do like this but Failed
int SI_Read (HANDLE Handle, byte[] Buffer, int NumBytesToRead,IntByReference NumBytesReturned);
int SI_Write (HANDLE Handle, byte[] lpBuffer, int dwBytesToWrite, IntByReference lpdwBytesWritten);

the problem in byte[] Buffer
please can anyone help me ?
thanks ...
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
LPVOID isn't a byte[] but a pointer of unknown type (a platform independent form of void *). You'll probably need a Pointer. You could probably use a Memory object. This later gives you access to its own byte[].
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!