3 messages in net.java.dev.jna.users[jna-users] help trying to map libpam
FromSent OnAttachments
Crump, MichaelNov 7, 2008 1:01 pm 
Timothy WallNov 7, 2008 4:51 pm 
Crump, MichaelNov 10, 2008 5:37 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[jna-users] help trying to map libpamActions...
From:Crump, Michael (mcr@leadscope.com)
Date:Nov 7, 2008 1:01:37 pm
List:net.java.dev.jna.users

Hello,

JNA looks very exciting. I'm just starting to dig in and had a question about mapping a couple of functions from libpam. It looks like the preference is to create structures for c define types but the libpam documentation specifically says that the pam_handle_t type is a private structure that should not be accessed directly. So I'm struggling with the best way to map the following functions to jna:

int pam_start(const char *service_name, const char *user, const struct pam_conv *pam_conversation, pam_handle_t **pamh);

int pam_authenticate(pam_handle_t *pamh, int flags);

I think the correct mapping might look something like this:

int pam_start(String service_name, String user, (not sure about pointer to function yet), PointerByReference pamh);

int pam_authenticate(Pointer pamh, int flags);

Would it be better to use a pointer type for the pam_handle_t *? If so how is the PointerType class supposed to be used?

Thanks in advance.

Regards,

Michael Crump