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