/*********************************************************************** * ldap_create_sort_controlA (WLDAP32.@) * * See ldap_create_sort_controlW. */ ULONG CDECL ldap_create_sort_controlA( WLDAP32_LDAP *ld, PLDAPSortKeyA *sortkey, UCHAR critical, PLDAPControlA *control ) { ULONG ret = WLDAP32_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; }
/*********************************************************************** * ldap_encode_sort_controlW (WLDAP32.@) * * Create a control for server sorted search results. * * PARAMS * ld [I] Pointer to an LDAP context. * sortkey [I] Array of LDAPSortKey structures, each specifying an * attribute to use as a sort key, a matching rule and * the sort order (ascending or descending). * critical [I] Tells the server this control is critical to the * search operation. * control [O] LDAPControl created. * * RETURNS * Success: LDAP_SUCCESS * Failure: An LDAP error code. * * NOTES * This function is obsolete. Use its equivalent * ldap_create_sort_control instead. */ ULONG CDECL ldap_encode_sort_controlW( WLDAP32_LDAP *ld, PLDAPSortKeyW *sortkeys, PLDAPControlW ret, BOOLEAN critical ) { LDAPControlW *control; ULONG result; if ((result = ldap_create_sort_controlW( ld, sortkeys, critical, &control )) == WLDAP32_LDAP_SUCCESS) { ret->ldctl_oid = strdupW(control->ldctl_oid); bv_val_dup( &control->ldctl_value, &ret->ldctl_value ); ret->ldctl_iscritical = control->ldctl_iscritical; ldap_control_freeW( control ); } return result; }
/*********************************************************************** * ldap_encode_sort_controlW (WLDAP32.@) * * Create a control for server sorted search results. * * PARAMS * ld [I] Pointer to an LDAP context. * sortkey [I] Array of LDAPSortKey structures, each specifying an * attribute to use as a sort key, a matching rule and * the sort order (ascending or descending). * critical [I] Tells the server this control is critical to the * search operation. * control [O] LDAPControl created. * * RETURNS * Success: LDAP_SUCCESS * Failure: An LDAP error code. * * NOTES * This function is obsolete. Use its equivalent * ldap_create_sort_control instead. */ ULONG CDECL ldap_encode_sort_controlW( WLDAP32_LDAP *ld, PLDAPSortKeyW *sortkeys, PLDAPControlW control, BOOLEAN critical ) { return ldap_create_sort_controlW( ld, sortkeys, critical, &control ); }