wldap32: Fix build against latest OpenLDAP release.

This commit is contained in:
Hans Leidekker 2007-11-08 12:35:36 +01:00 committed by Alexandre Julliard
parent 8ae0eeafc6
commit 032dbfe474
5 changed files with 94 additions and 11 deletions

10
configure vendored
View File

@ -12902,11 +12902,19 @@ LIBS="$LIBS $LDAPLIBS $LIBPTHREAD"
for ac_func in \
ldap_count_references \
ldap_first_reference \
ldap_next_reference \
ldap_parse_reference
ldap_parse_reference \
ldap_parse_sort_control \
ldap_parse_sortresponse_control \
ldap_parse_vlv_control \
ldap_parse_vlvresponse_control
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5

View File

@ -864,7 +864,11 @@ then
ldap_count_references \
ldap_first_reference \
ldap_next_reference \
ldap_parse_reference,
ldap_parse_reference \
ldap_parse_sort_control \
ldap_parse_sortresponse_control \
ldap_parse_vlv_control \
ldap_parse_vlvresponse_control,
[$LDAPLIBS $LIBPTHREAD])
fi
WINE_NOTICE_IF([test "x$LDAPLIBS" = "x"],[libldap (OpenLDAP) development files not found.

View File

@ -325,7 +325,13 @@ ULONG CDECL ldap_parse_sort_controlW( WLDAP32_LDAP *ld, PLDAPControlW *control,
#ifdef HAVE_LDAP
char *attrU = NULL;
LDAPControl **controlU = NULL;
#ifdef HAVE_LDAP_PARSE_SORT_CONTROL
unsigned long res;
#elif defined(HAVE_LDAP_PARSE_SORTRESPONSE_CONTROL)
ber_int_t res;
LDAPControl *sortcontrol = NULL;
unsigned int i;
#endif
TRACE( "(%p, %p, %p, %p)\n", ld, control, result, attr );
@ -336,10 +342,29 @@ ULONG CDECL ldap_parse_sort_controlW( WLDAP32_LDAP *ld, PLDAPControlW *control,
if (!controlU) return WLDAP32_LDAP_NO_MEMORY;
}
ret = ldap_parse_sort_control( ld, controlU, &res, &attrU );
*result = res;
*attr = strUtoW( attrU );
#ifdef HAVE_LDAP_PARSE_SORT_CONTROL
if (!(ret = ldap_parse_sort_control( ld, controlU, &res, &attrU )))
{
*result = res;
*attr = strUtoW( attrU );
}
#elif defined(HAVE_LDAP_PARSE_SORTRESPONSE_CONTROL)
for (i = 0; controlU[i]; i++)
{
if (!strcmp( LDAP_SERVER_RESP_SORT_OID, controlU[i]->ldctl_oid ))
sortcontrol = controlU[i];
}
if (!sortcontrol)
{
controlarrayfreeU( controlU );
return WLDAP32_LDAP_CONTROL_NOT_FOUND;
}
if (!(ret = ldap_parse_sortresponse_control( ld, sortcontrol, &res, &attrU )))
{
*result = res;
*attr = strUtoW( attrU );
}
#endif
controlarrayfreeU( controlU );
#endif
@ -405,7 +430,13 @@ INT CDECL ldap_parse_vlv_controlW( WLDAP32_LDAP *ld, PLDAPControlW *control,
int ret = LDAP_NOT_SUPPORTED;
#ifdef HAVE_LDAP
LDAPControl **controlU = NULL;
#ifdef HAVE_LDAP_PARSE_VLV_CONTROL
unsigned long pos, count;
#elif defined(HAVE_LDAP_PARSE_VLVRESPONSE_CONTROL)
ber_int_t pos, count;
LDAPControl *vlvcontrol = NULL;
unsigned int i;
#endif
TRACE( "(%p, %p, %p, %p, %p, %p)\n", ld, control, targetpos,
listcount, context, errcode );
@ -417,11 +448,31 @@ INT CDECL ldap_parse_vlv_controlW( WLDAP32_LDAP *ld, PLDAPControlW *control,
if (!controlU) return WLDAP32_LDAP_NO_MEMORY;
}
ret = ldap_parse_vlv_control( ld, controlU, &pos, &count,
(struct berval **)context, errcode );
*targetpos = pos;
*listcount = count;
#ifdef HAVE_LDAP_PARSE_VLV_CONTROL
if (!(ret = ldap_parse_vlv_control( ld, controlU, &pos, &count,
(struct berval **)context, errcode )))
{
*targetpos = pos;
*listcount = count;
}
#elif defined(HAVE_LDAP_PARSE_VLVRESPONSE_CONTROL)
for (i = 0; controlU[i]; i++)
{
if (!strcmp( LDAP_CONTROL_VLVRESPONSE, controlU[i]->ldctl_oid ))
vlvcontrol = controlU[i];
}
if (!vlvcontrol)
{
controlarrayfreeU( controlU );
return WLDAP32_LDAP_CONTROL_NOT_FOUND;
}
if (!(ret = ldap_parse_vlvresponse_control( ld, vlvcontrol, &pos, &count,
(struct berval **)context, errcode )))
{
*targetpos = pos;
*listcount = count;
}
#endif
controlarrayfreeU( controlU );
#endif

View File

@ -190,6 +190,14 @@ typedef struct WLDAP32_berval
#define LDAP_PAGED_RESULT_OID_STRING_W (const WCHAR []){'1','.','2','.', \
'8','4','0','.','1','1','3','5','5','6','.','1','.','4','.','3','1','9',0}
#define LDAP_SERVER_RESP_SORT_OID "1.2.840.113556.1.4.474"
#define LDAP_SERVER_RESP_SORT_OID_W (const WCHAR []){'1','.','2','.', \
'8','4','0','.','1','1','3','5','5','6','.','1','.','4','.','4','7','4',0}
#define LDAP_CONTROL_VLVRESPONSE "2.16.840.1.113730.3.4.10"
#define LDAP_CONTROL_VLVRESPONSE_W (const WCHAR []){'2','.','1','6','.', \
'8','4','0','.','1','.','1','1','3','7','3','0','.','3','.','4','.','1','0',0}
typedef struct ldapcontrolA
{
PCHAR ldctl_oid;

View File

@ -288,6 +288,18 @@
/* Define to 1 if you have the `ldap_parse_reference' function. */
#undef HAVE_LDAP_PARSE_REFERENCE
/* Define to 1 if you have the `ldap_parse_sortresponse_control' function. */
#undef HAVE_LDAP_PARSE_SORTRESPONSE_CONTROL
/* Define to 1 if you have the `ldap_parse_sort_control' function. */
#undef HAVE_LDAP_PARSE_SORT_CONTROL
/* Define to 1 if you have the `ldap_parse_vlvresponse_control' function. */
#undef HAVE_LDAP_PARSE_VLVRESPONSE_CONTROL
/* Define to 1 if you have the `ldap_parse_vlv_control' function. */
#undef HAVE_LDAP_PARSE_VLV_CONTROL
/* Define if you have libaudioIO */
#undef HAVE_LIBAUDIOIO