mirror of
https://github.com/reactos/wine.git
synced 2024-11-29 14:40:56 +00:00
Implement ldap_search_ext* and ldap_start_tls_s* functions.
This commit is contained in:
parent
d42210dd11
commit
8d09a7cd2b
@ -120,3 +120,55 @@ WLDAP32_LDAP *ldap_openW( PWCHAR hostname, ULONG portnumber )
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ULONG ldap_start_tls_sA( WLDAP32_LDAP *ld, PULONG retval, WLDAP32_LDAPMessage **result,
|
||||
PLDAPControlA *serverctrls, PLDAPControlA *clientctrls )
|
||||
{
|
||||
ULONG ret = LDAP_NOT_SUPPORTED;
|
||||
#ifdef HAVE_LDAP
|
||||
LDAPControlW **serverctrlsW, **clientctrlsW;
|
||||
|
||||
TRACE( "(%p, %p, %p, %p, %p)\n", ld, retval, result, serverctrls, clientctrls );
|
||||
|
||||
if (!ld) return ~0UL;
|
||||
|
||||
serverctrlsW = controlarrayAtoW( serverctrls );
|
||||
if (!serverctrlsW) return LDAP_NO_MEMORY;
|
||||
|
||||
clientctrlsW = controlarrayAtoW( clientctrls );
|
||||
if (!clientctrlsW) return LDAP_NO_MEMORY;
|
||||
|
||||
ret = ldap_start_tls_sW( ld, retval, result, serverctrlsW, clientctrlsW );
|
||||
|
||||
controlarrayfreeW( serverctrlsW );
|
||||
controlarrayfreeW( clientctrlsW );
|
||||
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
ULONG ldap_start_tls_sW( WLDAP32_LDAP *ld, PULONG retval, WLDAP32_LDAPMessage **result,
|
||||
PLDAPControlW *serverctrls, PLDAPControlW *clientctrls )
|
||||
{
|
||||
ULONG ret = LDAP_NOT_SUPPORTED;
|
||||
#ifdef HAVE_LDAP
|
||||
LDAPControl **serverctrlsU, **clientctrlsU;
|
||||
|
||||
TRACE( "(%p, %p, %p, %p, %p)\n", ld, retval, result, serverctrls, clientctrls );
|
||||
|
||||
if (!ld) return ~0UL;
|
||||
|
||||
serverctrlsU = controlarrayWtoU( serverctrls );
|
||||
if (!serverctrlsU) return LDAP_NO_MEMORY;
|
||||
|
||||
clientctrlsU = controlarrayWtoU( clientctrls );
|
||||
if (!clientctrlsU) return LDAP_NO_MEMORY;
|
||||
|
||||
ret = ldap_start_tls_s( ld, serverctrlsU, clientctrlsU );
|
||||
|
||||
controlarrayfreeU( serverctrlsU );
|
||||
controlarrayfreeU( clientctrlsU );
|
||||
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
@ -99,6 +99,186 @@ ULONG ldap_searchW( WLDAP32_LDAP *ld, PWCHAR base, ULONG scope, PWCHAR filter,
|
||||
return ret;
|
||||
}
|
||||
|
||||
ULONG ldap_search_extA( WLDAP32_LDAP *ld, PCHAR base, ULONG scope,
|
||||
PCHAR filter, PCHAR attrs[], ULONG attrsonly, PLDAPControlA *serverctrls,
|
||||
PLDAPControlA *clientctrls, ULONG timelimit, ULONG sizelimit, ULONG *message )
|
||||
{
|
||||
ULONG ret = LDAP_NOT_SUPPORTED;
|
||||
#ifdef HAVE_LDAP
|
||||
WCHAR *baseW, *filterW, **attrsW;
|
||||
LDAPControlW **serverctrlsW, **clientctrlsW;
|
||||
|
||||
TRACE( "(%p, %s, 0x%08lx, %s, %p, 0x%08lx, %p, %p, 0x%08lx, 0x%08lx, %p)\n",
|
||||
ld, debugstr_a(base), scope, debugstr_a(filter), attrs, attrsonly,
|
||||
serverctrls, clientctrls, timelimit, sizelimit, message );
|
||||
|
||||
if (!ld) return ~0UL;
|
||||
|
||||
baseW = strAtoW( base );
|
||||
if (!baseW) return LDAP_NO_MEMORY;
|
||||
|
||||
filterW = strAtoW( filter );
|
||||
if (!filterW) return LDAP_NO_MEMORY;
|
||||
|
||||
attrsW = strarrayAtoW( attrs );
|
||||
if (!attrsW) return LDAP_NO_MEMORY;
|
||||
|
||||
serverctrlsW = controlarrayAtoW( serverctrls );
|
||||
if (!serverctrlsW) return LDAP_NO_MEMORY;
|
||||
|
||||
clientctrlsW = controlarrayAtoW( clientctrls );
|
||||
if (!clientctrlsW) return LDAP_NO_MEMORY;
|
||||
|
||||
ret = ldap_search_extW( ld, baseW, scope, filterW, attrsW, attrsonly,
|
||||
serverctrlsW, clientctrlsW, timelimit, sizelimit, message );
|
||||
|
||||
strfreeW( baseW );
|
||||
strfreeW( filterW );
|
||||
strarrayfreeW( attrsW );
|
||||
controlarrayfreeW( serverctrlsW );
|
||||
controlarrayfreeW( clientctrlsW );
|
||||
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
ULONG ldap_search_extW( WLDAP32_LDAP *ld, PWCHAR base, ULONG scope,
|
||||
PWCHAR filter, PWCHAR attrs[], ULONG attrsonly, PLDAPControlW *serverctrls,
|
||||
PLDAPControlW *clientctrls, ULONG timelimit, ULONG sizelimit, ULONG *message )
|
||||
{
|
||||
ULONG ret = LDAP_NOT_SUPPORTED;
|
||||
#ifdef HAVE_LDAP
|
||||
char *baseU, *filterU, **attrsU;
|
||||
LDAPControl **serverctrlsU, **clientctrlsU;
|
||||
struct timeval tv;
|
||||
|
||||
TRACE( "(%p, %s, 0x%08lx, %s, %p, 0x%08lx, %p, %p, 0x%08lx, 0x%08lx, %p)\n",
|
||||
ld, debugstr_w(base), scope, debugstr_w(filter), attrs, attrsonly,
|
||||
serverctrls, clientctrls, timelimit, sizelimit, message );
|
||||
|
||||
if (!ld) return ~0UL;
|
||||
|
||||
baseU = strWtoU( base );
|
||||
if (!baseU) return LDAP_NO_MEMORY;
|
||||
|
||||
filterU = strWtoU( filter );
|
||||
if (!filterU) return LDAP_NO_MEMORY;
|
||||
|
||||
attrsU = strarrayWtoU( attrs );
|
||||
if (!attrsU) return LDAP_NO_MEMORY;
|
||||
|
||||
serverctrlsU = controlarrayWtoU( serverctrls );
|
||||
if (!serverctrlsU) return LDAP_NO_MEMORY;
|
||||
|
||||
clientctrlsU = controlarrayWtoU( clientctrls );
|
||||
if (!clientctrlsU) return LDAP_NO_MEMORY;
|
||||
|
||||
tv.tv_sec = timelimit;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
ret = ldap_search_ext( ld, baseU, scope, filterU, attrsU, attrsonly,
|
||||
serverctrlsU, clientctrlsU, &tv, sizelimit, (int *)message );
|
||||
|
||||
strfreeU( baseU );
|
||||
strfreeU( filterU );
|
||||
strarrayfreeU( attrsU );
|
||||
controlarrayfreeU( serverctrlsU );
|
||||
controlarrayfreeU( clientctrlsU );
|
||||
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
ULONG ldap_search_ext_sA( WLDAP32_LDAP *ld, PCHAR base, ULONG scope,
|
||||
PCHAR filter, PCHAR attrs[], ULONG attrsonly, PLDAPControlA *serverctrls,
|
||||
PLDAPControlA *clientctrls, ULONG timelimit, ULONG sizelimit, WLDAP32_LDAPMessage **res )
|
||||
{
|
||||
ULONG ret = LDAP_NOT_SUPPORTED;
|
||||
#ifdef HAVE_LDAP
|
||||
WCHAR *baseW, *filterW, **attrsW;
|
||||
LDAPControlW **serverctrlsW, **clientctrlsW;
|
||||
|
||||
TRACE( "(%p, %s, 0x%08lx, %s, %p, 0x%08lx, %p, %p, 0x%08lx, 0x%08lx, %p)\n",
|
||||
ld, debugstr_a(base), scope, debugstr_a(filter), attrs, attrsonly,
|
||||
serverctrls, clientctrls, timelimit, sizelimit, res );
|
||||
|
||||
if (!ld) return ~0UL;
|
||||
|
||||
baseW = strAtoW( base );
|
||||
if (!baseW) return LDAP_NO_MEMORY;
|
||||
|
||||
filterW = strAtoW( filter );
|
||||
if (!filterW) return LDAP_NO_MEMORY;
|
||||
|
||||
attrsW = strarrayAtoW( attrs );
|
||||
if (!attrsW) return LDAP_NO_MEMORY;
|
||||
|
||||
serverctrlsW = controlarrayAtoW( serverctrls );
|
||||
if (!serverctrlsW) return LDAP_NO_MEMORY;
|
||||
|
||||
clientctrlsW = controlarrayAtoW( clientctrls );
|
||||
if (!clientctrlsW) return LDAP_NO_MEMORY;
|
||||
|
||||
ret = ldap_search_ext_sW( ld, baseW, scope, filterW, attrsW, attrsonly,
|
||||
serverctrlsW, clientctrlsW, timelimit, sizelimit, res );
|
||||
|
||||
strfreeW( baseW );
|
||||
strfreeW( filterW );
|
||||
strarrayfreeW( attrsW );
|
||||
controlarrayfreeW( serverctrlsW );
|
||||
controlarrayfreeW( clientctrlsW );
|
||||
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
ULONG ldap_search_ext_sW( WLDAP32_LDAP *ld, PWCHAR base, ULONG scope,
|
||||
PWCHAR filter, PWCHAR attrs[], ULONG attrsonly, PLDAPControlW *serverctrls,
|
||||
PLDAPControlW *clientctrls, ULONG timelimit, ULONG sizelimit, WLDAP32_LDAPMessage **res )
|
||||
{
|
||||
ULONG ret = LDAP_NOT_SUPPORTED;
|
||||
#ifdef HAVE_LDAP
|
||||
char *baseU, *filterU, **attrsU;
|
||||
LDAPControl **serverctrlsU, **clientctrlsU;
|
||||
struct timeval tv;
|
||||
|
||||
TRACE( "(%p, %s, 0x%08lx, %s, %p, 0x%08lx, %p, %p, 0x%08lx, 0x%08lx, %p)\n",
|
||||
ld, debugstr_w(base), scope, debugstr_w(filter), attrs, attrsonly,
|
||||
serverctrls, clientctrls, timelimit, sizelimit, res );
|
||||
|
||||
if (!ld) return ~0UL;
|
||||
|
||||
baseU = strWtoU( base );
|
||||
if (!baseU) return LDAP_NO_MEMORY;
|
||||
|
||||
filterU = strWtoU( filter );
|
||||
if (!filterU) return LDAP_NO_MEMORY;
|
||||
|
||||
attrsU = strarrayWtoU( attrs );
|
||||
if (!attrsU) return LDAP_NO_MEMORY;
|
||||
|
||||
serverctrlsU = controlarrayWtoU( serverctrls );
|
||||
if (!serverctrlsU) return LDAP_NO_MEMORY;
|
||||
|
||||
clientctrlsU = controlarrayWtoU( clientctrls );
|
||||
if (!clientctrlsU) return LDAP_NO_MEMORY;
|
||||
|
||||
tv.tv_sec = timelimit;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
ret = ldap_search_ext_s( ld, baseU, scope, filterU, attrsU, attrsonly,
|
||||
serverctrlsU, clientctrlsU, &tv, sizelimit, res );
|
||||
|
||||
strfreeU( baseU );
|
||||
strfreeU( filterU );
|
||||
strarrayfreeU( attrsU );
|
||||
controlarrayfreeU( serverctrlsU );
|
||||
controlarrayfreeU( clientctrlsU );
|
||||
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
ULONG ldap_search_sA( WLDAP32_LDAP *ld, PCHAR base, ULONG scope, PCHAR filter,
|
||||
PCHAR attrs[], ULONG attrsonly, WLDAP32_LDAPMessage **res )
|
||||
{
|
||||
|
@ -109,6 +109,14 @@ ULONG ldap_sasl_bind_sA(WLDAP32_LDAP*,const PCHAR,const PCHAR,const BERVAL*,PLDA
|
||||
ULONG ldap_sasl_bind_sW(WLDAP32_LDAP*,const PWCHAR,const PWCHAR,const BERVAL*,PLDAPControlW*,PLDAPControlW*,PBERVAL*);
|
||||
ULONG ldap_searchA(WLDAP32_LDAP*,PCHAR,ULONG,PCHAR,PCHAR[],ULONG);
|
||||
ULONG ldap_searchW(WLDAP32_LDAP*,PWCHAR,ULONG,PWCHAR,PWCHAR[],ULONG);
|
||||
ULONG ldap_search_extA(WLDAP32_LDAP*,PCHAR,ULONG,PCHAR,PCHAR[],ULONG,PLDAPControlA*,
|
||||
PLDAPControlA*,ULONG,ULONG,ULONG*);
|
||||
ULONG ldap_search_extW(WLDAP32_LDAP*,PWCHAR,ULONG,PWCHAR,PWCHAR[],ULONG,PLDAPControlW*,
|
||||
PLDAPControlW*,ULONG,ULONG,ULONG*);
|
||||
ULONG ldap_search_ext_sA(WLDAP32_LDAP*,PCHAR,ULONG,PCHAR,PCHAR[],ULONG,PLDAPControlA*,
|
||||
PLDAPControlA*,ULONG,ULONG,WLDAP32_LDAPMessage**);
|
||||
ULONG ldap_search_ext_sW(WLDAP32_LDAP*,PWCHAR,ULONG,PWCHAR,PWCHAR[],ULONG,PLDAPControlW*,
|
||||
PLDAPControlW*,ULONG,ULONG,WLDAP32_LDAPMessage**);
|
||||
ULONG ldap_search_sA(WLDAP32_LDAP*,PCHAR,ULONG,PCHAR,PCHAR[],ULONG,WLDAP32_LDAPMessage**);
|
||||
ULONG ldap_search_sW(WLDAP32_LDAP*,PWCHAR,ULONG,PWCHAR,PWCHAR[],ULONG,WLDAP32_LDAPMessage**);
|
||||
ULONG ldap_search_stA(WLDAP32_LDAP*,const PCHAR,ULONG,const PCHAR,PCHAR[],ULONG,
|
||||
@ -119,6 +127,8 @@ 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 ldap_start_tls_sA(WLDAP32_PLDAP,PULONG,WLDAP32_LDAPMessage**,PLDAPControlA*,PLDAPControlA*);
|
||||
ULONG ldap_start_tls_sW(WLDAP32_PLDAP,PULONG,WLDAP32_LDAPMessage**,PLDAPControlW*,PLDAPControlW*);
|
||||
ULONG WLDAP32_ldap_unbind(WLDAP32_LDAP*);
|
||||
ULONG WLDAP32_ldap_unbind_s(WLDAP32_LDAP*);
|
||||
|
||||
|
@ -32,6 +32,12 @@
|
||||
@ cdecl ldap_search(ptr str long str ptr long) ldap_searchA
|
||||
@ cdecl ldap_searchA(ptr str long str ptr long)
|
||||
@ cdecl ldap_searchW(ptr wstr long wstr ptr long)
|
||||
@ cdecl ldap_search_ext(ptr str long str ptr long ptr ptr long long ptr) ldap_search_extA
|
||||
@ cdecl ldap_search_extA(ptr str long str ptr long ptr ptr long long ptr)
|
||||
@ cdecl ldap_search_extW(ptr wstr long wstr ptr long ptr ptr long long ptr)
|
||||
@ cdecl ldap_search_ext_s(ptr str long str ptr long ptr ptr ptr long ptr) ldap_search_ext_sA
|
||||
@ cdecl ldap_search_ext_sA(ptr str long str ptr long ptr ptr ptr long ptr)
|
||||
@ cdecl ldap_search_ext_sW(ptr wstr long wstr ptr long ptr ptr ptr long ptr)
|
||||
@ cdecl ldap_search_s(ptr str long str ptr long ptr) ldap_search_sA
|
||||
@ cdecl ldap_search_sA(ptr str long str ptr long ptr)
|
||||
@ cdecl ldap_search_sW(ptr wstr long wstr ptr long ptr)
|
||||
@ -44,5 +50,7 @@
|
||||
@ 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_start_tls_sA(ptr ptr ptr ptr ptr)
|
||||
@ cdecl ldap_start_tls_sW(ptr ptr ptr ptr ptr)
|
||||
@ cdecl ldap_unbind(ptr) WLDAP32_ldap_unbind
|
||||
@ cdecl ldap_unbind_s(ptr) WLDAP32_ldap_unbind_s
|
||||
|
Loading…
Reference in New Issue
Block a user