/*********************************************************************** * ldap_value_freeW (WLDAP32.@) * * Free an array of string values. * * PARAMS * vals [I] Array of string values. * * RETURNS * Success: LDAP_SUCCESS * Failure: An LDAP error code. */ ULONG CDECL ldap_value_freeW( PWCHAR *vals ) { TRACE( "(%p)\n", vals ); strarrayfreeW( vals ); return WLDAP32_LDAP_SUCCESS; }
/*********************************************************************** * ldap_search_extA (WLDAP32.@) * * See ldap_search_extW. */ ULONG CDECL 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 = WLDAP32_LDAP_NOT_SUPPORTED; #ifdef HAVE_LDAP WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; ret = WLDAP32_LDAP_NO_MEMORY; TRACE( "(%p, %s, 0x%08x, %s, %p, 0x%08x, %p, %p, 0x%08x, 0x%08x, %p)\n", ld, debugstr_a(base), scope, debugstr_a(filter), attrs, attrsonly, serverctrls, clientctrls, timelimit, sizelimit, message ); if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (base) { baseW = strAtoW( base ); if (!baseW) goto exit; } if (filter) { filterW = strAtoW( filter ); if (!filterW) goto exit; } if (attrs) { attrsW = strarrayAtoW( attrs ); if (!attrsW) goto exit; } if (serverctrls) { serverctrlsW = controlarrayAtoW( serverctrls ); if (!serverctrlsW) goto exit; } if (clientctrls) { clientctrlsW = controlarrayAtoW( clientctrls ); if (!clientctrlsW) goto exit; } ret = ldap_search_extW( ld, baseW, scope, filterW, attrsW, attrsonly, serverctrlsW, clientctrlsW, timelimit, sizelimit, message ); exit: strfreeW( baseW ); strfreeW( filterW ); strarrayfreeW( attrsW ); controlarrayfreeW( serverctrlsW ); controlarrayfreeW( clientctrlsW ); #endif return ret; }
/*********************************************************************** * ldap_count_valuesA (WLDAP32.@) * * See ldap_count_valuesW. */ ULONG CDECL ldap_count_valuesA( PCHAR *vals ) { ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED; #ifdef HAVE_LDAP WCHAR **valsW = NULL; TRACE( "(%p)\n", vals ); if (!vals) return 0; valsW = strarrayAtoW( vals ); if (!valsW) return WLDAP32_LDAP_NO_MEMORY; ret = ldap_count_valuesW( valsW ); strarrayfreeW( valsW ); #endif return ret; }
/*********************************************************************** * ldap_search_stA (WLDAP32.@) * * See ldap_search_stW. */ ULONG CDECL ldap_search_stA( WLDAP32_LDAP *ld, const PCHAR base, ULONG scope, const PCHAR filter, PCHAR attrs[], ULONG attrsonly, struct l_timeval *timeout, WLDAP32_LDAPMessage **res ) { ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED; #ifdef HAVE_LDAP WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL; ret = WLDAP32_LDAP_NO_MEMORY; TRACE( "(%p, %s, 0x%08x, %s, %p, 0x%08x, %p, %p)\n", ld, debugstr_a(base), scope, debugstr_a(filter), attrs, attrsonly, timeout, res ); if (!ld || !res) return WLDAP32_LDAP_PARAM_ERROR; if (base) { baseW = strAtoW( base ); if (!baseW) goto exit; } if (filter) { filterW = strAtoW( filter ); if (!filterW) goto exit; } if (attrs) { attrsW = strarrayAtoW( attrs ); if (!attrsW) goto exit; } ret = ldap_search_stW( ld, baseW, scope, filterW, attrsW, attrsonly, timeout, res ); exit: strfreeW( baseW ); strfreeW( filterW ); strarrayfreeW( attrsW ); #endif return ret; }
/*********************************************************************** * ldap_searchA (WLDAP32.@) * * See ldap_searchW. */ ULONG CDECL ldap_searchA( WLDAP32_LDAP *ld, PCHAR base, ULONG scope, PCHAR filter, PCHAR attrs[], ULONG attrsonly ) { ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED; #ifdef HAVE_LDAP WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL; ret = WLDAP32_LDAP_NO_MEMORY; TRACE( "(%p, %s, 0x%08x, %s, %p, 0x%08x)\n", ld, debugstr_a(base), scope, debugstr_a(filter), attrs, attrsonly ); if (!ld) return ~0u; if (base) { baseW = strAtoW( base ); if (!baseW) goto exit; } if (filter) { filterW = strAtoW( filter ); if (!filterW) goto exit; } if (attrs) { attrsW = strarrayAtoW( attrs ); if (!attrsW) goto exit; } ret = ldap_searchW( ld, baseW, scope, filterW, attrsW, attrsonly ); exit: strfreeW( baseW ); strfreeW( filterW ); strarrayfreeW( attrsW ); #endif return ret; }