Commit d5ebfb54 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

Implement ldap_simple_bind* and ldap_unbind* functions.

parent 39a6c8b4
...@@ -132,3 +132,119 @@ ULONG ldap_bind_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR cred, ULONG method ) ...@@ -132,3 +132,119 @@ ULONG ldap_bind_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR cred, ULONG method )
#endif #endif
return ret; return ret;
} }
ULONG ldap_simple_bindA( WLDAP32_LDAP *ld, PCHAR dn, PCHAR passwd )
{
ULONG ret = LDAP_NOT_SUPPORTED;
#ifdef HAVE_LDAP
WCHAR *dnW, *passwdW;
TRACE( "(%p, %s, %p)\n", ld, debugstr_a(dn), passwd );
dnW = strAtoW( dn );
if (!dnW) return LDAP_NO_MEMORY;
passwdW = strAtoW( passwd );
if (!passwdW) return LDAP_NO_MEMORY;
ret = ldap_simple_bindW( ld, dnW, passwdW );
strfreeW( dnW );
strfreeW( passwdW );
#endif
return ret;
}
ULONG ldap_simple_bindW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR passwd )
{
ULONG ret = LDAP_NOT_SUPPORTED;
#ifdef HAVE_LDAP
char *dnU, *passwdU;
TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), passwd );
dnU = strWtoU( dn );
if (!dnU) return LDAP_NO_MEMORY;
passwdU = strWtoU( passwd );
if (!passwdU) return LDAP_NO_MEMORY;
ret = ldap_simple_bind( ld, dnU, passwdU );
strfreeU( dnU );
strfreeU( passwdU );
#endif
return ret;
}
ULONG ldap_simple_bind_sA( WLDAP32_LDAP *ld, PCHAR dn, PCHAR passwd )
{
ULONG ret = LDAP_NOT_SUPPORTED;
#ifdef HAVE_LDAP
WCHAR *dnW, *passwdW;
TRACE( "(%p, %s, %p)\n", ld, debugstr_a(dn), passwd );
dnW = strAtoW( dn );
if (!dnW) return LDAP_NO_MEMORY;
passwdW = strAtoW( passwd );
if (!passwdW) return LDAP_NO_MEMORY;
ret = ldap_simple_bind_sW( ld, dnW, passwdW );
strfreeW( dnW );
strfreeW( passwdW );
#endif
return ret;
}
ULONG ldap_simple_bind_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR passwd )
{
ULONG ret = LDAP_NOT_SUPPORTED;
#ifdef HAVE_LDAP
char *dnU, *passwdU;
TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), passwd );
dnU = strWtoU( dn );
if (!dnU) return LDAP_NO_MEMORY;
passwdU = strWtoU( passwd );
if (!passwdU) return LDAP_NO_MEMORY;
ret = ldap_simple_bind_s( ld, dnU, passwdU );
strfreeU( dnU );
strfreeU( passwdU );
#endif
return ret;
}
ULONG WLDAP32_ldap_unbind( WLDAP32_LDAP *ld )
{
ULONG ret = LDAP_NOT_SUPPORTED;
#ifdef HAVE_LDAP
TRACE( "(%p)\n", ld );
ret = ldap_unbind( ld );
#endif
return ret;
}
ULONG WLDAP32_ldap_unbind_s( WLDAP32_LDAP *ld )
{
ULONG ret = LDAP_NOT_SUPPORTED;
#ifdef HAVE_LDAP
TRACE( "(%p)\n", ld );
ret = ldap_unbind_s( ld );
#endif
return ret;
}
...@@ -53,6 +53,12 @@ ULONG ldap_bindA(WLDAP32_LDAP*,PCHAR,PCHAR,ULONG); ...@@ -53,6 +53,12 @@ ULONG ldap_bindA(WLDAP32_LDAP*,PCHAR,PCHAR,ULONG);
ULONG ldap_bindW(WLDAP32_LDAP*,PWCHAR,PWCHAR,ULONG); ULONG ldap_bindW(WLDAP32_LDAP*,PWCHAR,PWCHAR,ULONG);
ULONG ldap_bind_sA(WLDAP32_LDAP*,PCHAR,PCHAR,ULONG); ULONG ldap_bind_sA(WLDAP32_LDAP*,PCHAR,PCHAR,ULONG);
ULONG ldap_bind_sW(WLDAP32_LDAP*,PWCHAR,PWCHAR,ULONG); ULONG ldap_bind_sW(WLDAP32_LDAP*,PWCHAR,PWCHAR,ULONG);
ULONG ldap_simple_bindA(WLDAP32_LDAP*,PCHAR,PCHAR);
ULONG ldap_simple_bindW(WLDAP32_LDAP*,PWCHAR,PWCHAR);
ULONG ldap_simple_bind_sA(WLDAP32_LDAP*,PCHAR,PCHAR);
ULONG ldap_simple_bind_sW(WLDAP32_LDAP*,PWCHAR,PWCHAR);
ULONG WLDAP32_ldap_unbind(WLDAP32_LDAP*);
ULONG WLDAP32_ldap_unbind_s(WLDAP32_LDAP*);
ULONG LdapGetLastError(void); ULONG LdapGetLastError(void);
ULONG LdapMapErrorToWin32(ULONG); ULONG LdapMapErrorToWin32(ULONG);
......
...@@ -22,3 +22,11 @@ ...@@ -22,3 +22,11 @@
@ stub ldap_open @ stub ldap_open
@ stub ldap_openA @ stub ldap_openA
@ stub ldap_openW @ stub ldap_openW
@ cdecl ldap_simple_bind(ptr str str) ldap_simple_bindA
@ cdecl ldap_simple_bindA(ptr str str)
@ cdecl ldap_simple_bindW(ptr wstr wstr)
@ cdecl ldap_simple_bind_s(ptr str str) ldap_simple_bind_sA
@ cdecl ldap_simple_bind_sA(ptr str str)
@ cdecl ldap_simple_bind_sW(ptr wstr wstr)
@ cdecl ldap_unbind(ptr) WLDAP32_ldap_unbind
@ cdecl ldap_unbind_s(ptr) WLDAP32_ldap_unbind_s
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment