Commit 8db46756 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wldap32: Get rid of the WLDAP32_ prefix.

We can now include the public header without conflicts. Signed-off-by: 's avatarHans Leidekker <hans@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 81e418ef
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#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,9 +34,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32); ...@@ -33,9 +34,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
* *
* See ldap_addW. * See ldap_addW.
*/ */
ULONG CDECL ldap_addA( WLDAP32_LDAP *ld, char *dn, LDAPModA **attrs ) ULONG CDECL ldap_addA( LDAP *ld, char *dn, LDAPModA **attrs )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL; WCHAR *dnW = NULL;
LDAPModW **attrsW = NULL; LDAPModW **attrsW = NULL;
...@@ -74,14 +75,14 @@ exit: ...@@ -74,14 +75,14 @@ exit:
* the operation. Cancel the operation by calling ldap_abandon * the operation. Cancel the operation by calling ldap_abandon
* with the message ID. * with the message ID.
*/ */
ULONG CDECL ldap_addW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **attrs ) ULONG CDECL ldap_addW( LDAP *ld, WCHAR *dn, LDAPModW **attrs )
{ {
ULONG ret, msg; ULONG ret, msg;
TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), attrs ); TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), attrs );
ret = ldap_add_extW( ld, dn, attrs, NULL, NULL, &msg ); ret = ldap_add_extW( ld, dn, attrs, NULL, NULL, &msg );
if (ret == WLDAP32_LDAP_SUCCESS) return msg; if (ret == LDAP_SUCCESS) return msg;
return ~0u; return ~0u;
} }
...@@ -90,17 +91,17 @@ ULONG CDECL ldap_addW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **attrs ) ...@@ -90,17 +91,17 @@ ULONG CDECL ldap_addW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **attrs )
* *
* See ldap_add_extW. * See ldap_add_extW.
*/ */
ULONG CDECL ldap_add_extA( WLDAP32_LDAP *ld, char *dn, LDAPModA **attrs, LDAPControlA **serverctrls, ULONG CDECL ldap_add_extA( LDAP *ld, char *dn, LDAPModA **attrs, LDAPControlA **serverctrls,
LDAPControlA **clientctrls, ULONG *message ) LDAPControlA **clientctrls, ULONG *message )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL; WCHAR *dnW = NULL;
LDAPModW **attrsW = NULL; LDAPModW **attrsW = NULL;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
TRACE( "(%p, %s, %p, %p, %p, %p)\n", ld, debugstr_a(dn), attrs, serverctrls, clientctrls, message ); TRACE( "(%p, %s, %p, %p, %p, %p)\n", ld, debugstr_a(dn), attrs, serverctrls, clientctrls, message );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) goto exit; if (dn && !(dnW = strAtoW( dn ))) goto exit;
if (attrs && !(attrsW = modarrayAtoW( attrs ))) goto exit; if (attrs && !(attrsW = modarrayAtoW( attrs ))) goto exit;
...@@ -140,24 +141,24 @@ exit: ...@@ -140,24 +141,24 @@ exit:
* the operation. The serverctrls and clientctrls parameters are * the operation. The serverctrls and clientctrls parameters are
* optional and should be set to NULL if not used. * optional and should be set to NULL if not used.
*/ */
ULONG CDECL ldap_add_extW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **attrs, LDAPControlW **serverctrls, ULONG CDECL ldap_add_extW( LDAP *ld, WCHAR *dn, LDAPModW **attrs, LDAPControlW **serverctrls,
LDAPControlW **clientctrls, ULONG *message ) LDAPControlW **clientctrls, ULONG *message )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
char *dnU = NULL; char *dnU = NULL;
LDAPModU **attrsU = NULL; LDAPModU **attrsU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **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 );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnU = strWtoU( dn ))) goto exit; if (dn && !(dnU = strWtoU( dn ))) goto exit;
if (attrs && !(attrsU = modarrayWtoU( attrs ))) goto exit; if (attrs && !(attrsU = modarrayWtoU( attrs ))) goto exit;
if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit;
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit; if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
ret = map_error( ldap_funcs->ldap_add_ext( ld->ld, dnU, attrsU, serverctrlsU, clientctrlsU, message ) ); ret = map_error( ldap_funcs->fn_ldap_add_ext( CTX(ld), dnU, attrsU, serverctrlsU, clientctrlsU, message ) );
exit: exit:
free( dnU ); free( dnU );
...@@ -172,17 +173,17 @@ exit: ...@@ -172,17 +173,17 @@ exit:
* *
* See ldap_add_ext_sW. * See ldap_add_ext_sW.
*/ */
ULONG CDECL ldap_add_ext_sA( WLDAP32_LDAP *ld, char *dn, LDAPModA **attrs, LDAPControlA **serverctrls, ULONG CDECL ldap_add_ext_sA( LDAP *ld, char *dn, LDAPModA **attrs, LDAPControlA **serverctrls,
LDAPControlA **clientctrls ) LDAPControlA **clientctrls )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL; WCHAR *dnW = NULL;
LDAPModW **attrsW = NULL; LDAPModW **attrsW = NULL;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_a(dn), attrs, serverctrls, clientctrls ); TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_a(dn), attrs, serverctrls, clientctrls );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) goto exit; if (dn && !(dnW = strAtoW( dn ))) goto exit;
if (attrs && !(attrsW = modarrayAtoW( attrs ))) goto exit; if (attrs && !(attrsW = modarrayAtoW( attrs ))) goto exit;
...@@ -220,24 +221,24 @@ exit: ...@@ -220,24 +221,24 @@ exit:
* The serverctrls and clientctrls parameters are optional and * The serverctrls and clientctrls parameters are optional and
* should be set to NULL if not used. * should be set to NULL if not used.
*/ */
ULONG CDECL ldap_add_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **attrs, LDAPControlW **serverctrls, ULONG CDECL ldap_add_ext_sW( LDAP *ld, WCHAR *dn, LDAPModW **attrs, LDAPControlW **serverctrls,
LDAPControlW **clientctrls ) LDAPControlW **clientctrls )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
char *dnU = NULL; char *dnU = NULL;
LDAPModU **attrsU = NULL; LDAPModU **attrsU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **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 );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnU = strWtoU( dn ))) goto exit; if (dn && !(dnU = strWtoU( dn ))) goto exit;
if (attrs && !(attrsU = modarrayWtoU( attrs ))) goto exit; if (attrs && !(attrsU = modarrayWtoU( attrs ))) goto exit;
if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit;
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit; if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
ret = map_error( ldap_funcs->ldap_add_ext_s( ld->ld, dnU, attrsU, serverctrlsU, clientctrlsU ) ); ret = map_error( ldap_funcs->fn_ldap_add_ext_s( CTX(ld), dnU, attrsU, serverctrlsU, clientctrlsU ) );
exit: exit:
free( dnU ); free( dnU );
...@@ -252,15 +253,15 @@ exit: ...@@ -252,15 +253,15 @@ exit:
* *
* See ldap_add_sW. * See ldap_add_sW.
*/ */
ULONG CDECL ldap_add_sA( WLDAP32_LDAP *ld, char *dn, LDAPModA **attrs ) ULONG CDECL ldap_add_sA( LDAP *ld, char *dn, LDAPModA **attrs )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL; WCHAR *dnW = NULL;
LDAPModW **attrsW = NULL; LDAPModW **attrsW = NULL;
TRACE( "(%p, %s, %p)\n", ld, debugstr_a(dn), attrs ); TRACE( "(%p, %s, %p)\n", ld, debugstr_a(dn), attrs );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) goto exit; if (dn && !(dnW = strAtoW( dn ))) goto exit;
if (attrs && !(attrsW = modarrayAtoW( attrs ))) goto exit; if (attrs && !(attrsW = modarrayAtoW( attrs ))) goto exit;
...@@ -288,7 +289,7 @@ exit: ...@@ -288,7 +289,7 @@ exit:
* Success: LDAP_SUCCESS * Success: LDAP_SUCCESS
* Failure: An LDAP error code. * Failure: An LDAP error code.
*/ */
ULONG CDECL ldap_add_sW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **attrs ) ULONG CDECL ldap_add_sW( LDAP *ld, WCHAR *dn, LDAPModW **attrs )
{ {
TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), attrs ); TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), attrs );
return ldap_add_ext_sW( ld, dn, attrs, NULL, NULL ); return ldap_add_ext_sW( ld, dn, attrs, NULL, NULL );
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#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 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32); ...@@ -33,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
* *
* See ldap_compareW. * See ldap_compareW.
*/ */
ULONG CDECL ldap_compareA( WLDAP32_LDAP *ld, char *dn, char *attr, char *value ) ULONG CDECL ldap_compareA( LDAP *ld, char *dn, char *attr, char *value )
{ {
ULONG ret = ~0u; ULONG ret = ~0u;
WCHAR *dnW = NULL, *attrW = NULL, *valueW = NULL; WCHAR *dnW = NULL, *attrW = NULL, *valueW = NULL;
...@@ -70,14 +71,14 @@ exit: ...@@ -70,14 +71,14 @@ exit:
* Success: Message ID of the compare operation. * Success: Message ID of the compare operation.
* Failure: An LDAP error code. * Failure: An LDAP error code.
*/ */
ULONG CDECL ldap_compareW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value ) ULONG CDECL ldap_compareW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value )
{ {
ULONG msg, ret; ULONG msg, ret;
TRACE( "(%p, %s, %s, %s)\n", ld, debugstr_w(dn), debugstr_w(attr), debugstr_w(value) ); TRACE( "(%p, %s, %s, %s)\n", ld, debugstr_w(dn), debugstr_w(attr), debugstr_w(value) );
ret = ldap_compare_extW( ld, dn, attr, value, NULL, NULL, NULL, &msg ); ret = ldap_compare_extW( ld, dn, attr, value, NULL, NULL, NULL, &msg );
if (ret == WLDAP32_LDAP_SUCCESS) return msg; if (ret == LDAP_SUCCESS) return msg;
return ~0u; return ~0u;
} }
...@@ -86,18 +87,18 @@ ULONG CDECL ldap_compareW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *valu ...@@ -86,18 +87,18 @@ ULONG CDECL ldap_compareW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *valu
* *
* See ldap_compare_extW. * See ldap_compare_extW.
*/ */
ULONG CDECL ldap_compare_extA( WLDAP32_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, LDAPControlA **serverctrls, LDAPControlA **clientctrls, struct berval *data, LDAPControlA **serverctrls, LDAPControlA **clientctrls,
ULONG *message ) ULONG *message )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL, *attrW = NULL, *valueW = NULL; WCHAR *dnW = NULL, *attrW = NULL, *valueW = NULL;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
TRACE( "(%p, %s, %s, %s, %p, %p, %p, %p)\n", ld, debugstr_a(dn), debugstr_a(attr), debugstr_a(value), TRACE( "(%p, %s, %s, %s, %p, %p, %p, %p)\n", ld, debugstr_a(dn), debugstr_a(attr), debugstr_a(value),
data, serverctrls, clientctrls, message ); data, serverctrls, clientctrls, message );
if (!ld || !message) return WLDAP32_LDAP_PARAM_ERROR; if (!ld || !message) return LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) goto exit; if (dn && !(dnW = strAtoW( dn ))) goto exit;
if (attr && !(attrW = strAtoW( attr ))) goto exit; if (attr && !(attrW = strAtoW( attr ))) goto exit;
...@@ -140,10 +141,10 @@ exit: ...@@ -140,10 +141,10 @@ exit:
* both are non-NULL, data will be used. The serverctrls and clientctrls * both are non-NULL, data will be used. The serverctrls and clientctrls
* parameters are optional and should be set to NULL if not used. * parameters are optional and should be set to NULL if not used.
*/ */
ULONG CDECL ldap_compare_extW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, ULONG CDECL ldap_compare_extW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, struct berval *data,
struct WLDAP32_berval *data, LDAPControlW **serverctrls, LDAPControlW **clientctrls, ULONG *message ) LDAPControlW **serverctrls, LDAPControlW **clientctrls, ULONG *message )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
char *dnU = NULL, *attrU = NULL, *valueU = NULL; char *dnU = NULL, *attrU = NULL, *valueU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
struct bervalU *dataU = NULL, val = { 0, NULL }; struct bervalU *dataU = NULL, val = { 0, NULL };
...@@ -151,8 +152,8 @@ ULONG CDECL ldap_compare_extW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR * ...@@ -151,8 +152,8 @@ ULONG CDECL ldap_compare_extW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *
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 );
if (!ld || !message) return WLDAP32_LDAP_PARAM_ERROR; if (!ld || !message) return LDAP_PARAM_ERROR;
if (!attr) return WLDAP32_LDAP_NO_MEMORY; if (!attr) return LDAP_NO_MEMORY;
if (dn && !(dnU = strWtoU( dn ))) goto exit; if (dn && !(dnU = strWtoU( dn ))) goto exit;
if (!(attrU = strWtoU( attr ))) goto exit; if (!(attrU = strWtoU( attr ))) goto exit;
...@@ -170,8 +171,8 @@ ULONG CDECL ldap_compare_extW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR * ...@@ -170,8 +171,8 @@ ULONG CDECL ldap_compare_extW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *
if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit;
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit; if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
ret = map_error( ldap_funcs->ldap_compare_ext( ld->ld, dnU, attrU, dataU ? dataU : &val, serverctrlsU, ret = map_error( ldap_funcs->fn_ldap_compare_ext( CTX(ld), dnU, attrU, dataU ? dataU : &val, serverctrlsU,
clientctrlsU, message ) ); clientctrlsU, message ) );
exit: exit:
free( dnU ); free( dnU );
free( attrU ); free( attrU );
...@@ -187,17 +188,17 @@ exit: ...@@ -187,17 +188,17 @@ exit:
* *
* See ldap_compare_ext_sW. * See ldap_compare_ext_sW.
*/ */
ULONG CDECL ldap_compare_ext_sA( WLDAP32_LDAP *ld, char *dn, char *attr, char *value, ULONG CDECL ldap_compare_ext_sA( LDAP *ld, char *dn, char *attr, char *value, struct berval *data,
struct WLDAP32_berval *data, LDAPControlA **serverctrls, LDAPControlA **clientctrls ) LDAPControlA **serverctrls, LDAPControlA **clientctrls )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL, *attrW = NULL, *valueW = NULL; WCHAR *dnW = NULL, *attrW = NULL, *valueW = NULL;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
TRACE( "(%p, %s, %s, %s, %p, %p, %p)\n", ld, debugstr_a(dn), debugstr_a(attr), debugstr_a(value), TRACE( "(%p, %s, %s, %s, %p, %p, %p)\n", ld, debugstr_a(dn), debugstr_a(attr), debugstr_a(value),
data, serverctrls, clientctrls ); data, serverctrls, clientctrls );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) goto exit; if (dn && !(dnW = strAtoW( dn ))) goto exit;
if (attr && !(attrW = strAtoW( attr ))) goto exit; if (attr && !(attrW = strAtoW( attr ))) goto exit;
...@@ -239,10 +240,10 @@ exit: ...@@ -239,10 +240,10 @@ exit:
* both are non-NULL, data will be used. The serverctrls and clientctrls * both are non-NULL, data will be used. The serverctrls and clientctrls
* parameters are optional and should be set to NULL if not used. * parameters are optional and should be set to NULL if not used.
*/ */
ULONG CDECL ldap_compare_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, ULONG CDECL ldap_compare_ext_sW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, struct berval *data,
struct WLDAP32_berval *data, LDAPControlW **serverctrls, LDAPControlW **clientctrls ) LDAPControlW **serverctrls, LDAPControlW **clientctrls )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
char *dnU = NULL, *attrU = NULL, *valueU = NULL; char *dnU = NULL, *attrU = NULL, *valueU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
struct bervalU *dataU = NULL, val = { 0, NULL }; struct bervalU *dataU = NULL, val = { 0, NULL };
...@@ -250,7 +251,7 @@ ULONG CDECL ldap_compare_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR ...@@ -250,7 +251,7 @@ ULONG CDECL ldap_compare_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR
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 );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnU = strWtoU( dn ))) goto exit; if (dn && !(dnU = strWtoU( dn ))) goto exit;
if (attr && !(attrU = strWtoU( attr ))) goto exit; if (attr && !(attrU = strWtoU( attr ))) goto exit;
...@@ -268,8 +269,8 @@ ULONG CDECL ldap_compare_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR ...@@ -268,8 +269,8 @@ ULONG CDECL ldap_compare_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR
if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit;
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit; if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
ret = map_error( ldap_funcs->ldap_compare_ext_s( ld->ld, dnU, attrU, dataU ? dataU : &val, serverctrlsU, ret = map_error( ldap_funcs->fn_ldap_compare_ext_s( CTX(ld), dnU, attrU, dataU ? dataU : &val, serverctrlsU,
clientctrlsU ) ); clientctrlsU ) );
exit: exit:
free( dnU ); free( dnU );
free( attrU ); free( attrU );
...@@ -285,14 +286,14 @@ exit: ...@@ -285,14 +286,14 @@ exit:
* *
* See ldap_compare_sW. * See ldap_compare_sW.
*/ */
ULONG CDECL ldap_compare_sA( WLDAP32_LDAP *ld, PCHAR dn, PCHAR attr, PCHAR value ) ULONG CDECL ldap_compare_sA( LDAP *ld, PCHAR dn, PCHAR attr, PCHAR value )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL, *attrW = NULL, *valueW = NULL; WCHAR *dnW = NULL, *attrW = NULL, *valueW = NULL;
TRACE( "(%p, %s, %s, %s)\n", ld, debugstr_a(dn), debugstr_a(attr), debugstr_a(value) ); TRACE( "(%p, %s, %s, %s)\n", ld, debugstr_a(dn), debugstr_a(attr), debugstr_a(value) );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) goto exit; if (dn && !(dnW = strAtoW( dn ))) goto exit;
if (attr && !(attrW = strAtoW( attr ))) goto exit; if (attr && !(attrW = strAtoW( attr ))) goto exit;
...@@ -322,7 +323,7 @@ exit: ...@@ -322,7 +323,7 @@ exit:
* Success: LDAP_SUCCESS * Success: LDAP_SUCCESS
* Failure: An LDAP error code. * Failure: An LDAP error code.
*/ */
ULONG CDECL ldap_compare_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value ) ULONG CDECL ldap_compare_sW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value )
{ {
TRACE( "(%p, %s, %s, %s)\n", ld, debugstr_w(dn), debugstr_w(attr), debugstr_w(value) ); TRACE( "(%p, %s, %s, %s)\n", ld, debugstr_w(dn), debugstr_w(attr), debugstr_w(value) );
return ldap_compare_ext_sW( ld, dn, attr, value, NULL, NULL, NULL ); return ldap_compare_ext_sW( ld, dn, attr, value, NULL, NULL, NULL );
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#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"
...@@ -37,7 +38,7 @@ ULONG CDECL ldap_control_freeA( LDAPControlA *control ) ...@@ -37,7 +38,7 @@ ULONG CDECL ldap_control_freeA( LDAPControlA *control )
{ {
TRACE( "(%p)\n", control ); TRACE( "(%p)\n", control );
controlfreeA( control ); controlfreeA( control );
return WLDAP32_LDAP_SUCCESS; return LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -55,7 +56,7 @@ ULONG CDECL ldap_control_freeW( LDAPControlW *control ) ...@@ -55,7 +56,7 @@ ULONG CDECL ldap_control_freeW( LDAPControlW *control )
{ {
TRACE( "(%p)\n", control ); TRACE( "(%p)\n", control );
controlfreeW( control ); controlfreeW( control );
return WLDAP32_LDAP_SUCCESS; return LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -67,7 +68,7 @@ ULONG CDECL ldap_controls_freeA( LDAPControlA **controls ) ...@@ -67,7 +68,7 @@ ULONG CDECL ldap_controls_freeA( LDAPControlA **controls )
{ {
TRACE( "(%p)\n", controls ); TRACE( "(%p)\n", controls );
controlarrayfreeA( controls ); controlarrayfreeA( controls );
return WLDAP32_LDAP_SUCCESS; return LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -85,7 +86,7 @@ ULONG CDECL ldap_controls_freeW( LDAPControlW **controls ) ...@@ -85,7 +86,7 @@ ULONG CDECL ldap_controls_freeW( LDAPControlW **controls )
{ {
TRACE( "(%p)\n", controls ); TRACE( "(%p)\n", controls );
controlarrayfreeW( controls ); controlarrayfreeW( controls );
return WLDAP32_LDAP_SUCCESS; return LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -93,8 +94,7 @@ ULONG CDECL ldap_controls_freeW( LDAPControlW **controls ) ...@@ -93,8 +94,7 @@ ULONG CDECL ldap_controls_freeW( LDAPControlW **controls )
* *
* See ldap_create_sort_controlW. * See ldap_create_sort_controlW.
*/ */
ULONG CDECL ldap_create_sort_controlA( WLDAP32_LDAP *ld, LDAPSortKeyA **sortkey, UCHAR critical, ULONG CDECL ldap_create_sort_controlA( LDAP *ld, LDAPSortKeyA **sortkey, UCHAR critical, LDAPControlA **control )
LDAPControlA **control )
{ {
ULONG ret; ULONG ret;
LDAPSortKeyW **sortkeyW; LDAPSortKeyW **sortkeyW;
...@@ -102,16 +102,16 @@ ULONG CDECL ldap_create_sort_controlA( WLDAP32_LDAP *ld, LDAPSortKeyA **sortkey, ...@@ -102,16 +102,16 @@ ULONG CDECL ldap_create_sort_controlA( WLDAP32_LDAP *ld, LDAPSortKeyA **sortkey,
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 LDAP_PARAM_ERROR;
if (!(sortkeyW = sortkeyarrayAtoW( sortkey ))) return WLDAP32_LDAP_NO_MEMORY; if (!(sortkeyW = sortkeyarrayAtoW( sortkey ))) return LDAP_NO_MEMORY;
ret = ldap_create_sort_controlW( ld, sortkeyW, critical, &controlW ); ret = ldap_create_sort_controlW( ld, sortkeyW, critical, &controlW );
if (ret == WLDAP32_LDAP_SUCCESS) if (ret == LDAP_SUCCESS)
{ {
LDAPControlA *controlA = controlWtoA( controlW ); LDAPControlA *controlA = controlWtoA( controlW );
if (controlA) *control = controlA; if (controlA) *control = controlA;
else ret = WLDAP32_LDAP_NO_MEMORY; else ret = LDAP_NO_MEMORY;
ldap_control_freeW( controlW ); ldap_control_freeW( controlW );
} }
...@@ -141,8 +141,7 @@ ULONG CDECL ldap_create_sort_controlA( WLDAP32_LDAP *ld, LDAPSortKeyA **sortkey, ...@@ -141,8 +141,7 @@ ULONG CDECL ldap_create_sort_controlA( WLDAP32_LDAP *ld, LDAPSortKeyA **sortkey,
* Pass the created control as a server control in subsequent calls * Pass the created control as a server control in subsequent calls
* to ldap_search_ext(_s) to obtain sorted search results. * to ldap_search_ext(_s) to obtain sorted search results.
*/ */
ULONG CDECL ldap_create_sort_controlW( WLDAP32_LDAP *ld, LDAPSortKeyW **sortkey, UCHAR critical, ULONG CDECL ldap_create_sort_controlW( LDAP *ld, LDAPSortKeyW **sortkey, UCHAR critical, LDAPControlW **control )
LDAPControlW **control )
{ {
ULONG ret; ULONG ret;
LDAPSortKeyU **sortkeyU; LDAPSortKeyU **sortkeyU;
...@@ -150,17 +149,17 @@ ULONG CDECL ldap_create_sort_controlW( WLDAP32_LDAP *ld, LDAPSortKeyW **sortkey, ...@@ -150,17 +149,17 @@ ULONG CDECL ldap_create_sort_controlW( WLDAP32_LDAP *ld, LDAPSortKeyW **sortkey,
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 LDAP_PARAM_ERROR;
if (!(sortkeyU = sortkeyarrayWtoU( sortkey ))) return WLDAP32_LDAP_NO_MEMORY; if (!(sortkeyU = sortkeyarrayWtoU( sortkey ))) return LDAP_NO_MEMORY;
ret = map_error( ldap_funcs->ldap_create_sort_control( ld->ld, sortkeyU, critical, &controlU ) ); ret = map_error( ldap_funcs->fn_ldap_create_sort_control( CTX(ld), sortkeyU, critical, &controlU ) );
if (ret == WLDAP32_LDAP_SUCCESS) if (ret == 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 = LDAP_NO_MEMORY;
ldap_funcs->ldap_control_free( controlU ); ldap_funcs->fn_ldap_control_free( controlU );
} }
sortkeyarrayfreeU( sortkeyU ); sortkeyarrayfreeU( sortkeyU );
...@@ -172,8 +171,7 @@ ULONG CDECL ldap_create_sort_controlW( WLDAP32_LDAP *ld, LDAPSortKeyW **sortkey, ...@@ -172,8 +171,7 @@ ULONG CDECL ldap_create_sort_controlW( WLDAP32_LDAP *ld, LDAPSortKeyW **sortkey,
* *
* See ldap_create_vlv_controlW. * See ldap_create_vlv_controlW.
*/ */
INT CDECL ldap_create_vlv_controlA( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info, UCHAR critical, INT CDECL ldap_create_vlv_controlA( LDAP *ld, LDAPVLVInfo *info, UCHAR critical, LDAPControlA **control )
LDAPControlA **control )
{ {
INT ret; INT ret;
LDAPControlW *controlW; LDAPControlW *controlW;
...@@ -183,11 +181,11 @@ INT CDECL ldap_create_vlv_controlA( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info, ...@@ -183,11 +181,11 @@ INT CDECL ldap_create_vlv_controlA( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info,
if (!ld || !control) return ~0u; if (!ld || !control) return ~0u;
ret = ldap_create_vlv_controlW( ld, info, critical, &controlW ); ret = ldap_create_vlv_controlW( ld, info, critical, &controlW );
if (ret == WLDAP32_LDAP_SUCCESS) if (ret == LDAP_SUCCESS)
{ {
LDAPControlA *controlA = controlWtoA( controlW ); LDAPControlA *controlA = controlWtoA( controlW );
if (controlA) *control = controlA; if (controlA) *control = controlA;
else ret = WLDAP32_LDAP_NO_MEMORY; else ret = LDAP_NO_MEMORY;
ldap_control_freeW( controlW ); ldap_control_freeW( controlW );
} }
...@@ -216,8 +214,7 @@ INT CDECL ldap_create_vlv_controlA( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info, ...@@ -216,8 +214,7 @@ INT CDECL ldap_create_vlv_controlA( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info,
* server will then return a sorted, contiguous subset of results * server will then return a sorted, contiguous subset of results
* that meets the criteria specified in the LDAPVLVInfo structure. * that meets the criteria specified in the LDAPVLVInfo structure.
*/ */
INT CDECL ldap_create_vlv_controlW( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info, UCHAR critical, INT CDECL ldap_create_vlv_controlW( LDAP *ld, LDAPVLVInfo *info, UCHAR critical, LDAPControlW **control )
LDAPControlW **control )
{ {
ULONG ret; ULONG ret;
LDAPVLVInfoU *infoU = NULL; LDAPVLVInfoU *infoU = NULL;
...@@ -227,22 +224,22 @@ INT CDECL ldap_create_vlv_controlW( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info, ...@@ -227,22 +224,22 @@ INT CDECL ldap_create_vlv_controlW( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info,
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 LDAP_NO_MEMORY;
ret = map_error( ldap_funcs->ldap_create_vlv_control( ld->ld, infoU, &controlU ) ); ret = map_error( ldap_funcs->fn_ldap_create_vlv_control( CTX(ld), infoU, &controlU ) );
if (ret == WLDAP32_LDAP_SUCCESS) if (ret == 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 = LDAP_NO_MEMORY;
ldap_funcs->ldap_control_free( controlU ); ldap_funcs->fn_ldap_control_free( controlU );
} }
vlvinfofreeU( infoU ); vlvinfofreeU( infoU );
return ret; return ret;
} }
static inline void bv_val_dup( const struct WLDAP32_berval *src, struct WLDAP32_berval *dst ) static inline void bv_val_dup( const struct berval *src, struct berval *dst )
{ {
if ((dst->bv_val = RtlAllocateHeap( GetProcessHeap(), 0 , src->bv_len ))) if ((dst->bv_val = RtlAllocateHeap( GetProcessHeap(), 0 , src->bv_len )))
{ {
...@@ -258,12 +255,12 @@ static inline void bv_val_dup( const struct WLDAP32_berval *src, struct WLDAP32_ ...@@ -258,12 +255,12 @@ static inline void bv_val_dup( const struct WLDAP32_berval *src, struct WLDAP32_
* *
* See ldap_encode_sort_controlW. * See ldap_encode_sort_controlW.
*/ */
ULONG CDECL ldap_encode_sort_controlA( WLDAP32_LDAP *ld, LDAPSortKeyA **sortkeys, LDAPControlA *ret, BOOLEAN critical ) ULONG CDECL ldap_encode_sort_controlA( LDAP *ld, LDAPSortKeyA **sortkeys, LDAPControlA *ret, BOOLEAN critical )
{ {
LDAPControlA *control; LDAPControlA *control;
ULONG result; ULONG result;
if ((result = ldap_create_sort_controlA( ld, sortkeys, critical, &control )) == WLDAP32_LDAP_SUCCESS) if ((result = ldap_create_sort_controlA( ld, sortkeys, critical, &control )) == LDAP_SUCCESS)
{ {
ret->ldctl_oid = strdupU(control->ldctl_oid); ret->ldctl_oid = strdupU(control->ldctl_oid);
bv_val_dup( &control->ldctl_value, &ret->ldctl_value ); bv_val_dup( &control->ldctl_value, &ret->ldctl_value );
...@@ -295,12 +292,12 @@ ULONG CDECL ldap_encode_sort_controlA( WLDAP32_LDAP *ld, LDAPSortKeyA **sortkeys ...@@ -295,12 +292,12 @@ ULONG CDECL ldap_encode_sort_controlA( WLDAP32_LDAP *ld, LDAPSortKeyA **sortkeys
* This function is obsolete. Use its equivalent * This function is obsolete. Use its equivalent
* ldap_create_sort_control instead. * ldap_create_sort_control instead.
*/ */
ULONG CDECL ldap_encode_sort_controlW( WLDAP32_LDAP *ld, LDAPSortKeyW **sortkeys, LDAPControlW *ret, BOOLEAN critical ) ULONG CDECL ldap_encode_sort_controlW( LDAP *ld, LDAPSortKeyW **sortkeys, LDAPControlW *ret, BOOLEAN critical )
{ {
LDAPControlW *control; LDAPControlW *control;
ULONG result; ULONG result;
if ((result = ldap_create_sort_controlW( ld, sortkeys, critical, &control )) == WLDAP32_LDAP_SUCCESS) if ((result = ldap_create_sort_controlW( ld, sortkeys, critical, &control )) == LDAP_SUCCESS)
{ {
ret->ldctl_oid = strdupW(control->ldctl_oid); ret->ldctl_oid = strdupW(control->ldctl_oid);
bv_val_dup( &control->ldctl_value, &ret->ldctl_value ); bv_val_dup( &control->ldctl_value, &ret->ldctl_value );
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#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 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32); ...@@ -33,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
* *
* See ldap_deleteW. * See ldap_deleteW.
*/ */
ULONG CDECL ldap_deleteA( WLDAP32_LDAP *ld, char *dn ) ULONG CDECL ldap_deleteA( LDAP *ld, char *dn )
{ {
ULONG ret; ULONG ret;
WCHAR *dnW = NULL; WCHAR *dnW = NULL;
...@@ -41,7 +42,7 @@ ULONG CDECL ldap_deleteA( WLDAP32_LDAP *ld, char *dn ) ...@@ -41,7 +42,7 @@ ULONG CDECL ldap_deleteA( WLDAP32_LDAP *ld, char *dn )
TRACE( "(%p, %s)\n", ld, debugstr_a(dn) ); TRACE( "(%p, %s)\n", ld, debugstr_a(dn) );
if (!ld) return ~0u; if (!ld) return ~0u;
if (dn && !(dnW = strAtoW( dn ))) return WLDAP32_LDAP_NO_MEMORY; if (dn && !(dnW = strAtoW( dn ))) return LDAP_NO_MEMORY;
ret = ldap_deleteW( ld, dnW ); ret = ldap_deleteW( ld, dnW );
free( dnW ); free( dnW );
...@@ -66,14 +67,14 @@ ULONG CDECL ldap_deleteA( WLDAP32_LDAP *ld, char *dn ) ...@@ -66,14 +67,14 @@ ULONG CDECL ldap_deleteA( WLDAP32_LDAP *ld, char *dn )
* the operation. Cancel the operation by calling ldap_abandon * the operation. Cancel the operation by calling ldap_abandon
* with the message ID. * with the message ID.
*/ */
ULONG CDECL ldap_deleteW( WLDAP32_LDAP *ld, WCHAR *dn ) ULONG CDECL ldap_deleteW( LDAP *ld, WCHAR *dn )
{ {
ULONG ret, msg; ULONG ret, msg;
TRACE( "(%p, %s)\n", ld, debugstr_w(dn) ); TRACE( "(%p, %s)\n", ld, debugstr_w(dn) );
ret = ldap_delete_extW( ld, dn, NULL, NULL, &msg ); ret = ldap_delete_extW( ld, dn, NULL, NULL, &msg );
if (ret == WLDAP32_LDAP_SUCCESS) return msg; if (ret == LDAP_SUCCESS) return msg;
return ~0u; return ~0u;
} }
...@@ -82,16 +83,16 @@ ULONG CDECL ldap_deleteW( WLDAP32_LDAP *ld, WCHAR *dn ) ...@@ -82,16 +83,16 @@ ULONG CDECL ldap_deleteW( WLDAP32_LDAP *ld, WCHAR *dn )
* *
* See ldap_delete_extW. * See ldap_delete_extW.
*/ */
ULONG CDECL ldap_delete_extA( WLDAP32_LDAP *ld, char *dn, LDAPControlA **serverctrls, ULONG CDECL ldap_delete_extA( LDAP *ld, char *dn, LDAPControlA **serverctrls, LDAPControlA **clientctrls,
LDAPControlA **clientctrls, ULONG *message ) ULONG *message )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL; WCHAR *dnW = NULL;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_a(dn), serverctrls, clientctrls, message ); TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_a(dn), serverctrls, clientctrls, message );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) goto exit; if (dn && !(dnW = strAtoW( dn ))) goto exit;
if (serverctrls && !(serverctrlsW = controlarrayAtoW( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsW = controlarrayAtoW( serverctrls ))) goto exit;
...@@ -127,22 +128,22 @@ exit: ...@@ -127,22 +128,22 @@ exit:
* the operation. The serverctrls and clientctrls parameters are * the operation. The serverctrls and clientctrls parameters are
* optional and should be set to NULL if not used. * optional and should be set to NULL if not used.
*/ */
ULONG CDECL ldap_delete_extW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPControlW **serverctrls, ULONG CDECL ldap_delete_extW( LDAP *ld, WCHAR *dn, LDAPControlW **serverctrls, LDAPControlW **clientctrls,
LDAPControlW **clientctrls, ULONG *message ) ULONG *message )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
char *dnU = NULL; char *dnU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **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 );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnU = strWtoU( dn ))) goto exit; if (dn && !(dnU = strWtoU( dn ))) goto exit;
if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit;
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit; if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
ret = map_error( ldap_funcs->ldap_delete_ext( ld->ld, dnU, serverctrlsU, clientctrlsU, message ) ); ret = map_error( ldap_funcs->fn_ldap_delete_ext( CTX(ld), dnU, serverctrlsU, clientctrlsU, message ) );
exit: exit:
free( dnU ); free( dnU );
...@@ -156,16 +157,15 @@ exit: ...@@ -156,16 +157,15 @@ exit:
* *
* See ldap_delete_ext_sW. * See ldap_delete_ext_sW.
*/ */
ULONG CDECL ldap_delete_ext_sA( WLDAP32_LDAP *ld, char *dn, LDAPControlA **serverctrls, ULONG CDECL ldap_delete_ext_sA( LDAP *ld, char *dn, LDAPControlA **serverctrls, LDAPControlA **clientctrls )
LDAPControlA **clientctrls )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL; WCHAR *dnW = NULL;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
TRACE( "(%p, %s, %p, %p)\n", ld, debugstr_a(dn), serverctrls, clientctrls ); TRACE( "(%p, %s, %p, %p)\n", ld, debugstr_a(dn), serverctrls, clientctrls );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) goto exit; if (dn && !(dnW = strAtoW( dn ))) goto exit;
if (serverctrls && !(serverctrlsW = controlarrayAtoW( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsW = controlarrayAtoW( serverctrls ))) goto exit;
...@@ -199,22 +199,21 @@ exit: ...@@ -199,22 +199,21 @@ exit:
* The serverctrls and clientctrls parameters are optional and * The serverctrls and clientctrls parameters are optional and
* should be set to NULL if not used. * should be set to NULL if not used.
*/ */
ULONG CDECL ldap_delete_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPControlW **serverctrls, ULONG CDECL ldap_delete_ext_sW( LDAP *ld, WCHAR *dn, LDAPControlW **serverctrls, LDAPControlW **clientctrls )
LDAPControlW **clientctrls )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
char *dnU = NULL; char *dnU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **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 );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnU = strWtoU( dn ))) goto exit; if (dn && !(dnU = strWtoU( dn ))) goto exit;
if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit;
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit; if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
ret = map_error( ldap_funcs->ldap_delete_ext_s( ld->ld, dnU, serverctrlsU, clientctrlsU ) ); ret = map_error( ldap_funcs->fn_ldap_delete_ext_s( CTX(ld), dnU, serverctrlsU, clientctrlsU ) );
exit: exit:
free( dnU ); free( dnU );
...@@ -228,15 +227,15 @@ exit: ...@@ -228,15 +227,15 @@ exit:
* *
* See ldap_delete_sW. * See ldap_delete_sW.
*/ */
ULONG CDECL ldap_delete_sA( WLDAP32_LDAP *ld, char *dn ) ULONG CDECL ldap_delete_sA( LDAP *ld, char *dn )
{ {
ULONG ret; ULONG ret;
WCHAR *dnW = NULL; WCHAR *dnW = NULL;
TRACE( "(%p, %s)\n", ld, debugstr_a(dn) ); TRACE( "(%p, %s)\n", ld, debugstr_a(dn) );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) return WLDAP32_LDAP_NO_MEMORY; if (dn && !(dnW = strAtoW( dn ))) return LDAP_NO_MEMORY;
ret = ldap_delete_sW( ld, dnW ); ret = ldap_delete_sW( ld, dnW );
free( dnW ); free( dnW );
...@@ -256,7 +255,7 @@ ULONG CDECL ldap_delete_sA( WLDAP32_LDAP *ld, char *dn ) ...@@ -256,7 +255,7 @@ ULONG CDECL ldap_delete_sA( WLDAP32_LDAP *ld, char *dn )
* Success: LDAP_SUCCESS * Success: LDAP_SUCCESS
* Failure: An LDAP error code. * Failure: An LDAP error code.
*/ */
ULONG CDECL ldap_delete_sW( WLDAP32_LDAP *ld, WCHAR *dn ) ULONG CDECL ldap_delete_sW( LDAP *ld, WCHAR *dn )
{ {
TRACE( "(%p, %s)\n", ld, debugstr_w(dn) ); TRACE( "(%p, %s)\n", ld, debugstr_w(dn) );
return ldap_delete_ext_sW( ld, dn, NULL, NULL ); return ldap_delete_ext_sW( ld, dn, NULL, NULL );
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#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"
...@@ -74,11 +75,11 @@ WCHAR * CDECL ldap_dn2ufnW( WCHAR *dn ) ...@@ -74,11 +75,11 @@ WCHAR * CDECL ldap_dn2ufnW( WCHAR *dn )
if (!(dnU = strWtoU( dn ))) return NULL; if (!(dnU = strWtoU( dn ))) return NULL;
retU = ldap_funcs->ldap_dn2ufn( dnU ); retU = ldap_funcs->fn_ldap_dn2ufn( dnU );
ret = strUtoW( retU ); ret = strUtoW( retU );
free( dnU ); free( dnU );
ldap_funcs->ldap_memfree( retU ); ldap_funcs->fn_ldap_memfree( retU );
return ret; return ret;
} }
...@@ -130,11 +131,11 @@ WCHAR ** CDECL ldap_explode_dnW( WCHAR *dn, ULONG notypes ) ...@@ -130,11 +131,11 @@ WCHAR ** CDECL ldap_explode_dnW( WCHAR *dn, ULONG notypes )
if (!(dnU = strWtoU( dn ))) return NULL; if (!(dnU = strWtoU( dn ))) return NULL;
retU = ldap_funcs->ldap_explode_dn( dnU, notypes ); retU = ldap_funcs->fn_ldap_explode_dn( dnU, notypes );
ret = strarrayUtoW( retU ); ret = strarrayUtoW( retU );
free( dnU ); free( dnU );
ldap_funcs->ldap_memvfree( (void **)retU ); ldap_funcs->fn_ldap_memvfree( (void **)retU );
return ret; return ret;
} }
...@@ -143,7 +144,7 @@ WCHAR ** CDECL ldap_explode_dnW( WCHAR *dn, ULONG notypes ) ...@@ -143,7 +144,7 @@ WCHAR ** CDECL ldap_explode_dnW( WCHAR *dn, ULONG notypes )
* *
* See ldap_get_dnW. * See ldap_get_dnW.
*/ */
char * CDECL ldap_get_dnA( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry ) char * CDECL ldap_get_dnA( LDAP *ld, LDAPMessage *entry )
{ {
char *ret; char *ret;
WCHAR *retW; WCHAR *retW;
...@@ -175,7 +176,7 @@ char * CDECL ldap_get_dnA( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry ) ...@@ -175,7 +176,7 @@ char * CDECL ldap_get_dnA( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry )
* NOTES * NOTES
* Free the string with ldap_memfree. * Free the string with ldap_memfree.
*/ */
WCHAR * CDECL ldap_get_dnW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry ) WCHAR * CDECL ldap_get_dnW( LDAP *ld, LDAPMessage *entry )
{ {
WCHAR *ret; WCHAR *ret;
char *retU; char *retU;
...@@ -184,10 +185,10 @@ WCHAR * CDECL ldap_get_dnW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry ) ...@@ -184,10 +185,10 @@ WCHAR * CDECL ldap_get_dnW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry )
if (!ld || !entry) return NULL; if (!ld || !entry) return NULL;
retU = ldap_funcs->ldap_get_dn( ld->ld, entry->Request ); retU = ldap_funcs->fn_ldap_get_dn( CTX(ld), MSG(entry) );
ret = strUtoW( retU ); ret = strUtoW( retU );
ldap_funcs->ldap_memfree( retU ); ldap_funcs->fn_ldap_memfree( retU );
return ret; return ret;
} }
...@@ -203,16 +204,16 @@ ULONG CDECL ldap_ufn2dnA( char *ufn, char **dn ) ...@@ -203,16 +204,16 @@ ULONG CDECL ldap_ufn2dnA( char *ufn, char **dn )
TRACE( "(%s, %p)\n", debugstr_a(ufn), dn ); TRACE( "(%s, %p)\n", debugstr_a(ufn), dn );
if (!dn) return WLDAP32_LDAP_PARAM_ERROR; if (!dn) return LDAP_PARAM_ERROR;
*dn = NULL; *dn = NULL;
if (ufn && !(ufnW = strAtoW( ufn ))) return WLDAP32_LDAP_NO_MEMORY; if (ufn && !(ufnW = strAtoW( ufn ))) return LDAP_NO_MEMORY;
ret = ldap_ufn2dnW( ufnW, &dnW ); ret = ldap_ufn2dnW( ufnW, &dnW );
if (dnW) if (dnW)
{ {
char *str; char *str;
if (!(str = strWtoA( dnW ))) ret = WLDAP32_LDAP_NO_MEMORY; if (!(str = strWtoA( dnW ))) ret = LDAP_NO_MEMORY;
else *dn = str; else *dn = str;
} }
...@@ -239,21 +240,21 @@ ULONG CDECL ldap_ufn2dnA( char *ufn, char **dn ) ...@@ -239,21 +240,21 @@ ULONG CDECL ldap_ufn2dnA( char *ufn, char **dn )
*/ */
ULONG CDECL ldap_ufn2dnW( WCHAR *ufn, WCHAR **dn ) ULONG CDECL ldap_ufn2dnW( WCHAR *ufn, WCHAR **dn )
{ {
ULONG ret = WLDAP32_LDAP_SUCCESS; ULONG ret = LDAP_SUCCESS;
char *ufnU = NULL; char *ufnU = NULL;
TRACE( "(%s, %p)\n", debugstr_w(ufn), dn ); TRACE( "(%s, %p)\n", debugstr_w(ufn), dn );
if (!dn) return WLDAP32_LDAP_PARAM_ERROR; if (!dn) return LDAP_PARAM_ERROR;
*dn = NULL; *dn = NULL;
if (ufn) if (ufn)
{ {
WCHAR *str; WCHAR *str;
if (!(ufnU = strWtoU( ufn ))) return WLDAP32_LDAP_NO_MEMORY; if (!(ufnU = strWtoU( ufn ))) return LDAP_NO_MEMORY;
/* FIXME: do more than just a copy */ /* FIXME: do more than just a copy */
if (!(str = strUtoW( ufnU ))) ret = WLDAP32_LDAP_NO_MEMORY; if (!(str = strUtoW( ufnU ))) ret = LDAP_NO_MEMORY;
else *dn = str; else *dn = str;
} }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#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"
...@@ -35,24 +36,24 @@ ULONG map_error( int error ) ...@@ -35,24 +36,24 @@ ULONG map_error( int error )
{ {
switch (error) switch (error)
{ {
case 0: return WLDAP32_LDAP_SUCCESS; case 0: return LDAP_SUCCESS;
case -1: return WLDAP32_LDAP_SERVER_DOWN; case -1: return LDAP_SERVER_DOWN;
case -2: return WLDAP32_LDAP_LOCAL_ERROR; case -2: return LDAP_LOCAL_ERROR;
case -3: return WLDAP32_LDAP_ENCODING_ERROR; case -3: return LDAP_ENCODING_ERROR;
case -4: return WLDAP32_LDAP_DECODING_ERROR; case -4: return LDAP_DECODING_ERROR;
case -5: return WLDAP32_LDAP_TIMEOUT; case -5: return LDAP_TIMEOUT;
case -6: return WLDAP32_LDAP_AUTH_UNKNOWN; case -6: return LDAP_AUTH_UNKNOWN;
case -7: return WLDAP32_LDAP_FILTER_ERROR; case -7: return LDAP_FILTER_ERROR;
case -8: return WLDAP32_LDAP_USER_CANCELLED; case -8: return LDAP_USER_CANCELLED;
case -9: return WLDAP32_LDAP_PARAM_ERROR; case -9: return LDAP_PARAM_ERROR;
case -10: return WLDAP32_LDAP_NO_MEMORY; case -10: return LDAP_NO_MEMORY;
case -11: return WLDAP32_LDAP_CONNECT_ERROR; case -11: return LDAP_CONNECT_ERROR;
case -12: return WLDAP32_LDAP_NOT_SUPPORTED; case -12: return LDAP_NOT_SUPPORTED;
case -13: return WLDAP32_LDAP_CONTROL_NOT_FOUND; case -13: return LDAP_CONTROL_NOT_FOUND;
case -14: return WLDAP32_LDAP_NO_RESULTS_RETURNED; case -14: return LDAP_NO_RESULTS_RETURNED;
case -15: return WLDAP32_LDAP_MORE_RESULTS_TO_RETURN; case -15: return LDAP_MORE_RESULTS_TO_RETURN;
case -16: return WLDAP32_LDAP_CLIENT_LOOP; case -16: return LDAP_CLIENT_LOOP;
case -17: return WLDAP32_LDAP_REFERRAL_LIMIT_EXCEEDED; case -17: return LDAP_REFERRAL_LIMIT_EXCEEDED;
default: return error; default: return error;
} }
} }
...@@ -68,10 +69,10 @@ char * CDECL ldap_err2stringA( ULONG err ) ...@@ -68,10 +69,10 @@ char * CDECL ldap_err2stringA( ULONG err )
TRACE( "(0x%08x)\n", err ); TRACE( "(0x%08x)\n", err );
if (err <= WLDAP32_LDAP_REFERRAL_LIMIT_EXCEEDED) if (err <= LDAP_REFERRAL_LIMIT_EXCEEDED)
LoadStringA( hwldap32, err, buf, 256 ); LoadStringA( hwldap32, err, buf, 256 );
else else
LoadStringA( hwldap32, WLDAP32_LDAP_LOCAL_ERROR, buf, 256 ); LoadStringA( hwldap32, LDAP_LOCAL_ERROR, buf, 256 );
return buf; return buf;
} }
...@@ -98,10 +99,10 @@ WCHAR * CDECL ldap_err2stringW( ULONG err ) ...@@ -98,10 +99,10 @@ WCHAR * CDECL ldap_err2stringW( ULONG err )
TRACE( "(0x%08x)\n", err ); TRACE( "(0x%08x)\n", err );
if (err <= WLDAP32_LDAP_REFERRAL_LIMIT_EXCEEDED) if (err <= LDAP_REFERRAL_LIMIT_EXCEEDED)
LoadStringW( hwldap32, err, buf, 256 ); LoadStringW( hwldap32, err, buf, 256 );
else else
LoadStringW( hwldap32, WLDAP32_LDAP_LOCAL_ERROR, buf, 256 ); LoadStringW( hwldap32, LDAP_LOCAL_ERROR, buf, 256 );
return buf; return buf;
} }
...@@ -121,7 +122,7 @@ WCHAR * CDECL ldap_err2stringW( ULONG err ) ...@@ -121,7 +122,7 @@ WCHAR * CDECL ldap_err2stringW( ULONG err )
* NOTES * NOTES
* Like native, this function does nothing. * Like native, this function does nothing.
*/ */
void CDECL WLDAP32_ldap_perror( WLDAP32_LDAP *ld, const PCHAR msg ) void CDECL ldap_perror( LDAP *ld, const PCHAR msg )
{ {
TRACE( "(%p, %s)\n", ld, debugstr_a(msg) ); TRACE( "(%p, %s)\n", ld, debugstr_a(msg) );
} }
...@@ -143,7 +144,7 @@ void CDECL WLDAP32_ldap_perror( WLDAP32_LDAP *ld, const PCHAR msg ) ...@@ -143,7 +144,7 @@ void CDECL WLDAP32_ldap_perror( WLDAP32_LDAP *ld, const PCHAR msg )
* NOTES * NOTES
* If not asked for, use ldap_msgfree to free the LDAPMessage. * If not asked for, use ldap_msgfree to free the LDAPMessage.
*/ */
ULONG CDECL WLDAP32_ldap_result2error( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *res, ULONG free ) ULONG CDECL ldap_result2error( LDAP *ld, LDAPMessage *res, ULONG free )
{ {
ULONG ret; ULONG ret;
int error; int error;
...@@ -152,8 +153,8 @@ ULONG CDECL WLDAP32_ldap_result2error( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *re ...@@ -152,8 +153,8 @@ ULONG CDECL WLDAP32_ldap_result2error( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *re
if (!ld || !res) return ~0u; if (!ld || !res) return ~0u;
ret = map_error( ldap_funcs->ldap_parse_result( ld->ld, res->Request, &error, NULL, NULL, NULL, NULL, free ) ); ret = map_error( ldap_funcs->fn_ldap_parse_result( CTX(ld), MSG(res), &error, NULL, NULL, NULL, NULL, free ) );
if (ret == WLDAP32_LDAP_SUCCESS) if (ret == LDAP_SUCCESS)
ret = error; ret = error;
else else
ret = ~0u; ret = ~0u;
...@@ -178,7 +179,7 @@ ULONG CDECL LdapGetLastError( void ) ...@@ -178,7 +179,7 @@ ULONG CDECL LdapGetLastError( void )
return GetLastError(); return GetLastError();
} }
static const ULONG WLDAP32_errormap[] = { static const ULONG errormap[] = {
/* LDAP_SUCCESS */ ERROR_SUCCESS, /* LDAP_SUCCESS */ ERROR_SUCCESS,
/* LDAP_OPERATIONS_ERROR */ ERROR_OPEN_FAILED, /* LDAP_OPERATIONS_ERROR */ ERROR_OPEN_FAILED,
/* LDAP_PROTOCOL_ERROR */ ERROR_INVALID_LEVEL, /* LDAP_PROTOCOL_ERROR */ ERROR_INVALID_LEVEL,
...@@ -294,6 +295,6 @@ ULONG CDECL LdapMapErrorToWin32( ULONG err ) ...@@ -294,6 +295,6 @@ ULONG CDECL LdapMapErrorToWin32( ULONG err )
{ {
TRACE( "(0x%08x)\n", err ); TRACE( "(0x%08x)\n", err );
if (err >= ARRAY_SIZE( WLDAP32_errormap )) return ERROR_DS_GENERIC_ERROR; if (err >= ARRAY_SIZE( errormap )) return ERROR_DS_GENERIC_ERROR;
return WLDAP32_errormap[err]; return errormap[err];
} }
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#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"
...@@ -45,12 +46,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32); ...@@ -45,12 +46,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
* Contrary to native, OpenLDAP does not require us to close * Contrary to native, OpenLDAP does not require us to close
* extended operations, so this is a no-op. * extended operations, so this is a no-op.
*/ */
ULONG CDECL ldap_close_extended_op( WLDAP32_LDAP *ld, ULONG msgid ) ULONG CDECL ldap_close_extended_op( LDAP *ld, ULONG msgid )
{ {
TRACE( "(%p, 0x%08x)\n", ld, msgid ); TRACE( "(%p, 0x%08x)\n", ld, msgid );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
return WLDAP32_LDAP_SUCCESS; return LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -58,16 +59,16 @@ ULONG CDECL ldap_close_extended_op( WLDAP32_LDAP *ld, ULONG msgid ) ...@@ -58,16 +59,16 @@ ULONG CDECL ldap_close_extended_op( WLDAP32_LDAP *ld, ULONG msgid )
* *
* See ldap_extended_operationW. * See ldap_extended_operationW.
*/ */
ULONG CDECL ldap_extended_operationA( WLDAP32_LDAP *ld, char *oid, struct WLDAP32_berval *data, ULONG CDECL ldap_extended_operationA( LDAP *ld, char *oid, struct berval *data, LDAPControlA **serverctrls,
LDAPControlA **serverctrls, LDAPControlA **clientctrls, ULONG *message ) LDAPControlA **clientctrls, ULONG *message )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *oidW = NULL; WCHAR *oidW = NULL;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
TRACE( "(%p, %s, %p, %p, %p, %p)\n", ld, debugstr_a(oid), data, serverctrls, clientctrls, message ); TRACE( "(%p, %s, %p, %p, %p, %p)\n", ld, debugstr_a(oid), data, serverctrls, clientctrls, message );
if (!ld || !message) return WLDAP32_LDAP_PARAM_ERROR; if (!ld || !message) return LDAP_PARAM_ERROR;
if (oid && !(oidW = strAtoW( oid ))) goto exit; if (oid && !(oidW = strAtoW( oid ))) goto exit;
if (serverctrls && !(serverctrlsW = controlarrayAtoW( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsW = controlarrayAtoW( serverctrls ))) goto exit;
...@@ -107,24 +108,25 @@ exit: ...@@ -107,24 +108,25 @@ exit:
* are optional and should be set to NULL if not used. Call * are optional and should be set to NULL if not used. Call
* ldap_close_extended_op to close the operation. * ldap_close_extended_op to close the operation.
*/ */
ULONG CDECL ldap_extended_operationW( WLDAP32_LDAP *ld, WCHAR *oid, struct WLDAP32_berval *data, ULONG CDECL ldap_extended_operationW( LDAP *ld, WCHAR *oid, struct berval *data, LDAPControlW **serverctrls,
LDAPControlW **serverctrls, LDAPControlW **clientctrls, ULONG *message ) LDAPControlW **clientctrls, ULONG *message )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
char *oidU = NULL; char *oidU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
struct bervalU *dataU = NULL; struct bervalU *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 );
if (!ld || !message) return WLDAP32_LDAP_PARAM_ERROR; if (!ld || !message) return LDAP_PARAM_ERROR;
if (oid && !(oidU = strWtoU( oid ))) goto exit; if (oid && !(oidU = strWtoU( oid ))) goto exit;
if (data && !(dataU = bervalWtoU( data ))) goto exit; if (data && !(dataU = bervalWtoU( data ))) goto exit;
if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit;
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit; if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
ret = map_error( ldap_funcs->ldap_extended_operation( ld->ld, oidU, dataU, serverctrlsU, clientctrlsU, message ) ); ret = map_error( ldap_funcs->fn_ldap_extended_operation( CTX(ld), oidU, dataU, serverctrlsU, clientctrlsU,
message ) );
exit: exit:
free( oidU ); free( oidU );
...@@ -139,16 +141,16 @@ exit: ...@@ -139,16 +141,16 @@ exit:
* *
* See ldap_extended_operation_sW. * See ldap_extended_operation_sW.
*/ */
ULONG CDECL ldap_extended_operation_sA( WLDAP32_LDAP *ld, char *oid, struct WLDAP32_berval *data, ULONG CDECL ldap_extended_operation_sA( LDAP *ld, char *oid, struct berval *data, LDAPControlA **serverctrls,
LDAPControlA **serverctrls, LDAPControlA **clientctrls, char **retoid, struct WLDAP32_berval **retdata ) LDAPControlA **clientctrls, char **retoid, struct berval **retdata )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *oidW = NULL, *retoidW = NULL; WCHAR *oidW = NULL, *retoidW = NULL;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
TRACE( "(%p, %s, %p, %p, %p, %p, %p)\n", ld, debugstr_a(oid), data, serverctrls, clientctrls, retoid, retdata ); TRACE( "(%p, %s, %p, %p, %p, %p, %p)\n", ld, debugstr_a(oid), data, serverctrls, clientctrls, retoid, retdata );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (oid && !(oidW = strAtoW( oid ))) goto exit; if (oid && !(oidW = strAtoW( oid ))) goto exit;
if (serverctrls && !(serverctrlsW = controlarrayAtoW( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsW = controlarrayAtoW( serverctrls ))) goto exit;
...@@ -159,7 +161,7 @@ ULONG CDECL ldap_extended_operation_sA( WLDAP32_LDAP *ld, char *oid, struct WLDA ...@@ -159,7 +161,7 @@ ULONG CDECL ldap_extended_operation_sA( WLDAP32_LDAP *ld, char *oid, struct WLDA
{ {
char *str = strWtoA( retoidW ); char *str = strWtoA( retoidW );
if (str) *retoid = str; if (str) *retoid = str;
else ret = WLDAP32_LDAP_NO_MEMORY; else ret = LDAP_NO_MEMORY;
ldap_memfreeW( retoidW ); ldap_memfreeW( retoidW );
} }
...@@ -194,38 +196,38 @@ exit: ...@@ -194,38 +196,38 @@ exit:
* and retdata parameters are also optional. Set to NULL if not * and retdata parameters are also optional. Set to NULL if not
* used. Free retoid and retdata after use with ldap_memfree. * used. Free retoid and retdata after use with ldap_memfree.
*/ */
ULONG CDECL ldap_extended_operation_sW( WLDAP32_LDAP *ld, WCHAR *oid, struct WLDAP32_berval *data, ULONG CDECL ldap_extended_operation_sW( LDAP *ld, WCHAR *oid, struct berval *data, LDAPControlW **serverctrls,
LDAPControlW **serverctrls, LDAPControlW **clientctrls, WCHAR **retoid, struct WLDAP32_berval **retdata ) LDAPControlW **clientctrls, WCHAR **retoid, struct berval **retdata )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
char *oidU = NULL, *retoidU = NULL; char *oidU = NULL, *retoidU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
struct bervalU *retdataU, *dataU = NULL; struct bervalU *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 );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (oid && !(oidU = strWtoU( oid ))) goto exit; if (oid && !(oidU = strWtoU( oid ))) goto exit;
if (data && !(dataU = bervalWtoU( data ))) goto exit; if (data && !(dataU = bervalWtoU( data ))) goto exit;
if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit;
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit; if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
ret = map_error( ldap_funcs->ldap_extended_operation_s( ld->ld, oidU, dataU, serverctrlsU, clientctrlsU, ret = map_error( ldap_funcs->fn_ldap_extended_operation_s( CTX(ld), oidU, dataU, serverctrlsU, clientctrlsU,
&retoidU, &retdataU ) ); &retoidU, &retdataU ) );
if (retoid && retoidU) if (retoid && retoidU)
{ {
WCHAR *str = strUtoW( retoidU ); WCHAR *str = strUtoW( retoidU );
if (str) *retoid = str; if (str) *retoid = str;
else ret = WLDAP32_LDAP_NO_MEMORY; else ret = LDAP_NO_MEMORY;
ldap_funcs->ldap_memfree( retoidU ); ldap_funcs->fn_ldap_memfree( retoidU );
} }
if (retdata && retdataU) if (retdata && retdataU)
{ {
struct WLDAP32_berval *bv = bervalUtoW( retdataU ); struct berval *bv = bervalUtoW( retdataU );
if (bv) *retdata = bv; if (bv) *retdata = bv;
else ret = WLDAP32_LDAP_NO_MEMORY; else ret = LDAP_NO_MEMORY;
ldap_funcs->ber_bvfree( retdataU ); ldap_funcs->fn_ber_bvfree( retdataU );
} }
exit: exit:
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#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"
...@@ -190,18 +191,18 @@ static char *urlify_hostnames( const char *scheme, char *hostnames, ULONG port ) ...@@ -190,18 +191,18 @@ static char *urlify_hostnames( const char *scheme, char *hostnames, ULONG port )
} }
static WLDAP32_LDAP *create_context( const char *url ) static LDAP *create_context( const char *url )
{ {
WLDAP32_LDAP *ld; LDAP *ld;
int version = WLDAP32_LDAP_VERSION3; int version = LDAP_VERSION3;
if (!(ld = calloc( 1, sizeof( *ld )))) return NULL; if (!(ld = calloc( 1, sizeof( *ld )))) return NULL;
if (map_error( ldap_funcs->ldap_initialize( &ld->ld, url ) ) != WLDAP32_LDAP_SUCCESS) if (map_error( ldap_funcs->fn_ldap_initialize( &CTX(ld), url ) ) != LDAP_SUCCESS)
{ {
free( ld ); free( ld );
return NULL; return NULL;
} }
ldap_funcs->ldap_set_option( ld->ld, WLDAP32_LDAP_OPT_PROTOCOL_VERSION, &version ); ldap_funcs->fn_ldap_set_option( CTX(ld), LDAP_OPT_PROTOCOL_VERSION, &version );
return ld; return ld;
} }
...@@ -210,9 +211,9 @@ static WLDAP32_LDAP *create_context( const char *url ) ...@@ -210,9 +211,9 @@ static WLDAP32_LDAP *create_context( const char *url )
* *
* See cldap_openW. * See cldap_openW.
*/ */
WLDAP32_LDAP * CDECL cldap_openA( char *hostname, ULONG portnumber ) LDAP * CDECL cldap_openA( char *hostname, ULONG portnumber )
{ {
WLDAP32_LDAP *ld; LDAP *ld;
WCHAR *hostnameW = NULL; WCHAR *hostnameW = NULL;
TRACE( "(%s, %d)\n", debugstr_a(hostname), portnumber ); TRACE( "(%s, %d)\n", debugstr_a(hostname), portnumber );
...@@ -246,9 +247,9 @@ WLDAP32_LDAP * CDECL cldap_openA( char *hostname, ULONG portnumber ) ...@@ -246,9 +247,9 @@ WLDAP32_LDAP * CDECL cldap_openA( char *hostname, ULONG portnumber )
* will take precedence over the port number supplied as a parameter * will take precedence over the port number supplied as a parameter
* to this function. * to this function.
*/ */
WLDAP32_LDAP * CDECL cldap_openW( WCHAR *hostname, ULONG portnumber ) LDAP * CDECL cldap_openW( WCHAR *hostname, ULONG portnumber )
{ {
WLDAP32_LDAP *ld = NULL; LDAP *ld = NULL;
char *hostnameU, *url = NULL; char *hostnameU, *url = NULL;
TRACE( "(%s, %d)\n", debugstr_w(hostname), portnumber ); TRACE( "(%s, %d)\n", debugstr_w(hostname), portnumber );
...@@ -282,12 +283,12 @@ exit: ...@@ -282,12 +283,12 @@ exit:
* The timeout parameter may be NULL in which case a default timeout * The timeout parameter may be NULL in which case a default timeout
* value will be used. * value will be used.
*/ */
ULONG CDECL ldap_connect( WLDAP32_LDAP *ld, struct l_timeval *timeout ) ULONG CDECL ldap_connect( LDAP *ld, struct l_timeval *timeout )
{ {
TRACE( "(%p, %p)\n", ld, timeout ); TRACE( "(%p, %p)\n", ld, timeout );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
return WLDAP32_LDAP_SUCCESS; /* FIXME: do something, e.g. ping the host */ return LDAP_SUCCESS; /* FIXME: do something, e.g. ping the host */
} }
/*********************************************************************** /***********************************************************************
...@@ -295,9 +296,9 @@ ULONG CDECL ldap_connect( WLDAP32_LDAP *ld, struct l_timeval *timeout ) ...@@ -295,9 +296,9 @@ ULONG CDECL ldap_connect( WLDAP32_LDAP *ld, struct l_timeval *timeout )
* *
* See ldap_initW. * See ldap_initW.
*/ */
WLDAP32_LDAP * CDECL ldap_initA( const PCHAR hostname, ULONG portnumber ) LDAP * CDECL ldap_initA( const PCHAR hostname, ULONG portnumber )
{ {
WLDAP32_LDAP *ld; LDAP *ld;
WCHAR *hostnameW = NULL; WCHAR *hostnameW = NULL;
TRACE( "(%s, %d)\n", debugstr_a(hostname), portnumber ); TRACE( "(%s, %d)\n", debugstr_a(hostname), portnumber );
...@@ -332,9 +333,9 @@ WLDAP32_LDAP * CDECL ldap_initA( const PCHAR hostname, ULONG portnumber ) ...@@ -332,9 +333,9 @@ WLDAP32_LDAP * CDECL ldap_initA( const PCHAR hostname, ULONG portnumber )
* to this function. The connection will not be made until the first * to this function. The connection will not be made until the first
* LDAP function that needs it is called. * LDAP function that needs it is called.
*/ */
WLDAP32_LDAP * CDECL ldap_initW( const PWCHAR hostname, ULONG portnumber ) LDAP * CDECL ldap_initW( const PWCHAR hostname, ULONG portnumber )
{ {
WLDAP32_LDAP *ld = NULL; LDAP *ld = NULL;
char *hostnameU, *url = NULL; char *hostnameU, *url = NULL;
TRACE( "(%s, %d)\n", debugstr_w(hostname), portnumber ); TRACE( "(%s, %d)\n", debugstr_w(hostname), portnumber );
...@@ -355,9 +356,9 @@ exit: ...@@ -355,9 +356,9 @@ exit:
* *
* See ldap_openW. * See ldap_openW.
*/ */
WLDAP32_LDAP * CDECL ldap_openA( char *hostname, ULONG portnumber ) LDAP * CDECL ldap_openA( char *hostname, ULONG portnumber )
{ {
WLDAP32_LDAP *ld; LDAP *ld;
WCHAR *hostnameW = NULL; WCHAR *hostnameW = NULL;
TRACE( "(%s, %d)\n", debugstr_a(hostname), portnumber ); TRACE( "(%s, %d)\n", debugstr_a(hostname), portnumber );
...@@ -391,9 +392,9 @@ WLDAP32_LDAP * CDECL ldap_openA( char *hostname, ULONG portnumber ) ...@@ -391,9 +392,9 @@ WLDAP32_LDAP * CDECL ldap_openA( char *hostname, ULONG portnumber )
* will take precedence over the port number supplied as a parameter * will take precedence over the port number supplied as a parameter
* to this function. * to this function.
*/ */
WLDAP32_LDAP * CDECL ldap_openW( WCHAR *hostname, ULONG portnumber ) LDAP * CDECL ldap_openW( WCHAR *hostname, ULONG portnumber )
{ {
WLDAP32_LDAP *ld = NULL; LDAP *ld = NULL;
char *hostnameU, *url = NULL; char *hostnameU, *url = NULL;
TRACE( "(%s, %d)\n", debugstr_w(hostname), portnumber ); TRACE( "(%s, %d)\n", debugstr_w(hostname), portnumber );
...@@ -414,9 +415,9 @@ exit: ...@@ -414,9 +415,9 @@ exit:
* *
* See ldap_sslinitW. * See ldap_sslinitW.
*/ */
WLDAP32_LDAP * CDECL ldap_sslinitA( char *hostname, ULONG portnumber, int secure ) LDAP * CDECL ldap_sslinitA( char *hostname, ULONG portnumber, int secure )
{ {
WLDAP32_LDAP *ld; LDAP *ld;
WCHAR *hostnameW = NULL; WCHAR *hostnameW = NULL;
TRACE( "(%s, %d, 0x%08x)\n", debugstr_a(hostname), portnumber, secure ); TRACE( "(%s, %d, 0x%08x)\n", debugstr_a(hostname), portnumber, secure );
...@@ -452,9 +453,9 @@ WLDAP32_LDAP * CDECL ldap_sslinitA( char *hostname, ULONG portnumber, int secure ...@@ -452,9 +453,9 @@ WLDAP32_LDAP * CDECL ldap_sslinitA( char *hostname, ULONG portnumber, int secure
* to this function. The connection will not be made until the first * to this function. The connection will not be made until the first
* LDAP function that needs it is called. * LDAP function that needs it is called.
*/ */
WLDAP32_LDAP * CDECL ldap_sslinitW( WCHAR *hostname, ULONG portnumber, int secure ) LDAP * CDECL ldap_sslinitW( WCHAR *hostname, ULONG portnumber, int secure )
{ {
WLDAP32_LDAP *ld = NULL; LDAP *ld = NULL;
char *hostnameU, *url = NULL; char *hostnameU, *url = NULL;
TRACE( "(%s, %d, 0x%08x)\n", debugstr_w(hostname), portnumber, secure ); TRACE( "(%s, %d, 0x%08x)\n", debugstr_w(hostname), portnumber, secure );
...@@ -480,10 +481,10 @@ exit: ...@@ -480,10 +481,10 @@ exit:
* *
* See ldap_start_tls_sW. * See ldap_start_tls_sW.
*/ */
ULONG CDECL ldap_start_tls_sA( WLDAP32_LDAP *ld, ULONG *retval, WLDAP32_LDAPMessage **result, ULONG CDECL ldap_start_tls_sA( LDAP *ld, ULONG *retval, LDAPMessage **result, LDAPControlA **serverctrls,
LDAPControlA **serverctrls, LDAPControlA **clientctrls ) LDAPControlA **clientctrls )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = 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 );
...@@ -520,10 +521,10 @@ exit: ...@@ -520,10 +521,10 @@ exit:
* NOTES * NOTES
* LDAP function that needs it is called. * LDAP function that needs it is called.
*/ */
ULONG CDECL ldap_start_tls_sW( WLDAP32_LDAP *ld, ULONG *retval, WLDAP32_LDAPMessage **result, ULONG CDECL ldap_start_tls_sW( LDAP *ld, ULONG *retval, LDAPMessage **result, LDAPControlW **serverctrls,
LDAPControlW **serverctrls, LDAPControlW **clientctrls ) LDAPControlW **clientctrls )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **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 );
...@@ -538,7 +539,7 @@ ULONG CDECL ldap_start_tls_sW( WLDAP32_LDAP *ld, ULONG *retval, WLDAP32_LDAPMess ...@@ -538,7 +539,7 @@ ULONG CDECL ldap_start_tls_sW( WLDAP32_LDAP *ld, ULONG *retval, WLDAP32_LDAPMess
if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit;
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit; if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
ret = map_error( ldap_funcs->ldap_start_tls_s( ld->ld, serverctrlsU, clientctrlsU ) ); ret = map_error( ldap_funcs->fn_ldap_start_tls_s( CTX(ld), serverctrlsU, clientctrlsU ) );
exit: exit:
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
...@@ -552,7 +553,7 @@ exit: ...@@ -552,7 +553,7 @@ exit:
ULONG CDECL ldap_startup( LDAP_VERSION_INFO *version, HANDLE *instance ) ULONG CDECL ldap_startup( LDAP_VERSION_INFO *version, HANDLE *instance )
{ {
TRACE( "(%p, %p)\n", version, instance ); TRACE( "(%p, %p)\n", version, instance );
return WLDAP32_LDAP_SUCCESS; return LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -567,7 +568,7 @@ ULONG CDECL ldap_startup( LDAP_VERSION_INFO *version, HANDLE *instance ) ...@@ -567,7 +568,7 @@ ULONG CDECL ldap_startup( LDAP_VERSION_INFO *version, HANDLE *instance )
* Success: TRUE * Success: TRUE
* Failure: FALSE * Failure: FALSE
*/ */
BOOLEAN CDECL ldap_stop_tls_s( WLDAP32_LDAP *ld ) BOOLEAN CDECL ldap_stop_tls_s( LDAP *ld )
{ {
TRACE( "(%p)\n", ld ); TRACE( "(%p)\n", ld );
return TRUE; /* FIXME: find a way to stop tls on a connection */ return TRUE; /* FIXME: find a way to stop tls on a connection */
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "config.h" #include "config.h"
#ifdef HAVE_LDAP #ifdef HAVE_LDAP
#include <assert.h>
#include <stdarg.h> #include <stdarg.h>
#include <sys/time.h> #include <sys/time.h>
#ifdef HAVE_LDAP_H #ifdef HAVE_LDAP_H
...@@ -41,7 +42,7 @@ ...@@ -41,7 +42,7 @@
#include "winbase.h" #include "winbase.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "winldap_private.h" #include "libldap.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32); WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
...@@ -54,6 +55,8 @@ C_ASSERT( sizeof(LDAPAPIInfoU) == sizeof(LDAPAPIInfo) ); ...@@ -54,6 +55,8 @@ C_ASSERT( sizeof(LDAPAPIInfoU) == sizeof(LDAPAPIInfo) );
C_ASSERT( sizeof(LDAPAPIFeatureInfoU) == sizeof(LDAPAPIFeatureInfo) ); C_ASSERT( sizeof(LDAPAPIFeatureInfoU) == sizeof(LDAPAPIFeatureInfo) );
C_ASSERT( sizeof(struct timevalU) == sizeof(struct timeval) ); C_ASSERT( sizeof(struct timevalU) == sizeof(struct timeval) );
#define WLDAP32_LBER_ERROR (~0l)
static LDAPMod *nullmods[] = { NULL }; static LDAPMod *nullmods[] = { NULL };
static const struct ldap_callbacks *callbacks; static const struct ldap_callbacks *callbacks;
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#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,9 +34,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32); ...@@ -33,9 +34,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
* *
* See ldap_modifyW. * See ldap_modifyW.
*/ */
ULONG CDECL ldap_modifyA( WLDAP32_LDAP *ld, char *dn, LDAPModA **mods ) ULONG CDECL ldap_modifyA( LDAP *ld, char *dn, LDAPModA **mods )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL; WCHAR *dnW = NULL;
LDAPModW **modsW = NULL; LDAPModW **modsW = NULL;
...@@ -74,14 +75,14 @@ exit: ...@@ -74,14 +75,14 @@ exit:
* the operation. Cancel the operation by calling ldap_abandon * the operation. Cancel the operation by calling ldap_abandon
* with the message ID. * with the message ID.
*/ */
ULONG CDECL ldap_modifyW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **mods ) ULONG CDECL ldap_modifyW( LDAP *ld, WCHAR *dn, LDAPModW **mods )
{ {
ULONG ret, msg; ULONG ret, msg;
TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), mods ); TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), mods );
ret = ldap_modify_extW( ld, dn, mods, NULL, NULL, &msg ); ret = ldap_modify_extW( ld, dn, mods, NULL, NULL, &msg );
if (ret == WLDAP32_LDAP_SUCCESS) return msg; if (ret == LDAP_SUCCESS) return msg;
return ~0u; return ~0u;
} }
...@@ -90,10 +91,10 @@ ULONG CDECL ldap_modifyW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **mods ) ...@@ -90,10 +91,10 @@ ULONG CDECL ldap_modifyW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **mods )
* *
* See ldap_modify_extW. * See ldap_modify_extW.
*/ */
ULONG CDECL ldap_modify_extA( WLDAP32_LDAP *ld, char *dn, LDAPModA **mods, ULONG CDECL ldap_modify_extA( LDAP *ld, char *dn, LDAPModA **mods, LDAPControlA **serverctrls,
LDAPControlA **serverctrls, LDAPControlA **clientctrls, ULONG *message ) LDAPControlA **clientctrls, ULONG *message )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL; WCHAR *dnW = NULL;
LDAPModW **modsW = NULL; LDAPModW **modsW = NULL;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
...@@ -140,10 +141,10 @@ exit: ...@@ -140,10 +141,10 @@ exit:
* the operation. The serverctrls and clientctrls parameters are * the operation. The serverctrls and clientctrls parameters are
* optional and should be set to NULL if not used. * optional and should be set to NULL if not used.
*/ */
ULONG CDECL ldap_modify_extW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **mods, ULONG CDECL ldap_modify_extW( LDAP *ld, WCHAR *dn, LDAPModW **mods, LDAPControlW **serverctrls,
LDAPControlW **serverctrls, LDAPControlW **clientctrls, ULONG *message ) LDAPControlW **clientctrls, ULONG *message )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
char *dnU = NULL; char *dnU = NULL;
LDAPModU **modsU = NULL; LDAPModU **modsU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
...@@ -157,7 +158,7 @@ ULONG CDECL ldap_modify_extW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **mods, ...@@ -157,7 +158,7 @@ ULONG CDECL ldap_modify_extW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **mods,
if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit;
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit; if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
ret = map_error( ldap_funcs->ldap_modify_ext( ld->ld, dnU, modsU, serverctrlsU, clientctrlsU, message ) ); ret = map_error( ldap_funcs->fn_ldap_modify_ext( CTX(ld), dnU, modsU, serverctrlsU, clientctrlsU, message ) );
exit: exit:
free( dnU ); free( dnU );
...@@ -172,17 +173,17 @@ exit: ...@@ -172,17 +173,17 @@ exit:
* *
* See ldap_modify_ext_sW. * See ldap_modify_ext_sW.
*/ */
ULONG CDECL ldap_modify_ext_sA( WLDAP32_LDAP *ld, char *dn, LDAPModA **mods, ULONG CDECL ldap_modify_ext_sA( LDAP *ld, char *dn, LDAPModA **mods, LDAPControlA **serverctrls,
LDAPControlA **serverctrls, LDAPControlA **clientctrls ) LDAPControlA **clientctrls )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL; WCHAR *dnW = NULL;
LDAPModW **modsW = NULL; LDAPModW **modsW = NULL;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_a(dn), mods, serverctrls, clientctrls ); TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_a(dn), mods, serverctrls, clientctrls );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) goto exit; if (dn && !(dnW = strAtoW( dn ))) goto exit;
if (mods && !(modsW = modarrayAtoW( mods ))) goto exit; if (mods && !(modsW = modarrayAtoW( mods ))) goto exit;
...@@ -220,24 +221,24 @@ exit: ...@@ -220,24 +221,24 @@ exit:
* The serverctrls and clientctrls parameters are optional and * The serverctrls and clientctrls parameters are optional and
* should be set to NULL if not used. * should be set to NULL if not used.
*/ */
ULONG CDECL ldap_modify_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **mods, ULONG CDECL ldap_modify_ext_sW( LDAP *ld, WCHAR *dn, LDAPModW **mods, LDAPControlW **serverctrls,
LDAPControlW **serverctrls, LDAPControlW **clientctrls ) LDAPControlW **clientctrls )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
char *dnU = NULL; char *dnU = NULL;
LDAPModU **modsU = NULL; LDAPModU **modsU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **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 );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnU = strWtoU( dn ))) goto exit; if (dn && !(dnU = strWtoU( dn ))) goto exit;
if (mods && !(modsU = modarrayWtoU( mods ))) goto exit; if (mods && !(modsU = modarrayWtoU( mods ))) goto exit;
if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit;
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit; if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
ret = map_error( ldap_funcs->ldap_modify_ext_s( ld->ld, dnU, modsU, serverctrlsU, clientctrlsU ) ); ret = map_error( ldap_funcs->fn_ldap_modify_ext_s( CTX(ld), dnU, modsU, serverctrlsU, clientctrlsU ) );
exit: exit:
free( dnU ); free( dnU );
...@@ -252,15 +253,15 @@ exit: ...@@ -252,15 +253,15 @@ exit:
* *
* See ldap_modify_sW. * See ldap_modify_sW.
*/ */
ULONG CDECL ldap_modify_sA( WLDAP32_LDAP *ld, char *dn, LDAPModA **mods ) ULONG CDECL ldap_modify_sA( LDAP *ld, char *dn, LDAPModA **mods )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL; WCHAR *dnW = NULL;
LDAPModW **modsW = NULL; LDAPModW **modsW = NULL;
TRACE( "(%p, %s, %p)\n", ld, debugstr_a(dn), mods ); TRACE( "(%p, %s, %p)\n", ld, debugstr_a(dn), mods );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) goto exit; if (dn && !(dnW = strAtoW( dn ))) goto exit;
if (mods && !(modsW = modarrayAtoW( mods ))) goto exit; if (mods && !(modsW = modarrayAtoW( mods ))) goto exit;
...@@ -288,7 +289,7 @@ exit: ...@@ -288,7 +289,7 @@ exit:
* Success: LDAP_SUCCESS * Success: LDAP_SUCCESS
* Failure: An LDAP error code. * Failure: An LDAP error code.
*/ */
ULONG CDECL ldap_modify_sW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **mods ) ULONG CDECL ldap_modify_sW( LDAP *ld, WCHAR *dn, LDAPModW **mods )
{ {
TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), mods ); TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), mods );
return ldap_modify_ext_sW( ld, dn, mods, NULL, NULL ); return ldap_modify_ext_sW( ld, dn, mods, NULL, NULL );
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#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,9 +34,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32); ...@@ -33,9 +34,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
* *
* See ldap_modrdnW. * See ldap_modrdnW.
*/ */
ULONG CDECL ldap_modrdnA( WLDAP32_LDAP *ld, char *dn, char *newdn ) ULONG CDECL ldap_modrdnA( LDAP *ld, char *dn, char *newdn )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL, *newdnW = NULL; WCHAR *dnW = NULL, *newdnW = NULL;
TRACE( "(%p, %s, %s)\n", ld, debugstr_a(dn), debugstr_a(newdn) ); TRACE( "(%p, %s, %s)\n", ld, debugstr_a(dn), debugstr_a(newdn) );
...@@ -72,7 +73,7 @@ exit: ...@@ -72,7 +73,7 @@ exit:
* the operation. Cancel the operation by calling ldap_abandon * the operation. Cancel the operation by calling ldap_abandon
* with the message ID. * with the message ID.
*/ */
ULONG CDECL ldap_modrdnW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newdn ) ULONG CDECL ldap_modrdnW( LDAP *ld, WCHAR *dn, WCHAR *newdn )
{ {
TRACE( "(%p, %s, %s)\n", ld, debugstr_w(dn), debugstr_w(newdn) ); TRACE( "(%p, %s, %s)\n", ld, debugstr_w(dn), debugstr_w(newdn) );
return ldap_modrdn2W( ld, dn, newdn, 1 ); return ldap_modrdn2W( ld, dn, newdn, 1 );
...@@ -83,9 +84,9 @@ ULONG CDECL ldap_modrdnW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newdn ) ...@@ -83,9 +84,9 @@ ULONG CDECL ldap_modrdnW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newdn )
* *
* See ldap_modrdn2W. * See ldap_modrdn2W.
*/ */
ULONG CDECL ldap_modrdn2A( WLDAP32_LDAP *ld, char *dn, char *newdn, int delete ) ULONG CDECL ldap_modrdn2A( LDAP *ld, char *dn, char *newdn, int delete )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL, *newdnW = NULL; WCHAR *dnW = NULL, *newdnW = NULL;
TRACE( "(%p, %s, %p, 0x%02x)\n", ld, debugstr_a(dn), newdn, delete ); TRACE( "(%p, %s, %p, 0x%02x)\n", ld, debugstr_a(dn), newdn, delete );
...@@ -123,9 +124,9 @@ exit: ...@@ -123,9 +124,9 @@ exit:
* the operation. Cancel the operation by calling ldap_abandon * the operation. Cancel the operation by calling ldap_abandon
* with the message ID. * with the message ID.
*/ */
ULONG CDECL ldap_modrdn2W( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete ) ULONG CDECL ldap_modrdn2W( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
char *dnU = NULL, *newdnU = NULL; char *dnU = NULL, *newdnU = NULL;
ULONG msg; ULONG msg;
...@@ -136,8 +137,8 @@ ULONG CDECL ldap_modrdn2W( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete ...@@ -136,8 +137,8 @@ ULONG CDECL ldap_modrdn2W( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete
if (dn && !(dnU = strWtoU( dn ))) goto exit; if (dn && !(dnU = strWtoU( dn ))) goto exit;
if (!(newdnU = strWtoU( newdn ))) goto exit; if (!(newdnU = strWtoU( newdn ))) goto exit;
ret = ldap_funcs->ldap_rename( ld->ld, dnU, newdnU, NULL, delete, NULL, NULL, &msg ); ret = ldap_funcs->fn_ldap_rename( CTX(ld), dnU, newdnU, NULL, delete, NULL, NULL, &msg );
if (ret == WLDAP32_LDAP_SUCCESS) if (ret == LDAP_SUCCESS)
ret = msg; ret = msg;
else else
ret = ~0u; ret = ~0u;
...@@ -153,14 +154,14 @@ exit: ...@@ -153,14 +154,14 @@ exit:
* *
* See ldap_modrdn2_sW. * See ldap_modrdn2_sW.
*/ */
ULONG CDECL ldap_modrdn2_sA( WLDAP32_LDAP *ld, char *dn, char *newdn, int delete ) ULONG CDECL ldap_modrdn2_sA( LDAP *ld, char *dn, char *newdn, int delete )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL, *newdnW = NULL; WCHAR *dnW = NULL, *newdnW = NULL;
TRACE( "(%p, %s, %p, 0x%02x)\n", ld, debugstr_a(dn), newdn, delete ); TRACE( "(%p, %s, %p, 0x%02x)\n", ld, debugstr_a(dn), newdn, delete );
if (!ld || !newdn) return WLDAP32_LDAP_PARAM_ERROR; if (!ld || !newdn) return LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) goto exit; if (dn && !(dnW = strAtoW( dn ))) goto exit;
if (!(newdnW = strAtoW( newdn ))) goto exit; if (!(newdnW = strAtoW( newdn ))) goto exit;
...@@ -188,19 +189,19 @@ exit: ...@@ -188,19 +189,19 @@ exit:
* Success: LDAP_SUCCESS * Success: LDAP_SUCCESS
* Failure: An LDAP error code. * Failure: An LDAP error code.
*/ */
ULONG CDECL ldap_modrdn2_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete ) ULONG CDECL ldap_modrdn2_sW( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
char *dnU = NULL, *newdnU = NULL; char *dnU = NULL, *newdnU = NULL;
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 );
if (!ld || !newdn) return WLDAP32_LDAP_PARAM_ERROR; if (!ld || !newdn) return LDAP_PARAM_ERROR;
if (dn && !(dnU = strWtoU( dn ))) goto exit; if (dn && !(dnU = strWtoU( dn ))) goto exit;
if (!(newdnU = strWtoU( newdn ))) goto exit; if (!(newdnU = strWtoU( newdn ))) goto exit;
ret = map_error( ldap_funcs->ldap_rename_s( ld->ld, dnU, newdnU, NULL, delete, NULL, NULL )); ret = map_error( ldap_funcs->fn_ldap_rename_s( CTX(ld), dnU, newdnU, NULL, delete, NULL, NULL ));
exit: exit:
free( dnU ); free( dnU );
...@@ -213,14 +214,14 @@ exit: ...@@ -213,14 +214,14 @@ exit:
* *
* See ldap_modrdn_sW. * See ldap_modrdn_sW.
*/ */
ULONG CDECL ldap_modrdn_sA( WLDAP32_LDAP *ld, char *dn, char *newdn ) ULONG CDECL ldap_modrdn_sA( LDAP *ld, char *dn, char *newdn )
{ {
ULONG ret = WLDAP32_LDAP_NO_MEMORY; ULONG ret = LDAP_NO_MEMORY;
WCHAR *dnW = NULL, *newdnW = NULL; WCHAR *dnW = NULL, *newdnW = NULL;
TRACE( "(%p, %s, %p)\n", ld, debugstr_a(dn), newdn ); TRACE( "(%p, %s, %p)\n", ld, debugstr_a(dn), newdn );
if (!ld || !newdn) return WLDAP32_LDAP_PARAM_ERROR; if (!ld || !newdn) return LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) goto exit; if (dn && !(dnW = strAtoW( dn ))) goto exit;
if (!(newdnW = strAtoW( newdn ))) goto exit; if (!(newdnW = strAtoW( newdn ))) goto exit;
...@@ -247,7 +248,7 @@ exit: ...@@ -247,7 +248,7 @@ exit:
* Success: LDAP_SUCCESS * Success: LDAP_SUCCESS
* Failure: An LDAP error code. * Failure: An LDAP error code.
*/ */
ULONG CDECL ldap_modrdn_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newdn ) ULONG CDECL ldap_modrdn_sW( LDAP *ld, WCHAR *dn, WCHAR *newdn )
{ {
TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), newdn ); TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), newdn );
return ldap_modrdn2_sW( ld, dn, newdn, 1 ); return ldap_modrdn2_sW( ld, dn, newdn, 1 );
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#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,17 +34,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32); ...@@ -33,17 +34,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
* *
* See ldap_rename_extW. * See ldap_rename_extW.
*/ */
ULONG CDECL ldap_rename_extA( WLDAP32_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 = LDAP_NO_MEMORY;
WCHAR *dnW = NULL, *newrdnW = NULL, *newparentW = NULL; WCHAR *dnW = NULL, *newrdnW = NULL, *newparentW = NULL;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
TRACE( "(%p, %s, %s, %s, 0x%02x, %p, %p, %p)\n", ld, debugstr_a(dn), debugstr_a(newrdn), debugstr_a(newparent), TRACE( "(%p, %s, %s, %s, 0x%02x, %p, %p, %p)\n", ld, debugstr_a(dn), debugstr_a(newrdn), debugstr_a(newparent),
delete, serverctrls, clientctrls, message ); delete, serverctrls, clientctrls, message );
if (!ld || !message) return WLDAP32_LDAP_PARAM_ERROR; if (!ld || !message) return LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) goto exit; if (dn && !(dnW = strAtoW( dn ))) goto exit;
if (newrdn && !(newrdnW = strAtoW( newrdn ))) goto exit; if (newrdn && !(newrdnW = strAtoW( newrdn ))) goto exit;
...@@ -86,17 +87,17 @@ exit: ...@@ -86,17 +87,17 @@ exit:
* the operation. Cancel the operation by calling ldap_abandon * the operation. Cancel the operation by calling ldap_abandon
* with the message ID. * with the message ID.
*/ */
ULONG CDECL ldap_rename_extW( WLDAP32_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 = LDAP_NO_MEMORY;
char *dnU = NULL, *newrdnU = NULL, *newparentU = NULL; char *dnU = NULL, *newrdnU = NULL, *newparentU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **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 );
if (!ld || !message) return WLDAP32_LDAP_PARAM_ERROR; if (!ld || !message) return LDAP_PARAM_ERROR;
if (dn && !(dnU = strWtoU( dn ))) goto exit; if (dn && !(dnU = strWtoU( dn ))) goto exit;
if (newrdn && !(newrdnU = strWtoU( newrdn ))) goto exit; if (newrdn && !(newrdnU = strWtoU( newrdn ))) goto exit;
...@@ -104,8 +105,8 @@ ULONG CDECL ldap_rename_extW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newrdn, WCHAR ...@@ -104,8 +105,8 @@ ULONG CDECL ldap_rename_extW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newrdn, WCHAR
if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit;
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit; if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
ret = map_error( ldap_funcs->ldap_rename( ld->ld, dnU, newrdnU, newparentU, delete, serverctrlsU, clientctrlsU, ret = map_error( ldap_funcs->fn_ldap_rename( CTX(ld), dnU, newrdnU, newparentU, delete, serverctrlsU, clientctrlsU,
message ) ); message ) );
exit: exit:
free( dnU ); free( dnU );
free( newrdnU ); free( newrdnU );
...@@ -120,17 +121,17 @@ exit: ...@@ -120,17 +121,17 @@ exit:
* *
* See ldap_rename_ext_sW. * See ldap_rename_ext_sW.
*/ */
ULONG CDECL ldap_rename_ext_sA( WLDAP32_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 = LDAP_NO_MEMORY;
WCHAR *dnW = NULL, *newrdnW = NULL, *newparentW = NULL; WCHAR *dnW = NULL, *newrdnW = NULL, *newparentW = NULL;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
TRACE( "(%p, %s, %s, %s, 0x%02x, %p, %p)\n", ld, debugstr_a(dn), debugstr_a(newrdn), debugstr_a(newparent), TRACE( "(%p, %s, %s, %s, 0x%02x, %p, %p)\n", ld, debugstr_a(dn), debugstr_a(newrdn), debugstr_a(newparent),
delete, serverctrls, clientctrls ); delete, serverctrls, clientctrls );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) goto exit; if (dn && !(dnW = strAtoW( dn ))) goto exit;
if (newrdn && !(newrdnW = strAtoW( newrdn ))) goto exit; if (newrdn && !(newrdnW = strAtoW( newrdn ))) goto exit;
...@@ -166,17 +167,17 @@ exit: ...@@ -166,17 +167,17 @@ exit:
* Success: LDAP_SUCCESS * Success: LDAP_SUCCESS
* Failure: An LDAP error code. * Failure: An LDAP error code.
*/ */
ULONG CDECL ldap_rename_ext_sW( WLDAP32_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 = LDAP_PARAM_ERROR;
char *dnU = NULL, *newrdnU = NULL, *newparentU = NULL; char *dnU = NULL, *newrdnU = NULL, *newparentU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **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 );
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return LDAP_PARAM_ERROR;
if (dn && !(dnU = strWtoU( dn ))) goto exit; if (dn && !(dnU = strWtoU( dn ))) goto exit;
if (newrdn && !(newrdnU = strWtoU( newrdn ))) goto exit; if (newrdn && !(newrdnU = strWtoU( newrdn ))) goto exit;
...@@ -184,8 +185,8 @@ ULONG CDECL ldap_rename_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newrdn, WCHA ...@@ -184,8 +185,8 @@ ULONG CDECL ldap_rename_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newrdn, WCHA
if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit; if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit;
if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit; if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit;
ret = map_error( ldap_funcs->ldap_rename_s( ld->ld, dnU, newrdnU, newparentU, delete, serverctrlsU, ret = map_error( ldap_funcs->fn_ldap_rename_s( CTX(ld), dnU, newrdnU, newparentU, delete, serverctrlsU,
clientctrlsU ) ); clientctrlsU ) );
exit: exit:
free( dnU ); free( dnU );
free( newrdnU ); free( newrdnU );
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#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"
...@@ -45,10 +46,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32); ...@@ -45,10 +46,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
* Call ldap_count_values_len with the result of a call to * Call ldap_count_values_len with the result of a call to
* ldap_get_values_len. * ldap_get_values_len.
*/ */
ULONG CDECL WLDAP32_ldap_count_values_len( struct WLDAP32_berval **values ) ULONG CDECL ldap_count_values_len( struct berval **values )
{ {
ULONG ret = 0; ULONG ret = 0;
struct WLDAP32_berval **ptr = values; struct berval **ptr = values;
TRACE( "(%p)\n", values ); TRACE( "(%p)\n", values );
...@@ -107,7 +108,7 @@ ULONG CDECL ldap_count_valuesW( WCHAR **values ) ...@@ -107,7 +108,7 @@ ULONG CDECL ldap_count_valuesW( WCHAR **values )
* *
* See ldap_get_valuesW. * See ldap_get_valuesW.
*/ */
char ** CDECL ldap_get_valuesA( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, char *attr ) char ** CDECL ldap_get_valuesA( LDAP *ld, LDAPMessage *entry, char *attr )
{ {
char **ret; char **ret;
WCHAR *attrW = NULL, **retW; WCHAR *attrW = NULL, **retW;
...@@ -186,7 +187,7 @@ static char **bv2str_array( struct bervalU **bv ) ...@@ -186,7 +187,7 @@ static char **bv2str_array( struct bervalU **bv )
* ldap_first_entry or ldap_next_entry. Free the returned * ldap_first_entry or ldap_next_entry. Free the returned
* array with a call to ldap_value_freeW. * array with a call to ldap_value_freeW.
*/ */
WCHAR ** CDECL ldap_get_valuesW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, WCHAR *attr ) WCHAR ** CDECL ldap_get_valuesW( LDAP *ld, LDAPMessage *entry, WCHAR *attr )
{ {
WCHAR **ret = NULL; WCHAR **ret = NULL;
char *attrU, **retU; char *attrU, **retU;
...@@ -196,12 +197,12 @@ WCHAR ** CDECL ldap_get_valuesW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, W ...@@ -196,12 +197,12 @@ WCHAR ** CDECL ldap_get_valuesW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, W
if (!ld || !entry || !attr || !(attrU = strWtoU( attr ))) return NULL; if (!ld || !entry || !attr || !(attrU = strWtoU( attr ))) return NULL;
if ((bv = ldap_funcs->ldap_get_values_len( ld->ld, entry->Request, attrU ))) if ((bv = ldap_funcs->fn_ldap_get_values_len( CTX(ld), MSG(entry), attrU )))
{ {
retU = bv2str_array( bv ); retU = bv2str_array( bv );
ret = strarrayUtoW( retU ); ret = strarrayUtoW( retU );
ldap_funcs->ldap_value_free_len( bv ); ldap_funcs->fn_ldap_value_free_len( bv );
strarrayfreeU( retU ); strarrayfreeU( retU );
} }
...@@ -214,10 +215,10 @@ WCHAR ** CDECL ldap_get_valuesW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, W ...@@ -214,10 +215,10 @@ WCHAR ** CDECL ldap_get_valuesW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, W
* *
* See ldap_get_values_lenW. * See ldap_get_values_lenW.
*/ */
struct WLDAP32_berval ** CDECL ldap_get_values_lenA( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *message, char *attr ) struct berval ** CDECL ldap_get_values_lenA( LDAP *ld, LDAPMessage *message, char *attr )
{ {
WCHAR *attrW; WCHAR *attrW;
struct WLDAP32_berval **ret; struct berval **ret;
TRACE( "(%p, %p, %s)\n", ld, message, debugstr_a(attr) ); TRACE( "(%p, %p, %s)\n", ld, message, debugstr_a(attr) );
...@@ -248,17 +249,17 @@ struct WLDAP32_berval ** CDECL ldap_get_values_lenA( WLDAP32_LDAP *ld, WLDAP32_L ...@@ -248,17 +249,17 @@ struct WLDAP32_berval ** CDECL ldap_get_values_lenA( WLDAP32_LDAP *ld, WLDAP32_L
* ldap_first_entry or ldap_next_entry. Free the returned * ldap_first_entry or ldap_next_entry. Free the returned
* array with a call to ldap_value_free_len. * array with a call to ldap_value_free_len.
*/ */
struct WLDAP32_berval ** CDECL ldap_get_values_lenW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *message, WCHAR *attr ) struct berval ** CDECL ldap_get_values_lenW( LDAP *ld, LDAPMessage *message, WCHAR *attr )
{ {
char *attrU = NULL; char *attrU = NULL;
struct bervalU **retU; struct bervalU **retU;
struct WLDAP32_berval **ret = NULL; struct 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 ))) return NULL; if (!ld || !message || !attr || !(attrU = strWtoU( attr ))) return NULL;
if ((retU = ldap_funcs->ldap_get_values_len( ld->ld, message->Request, attrU ))) if ((retU = ldap_funcs->fn_ldap_get_values_len( CTX(ld), MSG(message), attrU )))
{ {
ret = bvarrayUtoW( retU ); ret = bvarrayUtoW( retU );
bvarrayfreeU( retU ); bvarrayfreeU( retU );
...@@ -280,12 +281,12 @@ struct WLDAP32_berval ** CDECL ldap_get_values_lenW( WLDAP32_LDAP *ld, WLDAP32_L ...@@ -280,12 +281,12 @@ struct WLDAP32_berval ** CDECL ldap_get_values_lenW( WLDAP32_LDAP *ld, WLDAP32_L
* Success: LDAP_SUCCESS * Success: LDAP_SUCCESS
* Failure: An LDAP error code. * Failure: An LDAP error code.
*/ */
ULONG CDECL WLDAP32_ldap_value_free_len( struct WLDAP32_berval **values ) ULONG CDECL ldap_value_free_len( struct berval **values )
{ {
TRACE( "(%p)\n", values ); TRACE( "(%p)\n", values );
bvarrayfreeW( values ); bvarrayfreeW( values );
return WLDAP32_LDAP_SUCCESS; return LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -298,7 +299,7 @@ ULONG CDECL ldap_value_freeA( char **values ) ...@@ -298,7 +299,7 @@ ULONG CDECL ldap_value_freeA( char **values )
TRACE( "(%p)\n", values ); TRACE( "(%p)\n", values );
strarrayfreeA( values ); strarrayfreeA( values );
return WLDAP32_LDAP_SUCCESS; return LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -318,5 +319,5 @@ ULONG CDECL ldap_value_freeW( WCHAR **values ) ...@@ -318,5 +319,5 @@ ULONG CDECL ldap_value_freeW( WCHAR **values )
TRACE( "(%p)\n", values ); TRACE( "(%p)\n", values );
strarrayfreeW( values ); strarrayfreeW( values );
return WLDAP32_LDAP_SUCCESS; return LDAP_SUCCESS;
} }
10 cdecl ldap_abandon(ptr long) WLDAP32_ldap_abandon 10 cdecl ldap_abandon(ptr long)
11 cdecl ldap_add(ptr str ptr) ldap_addA 11 cdecl ldap_add(ptr str ptr) ldap_addA
12 cdecl ldap_get_optionW(ptr long ptr) 12 cdecl ldap_get_optionW(ptr long ptr)
13 cdecl ldap_unbind(ptr) WLDAP32_ldap_unbind 13 cdecl ldap_unbind(ptr)
14 cdecl ldap_set_optionW(ptr long ptr) 14 cdecl ldap_set_optionW(ptr long ptr)
16 cdecl LdapGetLastError() 16 cdecl LdapGetLastError()
17 cdecl cldap_open(str long) cldap_openA 17 cdecl cldap_open(str long) cldap_openA
18 cdecl LdapMapErrorToWin32(long) 18 cdecl LdapMapErrorToWin32(long)
19 cdecl ldap_compare(ptr str str str) ldap_compareA 19 cdecl ldap_compare(ptr str str str) ldap_compareA
20 cdecl ldap_delete(ptr str) ldap_deleteA 20 cdecl ldap_delete(ptr str) ldap_deleteA
21 cdecl ldap_result2error(ptr ptr long) WLDAP32_ldap_result2error 21 cdecl ldap_result2error(ptr ptr long)
22 cdecl ldap_err2string(long) ldap_err2stringA 22 cdecl ldap_err2string(long) ldap_err2stringA
23 cdecl ldap_modify(ptr str ptr) ldap_modifyA 23 cdecl ldap_modify(ptr str ptr) ldap_modifyA
24 cdecl ldap_modrdn(ptr str ptr) ldap_modrdnA 24 cdecl ldap_modrdn(ptr str ptr) ldap_modrdnA
25 cdecl ldap_open(str long) ldap_openA 25 cdecl ldap_open(str long) ldap_openA
26 cdecl ldap_first_entry(ptr ptr) WLDAP32_ldap_first_entry 26 cdecl ldap_first_entry(ptr ptr)
27 cdecl ldap_next_entry(ptr ptr) WLDAP32_ldap_next_entry 27 cdecl ldap_next_entry(ptr ptr)
28 cdecl cldap_openW(wstr long) 28 cdecl cldap_openW(wstr long)
29 cdecl LdapUTF8ToUnicode(str long ptr long) 29 cdecl LdapUTF8ToUnicode(str long ptr long)
30 cdecl ldap_get_dn(ptr ptr) ldap_get_dnA 30 cdecl ldap_get_dn(ptr ptr) ldap_get_dnA
...@@ -23,17 +23,17 @@ ...@@ -23,17 +23,17 @@
33 cdecl ldap_next_attribute(ptr ptr ptr) ldap_next_attributeA 33 cdecl ldap_next_attribute(ptr ptr ptr) ldap_next_attributeA
34 cdecl ldap_get_values(ptr ptr str) ldap_get_valuesA 34 cdecl ldap_get_values(ptr ptr str) ldap_get_valuesA
35 cdecl ldap_get_values_len(ptr ptr str) ldap_get_values_lenA 35 cdecl ldap_get_values_len(ptr ptr str) ldap_get_values_lenA
36 cdecl ldap_count_entries(ptr ptr) WLDAP32_ldap_count_entries 36 cdecl ldap_count_entries(ptr ptr)
37 cdecl ldap_count_values(ptr) ldap_count_valuesA 37 cdecl ldap_count_values(ptr) ldap_count_valuesA
38 cdecl ldap_value_free(ptr) ldap_value_freeA 38 cdecl ldap_value_free(ptr) ldap_value_freeA
39 cdecl ldap_explode_dn(str long) ldap_explode_dnA 39 cdecl ldap_explode_dn(str long) ldap_explode_dnA
40 cdecl ldap_result(ptr long long ptr ptr) WLDAP32_ldap_result 40 cdecl ldap_result(ptr long long ptr ptr)
41 cdecl ldap_msgfree(ptr) WLDAP32_ldap_msgfree 41 cdecl ldap_msgfree(ptr)
42 cdecl ldap_addW(ptr wstr ptr) 42 cdecl ldap_addW(ptr wstr ptr)
43 cdecl ldap_search(ptr str long str ptr long) ldap_searchA 43 cdecl ldap_search(ptr str long str ptr long) ldap_searchA
44 cdecl ldap_add_s(ptr str ptr) ldap_add_sA 44 cdecl ldap_add_s(ptr str ptr) ldap_add_sA
45 cdecl ldap_bind_s(ptr str str long) ldap_bind_sA 45 cdecl ldap_bind_s(ptr str str long) ldap_bind_sA
46 cdecl ldap_unbind_s(ptr) WLDAP32_ldap_unbind_s 46 cdecl ldap_unbind_s(ptr)
47 cdecl ldap_delete_s(ptr str) ldap_delete_sA 47 cdecl ldap_delete_s(ptr str) ldap_delete_sA
48 cdecl ldap_modify_s(ptr str ptr) ldap_modify_sA 48 cdecl ldap_modify_s(ptr str ptr) ldap_modify_sA
49 cdecl ldap_modrdn_s(ptr str ptr) ldap_modrdn_sA 49 cdecl ldap_modrdn_s(ptr str ptr) ldap_modrdn_sA
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
51 cdecl ldap_search_st(ptr str long str ptr long ptr ptr) ldap_search_stA 51 cdecl ldap_search_st(ptr str long str ptr long ptr ptr) ldap_search_stA
52 cdecl ldap_compare_s(ptr str str str) ldap_compare_sA 52 cdecl ldap_compare_s(ptr str str str) ldap_compare_sA
53 cdecl LdapUnicodeToUTF8(wstr long ptr long) 53 cdecl LdapUnicodeToUTF8(wstr long ptr long)
54 cdecl ber_bvfree(ptr) WLDAP32_ber_bvfree 54 cdecl ber_bvfree(ptr)
55 cdecl cldap_openA(str long) 55 cdecl cldap_openA(str long)
56 cdecl ldap_addA(ptr str ptr) 56 cdecl ldap_addA(ptr str ptr)
57 cdecl ldap_add_ext(ptr str ptr ptr ptr ptr) ldap_add_extA 57 cdecl ldap_add_ext(ptr str ptr ptr ptr ptr) ldap_add_extA
...@@ -64,12 +64,12 @@ ...@@ -64,12 +64,12 @@
74 cdecl ldap_close_extended_op(ptr long) 74 cdecl ldap_close_extended_op(ptr long)
75 cdecl ldap_compareA(ptr str str str) 75 cdecl ldap_compareA(ptr str str str)
76 cdecl ldap_compareW(ptr wstr wstr wstr) 76 cdecl ldap_compareW(ptr wstr wstr wstr)
77 cdecl ldap_count_values_len(ptr) WLDAP32_ldap_count_values_len 77 cdecl ldap_count_values_len(ptr)
78 cdecl ldap_compare_ext(ptr str str str ptr ptr ptr ptr) ldap_compare_extA 78 cdecl ldap_compare_ext(ptr str str str ptr ptr ptr ptr) ldap_compare_extA
79 cdecl ldap_value_free_len(ptr) WLDAP32_ldap_value_free_len 79 cdecl ldap_value_free_len(ptr)
80 cdecl ldap_compare_extA(ptr str str str ptr ptr ptr ptr) 80 cdecl ldap_compare_extA(ptr str str str ptr ptr ptr ptr)
81 cdecl ldap_compare_extW(ptr wstr wstr wstr ptr ptr ptr ptr) 81 cdecl ldap_compare_extW(ptr wstr wstr wstr ptr ptr ptr ptr)
82 cdecl ldap_perror(ptr ptr) WLDAP32_ldap_perror 82 cdecl ldap_perror(ptr ptr)
83 cdecl ldap_compare_ext_s(ptr str str str ptr ptr ptr) ldap_compare_ext_sA 83 cdecl ldap_compare_ext_s(ptr str str str ptr ptr ptr) ldap_compare_ext_sA
84 cdecl ldap_compare_ext_sA(ptr str str str ptr ptr ptr) 84 cdecl ldap_compare_ext_sA(ptr str str str ptr ptr ptr)
85 cdecl ldap_compare_ext_sW(ptr wstr wstr wstr ptr ptr ptr) 85 cdecl ldap_compare_ext_sW(ptr wstr wstr wstr ptr ptr ptr)
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
92 cdecl ldap_controls_free(ptr) ldap_controls_freeA 92 cdecl ldap_controls_free(ptr) ldap_controls_freeA
93 cdecl ldap_controls_freeA(ptr) 93 cdecl ldap_controls_freeA(ptr)
94 cdecl ldap_controls_freeW(ptr) 94 cdecl ldap_controls_freeW(ptr)
95 cdecl ldap_count_references(ptr ptr) WLDAP32_ldap_count_references 95 cdecl ldap_count_references(ptr ptr)
96 cdecl ldap_count_valuesA(ptr) 96 cdecl ldap_count_valuesA(ptr)
97 cdecl ldap_count_valuesW(ptr) 97 cdecl ldap_count_valuesW(ptr)
98 cdecl ldap_create_page_control(ptr long ptr long ptr) ldap_create_page_controlA 98 cdecl ldap_create_page_control(ptr long ptr long ptr) ldap_create_page_controlA
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
125 cdecl ldap_extended_operationW(ptr wstr ptr ptr ptr ptr) 125 cdecl ldap_extended_operationW(ptr wstr ptr ptr ptr ptr)
126 cdecl ldap_first_attributeA(ptr ptr ptr) 126 cdecl ldap_first_attributeA(ptr ptr ptr)
127 cdecl ldap_first_attributeW(ptr ptr ptr) 127 cdecl ldap_first_attributeW(ptr ptr ptr)
128 cdecl ldap_first_reference(ptr ptr) WLDAP32_ldap_first_reference 128 cdecl ldap_first_reference(ptr ptr)
129 cdecl ldap_free_controls(ptr) ldap_free_controlsA 129 cdecl ldap_free_controls(ptr) ldap_free_controlsA
130 cdecl ldap_free_controlsA(ptr) 130 cdecl ldap_free_controlsA(ptr)
131 cdecl ldap_free_controlsW(ptr) 131 cdecl ldap_free_controlsW(ptr)
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
165 cdecl ldap_modrdn_sW(ptr wstr ptr) 165 cdecl ldap_modrdn_sW(ptr wstr ptr)
166 cdecl ldap_next_attributeA(ptr ptr ptr) 166 cdecl ldap_next_attributeA(ptr ptr ptr)
167 cdecl ldap_next_attributeW(ptr ptr ptr) 167 cdecl ldap_next_attributeW(ptr ptr ptr)
168 cdecl ldap_next_reference(ptr ptr) WLDAP32_ldap_next_reference 168 cdecl ldap_next_reference(ptr ptr)
169 cdecl ldap_openA(str long) 169 cdecl ldap_openA(str long)
170 cdecl ldap_openW(wstr long) 170 cdecl ldap_openW(wstr long)
171 cdecl ldap_parse_page_control(ptr ptr ptr ptr) ldap_parse_page_controlA 171 cdecl ldap_parse_page_control(ptr ptr ptr ptr) ldap_parse_page_controlA
...@@ -215,18 +215,18 @@ ...@@ -215,18 +215,18 @@
230 cdecl ldap_check_filterA(ptr str) 230 cdecl ldap_check_filterA(ptr str)
231 cdecl ldap_check_filterW(ptr wstr) 231 cdecl ldap_check_filterW(ptr wstr)
232 cdecl ldap_dn2ufnA(str) 232 cdecl ldap_dn2ufnA(str)
300 cdecl ber_init(ptr) WLDAP32_ber_init 300 cdecl ber_init(ptr)
301 cdecl ber_free(ptr long) WLDAP32_ber_free 301 cdecl ber_free(ptr long)
302 cdecl ber_bvecfree(ptr) WLDAP32_ber_bvecfree 302 cdecl ber_bvecfree(ptr)
303 cdecl ber_bvdup(ptr) WLDAP32_ber_bvdup 303 cdecl ber_bvdup(ptr)
304 cdecl ber_alloc_t(long) WLDAP32_ber_alloc_t 304 cdecl ber_alloc_t(long)
305 cdecl ber_skip_tag(ptr ptr) WLDAP32_ber_skip_tag 305 cdecl ber_skip_tag(ptr ptr)
306 cdecl ber_peek_tag(ptr ptr) WLDAP32_ber_peek_tag 306 cdecl ber_peek_tag(ptr ptr)
307 cdecl ber_first_element(ptr ptr ptr) WLDAP32_ber_first_element 307 cdecl ber_first_element(ptr ptr ptr)
308 cdecl ber_next_element(ptr ptr ptr) WLDAP32_ber_next_element 308 cdecl ber_next_element(ptr ptr ptr)
309 cdecl ber_flatten(ptr ptr) WLDAP32_ber_flatten 309 cdecl ber_flatten(ptr ptr)
310 varargs ber_printf(ptr str) WLDAP32_ber_printf 310 varargs ber_printf(ptr str)
311 varargs ber_scanf(ptr str) WLDAP32_ber_scanf 311 varargs ber_scanf(ptr str)
312 cdecl ldap_conn_from_msg(ptr ptr) 312 cdecl ldap_conn_from_msg(ptr ptr)
313 cdecl ldap_sasl_bindW(ptr wstr wstr ptr ptr ptr ptr) 313 cdecl ldap_sasl_bindW(ptr wstr wstr ptr ptr ptr ptr)
314 cdecl ldap_sasl_bind_sW(ptr wstr wstr ptr ptr ptr ptr) 314 cdecl ldap_sasl_bind_sW(ptr wstr wstr ptr ptr ptr ptr)
......
...@@ -34,7 +34,7 @@ ULONG CDECL ber_first_element( BerElement *, ULONG *, char ** ); ...@@ -34,7 +34,7 @@ ULONG CDECL ber_first_element( BerElement *, ULONG *, char ** );
int CDECL ber_flatten( BerElement *, BERVAL ** ); int CDECL ber_flatten( BerElement *, BERVAL ** );
void CDECL ber_free( BerElement *, int ); void CDECL ber_free( BerElement *, int );
BerElement * CDECL ber_init( BERVAL * ); BerElement * CDECL ber_init( BERVAL * );
ULONG CDECL ber_next_element( BerElement *, ULONG *, char ** ); ULONG CDECL ber_next_element( BerElement *, ULONG *, char * );
ULONG CDECL ber_peek_tag( BerElement *, ULONG * ); ULONG CDECL ber_peek_tag( BerElement *, ULONG * );
int WINAPIV ber_printf( BerElement *, char *, ... ); int WINAPIV ber_printf( BerElement *, char *, ... );
ULONG WINAPIV ber_scanf( BerElement *, char *, ... ); ULONG WINAPIV ber_scanf( BerElement *, char *, ... );
......
...@@ -293,6 +293,14 @@ typedef struct berval ...@@ -293,6 +293,14 @@ typedef struct berval
PCHAR bv_val; PCHAR bv_val;
} LDAP_BERVAL, *PLDAP_BERVAL, BERVAL, *PBERVAL, BerValue; } LDAP_BERVAL, *PLDAP_BERVAL, BERVAL, *PBERVAL, BerValue;
#define LDAP_PAGED_RESULT_OID_STRING "1.2.840.113556.1.4.319"
#define LDAP_SERVER_RESP_SORT_OID "1.2.840.113556.1.4.474"
#define LDAP_CONTROL_VLVRESPONSE "2.16.840.1.113730.3.4.10"
#define LDAP_PAGED_RESULT_OID_STRING_W L"1.2.840.113556.1.4.319"
#define LDAP_SERVER_RESP_SORT_OID_W L"1.2.840.113556.1.4.474"
#define LDAP_CONTROL_VLVRESPONSE_W L"2.16.840.1.113730.3.4.10"
typedef struct ldapcontrolA typedef struct ldapcontrolA
{ {
PCHAR ldctl_oid; PCHAR ldctl_oid;
...@@ -586,7 +594,7 @@ ULONG CDECL ldap_simple_bind_sW(LDAP*,PWCHAR,PWCHAR); ...@@ -586,7 +594,7 @@ ULONG CDECL ldap_simple_bind_sW(LDAP*,PWCHAR,PWCHAR);
#define ldap_simple_bind_s WINELIB_NAME_AW(ldap_simple_bind_s) #define ldap_simple_bind_s WINELIB_NAME_AW(ldap_simple_bind_s)
ULONG CDECL ldap_search_abandon_page(PLDAP,PLDAPSearch); ULONG CDECL ldap_search_abandon_page(PLDAP,PLDAPSearch);
ULONG CDECL ldap_searchA(LDAP*,PCHAR,ULONG,PCHAR,PCHAR[],ULONG); ULONG CDECL ldap_searchA(LDAP*,PCHAR,ULONG,PCHAR,PCHAR[],ULONG);
ULONG CDECL ldap_searchW(LDAP*,PWCHAR,ULONG,PWCHAR,PCHAR[],ULONG); ULONG CDECL ldap_searchW(LDAP*,PWCHAR,ULONG,PWCHAR,PWCHAR[],ULONG);
#define ldap_search WINELIB_NAME_AW(ldap_search) #define ldap_search WINELIB_NAME_AW(ldap_search)
ULONG CDECL ldap_search_extA(LDAP*,PCHAR,ULONG,PCHAR,PCHAR[],ULONG,PLDAPControlA*, ULONG CDECL ldap_search_extA(LDAP*,PCHAR,ULONG,PCHAR,PCHAR[],ULONG,PLDAPControlA*,
PLDAPControlA*,ULONG,ULONG,ULONG*); PLDAPControlA*,ULONG,ULONG,ULONG*);
......
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