title: Define HGlobal in JNA
body: <p>I have to translate app from C++ to Java, but it uses dll, so I have to use JNA. Application should scan something from device. Here is app in C++:</p>
  
  <pre><code>//HEADERS
  ABC_Shell = (int (*)(char* cmd, int len, char* rsp, int buflen))GetProcAddress(g_hLib, "ABC_Shell");
  ABC_ImageProcessFromRaw = (int (*)(HGLOBAL hFront, HGLOBAL hRear))GetProcAddress(g_hLib, "ABC_ImageProcessFromRaw");
  //END    
  
  HGLOBAL hImage[3];
  memset(hImage, 0, sizeof(hImage));
  
  nRet = ABC_Shell("CP12", strlen(szShell), (char*)hImage, sizeof(hImage));
  ABC_ImageProcessFromRaw(hImage[0], hImage[1]);  //FACE, BACK RGB IMAGE
  ABC_ImageProcessFromRaw(hImage[2], NULL);       //FACE IR IMAGE
  SaveImage(0, hImage[0], hImage[1], hImage[2]);
  </code></pre>
  
  <p>And here is in Java:</p>
  
  <pre><code>//HEADERS
  int ABC_Shell(String command, int len, byte[] response, int buflen);
  int ABC_ImageProcessFromRaw(byte[] hFront, byte[] hRear);
  //END
  
  byte[] response = new byte[64];
  api.ABC_Shell("CP12", 8, response, 1024);  // it works, but response is strange
  api.ABC_ImageProcessFromRaw(response, null);
  </code></pre>
  
  <p>Of course device is scanning, but I don't know what kind of variable use to take a response and after that use it in next function. In C++ is HGlobal[3], there is no something like that in JNA. I was looking here - <a href="https://jna.java.net/javadoc/platform/com/sun/jna/platform/win32/W32API.html" rel="nofollow">https://jna.java.net/javadoc/platform/com/sun/jna/platform/win32/W32API.html</a>.</p>
  
  <p>Do you have any ideas, how to handle this global memory block in three parts?</p>