Jna

0 respostas
V

Eu disponho de uma DLL de terceiros , da qual eu acesso por JNA

eu faço todo o processo certinho , assim como diz na documentação ocorre !

Prototype:

int _GetRemoteToken08(const char *account,char *password)

Both Account and Password are typical C ASCII encoded strings.

Return Values:

0 - Success
1 - Bad source password encoding (i.e. not ascii)
2 - Decoding scheme not allowed/implemented (true for resenders)
3 - Account field Required (for some schemes, such as Advanced Passwords)
4 - Unknown error
5 - Transcoding timeout

When the return value is 0, the password coded is stored
in the "password" variable, thus "password" must reference to a writable buffer in memory.

Other return values don't modify any of the above mentioned variables.

E ao final me é retornado " 0 " pela função que eu chamo na Dll , que como é de se supor "Sucesso"
porém, eu não sei como acessar a variável "password" na ddl , até então eu só sei chamar métodos !

alguém sabe como fazer , ou se é possível ?

import com.sun.jna.Native;
import com.sun.jna.win32.StdCallLibrary;

public class TesteJNA
{
    public static void main(String[] args)
    {
String FilePath = System.getProperty("user.dir");

        System.setProperty("jna.library.path", FilePath);
        DllLoad INSTANCE = (DllLoad) Native.loadLibrary("loaddefs", DllLoad.class);
	int sucess = INSTANCE._GetRemoteToken08("teste1", "teste2");
	System.out.println(sucess);


    }
}

interface DllLoad extends StdCallLibrary
{
    public int _GetRemoteToken08(final String account,String password);

}
Criado 30 de maio de 2008
Respostas 0
Participantes 1