Commit d08d6f51 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wldap32: Use the bundled liblber and libldap.

parent 17021e53
......@@ -652,8 +652,6 @@ ac_header_c_list=
ac_subst_vars='LTLIBOBJS
LIBOBJS
TAGSFLAGS
LDAP_LIBS
LDAP_CFLAGS
RT_LIBS
DELAYLOADFLAG
MSVCRTFLAGS
......@@ -723,6 +721,8 @@ PNG_PE_LIBS
PNG_PE_CFLAGS
MPG123_PE_LIBS
MPG123_PE_CFLAGS
LDAP_PE_LIBS
LDAP_PE_CFLAGS
LCMS2_PE_LIBS
LCMS2_PE_CFLAGS
JXR_PE_LIBS
......@@ -921,7 +921,6 @@ with_gssapi
with_gstreamer
with_inotify
with_krb5
with_ldap
with_mingw
with_netapi
with_opencl
......@@ -1714,6 +1713,8 @@ JXR_PE_CFLAGS
JXR_PE_LIBS
LCMS2_PE_CFLAGS
LCMS2_PE_LIBS
LDAP_PE_CFLAGS
LDAP_PE_LIBS
MPG123_PE_CFLAGS
MPG123_PE_LIBS
PNG_PE_CFLAGS
......@@ -1767,9 +1768,7 @@ KRB5_LIBS
GSSAPI_CFLAGS
GSSAPI_LIBS
NETAPI_CFLAGS
NETAPI_LIBS
LDAP_CFLAGS
LDAP_LIBS'
NETAPI_LIBS'
# Initialize some variables set by options.
......@@ -2428,7 +2427,6 @@ Optional Packages:
--without-gstreamer do not use GStreamer (codecs support)
--without-inotify do not use inotify (filesystem change notifications)
--without-krb5 do not use krb5 (Kerberos)
--without-ldap do not use LDAP
--without-mingw do not use the MinGW cross-compiler
--without-netapi do not use the Samba NetAPI library
--without-opencl do not use OpenCL
......@@ -2496,6 +2494,10 @@ Some influential environment variables:
version
LCMS2_PE_LIBS
Linker flags for the PE lcms2, overriding the bundled version
LDAP_PE_CFLAGS
C compiler flags for the PE ldap, overriding the bundled version
LDAP_PE_LIBS
Linker flags for the PE ldap, overriding the bundled version
MPG123_PE_CFLAGS
C compiler flags for the PE mpg123, overriding the bundled
version
......@@ -2585,8 +2587,6 @@ Some influential environment variables:
NETAPI_CFLAGS
C compiler flags for netapi, overriding pkg-config
NETAPI_LIBS Linker flags for netapi, overriding pkg-config
LDAP_CFLAGS C compiler flags for openldap, overriding pkg-config
LDAP_LIBS Linker flags for openldap, overriding pkg-config
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
......@@ -4281,13 +4281,6 @@ then :
fi
# Check whether --with-ldap was given.
if test ${with_ldap+y}
then :
withval=$with_ldap; if test "x$withval" = "xno"; then ac_cv_header_ldap_h=no; ac_cv_header_lber_h=no; fi
fi
# Check whether --with-mingw was given.
if test ${with_mingw+y}
then :
......@@ -8130,12 +8123,6 @@ then :
printf "%s\n" "#define HAVE_PWD_H 1" >>confdefs.h
fi
ac_fn_c_check_header_compile "$LINENO" "sasl/sasl.h" "ac_cv_header_sasl_sasl_h" "$ac_includes_default"
if test "x$ac_cv_header_sasl_sasl_h" = xyes
then :
printf "%s\n" "#define HAVE_SASL_SASL_H 1" >>confdefs.h
fi
ac_fn_c_check_header_compile "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default"
if test "x$ac_cv_header_sched_h" = xyes
then :
......@@ -13409,6 +13396,21 @@ fi
printf "%s\n" "$as_me:${as_lineno-$LINENO}: lcms2 cflags: $LCMS2_PE_CFLAGS" >&5
printf "%s\n" "$as_me:${as_lineno-$LINENO}: lcms2 libs: $LCMS2_PE_LIBS" >&5
if ${LDAP_PE_LIBS:+false} :
then :
LDAP_PE_LIBS=ldap
if ${LDAP_PE_CFLAGS:+false} :
then :
LDAP_PE_CFLAGS="-I\$(top_srcdir)/libs/ldap/include"
else $as_nop
enable_ldap=no
fi
else $as_nop
enable_ldap=no
fi
printf "%s\n" "$as_me:${as_lineno-$LINENO}: ldap cflags: $LDAP_PE_CFLAGS" >&5
printf "%s\n" "$as_me:${as_lineno-$LINENO}: ldap libs: $LDAP_PE_LIBS" >&5
if ${MPG123_PE_LIBS:+false} :
then :
MPG123_PE_LIBS=mpg123
......@@ -20077,154 +20079,6 @@ fi
;;
esac
if test "x$with_ldap" != "xno"
then
if ${LDAP_CFLAGS:+false} :
then :
if test ${PKG_CONFIG+y}
then :
LDAP_CFLAGS=`$PKG_CONFIG --cflags openldap 2>/dev/null`
fi
fi
if ${LDAP_LIBS:+false} :
then :
if test ${PKG_CONFIG+y}
then :
LDAP_LIBS=`$PKG_CONFIG --libs openldap 2>/dev/null`
fi
fi
LDAP_LIBS=${LDAP_LIBS:-"-lldap -llber"}
printf "%s\n" "$as_me:${as_lineno-$LINENO}: openldap cflags: $LDAP_CFLAGS" >&5
printf "%s\n" "$as_me:${as_lineno-$LINENO}: openldap libs: $LDAP_LIBS" >&5
ac_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $LDAP_CFLAGS"
ac_fn_c_check_header_compile "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default"
if test "x$ac_cv_header_ldap_h" = xyes
then :
printf "%s\n" "#define HAVE_LDAP_H 1" >>confdefs.h
fi
ac_fn_c_check_header_compile "$LINENO" "lber.h" "ac_cv_header_lber_h" "$ac_includes_default"
if test "x$ac_cv_header_lber_h" = xyes
then :
printf "%s\n" "#define HAVE_LBER_H 1" >>confdefs.h
fi
if test "$ac_cv_header_ldap_h" = "yes" -a "$ac_cv_header_lber_h" = "yes"
then
ac_fn_c_check_type "$LINENO" "LDAPSortKey" "ac_cv_type_LDAPSortKey" "#include <ldap.h>
"
if test "x$ac_cv_type_LDAPSortKey" = xyes
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ldap_initialize in -lldap" >&5
printf %s "checking for ldap_initialize in -lldap... " >&6; }
if test ${ac_cv_lib_ldap_ldap_initialize+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lldap $PTHREAD_LIBS $LDAP_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char ldap_initialize ();
int
main (void)
{
return ldap_initialize ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_ldap_ldap_initialize=yes
else $as_nop
ac_cv_lib_ldap_ldap_initialize=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_initialize" >&5
printf "%s\n" "$ac_cv_lib_ldap_ldap_initialize" >&6; }
if test "x$ac_cv_lib_ldap_ldap_initialize" = xyes
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ber_init in -llber" >&5
printf %s "checking for ber_init in -llber... " >&6; }
if test ${ac_cv_lib_lber_ber_init+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-llber $PTHREAD_LIBS $LDAP_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char ber_init ();
int
main (void)
{
return ber_init ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_lber_ber_init=yes
else $as_nop
ac_cv_lib_lber_ber_init=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lber_ber_init" >&5
printf "%s\n" "$ac_cv_lib_lber_ber_init" >&6; }
if test "x$ac_cv_lib_lber_ber_init" = xyes
then :
printf "%s\n" "#define HAVE_LDAP 1" >>confdefs.h
else $as_nop
LDAP_LIBS=""
fi
else $as_nop
LDAP_LIBS=""
fi
else $as_nop
LDAP_LIBS=""
fi
else
LDAP_LIBS=""
fi
CPPFLAGS=$ac_save_CPPFLAGS
fi
if test "x$LDAP_LIBS" = "x"
then :
case "x$with_ldap" in
x) as_fn_append wine_notices "|libldap (OpenLDAP) ${notice_platform}development files not found, LDAP won't be supported." ;;
xno) ;;
*) as_fn_error $? "libldap (OpenLDAP) ${notice_platform}development files not found, LDAP won't be supported.
This is an error since --with-ldap was requested." "$LINENO" 5 ;;
esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sched_setaffinity" >&5
printf %s "checking for sched_setaffinity... " >&6; }
if test ${wine_cv_have_sched_setaffinity+y}
......@@ -23316,6 +23170,8 @@ JXR_PE_CFLAGS = $JXR_PE_CFLAGS
JXR_PE_LIBS = $JXR_PE_LIBS
LCMS2_PE_CFLAGS = $LCMS2_PE_CFLAGS
LCMS2_PE_LIBS = $LCMS2_PE_LIBS
LDAP_PE_CFLAGS = $LDAP_PE_CFLAGS
LDAP_PE_LIBS = $LDAP_PE_LIBS
MPG123_PE_CFLAGS = $MPG123_PE_CFLAGS
MPG123_PE_LIBS = $MPG123_PE_LIBS
PNG_PE_CFLAGS = $PNG_PE_CFLAGS
......@@ -23385,8 +23241,6 @@ NETAPI_LIBS = $NETAPI_LIBS
MSVCRTFLAGS = $MSVCRTFLAGS
DELAYLOADFLAG = $DELAYLOADFLAG
RT_LIBS = $RT_LIBS
LDAP_CFLAGS = $LDAP_CFLAGS
LDAP_LIBS = $LDAP_LIBS
TAGSFLAGS = $TAGSFLAGS
LIBOBJS = $LIBOBJS
LTLIBOBJS = $LTLIBOBJS
......
......@@ -42,8 +42,6 @@ AC_ARG_WITH(gssapi, AS_HELP_STRING([--without-gssapi],[do not use GSSAPI (Ker
AC_ARG_WITH(gstreamer, AS_HELP_STRING([--without-gstreamer],[do not use GStreamer (codecs support)]))
AC_ARG_WITH(inotify, AS_HELP_STRING([--without-inotify],[do not use inotify (filesystem change notifications)]))
AC_ARG_WITH(krb5, AS_HELP_STRING([--without-krb5],[do not use krb5 (Kerberos)]))
AC_ARG_WITH(ldap, AS_HELP_STRING([--without-ldap],[do not use LDAP]),
[if test "x$withval" = "xno"; then ac_cv_header_ldap_h=no; ac_cv_header_lber_h=no; fi])
AC_ARG_WITH(mingw, AS_HELP_STRING([--without-mingw],[do not use the MinGW cross-compiler]))
AC_ARG_WITH(netapi, AS_HELP_STRING([--without-netapi],[do not use the Samba NetAPI library]))
AC_ARG_WITH(opencl, AS_HELP_STRING([--without-opencl],[do not use OpenCL]),
......@@ -456,7 +454,6 @@ AC_CHECK_HEADERS(\
port.h \
pthread.h \
pwd.h \
sasl/sasl.h \
sched.h \
scsi/scsi.h \
scsi/scsi_ioctl.h \
......@@ -1183,6 +1180,7 @@ WINE_EXTLIB_FLAGS(GSM, gsm, gsm, "-I\$(top_srcdir)/libs/gsm/inc")
WINE_EXTLIB_FLAGS(JPEG, jpeg, jpeg, "-I\$(top_srcdir)/libs/jpeg")
WINE_EXTLIB_FLAGS(JXR, jxr, jxr, "-I\$(top_srcdir)/libs/jxr/jxrgluelib -I\$(top_srcdir)/libs/jxr/image/sys")
WINE_EXTLIB_FLAGS(LCMS2, lcms2, lcms2, "-I\$(top_srcdir)/libs/lcms2/include")
WINE_EXTLIB_FLAGS(LDAP, ldap, ldap, "-I\$(top_srcdir)/libs/ldap/include")
WINE_EXTLIB_FLAGS(MPG123, mpg123, mpg123, "-I\$(top_srcdir)/libs/mpg123/src/libmpg123")
WINE_EXTLIB_FLAGS(PNG, png, "png \$(ZLIB_PE_LIBS)", "-I\$(top_srcdir)/libs/png")
WINE_EXTLIB_FLAGS(TIFF, tiff, "tiff \$(ZLIB_PE_LIBS)", "-I\$(top_srcdir)/libs/tiff/libtiff")
......@@ -2078,31 +2076,6 @@ case $host_os in
;;
esac
dnl **** Check for OpenLDAP ***
if test "x$with_ldap" != "xno"
then
dnl Actually there's no pkg-config support for ldap, but this way we can still override the flags
WINE_PACKAGE_FLAGS(LDAP,[openldap],[-lldap -llber],,,
[AC_CHECK_HEADERS([ldap.h lber.h])
if test "$ac_cv_header_ldap_h" = "yes" -a "$ac_cv_header_lber_h" = "yes"
then
AC_CHECK_TYPE(LDAPSortKey,
[AC_CHECK_LIB(ldap, ldap_initialize,
[AC_CHECK_LIB(lber, ber_init,
[AC_DEFINE(HAVE_LDAP, 1, [Define if you have the OpenLDAP development environment])],
[LDAP_LIBS=""],
[$PTHREAD_LIBS $LDAP_LIBS])],
[LDAP_LIBS=""],
[$PTHREAD_LIBS $LDAP_LIBS])],
[LDAP_LIBS=""],
[#include <ldap.h>])
else
LDAP_LIBS=""
fi])
fi
WINE_NOTICE_WITH(ldap,[test "x$LDAP_LIBS" = "x"],
[libldap (OpenLDAP) ${notice_platform}development files not found, LDAP won't be supported.])
AC_CACHE_CHECK([for sched_setaffinity],wine_cv_have_sched_setaffinity,
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <sched.h>]], [[sched_setaffinity(0, 0, 0);]])],[wine_cv_have_sched_setaffinity=yes],[wine_cv_have_sched_setaffinity=no]))
......
MODULE = wldap32.dll
UNIXLIB = wldap32.so
IMPORTLIB = wldap32
IMPORTS = user32
UNIX_CFLAGS = $(LDAP_CFLAGS)
UNIX_LIBS = $(LDAP_LIBS)
IMPORTS = $(LDAP_PE_LIBS) secur32 ws2_32 user32
EXTRAINCL = $(LDAP_PE_CFLAGS)
C_SRCS = \
add.c \
......@@ -16,7 +14,6 @@ C_SRCS = \
error.c \
extended.c \
init.c \
libldap.c \
main.c \
misc.c \
modify.c \
......
......@@ -22,7 +22,6 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap.h"
#include "wine/debug.h"
#include "winldap_private.h"
......@@ -105,8 +104,8 @@ ULONG CDECL ldap_add_extW( LDAP *ld, WCHAR *dn, LDAPModW **attrs, LDAPControlW *
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL;
LDAPModU **attrsU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
LDAPMod **attrsU = NULL;
LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
TRACE( "(%p, %s, %p, %p, %p, %p)\n", ld, debugstr_w(dn), attrs, serverctrls, clientctrls, message );
......@@ -118,8 +117,7 @@ ULONG CDECL ldap_add_extW( LDAP *ld, WCHAR *dn, LDAPModW **attrs, LDAPControlW *
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
else
{
struct ldap_add_ext_params params = { CTX(ld), dnU, attrsU, serverctrlsU, clientctrlsU, message };
ret = map_error( LDAP_CALL( ldap_add_ext, &params ));
ret = map_error( ldap_add_ext( CTX(ld), dnU, attrsU, serverctrlsU, clientctrlsU, (int *)message ) );
}
exit:
......@@ -168,8 +166,8 @@ ULONG CDECL ldap_add_ext_sW( LDAP *ld, WCHAR *dn, LDAPModW **attrs, LDAPControlW
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL;
LDAPModU **attrsU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
LDAPMod **attrsU = NULL;
LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_w(dn), attrs, serverctrls, clientctrls );
......@@ -181,8 +179,7 @@ ULONG CDECL ldap_add_ext_sW( LDAP *ld, WCHAR *dn, LDAPModW **attrs, LDAPControlW
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
else
{
struct ldap_add_ext_s_params params = { CTX(ld), dnU, attrsU, serverctrlsU, clientctrlsU };
ret = map_error( LDAP_CALL( ldap_add_ext_s, &params ));
ret = map_error( ldap_add_ext_s( CTX(ld), dnU, attrsU, serverctrlsU, clientctrlsU ) );
}
exit:
......
......@@ -22,7 +22,6 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap.h"
#include "wine/debug.h"
#include "winldap_private.h"
......@@ -71,9 +70,8 @@ ULONG CDECL ldap_compareW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value )
/***********************************************************************
* ldap_compare_extA (WLDAP32.@)
*/
ULONG CDECL ldap_compare_extA( LDAP *ld, char *dn, char *attr, char *value,
struct berval *data, LDAPControlA **serverctrls, LDAPControlA **clientctrls,
ULONG *message )
ULONG CDECL ldap_compare_extA( LDAP *ld, char *dn, char *attr, char *value, struct WLDAP32_berval *data,
LDAPControlA **serverctrls, LDAPControlA **clientctrls, ULONG *message )
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *dnW = NULL, *attrW = NULL, *valueW = NULL;
......@@ -104,13 +102,13 @@ exit:
/***********************************************************************
* ldap_compare_extW (WLDAP32.@)
*/
ULONG CDECL ldap_compare_extW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, struct berval *data,
ULONG CDECL ldap_compare_extW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, struct WLDAP32_berval *data,
LDAPControlW **serverctrls, LDAPControlW **clientctrls, ULONG *message )
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL, *attrU = NULL, *valueU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
struct bervalU *dataU = NULL, val = { 0, NULL };
LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
struct berval *dataU = NULL, val = { 0, NULL };
TRACE( "(%p, %s, %s, %s, %p, %p, %p, %p)\n", ld, debugstr_w(dn), debugstr_w(attr), debugstr_w(value),
data, serverctrls, clientctrls, message );
......@@ -135,8 +133,8 @@ ULONG CDECL ldap_compare_extW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, s
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
else
{
struct ldap_compare_ext_params params = { CTX(ld), dnU, attrU, dataU ? dataU : &val, serverctrlsU, clientctrlsU, message };
ret = map_error( LDAP_CALL( ldap_compare_ext, &params ));
ret = map_error( ldap_compare_ext( CTX(ld), dnU, attrU, dataU ? dataU : &val, serverctrlsU, clientctrlsU,
(int *)message ) );
}
exit:
......@@ -152,7 +150,7 @@ exit:
/***********************************************************************
* ldap_compare_ext_sA (WLDAP32.@)
*/
ULONG CDECL ldap_compare_ext_sA( LDAP *ld, char *dn, char *attr, char *value, struct berval *data,
ULONG CDECL ldap_compare_ext_sA( LDAP *ld, char *dn, char *attr, char *value, struct WLDAP32_berval *data,
LDAPControlA **serverctrls, LDAPControlA **clientctrls )
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
......@@ -184,13 +182,13 @@ exit:
/***********************************************************************
* ldap_compare_ext_sW (WLDAP32.@)
*/
ULONG CDECL ldap_compare_ext_sW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, struct berval *data,
ULONG CDECL ldap_compare_ext_sW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, struct WLDAP32_berval *data,
LDAPControlW **serverctrls, LDAPControlW **clientctrls )
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL, *attrU = NULL, *valueU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
struct bervalU *dataU = NULL, val = { 0, NULL };
LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
struct berval *dataU = NULL, val = { 0, NULL };
TRACE( "(%p, %s, %s, %s, %p, %p, %p)\n", ld, debugstr_w(dn), debugstr_w(attr), debugstr_w(value), data,
serverctrls, clientctrls );
......@@ -214,8 +212,7 @@ ULONG CDECL ldap_compare_ext_sW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value,
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
else
{
struct ldap_compare_ext_s_params params = { CTX(ld), dnU, attrU, dataU ? dataU : &val, serverctrlsU, clientctrlsU };
ret = map_error( LDAP_CALL( ldap_compare_ext_s, &params ));
ret = map_error( ldap_compare_ext_s( CTX(ld), dnU, attrU, dataU ? dataU : &val, serverctrlsU, clientctrlsU ) );
}
exit:
free( dnU );
......
......@@ -22,7 +22,6 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap.h"
#include "wine/debug.h"
#include "winldap_private.h"
......@@ -103,26 +102,22 @@ ULONG CDECL ldap_create_sort_controlA( LDAP *ld, LDAPSortKeyA **sortkey, UCHAR c
ULONG CDECL ldap_create_sort_controlW( LDAP *ld, LDAPSortKeyW **sortkey, UCHAR critical, LDAPControlW **control )
{
ULONG ret;
LDAPSortKeyU **sortkeyU;
LDAPControlU *controlU;
LDAPSortKey **sortkeyU;
LDAPControl *controlU;
TRACE( "(%p, %p, 0x%02x, %p)\n", ld, sortkey, critical, control );
if (!ld || !sortkey || !control) return WLDAP32_LDAP_PARAM_ERROR;
if ((sortkeyU = sortkeyarrayWtoU( sortkey )))
{
struct ldap_create_sort_control_params params = { CTX(ld), sortkeyU, critical, &controlU };
ret = map_error( LDAP_CALL( ldap_create_sort_control, &params ));
}
else return WLDAP32_LDAP_NO_MEMORY;
if (!(sortkeyU = sortkeyarrayWtoU( sortkey ))) return WLDAP32_LDAP_NO_MEMORY;
ret = map_error( ldap_create_sort_control( CTX(ld), sortkeyU, critical, &controlU ) );
if (ret == WLDAP32_LDAP_SUCCESS)
{
LDAPControlW *controlW = controlUtoW( controlU );
if (controlW) *control = controlW;
else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ldap_control_free, controlU );
ldap_control_free( controlU );
}
sortkeyarrayfreeU( sortkeyU );
......@@ -132,7 +127,7 @@ ULONG CDECL ldap_create_sort_controlW( LDAP *ld, LDAPSortKeyW **sortkey, UCHAR c
/***********************************************************************
* ldap_create_vlv_controlA (WLDAP32.@)
*/
INT CDECL ldap_create_vlv_controlA( LDAP *ld, LDAPVLVInfo *info, UCHAR critical, LDAPControlA **control )
INT CDECL ldap_create_vlv_controlA( LDAP *ld, WLDAP32_LDAPVLVInfo *info, UCHAR critical, LDAPControlA **control )
{
INT ret;
LDAPControlW *controlW;
......@@ -156,35 +151,32 @@ INT CDECL ldap_create_vlv_controlA( LDAP *ld, LDAPVLVInfo *info, UCHAR critical,
/***********************************************************************
* ldap_create_vlv_controlW (WLDAP32.@)
*/
INT CDECL ldap_create_vlv_controlW( LDAP *ld, LDAPVLVInfo *info, UCHAR critical, LDAPControlW **control )
INT CDECL ldap_create_vlv_controlW( LDAP *ld, WLDAP32_LDAPVLVInfo *info, UCHAR critical, LDAPControlW **control )
{
ULONG ret;
LDAPVLVInfoU *infoU = NULL;
LDAPControlU *controlU;
LDAPVLVInfo *infoU = NULL;
LDAPControl *controlU;
TRACE( "(%p, %p, 0x%02x, %p)\n", ld, info, critical, control );
if (!ld || !control) return ~0u;
if (info && !(infoU = vlvinfoWtoU( info ))) return WLDAP32_LDAP_NO_MEMORY;
else
{
struct ldap_create_vlv_control_params params = { CTX(ld), infoU, &controlU };
ret = map_error( LDAP_CALL( ldap_create_vlv_control, &params ));
}
ret = map_error( ldap_create_vlv_control( CTX(ld), infoU, &controlU ) );
if (ret == WLDAP32_LDAP_SUCCESS)
{
LDAPControlW *controlW = controlUtoW( controlU );
if (controlW) *control = controlW;
else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ldap_control_free, controlU );
ldap_control_free( controlU );
}
vlvinfofreeU( infoU );
return ret;
}
static inline void bv_val_dup( const struct berval *src, struct berval *dst )
static inline void bv_val_dup( const struct WLDAP32_berval *src, struct WLDAP32_berval *dst )
{
if ((dst->bv_val = RtlAllocateHeap( GetProcessHeap(), 0 , src->bv_len )))
{
......
......@@ -22,7 +22,6 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap.h"
#include "wine/debug.h"
#include "winldap_private.h"
......@@ -96,7 +95,7 @@ ULONG CDECL ldap_delete_extW( LDAP *ld, WCHAR *dn, LDAPControlW **serverctrls, L
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_w(dn), serverctrls, clientctrls, message );
......@@ -107,8 +106,7 @@ ULONG CDECL ldap_delete_extW( LDAP *ld, WCHAR *dn, LDAPControlW **serverctrls, L
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
else
{
struct ldap_delete_ext_params params = { CTX(ld), dnU, serverctrlsU, clientctrlsU, message };
ret = map_error( LDAP_CALL( ldap_delete_ext, &params ));
ret = map_error( ldap_delete_ext( CTX(ld), dnU, serverctrlsU, clientctrlsU, (int *)message ) );
}
exit:
......@@ -151,7 +149,7 @@ ULONG CDECL ldap_delete_ext_sW( LDAP *ld, WCHAR *dn, LDAPControlW **serverctrls,
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
TRACE( "(%p, %s, %p, %p)\n", ld, debugstr_w(dn), serverctrls, clientctrls );
......@@ -162,8 +160,7 @@ ULONG CDECL ldap_delete_ext_sW( LDAP *ld, WCHAR *dn, LDAPControlW **serverctrls,
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
else
{
struct ldap_delete_ext_s_params params = { CTX(ld), dnU, serverctrlsU, clientctrlsU };
ret = map_error( LDAP_CALL( ldap_delete_ext_s, &params ));
ret = map_error( ldap_delete_ext_s( CTX(ld), dnU, serverctrlsU, clientctrlsU ) );
}
exit:
......
......@@ -22,7 +22,6 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap.h"
#include "wine/debug.h"
#include "winldap_private.h"
......@@ -34,16 +33,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
*/
char * CDECL ldap_dn2ufnA( char *dn )
{
char *ret;
char *ret = NULL;
WCHAR *dnW, *retW;
TRACE( "(%s)\n", debugstr_a(dn) );
if (!(dnW = strAtoW( dn ))) return NULL;
retW = ldap_dn2ufnW( dnW );
ret = strWtoA( retW );
if ((retW = ldap_dn2ufnW( dnW ))) ret = strWtoA( retW );
free( dnW );
ldap_memfreeW( retW );
return ret;
......@@ -59,16 +55,10 @@ WCHAR * CDECL ldap_dn2ufnW( WCHAR *dn )
TRACE( "(%s)\n", debugstr_w(dn) );
if ((dnU = strWtoU( dn )))
{
struct ldap_dn2ufn_params params = { dnU, &retU };
LDAP_CALL( ldap_dn2ufn, &params );
ret = strUtoW( retU );
if (!(dnU = strWtoU( dn ))) return NULL;
if ((retU = ldap_dn2ufn( dnU ))) ret = strUtoW( retU );
free( dnU );
LDAP_CALL( ldap_memfree, retU );
}
ldap_memfree( retU );
return ret;
}
......@@ -77,16 +67,13 @@ WCHAR * CDECL ldap_dn2ufnW( WCHAR *dn )
*/
char ** CDECL ldap_explode_dnA( char *dn, ULONG notypes )
{
char **ret;
char **ret = NULL;
WCHAR *dnW, **retW;
TRACE( "(%s, %#lx)\n", debugstr_a(dn), notypes );
if (!(dnW = strAtoW( dn ))) return NULL;
retW = ldap_explode_dnW( dnW, notypes );
ret = strarrayWtoA( retW );
if ((retW = ldap_explode_dnW( dnW, notypes ))) ret = strarrayWtoA( retW );
free( dnW );
ldap_value_freeW( retW );
return ret;
......@@ -102,15 +89,10 @@ WCHAR ** CDECL ldap_explode_dnW( WCHAR *dn, ULONG notypes )
TRACE( "(%s, %#lx)\n", debugstr_w(dn), notypes );
if ((dnU = strWtoU( dn )))
{
struct ldap_explode_dn_params params = { dnU, notypes, &retU };
LDAP_CALL( ldap_explode_dn, &params );
ret = strarrayUtoW( retU );
if (!(dnU = strWtoU( dn ))) return NULL;
if ((retU = ldap_explode_dn( dnU, notypes ))) ret = strarrayUtoW( retU );
free( dnU );
LDAP_CALL( ldap_memvfree, retU );
}
ldap_memvfree( (void **)retU );
return ret;
}
......@@ -119,16 +101,14 @@ WCHAR ** CDECL ldap_explode_dnW( WCHAR *dn, ULONG notypes )
*/
char * CDECL ldap_get_dnA( LDAP *ld, LDAPMessage *entry )
{
char *ret;
char *ret = NULL;
WCHAR *retW;
TRACE( "(%p, %p)\n", ld, entry );
if (!ld || !entry) return NULL;
retW = ldap_get_dnW( ld, entry );
ret = strWtoA( retW );
if ((retW = ldap_get_dnW( ld, entry ))) ret = strWtoA( retW );
ldap_memfreeW( retW );
return ret;
}
......@@ -145,11 +125,8 @@ WCHAR * CDECL ldap_get_dnW( LDAP *ld, LDAPMessage *entry )
if (ld && entry)
{
struct ldap_get_dn_params params = { CTX(ld), MSG(entry), &retU };
LDAP_CALL( ldap_get_dn, &params );
ret = strUtoW( retU );
LDAP_CALL( ldap_memfree, retU );
if ((retU = ldap_get_dn( CTX(ld), MSG(entry) ))) ret = strUtoW( retU );
ldap_memfree( retU );
}
return ret;
}
......
......@@ -23,7 +23,6 @@
#include "winbase.h"
#include "winuser.h"
#include "winnls.h"
#include "winldap.h"
#include "wine/debug.h"
#include "winldap_private.h"
......@@ -36,25 +35,69 @@ ULONG map_error( int error )
{
switch (error)
{
case 0: return WLDAP32_LDAP_SUCCESS;
case -1: return WLDAP32_LDAP_SERVER_DOWN;
case -2: return WLDAP32_LDAP_LOCAL_ERROR;
case -3: return WLDAP32_LDAP_ENCODING_ERROR;
case -4: return WLDAP32_LDAP_DECODING_ERROR;
case -5: return WLDAP32_LDAP_TIMEOUT;
case -6: return WLDAP32_LDAP_AUTH_UNKNOWN;
case -7: return WLDAP32_LDAP_FILTER_ERROR;
case -8: return WLDAP32_LDAP_USER_CANCELLED;
case -9: return WLDAP32_LDAP_PARAM_ERROR;
case -10: return WLDAP32_LDAP_NO_MEMORY;
case -11: return WLDAP32_LDAP_CONNECT_ERROR;
case -12: return WLDAP32_LDAP_NOT_SUPPORTED;
case -13: return WLDAP32_LDAP_CONTROL_NOT_FOUND;
case -14: return WLDAP32_LDAP_NO_RESULTS_RETURNED;
case -15: return WLDAP32_LDAP_MORE_RESULTS_TO_RETURN;
case -16: return WLDAP32_LDAP_CLIENT_LOOP;
case -17: return WLDAP32_LDAP_REFERRAL_LIMIT_EXCEEDED;
default: return error;
case LDAP_SUCCESS: return WLDAP32_LDAP_SUCCESS;
case LDAP_OPERATIONS_ERROR: return WLDAP32_LDAP_OPERATIONS_ERROR;
case LDAP_PROTOCOL_ERROR: return WLDAP32_LDAP_PROTOCOL_ERROR;
case LDAP_TIMELIMIT_EXCEEDED: return WLDAP32_LDAP_TIMELIMIT_EXCEEDED;
case LDAP_SIZELIMIT_EXCEEDED: return WLDAP32_LDAP_SIZELIMIT_EXCEEDED;
case LDAP_COMPARE_FALSE: return WLDAP32_LDAP_COMPARE_FALSE;
case LDAP_COMPARE_TRUE: return WLDAP32_LDAP_COMPARE_TRUE;
case LDAP_AUTH_METHOD_NOT_SUPPORTED: return WLDAP32_LDAP_AUTH_METHOD_NOT_SUPPORTED;
case LDAP_STRONG_AUTH_REQUIRED: return WLDAP32_LDAP_STRONG_AUTH_REQUIRED;
case LDAP_PARTIAL_RESULTS: return WLDAP32_LDAP_PARTIAL_RESULTS;
case LDAP_REFERRAL: return WLDAP32_LDAP_REFERRAL;
case LDAP_ADMINLIMIT_EXCEEDED: return WLDAP32_LDAP_ADMIN_LIMIT_EXCEEDED;
case LDAP_UNAVAILABLE_CRITICAL_EXTENSION: return WLDAP32_LDAP_UNAVAILABLE_CRIT_EXTENSION;
case LDAP_CONFIDENTIALITY_REQUIRED: return WLDAP32_LDAP_CONFIDENTIALITY_REQUIRED;
case LDAP_SASL_BIND_IN_PROGRESS: return WLDAP32_LDAP_SASL_BIND_IN_PROGRESS;
case LDAP_NO_SUCH_ATTRIBUTE: return WLDAP32_LDAP_NO_SUCH_ATTRIBUTE;
case LDAP_UNDEFINED_TYPE: return WLDAP32_LDAP_UNDEFINED_TYPE;
case LDAP_INAPPROPRIATE_MATCHING: return WLDAP32_LDAP_INAPPROPRIATE_MATCHING;
case LDAP_CONSTRAINT_VIOLATION: return WLDAP32_LDAP_CONSTRAINT_VIOLATION;
case LDAP_TYPE_OR_VALUE_EXISTS: return WLDAP32_LDAP_ATTRIBUTE_OR_VALUE_EXISTS;
case LDAP_INVALID_SYNTAX: return WLDAP32_LDAP_INVALID_SYNTAX;
case LDAP_NO_SUCH_OBJECT: return WLDAP32_LDAP_NO_SUCH_OBJECT;
case LDAP_ALIAS_PROBLEM: return WLDAP32_LDAP_ALIAS_PROBLEM;
case LDAP_INVALID_DN_SYNTAX: return WLDAP32_LDAP_INVALID_DN_SYNTAX;
case LDAP_IS_LEAF: return WLDAP32_LDAP_IS_LEAF;
case LDAP_ALIAS_DEREF_PROBLEM: return WLDAP32_LDAP_ALIAS_DEREF_PROBLEM;
case LDAP_INAPPROPRIATE_AUTH: return WLDAP32_LDAP_INAPPROPRIATE_AUTH;
case LDAP_INVALID_CREDENTIALS: return WLDAP32_LDAP_INVALID_CREDENTIALS;
case LDAP_INSUFFICIENT_ACCESS: return WLDAP32_LDAP_INSUFFICIENT_RIGHTS;
case LDAP_BUSY: return WLDAP32_LDAP_BUSY;
case LDAP_UNAVAILABLE: return WLDAP32_LDAP_UNAVAILABLE;
case LDAP_UNWILLING_TO_PERFORM: return WLDAP32_LDAP_UNWILLING_TO_PERFORM;
case LDAP_LOOP_DETECT: return WLDAP32_LDAP_LOOP_DETECT;
case LDAP_NAMING_VIOLATION: return WLDAP32_LDAP_NAMING_VIOLATION;
case LDAP_OBJECT_CLASS_VIOLATION: return WLDAP32_LDAP_OBJECT_CLASS_VIOLATION;
case LDAP_NOT_ALLOWED_ON_NONLEAF: return WLDAP32_LDAP_NOT_ALLOWED_ON_NONLEAF;
case LDAP_NOT_ALLOWED_ON_RDN: return WLDAP32_LDAP_NOT_ALLOWED_ON_RDN;
case LDAP_ALREADY_EXISTS: return WLDAP32_LDAP_ALREADY_EXISTS;
case LDAP_NO_OBJECT_CLASS_MODS: return WLDAP32_LDAP_NO_OBJECT_CLASS_MODS;
case LDAP_RESULTS_TOO_LARGE: return WLDAP32_LDAP_RESULTS_TOO_LARGE;
case LDAP_AFFECTS_MULTIPLE_DSAS: return WLDAP32_LDAP_AFFECTS_MULTIPLE_DSAS;
case LDAP_VLV_ERROR: return WLDAP32_LDAP_VIRTUAL_LIST_VIEW_ERROR;
case LDAP_OTHER: return WLDAP32_LDAP_OTHER;
case LDAP_SERVER_DOWN: return WLDAP32_LDAP_SERVER_DOWN;
case LDAP_LOCAL_ERROR: return WLDAP32_LDAP_LOCAL_ERROR;
case LDAP_ENCODING_ERROR: return WLDAP32_LDAP_ENCODING_ERROR;
case LDAP_DECODING_ERROR: return WLDAP32_LDAP_DECODING_ERROR;
case LDAP_TIMEOUT: return WLDAP32_LDAP_TIMEOUT;
case LDAP_AUTH_UNKNOWN: return WLDAP32_LDAP_AUTH_UNKNOWN;
case LDAP_FILTER_ERROR: return WLDAP32_LDAP_FILTER_ERROR;
case LDAP_USER_CANCELLED: return WLDAP32_LDAP_USER_CANCELLED;
case LDAP_PARAM_ERROR: return WLDAP32_LDAP_PARAM_ERROR;
case LDAP_NO_MEMORY: return WLDAP32_LDAP_NO_MEMORY;
case LDAP_CONNECT_ERROR: return WLDAP32_LDAP_CONNECT_ERROR;
case LDAP_NOT_SUPPORTED: return WLDAP32_LDAP_NOT_SUPPORTED;
case LDAP_CONTROL_NOT_FOUND: return WLDAP32_LDAP_CONTROL_NOT_FOUND;
case LDAP_NO_RESULTS_RETURNED: return WLDAP32_LDAP_NO_RESULTS_RETURNED;
case LDAP_MORE_RESULTS_TO_RETURN: return WLDAP32_LDAP_MORE_RESULTS_TO_RETURN;
case LDAP_CLIENT_LOOP: return WLDAP32_LDAP_CLIENT_LOOP;
case LDAP_REFERRAL_LIMIT_EXCEEDED: return WLDAP32_LDAP_REFERRAL_LIMIT_EXCEEDED;
default:
FIXME( "no mapping for %d\n", error );
return error;
}
}
......@@ -109,11 +152,9 @@ ULONG CDECL WLDAP32_ldap_result2error( LDAP *ld, LDAPMessage *res, ULONG free )
TRACE( "(%p, %p, %#lx)\n", ld, res, free );
if (ld && res)
{
struct ldap_parse_result_params params = { CTX(ld), MSG(res), &error, NULL, NULL, NULL, NULL, free };
if (!LDAP_CALL( ldap_parse_result, &params )) return error;
}
if (ld && res && !ldap_parse_result( CTX(ld), MSG(res), &error, NULL, NULL, NULL, NULL, free ))
return error;
return ~0u;
}
......
......@@ -22,7 +22,6 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap.h"
#include "wine/debug.h"
#include "winldap_private.h"
......@@ -43,7 +42,7 @@ ULONG CDECL ldap_close_extended_op( LDAP *ld, ULONG msgid )
/***********************************************************************
* ldap_extended_operationA (WLDAP32.@)
*/
ULONG CDECL ldap_extended_operationA( LDAP *ld, char *oid, struct berval *data, LDAPControlA **serverctrls,
ULONG CDECL ldap_extended_operationA( LDAP *ld, char *oid, struct WLDAP32_berval *data, LDAPControlA **serverctrls,
LDAPControlA **clientctrls, ULONG *message )
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
......@@ -70,13 +69,13 @@ exit:
/***********************************************************************
* ldap_extended_operationW (WLDAP32.@)
*/
ULONG CDECL ldap_extended_operationW( LDAP *ld, WCHAR *oid, struct berval *data, LDAPControlW **serverctrls,
ULONG CDECL ldap_extended_operationW( LDAP *ld, WCHAR *oid, struct WLDAP32_berval *data, LDAPControlW **serverctrls,
LDAPControlW **clientctrls, ULONG *message )
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *oidU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
struct bervalU *dataU = NULL;
LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
struct berval *dataU = NULL;
TRACE( "(%p, %s, %p, %p, %p, %p)\n", ld, debugstr_w(oid), data, serverctrls, clientctrls, message );
......@@ -88,8 +87,7 @@ ULONG CDECL ldap_extended_operationW( LDAP *ld, WCHAR *oid, struct berval *data,
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
else
{
struct ldap_extended_operation_params params = { CTX(ld), oidU, dataU, serverctrlsU, clientctrlsU, message };
ret = map_error( LDAP_CALL( ldap_extended_operation, &params ));
ret = map_error( ldap_extended_operation( CTX(ld), oidU, dataU, serverctrlsU, clientctrlsU, (int *)message ) );
}
exit:
......@@ -103,8 +101,8 @@ exit:
/***********************************************************************
* ldap_extended_operation_sA (WLDAP32.@)
*/
ULONG CDECL ldap_extended_operation_sA( LDAP *ld, char *oid, struct berval *data, LDAPControlA **serverctrls,
LDAPControlA **clientctrls, char **retoid, struct berval **retdata )
ULONG CDECL ldap_extended_operation_sA( LDAP *ld, char *oid, struct WLDAP32_berval *data, LDAPControlA **serverctrls,
LDAPControlA **clientctrls, char **retoid, struct WLDAP32_berval **retdata )
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *oidW = NULL, *retoidW = NULL;
......@@ -137,13 +135,13 @@ exit:
/***********************************************************************
* ldap_extended_operation_sW (WLDAP32.@)
*/
ULONG CDECL ldap_extended_operation_sW( LDAP *ld, WCHAR *oid, struct berval *data, LDAPControlW **serverctrls,
LDAPControlW **clientctrls, WCHAR **retoid, struct berval **retdata )
ULONG CDECL ldap_extended_operation_sW( LDAP *ld, WCHAR *oid, struct WLDAP32_berval *data, LDAPControlW **serverctrls,
LDAPControlW **clientctrls, WCHAR **retoid, struct WLDAP32_berval **retdata )
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *oidU = NULL, *retoidU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
struct bervalU *retdataU, *dataU = NULL;
LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
struct berval *retdataU, *dataU = NULL;
TRACE( "(%p, %s, %p, %p, %p, %p, %p)\n", ld, debugstr_w(oid), data, serverctrls, clientctrls, retoid, retdata );
......@@ -155,8 +153,8 @@ ULONG CDECL ldap_extended_operation_sW( LDAP *ld, WCHAR *oid, struct berval *dat
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
else
{
struct ldap_extended_operation_s_params params = { CTX(ld), oidU, dataU, serverctrlsU, clientctrlsU, &retoidU, &retdataU };
ret = map_error( LDAP_CALL( ldap_extended_operation_s, &params ));
ret = map_error( ldap_extended_operation_s( CTX(ld), oidU, dataU, serverctrlsU, clientctrlsU, &retoidU,
&retdataU ) );
}
if (retoid && retoidU)
......@@ -164,14 +162,14 @@ ULONG CDECL ldap_extended_operation_sW( LDAP *ld, WCHAR *oid, struct berval *dat
WCHAR *str = strUtoW( retoidU );
if (str) *retoid = str;
else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ldap_memfree, retoidU );
ldap_memfree( retoidU );
}
if (retdata && retdataU)
{
struct berval *bv = bervalUtoW( retdataU );
struct WLDAP32_berval *bv = bervalUtoW( retdataU );
if (bv) *retdata = bv;
else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ber_bvfree, retdataU );
ber_bvfree( retdataU );
}
exit:
......
......@@ -24,7 +24,6 @@
#include "winbase.h"
#include "winnls.h"
#include "winternl.h"
#include "winldap.h"
#include "wine/debug.h"
#include "winldap_private.h"
......@@ -194,15 +193,11 @@ static LDAP *create_context( const char *url )
{
LDAP *ld;
int version = WLDAP32_LDAP_VERSION3;
struct ldap_initialize_params params;
if (!(ld = calloc( 1, sizeof( *ld )))) return NULL;
params.ld = &CTX(ld);
params.url = url;
if (map_error( LDAP_CALL( ldap_initialize, &params )) == WLDAP32_LDAP_SUCCESS)
if (map_error( ldap_initialize( &CTX(ld), url ) ) == WLDAP32_LDAP_SUCCESS)
{
struct ldap_set_option_params opt_params = { CTX(ld), WLDAP32_LDAP_OPT_PROTOCOL_VERSION, &version };
LDAP_CALL( ldap_set_option, &opt_params );
ldap_set_option( CTX(ld), WLDAP32_LDAP_OPT_PROTOCOL_VERSION, &version );
return ld;
}
free( ld );
......@@ -412,7 +407,7 @@ ULONG CDECL ldap_start_tls_sW( LDAP *ld, ULONG *retval, LDAPMessage **result, LD
LDAPControlW **clientctrls )
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
TRACE( "(%p, %p, %p, %p, %p)\n", ld, retval, result, serverctrls, clientctrls );
if (result)
......@@ -427,8 +422,7 @@ ULONG CDECL ldap_start_tls_sW( LDAP *ld, ULONG *retval, LDAPMessage **result, LD
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
else
{
struct ldap_start_tls_s_params params = { CTX(ld), serverctrlsU, clientctrlsU };
ret = map_error( LDAP_CALL( ldap_start_tls_s, &params ));
ret = map_error( ldap_start_tls_s( CTX(ld), serverctrlsU, clientctrlsU ) );
}
exit:
......
......@@ -24,14 +24,11 @@
#include "winbase.h"
#include "wine/debug.h"
#include "libldap.h"
HINSTANCE hwldap32;
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
unixlib_handle_t ldap_handle = 0;
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
{
TRACE( "(%p, %#lx, %p)\n", hinst, reason, reserved );
......@@ -41,9 +38,6 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
case DLL_PROCESS_ATTACH:
hwldap32 = hinst;
DisableThreadLibraryCalls( hinst );
if (NtQueryVirtualMemory( GetCurrentProcess(), hinst, MemoryWineUnixFuncs,
&ldap_handle, sizeof(ldap_handle), NULL ))
ERR( "No libldap support, expect problems\n" );
break;
}
return TRUE;
......
......@@ -22,7 +22,6 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap.h"
#include "wine/debug.h"
#include "winldap_private.h"
......@@ -105,8 +104,8 @@ ULONG CDECL ldap_modify_extW( LDAP *ld, WCHAR *dn, LDAPModW **mods, LDAPControlW
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL;
LDAPModU **modsU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
LDAPMod **modsU = NULL;
LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
TRACE( "(%p, %s, %p, %p, %p, %p)\n", ld, debugstr_w(dn), mods, serverctrls, clientctrls, message );
......@@ -118,8 +117,7 @@ ULONG CDECL ldap_modify_extW( LDAP *ld, WCHAR *dn, LDAPModW **mods, LDAPControlW
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
else
{
struct ldap_modify_ext_params params = { CTX(ld), dnU, modsU, serverctrlsU, clientctrlsU, message };
ret = map_error( LDAP_CALL( ldap_modify_ext, &params ));
ret = map_error( ldap_modify_ext( CTX(ld), dnU, modsU, serverctrlsU, clientctrlsU, (int *)message ) );
}
exit:
......@@ -168,8 +166,8 @@ ULONG CDECL ldap_modify_ext_sW( LDAP *ld, WCHAR *dn, LDAPModW **mods, LDAPContro
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL;
LDAPModU **modsU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
LDAPMod **modsU = NULL;
LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_w(dn), mods, serverctrls, clientctrls );
......@@ -181,8 +179,7 @@ ULONG CDECL ldap_modify_ext_sW( LDAP *ld, WCHAR *dn, LDAPModW **mods, LDAPContro
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
else
{
struct ldap_modify_ext_s_params params = { CTX(ld), dnU, modsU, serverctrlsU, clientctrlsU };
ret = map_error( LDAP_CALL( ldap_modify_ext_s, &params ));
ret = map_error( ldap_modify_ext_s( CTX(ld), dnU, modsU, serverctrlsU, clientctrlsU ) );
}
exit:
......
......@@ -22,7 +22,6 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap.h"
#include "wine/debug.h"
#include "winldap_private.h"
......@@ -91,7 +90,7 @@ ULONG CDECL ldap_modrdn2W( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete )
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL, *newdnU = NULL;
ULONG msg;
int msg;
TRACE( "(%p, %s, %p, 0x%02x)\n", ld, debugstr_w(dn), newdn, delete );
......@@ -101,8 +100,7 @@ ULONG CDECL ldap_modrdn2W( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete )
if ((newdnU = strWtoU( newdn )))
{
struct ldap_rename_params params = { CTX(ld), dnU, newdnU, NULL, delete, NULL, NULL, &msg };
ret = LDAP_CALL( ldap_rename, &params );
ret = ldap_rename( CTX(ld), dnU, newdnU, NULL, delete, NULL, NULL, &msg );
if (ret == WLDAP32_LDAP_SUCCESS)
ret = msg;
else
......@@ -152,8 +150,7 @@ ULONG CDECL ldap_modrdn2_sW( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete )
if ((newdnU = strWtoU( newdn )))
{
struct ldap_rename_s_params params = { CTX(ld), dnU, newdnU, NULL, delete, NULL, NULL };
ret = map_error( LDAP_CALL( ldap_rename_s, &params ));
ret = map_error( ldap_rename_s( CTX(ld), dnU, newdnU, NULL, delete, NULL, NULL ) );
free( newdnU );
}
free( dnU );
......
......@@ -22,7 +22,6 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap.h"
#include "wine/debug.h"
#include "winldap_private.h"
......@@ -161,7 +160,7 @@ ULONG CDECL ldap_get_optionW( LDAP *ld, int option, void *value )
{
case WLDAP32_LDAP_OPT_API_FEATURE_INFO:
{
LDAPAPIFeatureInfoU featureU;
LDAPAPIFeatureInfo featureU;
LDAPAPIFeatureInfoW *featureW = value;
if (!featureW->ldapaif_name) return WLDAP32_LDAP_PARAM_ERROR;
......@@ -169,9 +168,8 @@ ULONG CDECL ldap_get_optionW( LDAP *ld, int option, void *value )
featureU.ldapaif_info_version = featureW->ldapaif_info_version;
if ((featureU.ldapaif_name = strWtoU( featureW->ldapaif_name )))
{
struct ldap_get_option_params params = { CTX(ld), option, &featureU };
featureU.ldapaif_version = 0;
ret = map_error( LDAP_CALL( ldap_get_option, &params ));
ret = map_error( ldap_get_option( CTX(ld), option, &featureU ) );
}
else return WLDAP32_LDAP_NO_MEMORY;
......@@ -181,14 +179,13 @@ ULONG CDECL ldap_get_optionW( LDAP *ld, int option, void *value )
}
case WLDAP32_LDAP_OPT_API_INFO:
{
LDAPAPIInfoU infoU;
LDAPAPIInfo infoU;
LDAPAPIInfoW *infoW = value;
struct ldap_get_option_params params = { CTX(ld), option, &infoU };
memset( &infoU, 0, sizeof(infoU) );
infoU.ldapai_info_version = infoW->ldapai_info_version;
ret = map_error( LDAP_CALL( ldap_get_option, &params ));
ret = map_error( ldap_get_option( CTX(ld), option, &infoU ) );
if (ret == WLDAP32_LDAP_SUCCESS)
{
infoW->ldapai_api_version = infoU.ldapai_api_version;
......@@ -198,13 +195,13 @@ ULONG CDECL ldap_get_optionW( LDAP *ld, int option, void *value )
return WLDAP32_LDAP_NO_MEMORY;
if (infoU.ldapai_vendor_name && !(infoW->ldapai_vendor_name = strUtoW( infoU.ldapai_vendor_name )))
{
LDAP_CALL( ldap_memvfree, infoU.ldapai_extensions );
ldap_memvfree( (void **)infoU.ldapai_extensions );
return WLDAP32_LDAP_NO_MEMORY;
}
infoW->ldapai_vendor_version = infoU.ldapai_vendor_version;
LDAP_CALL( ldap_memvfree, infoU.ldapai_extensions );
LDAP_CALL( ldap_memfree, infoU.ldapai_vendor_name );
ldap_memvfree( (void **)infoU.ldapai_extensions );
ldap_memfree( infoU.ldapai_vendor_name );
}
return ret;
}
......@@ -216,10 +213,7 @@ ULONG CDECL ldap_get_optionW( LDAP *ld, int option, void *value )
case WLDAP32_LDAP_OPT_REFERRALS:
case WLDAP32_LDAP_OPT_SIZELIMIT:
case WLDAP32_LDAP_OPT_TIMELIMIT:
{
struct ldap_get_option_params params = { CTX(ld), option, value };
return map_error( LDAP_CALL( ldap_get_option, &params ));
}
return map_error( ldap_get_option( CTX(ld), option, value ) );
case WLDAP32_LDAP_OPT_CACHE_ENABLE:
case WLDAP32_LDAP_OPT_CACHE_FN_PTRS:
......@@ -355,38 +349,32 @@ ULONG CDECL ldap_set_optionA( LDAP *ld, int option, void *value )
static BOOL query_supported_server_ctrls( LDAP *ld )
{
char *attrs[] = { (char *)"supportedControl", NULL };
void *res, *entry;
struct bervalU **ctrls = SERVER_CTRLS(ld);
LDAPMessage *res, *entry;
struct berval **ctrls = SERVER_CTRLS(ld);
ULONG ret;
if (!ctrls)
{
struct ldap_search_ext_s_params params = { CTX(ld), (char *)"", LDAP_SCOPE_BASE,
(char *)"(objectClass=*)", attrs, FALSE, NULL, NULL, NULL, 0, &res };
ret = map_error( LDAP_CALL( ldap_search_ext_s, &params ));
}
else return TRUE;
if (ctrls) return TRUE;
ret = map_error( ldap_search_ext_s( CTX(ld), (char *)"", WLDAP32_LDAP_SCOPE_BASE, (char *)"(objectClass=*)",
attrs, FALSE, NULL, NULL, NULL, 0, &res ) );
if (ret == WLDAP32_LDAP_SUCCESS)
{
struct ldap_first_entry_params params = { CTX(ld), res, &entry };
if (!LDAP_CALL( ldap_first_entry, &params ))
if ((entry = ldap_first_entry( CTX(ld), res )))
{
ULONG count, i;
struct ldap_get_values_len_params get_params = { CTX(ld), entry, attrs[0], &ctrls };
LDAP_CALL( ldap_get_values_len, &get_params );
count = LDAP_CALL( ldap_count_values_len, ctrls );
ctrls = ldap_get_values_len( CTX(ld), entry, attrs[0] );
count = ldap_count_values_len( ctrls );
for (i = 0; i < count; i++) TRACE( "%lu: %s\n", i, debugstr_an( ctrls[i]->bv_val, ctrls[i]->bv_len ) );
*(struct bervalU ***)&SERVER_CTRLS(ld) = ctrls;
*(struct berval ***)&SERVER_CTRLS(ld) = ctrls;
}
}
else return FALSE;
LDAP_CALL( ldap_msgfree, res );
ldap_msgfree( res );
return ctrls != NULL;
}
static BOOL is_supported_server_ctrls( LDAP *ld, LDAPControlU **ctrls )
static BOOL is_supported_server_ctrls( LDAP *ld, LDAPControl **ctrls )
{
ULONG user_count, server_count, i, n, supported = 0;
......@@ -394,7 +382,7 @@ static BOOL is_supported_server_ctrls( LDAP *ld, LDAPControlU **ctrls )
return TRUE; /* can't verify, let the server handle it on next query */
user_count = controlarraylenU( ctrls );
server_count = LDAP_CALL( ldap_count_values_len, SERVER_CTRLS(ld) );
server_count = ldap_count_values_len( SERVER_CTRLS(ld) );
for (n = 0; n < user_count; n++)
{
......@@ -402,7 +390,7 @@ static BOOL is_supported_server_ctrls( LDAP *ld, LDAPControlU **ctrls )
for (i = 0; i < server_count; i++)
{
struct bervalU **server_ctrls = SERVER_CTRLS(ld);
struct berval **server_ctrls = SERVER_CTRLS(ld);
if (!strncmp( ctrls[n]->ldctl_oid, server_ctrls[i]->bv_val, server_ctrls[i]->bv_len))
{
supported++;
......@@ -429,28 +417,27 @@ ULONG CDECL ldap_set_optionW( LDAP *ld, int option, void *value )
{
case WLDAP32_LDAP_OPT_SERVER_CONTROLS:
{
LDAPControlU **ctrlsU;
LDAPControl **ctrlsU;
if (!(ctrlsU = controlarrayWtoU( value ))) return WLDAP32_LDAP_NO_MEMORY;
if (!is_supported_server_ctrls( ld, ctrlsU ))
ret = WLDAP32_LDAP_PARAM_ERROR;
else
{
struct ldap_set_option_params params = { CTX(ld), option, ctrlsU };
ret = map_error( LDAP_CALL( ldap_set_option, &params ));
}
ret = map_error( ldap_set_option( CTX(ld), option, ctrlsU ) );
controlarrayfreeU( ctrlsU );
return ret;
}
case WLDAP32_LDAP_OPT_REFERRALS:
{
struct ldap_set_option_params params = { CTX(ld), option, LDAP_OPT_ON };
if (value == WLDAP32_LDAP_OPT_OFF)
params.value = LDAP_OPT_OFF;
else
FIXME("upgrading referral value %p to WLDAP32_LDAP_OPT_ON (OpenLDAP lacks sufficient granularity)\n", value);
return map_error( LDAP_CALL( ldap_set_option, &params ));
if (value == WLDAP32_LDAP_OPT_OFF) value = LDAP_OPT_OFF;
else if (value != WLDAP32_LDAP_OPT_ON)
{
FIXME( "upgrading referral value %p to LDAP_OPT_ON (OpenLDAP lacks sufficient granularity)\n", value );
value = LDAP_OPT_ON;
}
return map_error( ldap_set_option( CTX(ld), option, value ) );
}
case WLDAP32_LDAP_OPT_DEREF:
case WLDAP32_LDAP_OPT_DESC:
......@@ -458,10 +445,7 @@ ULONG CDECL ldap_set_optionW( LDAP *ld, int option, void *value )
case WLDAP32_LDAP_OPT_PROTOCOL_VERSION:
case WLDAP32_LDAP_OPT_SIZELIMIT:
case WLDAP32_LDAP_OPT_TIMELIMIT:
{
struct ldap_set_option_params params = { CTX(ld), option, value };
return map_error( LDAP_CALL( ldap_set_option, &params ));
}
return map_error( ldap_set_option( CTX(ld), option, value ) );
case WLDAP32_LDAP_OPT_CACHE_ENABLE:
case WLDAP32_LDAP_OPT_CACHE_FN_PTRS:
......
......@@ -24,20 +24,18 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap.h"
#include "winber.h"
#include "wine/debug.h"
#include "winldap_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
static struct berval null_cookieW = { 0, NULL };
static struct WLDAP32_berval null_cookieW = { 0, NULL };
/***********************************************************************
* ldap_create_page_controlA (WLDAP32.@)
*/
ULONG CDECL ldap_create_page_controlA( LDAP *ld, ULONG pagesize, struct berval *cookie, UCHAR critical,
ULONG CDECL ldap_create_page_controlA( LDAP *ld, ULONG pagesize, struct WLDAP32_berval *cookie, UCHAR critical,
LDAPControlA **control )
{
ULONG ret;
......@@ -57,15 +55,16 @@ ULONG CDECL ldap_create_page_controlA( LDAP *ld, ULONG pagesize, struct berval *
}
/* create a page control by hand */
static ULONG create_page_control( ULONG pagesize, struct berval *cookie, UCHAR critical, LDAPControlW **control )
static ULONG create_page_control( ULONG pagesize, struct WLDAP32_berval *cookie, UCHAR critical,
LDAPControlW **control )
{
LDAPControlW *ctrl;
WLDAP32_BerElement *ber;
struct berval *berval, *vec[2];
struct WLDAP32_berval *berval, *vec[2];
int ret, len;
char *val;
if (!(ber = WLDAP32_ber_alloc_t( LBER_USE_DER ))) return WLDAP32_LDAP_NO_MEMORY;
if (!(ber = WLDAP32_ber_alloc_t( WLDAP32_LBER_USE_DER ))) return WLDAP32_LDAP_NO_MEMORY;
vec[1] = NULL;
if (cookie)
......@@ -109,7 +108,7 @@ static ULONG create_page_control( ULONG pagesize, struct berval *cookie, UCHAR c
/***********************************************************************
* ldap_create_page_controlW (WLDAP32.@)
*/
ULONG CDECL ldap_create_page_controlW( LDAP *ld, ULONG pagesize, struct berval *cookie, UCHAR critical,
ULONG CDECL ldap_create_page_controlW( LDAP *ld, ULONG pagesize, struct WLDAP32_berval *cookie, UCHAR critical,
LDAPControlW **control )
{
TRACE( "(%p, %#lx, %p, 0x%02x, %p)\n", ld, pagesize, cookie, critical, control );
......@@ -127,7 +126,7 @@ ULONG CDECL ldap_get_next_page( LDAP *ld, LDAPSearch *search, ULONG pagesize, UL
}
ULONG CDECL ldap_get_next_page_s( LDAP *ld, LDAPSearch *search, struct l_timeval *timeout, ULONG pagesize,
ULONG *count, LDAPMessage **results )
ULONG *count, WLDAP32_LDAPMessage **results )
{
ULONG ret;
......@@ -161,7 +160,7 @@ ULONG CDECL ldap_get_next_page_s( LDAP *ld, LDAPSearch *search, struct l_timeval
return ldap_get_paged_count( ld, search, count, *results );
}
ULONG CDECL ldap_get_paged_count( LDAP *ld, LDAPSearch *search, ULONG *count, LDAPMessage *results )
ULONG CDECL ldap_get_paged_count( LDAP *ld, LDAPSearch *search, ULONG *count, WLDAP32_LDAPMessage *results )
{
ULONG ret;
LDAPControlW **server_ctrls = NULL;
......@@ -196,7 +195,7 @@ ULONG CDECL ldap_get_paged_count( LDAP *ld, LDAPSearch *search, ULONG *count, LD
/***********************************************************************
* ldap_parse_page_controlA (WLDAP32.@)
*/
ULONG CDECL ldap_parse_page_controlA( LDAP *ld, LDAPControlA **ctrls, ULONG *count, struct berval **cookie )
ULONG CDECL ldap_parse_page_controlA( LDAP *ld, LDAPControlA **ctrls, ULONG *count, struct WLDAP32_berval **cookie )
{
ULONG ret;
LDAPControlW **ctrlsW = NULL;
......@@ -214,12 +213,13 @@ ULONG CDECL ldap_parse_page_controlA( LDAP *ld, LDAPControlA **ctrls, ULONG *cou
/***********************************************************************
* ldap_parse_page_controlW (WLDAP32.@)
*/
ULONG CDECL ldap_parse_page_controlW( LDAP *ld, LDAPControlW **ctrls, ULONG *ret_count, struct berval **ret_cookie )
ULONG CDECL ldap_parse_page_controlW( LDAP *ld, LDAPControlW **ctrls, ULONG *ret_count,
struct WLDAP32_berval **ret_cookie )
{
ULONG ret, count;
LDAPControlW *control = NULL;
WLDAP32_BerElement *ber;
struct berval *cookie = NULL;
struct WLDAP32_berval *cookie = NULL;
int tag;
ULONG i;
......@@ -273,8 +273,8 @@ ULONG CDECL ldap_search_abandon_page( LDAP *ld, LDAPSearch *search )
}
LDAPSearch * CDECL ldap_search_init_pageA( LDAP *ld, char *dn, ULONG scope, char *filter, char **attrs,
ULONG attrsonly, LDAPControlA **serverctrls, LDAPControlA **clientctrls, ULONG timelimit, ULONG sizelimit,
LDAPSortKeyA **sortkeys )
ULONG attrsonly, LDAPControlA **serverctrls, LDAPControlA **clientctrls,
ULONG timelimit, ULONG sizelimit, LDAPSortKeyA **sortkeys )
{
FIXME( "(%p, %s, %#lx, %s, %p, %#lx, %p, %p, %#lx, %#lx, %p)\n", ld, debugstr_a(dn), scope,
debugstr_a(filter), attrs, attrsonly, serverctrls, clientctrls, timelimit, sizelimit, sortkeys );
......@@ -282,8 +282,8 @@ LDAPSearch * CDECL ldap_search_init_pageA( LDAP *ld, char *dn, ULONG scope, char
}
LDAPSearch * CDECL ldap_search_init_pageW( LDAP *ld, WCHAR *dn, ULONG scope, WCHAR *filter, WCHAR **attrs,
ULONG attrsonly, LDAPControlW **serverctrls, LDAPControlW **clientctrls, ULONG timelimit, ULONG sizelimit,
LDAPSortKeyW **sortkeys )
ULONG attrsonly, LDAPControlW **serverctrls, LDAPControlW **clientctrls,
ULONG timelimit, ULONG sizelimit, LDAPSortKeyW **sortkeys )
{
LDAPSearch *search;
DWORD i, len;
......
......@@ -22,7 +22,6 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap.h"
#include "wine/debug.h"
#include "winldap_private.h"
......@@ -32,8 +31,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
/***********************************************************************
* ldap_parse_extended_resultA (WLDAP32.@)
*/
ULONG CDECL ldap_parse_extended_resultA( LDAP *ld, LDAPMessage *result, char **oid, struct berval **data,
BOOLEAN free )
ULONG CDECL ldap_parse_extended_resultA( LDAP *ld, WLDAP32_LDAPMessage *result, char **oid,
struct WLDAP32_berval **data, BOOLEAN free )
{
ULONG ret;
WCHAR *oidW = NULL;
......@@ -57,12 +56,12 @@ ULONG CDECL ldap_parse_extended_resultA( LDAP *ld, LDAPMessage *result, char **o
/***********************************************************************
* ldap_parse_extended_resultW (WLDAP32.@)
*/
ULONG CDECL ldap_parse_extended_resultW( LDAP *ld, LDAPMessage *result, WCHAR **oid, struct berval **data,
BOOLEAN free )
ULONG CDECL ldap_parse_extended_resultW( LDAP *ld, WLDAP32_LDAPMessage *result, WCHAR **oid,
struct WLDAP32_berval **data, BOOLEAN free )
{
ULONG ret;
char *oidU = NULL;
struct bervalU *dataU = NULL;
struct berval *dataU = NULL;
TRACE( "(%p, %p, %p, %p, 0x%02x)\n", ld, result, oid, data, free );
......@@ -70,22 +69,21 @@ ULONG CDECL ldap_parse_extended_resultW( LDAP *ld, LDAPMessage *result, WCHAR **
if (!result) return WLDAP32_LDAP_NO_RESULTS_RETURNED;
else
{
struct ldap_parse_extended_result_params params = { CTX(ld), result, &oidU, &dataU, free };
ret = map_error( LDAP_CALL( ldap_parse_extended_result, &params ));
ret = map_error( ldap_parse_extended_result( CTX(ld), result, &oidU, &dataU, free ) );
}
if (oid && oidU)
{
WCHAR *str;
if ((str = strUtoW( oidU ))) *oid = str;
else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ldap_memfree, oidU );
ldap_memfree( oidU );
}
if (data && dataU)
{
struct berval *bv;
struct WLDAP32_berval *bv;
if ((bv = bervalUtoW( dataU ))) *data = bv;
else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ber_bvfree, dataU );
ber_bvfree( dataU );
}
return ret;
......@@ -94,7 +92,7 @@ ULONG CDECL ldap_parse_extended_resultW( LDAP *ld, LDAPMessage *result, WCHAR **
/***********************************************************************
* ldap_parse_referenceA (WLDAP32.@)
*/
ULONG CDECL ldap_parse_referenceA( LDAP *ld, LDAPMessage *message, char ***referrals )
ULONG CDECL ldap_parse_referenceA( LDAP *ld, WLDAP32_LDAPMessage *message, char ***referrals )
{
ULONG ret;
WCHAR **referralsW = NULL;
......@@ -117,24 +115,21 @@ ULONG CDECL ldap_parse_referenceA( LDAP *ld, LDAPMessage *message, char ***refer
/***********************************************************************
* ldap_parse_referenceW (WLDAP32.@)
*/
ULONG CDECL ldap_parse_referenceW( LDAP *ld, LDAPMessage *message, WCHAR ***referrals )
ULONG CDECL ldap_parse_referenceW( LDAP *ld, WLDAP32_LDAPMessage *message, WCHAR ***referrals )
{
ULONG ret = ~0u;
char **referralsU = NULL;
TRACE( "(%p, %p, %p)\n", ld, message, referrals );
if (ld)
{
struct ldap_parse_reference_params params = { CTX(ld), message, &referralsU, NULL, 0 };
ret = map_error( LDAP_CALL( ldap_parse_reference, &params ));
}
if (ld) ret = map_error( ldap_parse_reference( CTX(ld), message, &referralsU, NULL, 0 ) );
if (referralsU)
{
WCHAR **ref;
if ((ref = strarrayUtoW( referralsU ))) *referrals = ref;
else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ldap_memfree, referralsU );
ldap_memfree( referralsU );
}
return ret;
}
......@@ -142,7 +137,7 @@ ULONG CDECL ldap_parse_referenceW( LDAP *ld, LDAPMessage *message, WCHAR ***refe
/***********************************************************************
* ldap_parse_resultA (WLDAP32.@)
*/
ULONG CDECL ldap_parse_resultA( LDAP *ld, LDAPMessage *result, ULONG *retcode, char **matched, char **error,
ULONG CDECL ldap_parse_resultA( LDAP *ld, WLDAP32_LDAPMessage *result, ULONG *retcode, char **matched, char **error,
char ***referrals, LDAPControlA ***serverctrls, BOOLEAN free )
{
ULONG ret;
......@@ -171,33 +166,30 @@ ULONG CDECL ldap_parse_resultA( LDAP *ld, LDAPMessage *result, ULONG *retcode, c
/***********************************************************************
* ldap_parse_resultW (WLDAP32.@)
*/
ULONG CDECL ldap_parse_resultW( LDAP *ld, LDAPMessage *result, ULONG *retcode, WCHAR **matched, WCHAR **error,
ULONG CDECL ldap_parse_resultW( LDAP *ld, WLDAP32_LDAPMessage *result, ULONG *retcode, WCHAR **matched, WCHAR **error,
WCHAR ***referrals, LDAPControlW ***serverctrls, BOOLEAN free )
{
ULONG ret;
char *matchedU = NULL, *errorU = NULL, **referralsU = NULL;
LDAPControlU **serverctrlsU = NULL;
LDAPControl **serverctrlsU = NULL;
TRACE( "(%p, %p, %p, %p, %p, %p, %p, 0x%02x)\n", ld, result, retcode, matched, error, referrals, serverctrls,
free );
if (ld)
{
struct ldap_parse_result_params params = { CTX(ld), MSG(result), (int *)retcode, &matchedU,
&errorU, &referralsU, &serverctrlsU, free };
ret = map_error( LDAP_CALL( ldap_parse_result, &params ));
}
else return WLDAP32_LDAP_PARAM_ERROR;
if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
ret = map_error( ldap_parse_result( CTX(ld), MSG(result), (int *)retcode, &matchedU, &errorU, &referralsU,
&serverctrlsU, free ) );
if (matched) *matched = strUtoW( matchedU );
if (error) *error = strUtoW( errorU );
if (referrals) *referrals = strarrayUtoW( referralsU );
if (serverctrls) *serverctrls = controlarrayUtoW( serverctrlsU );
LDAP_CALL( ldap_memfree, matchedU );
LDAP_CALL( ldap_memfree, errorU );
LDAP_CALL( ldap_memvfree, referralsU );
LDAP_CALL( ldap_controls_free, serverctrlsU );
ldap_memfree( matchedU );
ldap_memfree( errorU );
ldap_memfree( referralsU );
ldap_controls_free( serverctrlsU );
return ret;
}
......@@ -230,7 +222,7 @@ ULONG CDECL ldap_parse_sort_controlW( LDAP *ld, LDAPControlW **control, ULONG *r
{
ULONG ret;
char *attrU = NULL;
LDAPControlU **controlU, *sortcontrol = NULL;
LDAPControl **controlU, *sortcontrol = NULL;
int res;
unsigned int i;
......@@ -250,11 +242,8 @@ ULONG CDECL ldap_parse_sort_controlW( LDAP *ld, LDAPControlW **control, ULONG *r
controlarrayfreeU( controlU );
return WLDAP32_LDAP_CONTROL_NOT_FOUND;
}
else
{
struct ldap_parse_sortresponse_control_params params = { CTX(ld), sortcontrol, &res, &attrU };
ret = map_error( LDAP_CALL( ldap_parse_sortresponse_control, &params ));
}
ret = map_error( ldap_parse_sortresponse_control( CTX(ld), sortcontrol, &res, &attrU ) );
if (ret == WLDAP32_LDAP_SUCCESS)
{
WCHAR *str;
......@@ -264,7 +253,7 @@ ULONG CDECL ldap_parse_sort_controlW( LDAP *ld, LDAPControlW **control, ULONG *r
*result = res;
}
else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ldap_memfree, attrU );
ldap_memfree( attrU );
}
controlarrayfreeU( controlU );
......@@ -275,7 +264,7 @@ ULONG CDECL ldap_parse_sort_controlW( LDAP *ld, LDAPControlW **control, ULONG *r
* ldap_parse_vlv_controlA (WLDAP32.@)
*/
int CDECL ldap_parse_vlv_controlA( LDAP *ld, LDAPControlA **control, ULONG *targetpos, ULONG *listcount,
struct berval **context, int *errcode )
struct WLDAP32_berval **context, int *errcode )
{
int ret;
LDAPControlW **controlW = NULL;
......@@ -294,11 +283,11 @@ int CDECL ldap_parse_vlv_controlA( LDAP *ld, LDAPControlA **control, ULONG *targ
* ldap_parse_vlv_controlW (WLDAP32.@)
*/
int CDECL ldap_parse_vlv_controlW( LDAP *ld, LDAPControlW **control, ULONG *targetpos, ULONG *listcount,
struct berval **context, int *errcode )
struct WLDAP32_berval **context, int *errcode )
{
int ret, pos, count;
LDAPControlU **controlU, *vlvcontrolU = NULL;
struct bervalU *ctxU;
LDAPControl **controlU, *vlvcontrolU = NULL;
struct berval *ctxU;
unsigned int i;
TRACE( "(%p, %p, %p, %p, %p, %p)\n", ld, control, targetpos, listcount, context, errcode );
......@@ -317,14 +306,11 @@ int CDECL ldap_parse_vlv_controlW( LDAP *ld, LDAPControlW **control, ULONG *targ
controlarrayfreeU( controlU );
return WLDAP32_LDAP_CONTROL_NOT_FOUND;
}
else
{
struct ldap_parse_vlvresponse_control_params params = { CTX(ld), vlvcontrolU, &pos, &count, &ctxU, errcode };
ret = map_error( LDAP_CALL( ldap_parse_vlvresponse_control, &params ));
}
ret = map_error( ldap_parse_vlvresponse_control( CTX(ld), vlvcontrolU, &pos, &count, &ctxU, errcode ) );
if (ret == WLDAP32_LDAP_SUCCESS)
{
struct berval *bv;
struct WLDAP32_berval *bv;
if ((bv = bervalUtoW( ctxU )))
{
*context = bv;
......@@ -332,7 +318,7 @@ int CDECL ldap_parse_vlv_controlW( LDAP *ld, LDAPControlW **control, ULONG *targ
*listcount = count;
}
else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ber_bvfree, ctxU );
ber_bvfree( ctxU );
}
controlarrayfreeU( controlU );
......
......@@ -22,7 +22,6 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap.h"
#include "wine/debug.h"
#include "winldap_private.h"
......@@ -69,7 +68,7 @@ ULONG CDECL ldap_rename_extW( LDAP *ld, WCHAR *dn, WCHAR *newrdn, WCHAR *newpare
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL, *newrdnU = NULL, *newparentU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
TRACE( "(%p, %s, %s, %s, 0x%02x, %p, %p, %p)\n", ld, debugstr_w(dn), debugstr_w(newrdn), debugstr_w(newparent),
delete, serverctrls, clientctrls, message );
......@@ -83,8 +82,8 @@ ULONG CDECL ldap_rename_extW( LDAP *ld, WCHAR *dn, WCHAR *newrdn, WCHAR *newpare
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
else
{
struct ldap_rename_params params = { CTX(ld), dnU, newrdnU, newparentU, delete, serverctrlsU, clientctrlsU, message };
ret = map_error( LDAP_CALL( ldap_rename, &params ));
ret = map_error( ldap_rename( CTX(ld), dnU, newrdnU, newparentU, delete, serverctrlsU, clientctrlsU,
(int *)message ) );
}
exit:
free( dnU );
......@@ -135,7 +134,7 @@ ULONG CDECL ldap_rename_ext_sW( LDAP *ld, WCHAR *dn, WCHAR *newrdn, WCHAR *newpa
{
ULONG ret = WLDAP32_LDAP_PARAM_ERROR;
char *dnU = NULL, *newrdnU = NULL, *newparentU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
TRACE( "(%p, %s, %s, %s, 0x%02x, %p, %p)\n", ld, debugstr_w(dn), debugstr_w(newrdn), debugstr_w(newparent),
delete, serverctrls, clientctrls );
......@@ -149,8 +148,7 @@ ULONG CDECL ldap_rename_ext_sW( LDAP *ld, WCHAR *dn, WCHAR *newrdn, WCHAR *newpa
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
else
{
struct ldap_rename_s_params params = { CTX(ld), dnU, newrdnU, newparentU, delete, serverctrlsU, clientctrlsU };
ret = map_error( LDAP_CALL( ldap_rename_s, &params ));
ret = map_error( ldap_rename_s( CTX(ld), dnU, newrdnU, newparentU, delete, serverctrlsU, clientctrlsU ) );
}
exit:
free( dnU );
......
......@@ -23,7 +23,7 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap.h"
#include "winsock2.h"
#include "wine/debug.h"
#include "winldap_private.h"
......@@ -72,7 +72,8 @@ ULONG CDECL ldap_searchW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, WCH
* ldap_search_extA (WLDAP32.@)
*/
ULONG CDECL ldap_search_extA( LDAP *ld, char *base, ULONG scope, char *filter, char **attrs, ULONG attrsonly,
LDAPControlA **serverctrls, LDAPControlA **clientctrls, ULONG timelimit, ULONG sizelimit, ULONG *message )
LDAPControlA **serverctrls, LDAPControlA **clientctrls, ULONG timelimit,
ULONG sizelimit, ULONG *message )
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL;
......@@ -104,14 +105,14 @@ exit:
/***********************************************************************
* ldap_search_extW (WLDAP32.@)
*/
ULONG CDECL ldap_search_extW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, WCHAR **attrs,
ULONG attrsonly, LDAPControlW **serverctrls, LDAPControlW **clientctrls, ULONG timelimit, ULONG sizelimit,
ULONG *message )
ULONG CDECL ldap_search_extW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, WCHAR **attrs, ULONG attrsonly,
LDAPControlW **serverctrls, LDAPControlW **clientctrls, ULONG timelimit,
ULONG sizelimit, ULONG *message )
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *baseU = NULL, *filterU = NULL, **attrsU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
struct timevalU timevalU;
LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
struct timeval timevalU;
TRACE( "(%p, %s, %#lx, %s, %p, %#lx, %p, %p, %#lx, %#lx, %p)\n", ld, debugstr_w(base), scope,
debugstr_w(filter), attrs, attrsonly, serverctrls, clientctrls, timelimit, sizelimit, message );
......@@ -127,11 +128,8 @@ ULONG CDECL ldap_search_extW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter,
timevalU.tv_sec = timelimit;
timevalU.tv_usec = 0;
{
struct ldap_search_ext_params params = { CTX(ld), baseU, scope, filterU, attrsU, attrsonly,
serverctrlsU, clientctrlsU, timelimit ? &timevalU : NULL, sizelimit, message };
ret = map_error( LDAP_CALL( ldap_search_ext, &params ));
}
ret = map_error( ldap_search_ext( CTX(ld), baseU, scope, filterU, attrsU, attrsonly, serverctrlsU,
clientctrlsU, timelimit ? &timevalU : NULL, sizelimit, (int *)message ) );
exit:
free( baseU );
free( filterU );
......@@ -144,9 +142,9 @@ exit:
/***********************************************************************
* ldap_search_ext_sA (WLDAP32.@)
*/
ULONG CDECL ldap_search_ext_sA( LDAP *ld, char *base, ULONG scope, char *filter, char **attrs,
ULONG attrsonly, LDAPControlA **serverctrls, LDAPControlA **clientctrls, struct l_timeval *timeout,
ULONG sizelimit, LDAPMessage **res )
ULONG CDECL ldap_search_ext_sA( LDAP *ld, char *base, ULONG scope, char *filter, char **attrs, ULONG attrsonly,
LDAPControlA **serverctrls, LDAPControlA **clientctrls, struct l_timeval *timeout,
ULONG sizelimit, WLDAP32_LDAPMessage **res )
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL;
......@@ -178,15 +176,15 @@ exit:
/***********************************************************************
* ldap_search_ext_sW (WLDAP32.@)
*/
ULONG CDECL ldap_search_ext_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, WCHAR **attrs,
ULONG attrsonly, LDAPControlW **serverctrls, LDAPControlW **clientctrls, struct l_timeval *timeout,
ULONG CDECL ldap_search_ext_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, WCHAR **attrs, ULONG attrsonly,
LDAPControlW **serverctrls, LDAPControlW **clientctrls, struct l_timeval *timeout,
ULONG sizelimit, LDAPMessage **res )
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *baseU = NULL, *filterU = NULL, **attrsU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
struct timevalU timevalU;
void *msgU = NULL;
LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
struct timeval timevalU;
LDAPMessage *msgU = NULL;
TRACE( "(%p, %s, %#lx, %s, %p, %#lx, %p, %p, %p, %#lx, %p)\n", ld, debugstr_w(base), scope,
debugstr_w(filter), attrs, attrsonly, serverctrls, clientctrls, timeout, sizelimit, res );
......@@ -205,11 +203,8 @@ ULONG CDECL ldap_search_ext_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filte
timevalU.tv_usec = timeout->tv_usec;
}
{
struct ldap_search_ext_s_params params = { CTX(ld), baseU, scope, filterU, attrsU, attrsonly,
serverctrlsU, clientctrlsU, timeout ? &timevalU : NULL, sizelimit, &msgU };
ret = map_error( LDAP_CALL( ldap_search_ext_s, &params ));
}
ret = map_error( ldap_search_ext_s( CTX(ld), baseU, scope, filterU, attrsU, attrsonly, serverctrlsU,
clientctrlsU, timeout ? &timevalU : NULL, sizelimit, &msgU ) );
if (msgU)
{
......@@ -221,7 +216,7 @@ ULONG CDECL ldap_search_ext_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filte
}
else
{
LDAP_CALL( ldap_msgfree, msgU );
ldap_msgfree( msgU );
ret = WLDAP32_LDAP_NO_MEMORY;
}
}
......@@ -239,7 +234,7 @@ exit:
* ldap_search_sA (WLDAP32.@)
*/
ULONG CDECL ldap_search_sA( LDAP *ld, char *base, ULONG scope, char *filter, char **attrs, ULONG attrsonly,
LDAPMessage **res )
WLDAP32_LDAPMessage **res )
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL;
......@@ -266,7 +261,7 @@ exit:
* ldap_search_sW (WLDAP32.@)
*/
ULONG CDECL ldap_search_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, WCHAR **attrs, ULONG attrsonly,
LDAPMessage **res )
WLDAP32_LDAPMessage **res )
{
TRACE( "(%p, %s, %#lx, %s, %p, %#lx, %p)\n", ld, debugstr_w(base), scope, debugstr_w(filter), attrs,
attrsonly, res );
......@@ -277,7 +272,7 @@ ULONG CDECL ldap_search_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, W
* ldap_search_stA (WLDAP32.@)
*/
ULONG CDECL ldap_search_stA( LDAP *ld, const PCHAR base, ULONG scope, const PCHAR filter, char **attrs,
ULONG attrsonly, struct l_timeval *timeout, LDAPMessage **res )
ULONG attrsonly, struct l_timeval *timeout, WLDAP32_LDAPMessage **res )
{
ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL;
......@@ -304,7 +299,7 @@ exit:
* ldap_search_stW (WLDAP32.@)
*/
ULONG CDECL ldap_search_stW( LDAP *ld, const PWCHAR base, ULONG scope, const PWCHAR filter, WCHAR **attrs,
ULONG attrsonly, struct l_timeval *timeout, LDAPMessage **res )
ULONG attrsonly, struct l_timeval *timeout, WLDAP32_LDAPMessage **res )
{
TRACE( "(%p, %s, %#lx, %s, %p, %#lx, %p, %p)\n", ld, debugstr_w(base), scope, debugstr_w(filter), attrs,
attrsonly, timeout, res );
......
......@@ -31,7 +31,7 @@ static void test_ber_printf(void)
struct berval *bv;
ber = ber_alloc_t( 0 );
todo_wine ok( ber == NULL, "ber_alloc_t succeeded\n" );
ok( ber == NULL, "ber_alloc_t succeeded\n" );
ber = ber_alloc_t( LBER_USE_DER );
ok( ber != NULL, "ber_alloc_t failed\n" );
......
......@@ -23,7 +23,6 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap.h"
#include "wine/debug.h"
#include "winldap_private.h"
......@@ -33,10 +32,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
/***********************************************************************
* ldap_count_values_len (WLDAP32.@)
*/
ULONG CDECL WLDAP32_ldap_count_values_len( struct berval **values )
ULONG CDECL WLDAP32_ldap_count_values_len( struct WLDAP32_berval **values )
{
ULONG ret = 0;
struct berval **ptr = values;
struct WLDAP32_berval **ptr = values;
TRACE( "(%p)\n", values );
......@@ -78,7 +77,7 @@ ULONG CDECL ldap_count_valuesW( WCHAR **values )
/***********************************************************************
* ldap_get_valuesA (WLDAP32.@)
*/
char ** CDECL ldap_get_valuesA( LDAP *ld, LDAPMessage *entry, char *attr )
char ** CDECL ldap_get_valuesA( LDAP *ld, WLDAP32_LDAPMessage *entry, char *attr )
{
char **ret;
WCHAR *attrW = NULL, **retW;
......@@ -95,7 +94,7 @@ char ** CDECL ldap_get_valuesA( LDAP *ld, LDAPMessage *entry, char *attr )
return ret;
}
static char *bv2str( struct bervalU *bv )
static char *bv2str( struct berval *bv )
{
char *str = NULL;
unsigned int len = bv->bv_len;
......@@ -108,10 +107,10 @@ static char *bv2str( struct bervalU *bv )
return str;
}
static char **bv2str_array( struct bervalU **bv )
static char **bv2str_array( struct berval **bv )
{
unsigned int len = 0, i = 0;
struct bervalU **p = bv;
struct berval **p = bv;
char **str;
while (*p)
......@@ -141,24 +140,22 @@ static char **bv2str_array( struct bervalU **bv )
/***********************************************************************
* ldap_get_valuesW (WLDAP32.@)
*/
WCHAR ** CDECL ldap_get_valuesW( LDAP *ld, LDAPMessage *entry, WCHAR *attr )
WCHAR ** CDECL ldap_get_valuesW( LDAP *ld, WLDAP32_LDAPMessage *entry, WCHAR *attr )
{
WCHAR **ret = NULL;
char *attrU, **retU;
struct bervalU **bv;
struct berval **bv;
TRACE( "(%p, %p, %s)\n", ld, entry, debugstr_w(attr) );
if (ld && entry && attr && (attrU = strWtoU( attr )))
{
struct ldap_get_values_len_params params = { CTX(ld), MSG(entry), attrU, &bv };
if (!LDAP_CALL( ldap_get_values_len, &params ))
if ((bv = ldap_get_values_len( CTX(ld), MSG(entry), attrU )))
{
retU = bv2str_array( bv );
ret = strarrayUtoW( retU );
LDAP_CALL( ldap_value_free_len, bv );
ldap_value_free_len( bv );
strarrayfreeU( retU );
}
free( attrU );
......@@ -169,10 +166,10 @@ WCHAR ** CDECL ldap_get_valuesW( LDAP *ld, LDAPMessage *entry, WCHAR *attr )
/***********************************************************************
* ldap_get_values_lenA (WLDAP32.@)
*/
struct berval ** CDECL ldap_get_values_lenA( LDAP *ld, LDAPMessage *message, char *attr )
struct WLDAP32_berval ** CDECL ldap_get_values_lenA( LDAP *ld, LDAPMessage *message, char *attr )
{
WCHAR *attrW;
struct berval **ret;
struct WLDAP32_berval **ret;
TRACE( "(%p, %p, %s)\n", ld, message, debugstr_a(attr) );
......@@ -187,24 +184,21 @@ struct berval ** CDECL ldap_get_values_lenA( LDAP *ld, LDAPMessage *message, cha
/***********************************************************************
* ldap_get_values_lenW (WLDAP32.@)
*/
struct berval ** CDECL ldap_get_values_lenW( LDAP *ld, LDAPMessage *message, WCHAR *attr )
struct WLDAP32_berval ** CDECL ldap_get_values_lenW( LDAP *ld, WLDAP32_LDAPMessage *message, WCHAR *attr )
{
char *attrU = NULL;
struct bervalU **retU;
struct berval **ret = NULL;
struct berval **retU;
struct WLDAP32_berval **ret = NULL;
TRACE( "(%p, %p, %s)\n", ld, message, debugstr_w(attr) );
if (ld && message && attr && (attrU = strWtoU( attr )))
{
struct ldap_get_values_len_params params = { CTX(ld), MSG(message), attrU, &retU };
if (!LDAP_CALL( ldap_get_values_len, &params ))
if ((retU = ldap_get_values_len( CTX(ld), MSG(message), attrU )))
{
ret = bvarrayUtoW( retU );
bvarrayfreeU( retU );
}
free( attrU );
}
return ret;
......@@ -213,7 +207,7 @@ struct berval ** CDECL ldap_get_values_lenW( LDAP *ld, LDAPMessage *message, WCH
/***********************************************************************
* ldap_value_free_len (WLDAP32.@)
*/
ULONG CDECL WLDAP32_ldap_value_free_len( struct berval **values )
ULONG CDECL WLDAP32_ldap_value_free_len( struct WLDAP32_berval **values )
{
TRACE( "(%p)\n", values );
......
......@@ -140,15 +140,6 @@
/* Define to 1 if you have the <krb5/krb5.h> header file. */
#undef HAVE_KRB5_KRB5_H
/* Define to 1 if you have the <lber.h> header file. */
#undef HAVE_LBER_H
/* Define if you have the OpenLDAP development environment */
#undef HAVE_LDAP
/* Define to 1 if you have the <ldap.h> header file. */
#undef HAVE_LDAP_H
/* Define to 1 if you have the `gettextpo' library (-lgettextpo). */
#undef HAVE_LIBGETTEXTPO
......@@ -377,9 +368,6 @@
/* Define to 1 if you have the `res_getservers' function. */
#undef HAVE_RES_GETSERVERS
/* Define to 1 if you have the <sasl/sasl.h> header file. */
#undef HAVE_SASL_SASL_H
/* Define to 1 if you have the <sched.h> header file. */
#undef HAVE_SCHED_H
......
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