Commit 8be6ee36 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

Implement ldap_create_sort_control*.

parent 300c10a3
......@@ -89,6 +89,62 @@ ULONG ldap_controls_freeW( LDAPControlW **controls )
return ret;
}
ULONG ldap_create_sort_controlA( WLDAP32_LDAP *ld, PLDAPSortKeyA *sortkey,
UCHAR critical, PLDAPControlA *control )
{
ULONG ret = LDAP_NOT_SUPPORTED;
#ifdef HAVE_LDAP
LDAPSortKeyW **sortkeyW = NULL;
LDAPControlW *controlW = NULL;
TRACE( "(%p, %p, 0x%02x, %p)\n", ld, sortkey, critical, control );
if (!ld || !sortkey || !control)
return WLDAP32_LDAP_PARAM_ERROR;
sortkeyW = sortkeyarrayAtoW( sortkey );
if (!sortkeyW) return WLDAP32_LDAP_NO_MEMORY;
ret = ldap_create_sort_controlW( ld, sortkeyW, critical, &controlW );
*control = controlWtoA( controlW );
if (!*control) ret = WLDAP32_LDAP_NO_MEMORY;
ldap_control_freeW( controlW );
sortkeyarrayfreeW( sortkeyW );
#endif
return ret;
}
ULONG ldap_create_sort_controlW( WLDAP32_LDAP *ld, PLDAPSortKeyW *sortkey,
UCHAR critical, PLDAPControlW *control )
{
ULONG ret = LDAP_NOT_SUPPORTED;
#ifdef HAVE_LDAP
LDAPSortKey **sortkeyU = NULL;
LDAPControl *controlU = NULL;
TRACE( "(%p, %p, 0x%02x, %p)\n", ld, sortkey, critical, control );
if (!ld || !sortkey || !control)
return WLDAP32_LDAP_PARAM_ERROR;
sortkeyU = sortkeyarrayWtoU( sortkey );
if (!sortkeyU) return WLDAP32_LDAP_NO_MEMORY;
ret = ldap_create_sort_control( ld, sortkeyU, critical, &controlU );
*control = controlUtoW( controlU );
if (!*control) ret = WLDAP32_LDAP_NO_MEMORY;
ldap_control_free( controlU );
sortkeyarrayfreeU( sortkeyU );
#endif
return ret;
}
ULONG ldap_free_controlsA( LDAPControlA **controls )
{
return ldap_controls_freeA( controls );
......
......@@ -275,6 +275,8 @@ ULONG WLDAP32_ldap_count_references(WLDAP32_LDAP*,WLDAP32_LDAPMessage*);
ULONG ldap_count_valuesA(PCHAR*);
ULONG ldap_count_valuesW(PWCHAR*);
ULONG WLDAP32_ldap_count_values_len(PBERVAL*);
ULONG ldap_create_sort_controlA(WLDAP32_PLDAP,PLDAPSortKeyA*,UCHAR,PLDAPControlA*);
ULONG ldap_create_sort_controlW(WLDAP32_PLDAP,PLDAPSortKeyW*,UCHAR,PLDAPControlW*);
ULONG ldap_deleteA(WLDAP32_LDAP*,PCHAR);
ULONG ldap_deleteW(WLDAP32_LDAP*,PWCHAR);
ULONG ldap_delete_extA(WLDAP32_LDAP*,PCHAR,PLDAPControlA*,PLDAPControlA*,ULONG*);
......
......@@ -70,9 +70,9 @@
@ stub ldap_create_page_control
@ stub ldap_create_page_controlA
@ stub ldap_create_page_controlW
@ stub ldap_create_sort_control
@ stub ldap_create_sort_controlA
@ stub ldap_create_sort_controlW
@ cdecl ldap_create_sort_control(ptr ptr long ptr) ldap_create_sort_controlA
@ cdecl ldap_create_sort_controlA(ptr ptr long ptr)
@ cdecl ldap_create_sort_controlW(ptr ptr long ptr)
@ stub ldap_create_vlv_controlA
@ stub ldap_create_vlv_controlW
@ cdecl ldap_delete(ptr str) ldap_deleteA
......
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