Commit 17021e53 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wldap32: Add a prefix to definitions that conflict with OpenLDAP headers.

parent bf88332c
...@@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32); ...@@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
*/ */
ULONG CDECL ldap_addA( LDAP *ld, char *dn, LDAPModA **attrs ) ULONG CDECL ldap_addA( LDAP *ld, char *dn, LDAPModA **attrs )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *dnW = NULL; WCHAR *dnW = NULL;
LDAPModW **attrsW = NULL; LDAPModW **attrsW = NULL;
...@@ -63,7 +63,7 @@ ULONG CDECL ldap_addW( LDAP *ld, WCHAR *dn, LDAPModW **attrs ) ...@@ -63,7 +63,7 @@ ULONG CDECL ldap_addW( 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 );
ret = ldap_add_extW( ld, dn, attrs, NULL, NULL, &msg ); ret = ldap_add_extW( ld, dn, attrs, NULL, NULL, &msg );
if (ret == LDAP_SUCCESS) return msg; if (ret == WLDAP32_LDAP_SUCCESS) return msg;
return ~0u; return ~0u;
} }
...@@ -73,14 +73,14 @@ ULONG CDECL ldap_addW( LDAP *ld, WCHAR *dn, LDAPModW **attrs ) ...@@ -73,14 +73,14 @@ ULONG CDECL ldap_addW( LDAP *ld, WCHAR *dn, LDAPModW **attrs )
ULONG CDECL ldap_add_extA( 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 = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
...@@ -103,14 +103,14 @@ exit: ...@@ -103,14 +103,14 @@ exit:
ULONG CDECL ldap_add_extW( 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 = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
...@@ -136,14 +136,14 @@ exit: ...@@ -136,14 +136,14 @@ exit:
ULONG CDECL ldap_add_ext_sA( 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 = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
...@@ -166,14 +166,14 @@ exit: ...@@ -166,14 +166,14 @@ exit:
ULONG CDECL ldap_add_ext_sW( 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 = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
...@@ -198,13 +198,13 @@ exit: ...@@ -198,13 +198,13 @@ exit:
*/ */
ULONG CDECL ldap_add_sA( LDAP *ld, char *dn, LDAPModA **attrs ) ULONG CDECL ldap_add_sA( LDAP *ld, char *dn, LDAPModA **attrs )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
......
...@@ -92,11 +92,11 @@ int CDECL WLDAP32_ber_flatten( WLDAP32_BerElement *ber, BERVAL **berval ) ...@@ -92,11 +92,11 @@ int CDECL WLDAP32_ber_flatten( WLDAP32_BerElement *ber, BERVAL **berval )
struct berval *bervalW; struct berval *bervalW;
struct ber_flatten_params params = { BER(ber), &bervalU }; struct ber_flatten_params params = { BER(ber), &bervalU };
if (LDAP_CALL( ber_flatten, &params )) return LBER_ERROR; if (LDAP_CALL( ber_flatten, &params )) return WLDAP32_LBER_ERROR;
if (!(bervalW = bervalUtoW( bervalU ))) return LBER_ERROR; if (!(bervalW = bervalUtoW( bervalU ))) return WLDAP32_LBER_ERROR;
LDAP_CALL( ber_bvfree, bervalU ); LDAP_CALL( ber_bvfree, bervalU );
if (!bervalW) return LBER_ERROR; if (!bervalW) return WLDAP32_LBER_ERROR;
*berval = bervalW; *berval = bervalW;
return 0; return 0;
} }
......
...@@ -36,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32); ...@@ -36,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
*/ */
ULONG CDECL ldap_bindA( LDAP *ld, char *dn, char *cred, ULONG method ) ULONG CDECL ldap_bindA( LDAP *ld, char *dn, char *cred, ULONG method )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *dnW = NULL, *credW = NULL; WCHAR *dnW = NULL, *credW = NULL;
TRACE( "(%p, %s, %p, %#lx)\n", ld, debugstr_a(dn), cred, method ); TRACE( "(%p, %s, %p, %#lx)\n", ld, debugstr_a(dn), cred, method );
...@@ -59,7 +59,7 @@ exit: ...@@ -59,7 +59,7 @@ exit:
*/ */
ULONG CDECL ldap_bindW( LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method ) ULONG CDECL ldap_bindW( LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL, *credU = NULL; char *dnU = NULL, *credU = NULL;
struct bervalU pwd = { 0, NULL }; struct bervalU pwd = { 0, NULL };
int msg; int msg;
...@@ -67,7 +67,7 @@ ULONG CDECL ldap_bindW( LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method ) ...@@ -67,7 +67,7 @@ ULONG CDECL ldap_bindW( LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method )
TRACE( "(%p, %s, %p, %#lx)\n", ld, debugstr_w(dn), cred, method ); TRACE( "(%p, %s, %p, %#lx)\n", ld, debugstr_w(dn), cred, method );
if (!ld) return ~0u; if (!ld) return ~0u;
if (method != LDAP_AUTH_SIMPLE) return LDAP_PARAM_ERROR; if (method != WLDAP32_LDAP_AUTH_SIMPLE) return WLDAP32_LDAP_PARAM_ERROR;
if (dn && !(dnU = strWtoU( dn ))) goto exit; if (dn && !(dnU = strWtoU( dn ))) goto exit;
if (cred) if (cred)
...@@ -81,7 +81,7 @@ ULONG CDECL ldap_bindW( LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method ) ...@@ -81,7 +81,7 @@ ULONG CDECL ldap_bindW( LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method )
struct ldap_sasl_bind_params params = { CTX(ld), dnU, 0, &pwd, NULL, NULL, &msg }; struct ldap_sasl_bind_params params = { CTX(ld), dnU, 0, &pwd, NULL, NULL, &msg };
ret = map_error( LDAP_CALL( ldap_sasl_bind, &params )); ret = map_error( LDAP_CALL( ldap_sasl_bind, &params ));
} }
if (ret == LDAP_SUCCESS) if (ret == WLDAP32_LDAP_SUCCESS)
ret = msg; ret = msg;
else else
ret = ~0u; ret = ~0u;
...@@ -97,17 +97,17 @@ exit: ...@@ -97,17 +97,17 @@ exit:
*/ */
ULONG CDECL ldap_bind_sA( LDAP *ld, char *dn, char *cred, ULONG method ) ULONG CDECL ldap_bind_sA( LDAP *ld, char *dn, char *cred, ULONG method )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *dnW = NULL, *credW = NULL; WCHAR *dnW = NULL, *credW = NULL;
TRACE( "(%p, %s, %p, %#lx)\n", ld, debugstr_a(dn), cred, method ); TRACE( "(%p, %s, %p, %#lx)\n", ld, debugstr_a(dn), cred, method );
if (!ld) return LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) goto exit; if (dn && !(dnW = strAtoW( dn ))) goto exit;
if (cred) if (cred)
{ {
if (method == LDAP_AUTH_SIMPLE) if (method == WLDAP32_LDAP_AUTH_SIMPLE)
{ {
if (!(credW = strAtoW( cred ))) goto exit; if (!(credW = strAtoW( cred ))) goto exit;
} }
...@@ -127,15 +127,15 @@ exit: ...@@ -127,15 +127,15 @@ exit:
*/ */
ULONG CDECL ldap_bind_sW( LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method ) ULONG CDECL ldap_bind_sW( LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL, *credU = NULL; char *dnU = NULL, *credU = NULL;
struct bervalU pwd = { 0, NULL }; struct bervalU pwd = { 0, NULL };
TRACE( "(%p, %s, %p, %#lx)\n", ld, debugstr_w(dn), cred, method ); TRACE( "(%p, %s, %p, %#lx)\n", ld, debugstr_w(dn), cred, method );
if (!ld) return LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
if (method == LDAP_AUTH_SIMPLE) if (method == WLDAP32_LDAP_AUTH_SIMPLE)
{ {
if (dn && !(dnU = strWtoU( dn ))) goto exit; if (dn && !(dnU = strWtoU( dn ))) goto exit;
if (cred) if (cred)
...@@ -150,7 +150,7 @@ ULONG CDECL ldap_bind_sW( LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method ) ...@@ -150,7 +150,7 @@ ULONG CDECL ldap_bind_sW( LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method )
ret = map_error( LDAP_CALL( ldap_sasl_bind_s, &params )); ret = map_error( LDAP_CALL( ldap_sasl_bind_s, &params ));
} }
} }
else if (method == LDAP_AUTH_NEGOTIATE) else if (method == WLDAP32_LDAP_AUTH_NEGOTIATE)
{ {
SEC_WINNT_AUTH_IDENTITY_A idU; SEC_WINNT_AUTH_IDENTITY_A idU;
SEC_WINNT_AUTH_IDENTITY_W idW; SEC_WINNT_AUTH_IDENTITY_W idW;
...@@ -194,7 +194,7 @@ ULONG CDECL ldap_bind_sW( LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method ) ...@@ -194,7 +194,7 @@ ULONG CDECL ldap_bind_sW( LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method )
else else
{ {
FIXME( "method %#lx not supported\n", method ); FIXME( "method %#lx not supported\n", method );
return LDAP_PARAM_ERROR; return WLDAP32_LDAP_PARAM_ERROR;
} }
exit: exit:
...@@ -209,14 +209,14 @@ exit: ...@@ -209,14 +209,14 @@ exit:
ULONG CDECL ldap_sasl_bindA( LDAP *ld, const PCHAR dn, const PCHAR mechanism, const BERVAL *cred, ULONG CDECL ldap_sasl_bindA( LDAP *ld, const PCHAR dn, const PCHAR mechanism, const BERVAL *cred,
LDAPControlA **serverctrls, LDAPControlA **clientctrls, int *message ) LDAPControlA **serverctrls, LDAPControlA **clientctrls, int *message )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *dnW, *mechanismW = NULL; WCHAR *dnW, *mechanismW = NULL;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
TRACE( "(%p, %s, %s, %p, %p, %p, %p)\n", ld, debugstr_a(dn), TRACE( "(%p, %s, %s, %p, %p, %p, %p)\n", ld, debugstr_a(dn),
debugstr_a(mechanism), cred, serverctrls, clientctrls, message ); debugstr_a(mechanism), cred, serverctrls, clientctrls, message );
if (!ld || !dn || !mechanism || !cred || !message) return LDAP_PARAM_ERROR; if (!ld || !dn || !mechanism || !cred || !message) return WLDAP32_LDAP_PARAM_ERROR;
if (!(dnW = strAtoW( dn ))) goto exit; if (!(dnW = strAtoW( dn ))) goto exit;
if (!(mechanismW = strAtoW( mechanism ))) goto exit; if (!(mechanismW = strAtoW( mechanism ))) goto exit;
...@@ -239,7 +239,7 @@ exit: ...@@ -239,7 +239,7 @@ exit:
ULONG CDECL ldap_sasl_bindW( LDAP *ld, const PWCHAR dn, const PWCHAR mechanism, const BERVAL *cred, ULONG CDECL ldap_sasl_bindW( LDAP *ld, const PWCHAR dn, const PWCHAR mechanism, const BERVAL *cred,
LDAPControlW **serverctrls, LDAPControlW **clientctrls, int *message ) LDAPControlW **serverctrls, LDAPControlW **clientctrls, int *message )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU, *mechanismU = NULL; char *dnU, *mechanismU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
struct bervalU credU; struct bervalU credU;
...@@ -247,7 +247,7 @@ ULONG CDECL ldap_sasl_bindW( LDAP *ld, const PWCHAR dn, const PWCHAR mechanism, ...@@ -247,7 +247,7 @@ ULONG CDECL ldap_sasl_bindW( LDAP *ld, const PWCHAR dn, const PWCHAR mechanism,
TRACE( "(%p, %s, %s, %p, %p, %p, %p)\n", ld, debugstr_w(dn), TRACE( "(%p, %s, %s, %p, %p, %p, %p)\n", ld, debugstr_w(dn),
debugstr_w(mechanism), cred, serverctrls, clientctrls, message ); debugstr_w(mechanism), cred, serverctrls, clientctrls, message );
if (!ld || !dn || !mechanism || !cred || !message) return LDAP_PARAM_ERROR; if (!ld || !dn || !mechanism || !cred || !message) return WLDAP32_LDAP_PARAM_ERROR;
if (!(dnU = strWtoU( dn ))) goto exit; if (!(dnU = strWtoU( dn ))) goto exit;
if (!(mechanismU = strWtoU( mechanism ))) goto exit; if (!(mechanismU = strWtoU( mechanism ))) goto exit;
...@@ -275,14 +275,14 @@ exit: ...@@ -275,14 +275,14 @@ exit:
ULONG CDECL ldap_sasl_bind_sA( LDAP *ld, const PCHAR dn, const PCHAR mechanism, const BERVAL *cred, ULONG CDECL ldap_sasl_bind_sA( LDAP *ld, const PCHAR dn, const PCHAR mechanism, const BERVAL *cred,
LDAPControlA **serverctrls, LDAPControlA **clientctrls, BERVAL **serverdata ) LDAPControlA **serverctrls, LDAPControlA **clientctrls, BERVAL **serverdata )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *dnW, *mechanismW = NULL; WCHAR *dnW, *mechanismW = NULL;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
TRACE( "(%p, %s, %s, %p, %p, %p, %p)\n", ld, debugstr_a(dn), TRACE( "(%p, %s, %s, %p, %p, %p, %p)\n", ld, debugstr_a(dn),
debugstr_a(mechanism), cred, serverctrls, clientctrls, serverdata ); debugstr_a(mechanism), cred, serverctrls, clientctrls, serverdata );
if (!ld || !dn || !mechanism || !cred || !serverdata) return LDAP_PARAM_ERROR; if (!ld || !dn || !mechanism || !cred || !serverdata) return WLDAP32_LDAP_PARAM_ERROR;
if (!(dnW = strAtoW( dn ))) goto exit; if (!(dnW = strAtoW( dn ))) goto exit;
if (!(mechanismW = strAtoW( mechanism ))) goto exit; if (!(mechanismW = strAtoW( mechanism ))) goto exit;
...@@ -305,7 +305,7 @@ exit: ...@@ -305,7 +305,7 @@ exit:
ULONG CDECL ldap_sasl_bind_sW( LDAP *ld, const PWCHAR dn, const PWCHAR mechanism, const BERVAL *cred, ULONG CDECL ldap_sasl_bind_sW( LDAP *ld, const PWCHAR dn, const PWCHAR mechanism, const BERVAL *cred,
LDAPControlW **serverctrls, LDAPControlW **clientctrls, BERVAL **serverdata ) LDAPControlW **serverctrls, LDAPControlW **clientctrls, BERVAL **serverdata )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU, *mechanismU = NULL; char *dnU, *mechanismU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
struct bervalU *dataU, credU; struct bervalU *dataU, credU;
...@@ -313,7 +313,7 @@ ULONG CDECL ldap_sasl_bind_sW( LDAP *ld, const PWCHAR dn, const PWCHAR mechanism ...@@ -313,7 +313,7 @@ ULONG CDECL ldap_sasl_bind_sW( LDAP *ld, const PWCHAR dn, const PWCHAR mechanism
TRACE( "(%p, %s, %s, %p, %p, %p, %p)\n", ld, debugstr_w(dn), TRACE( "(%p, %s, %s, %p, %p, %p, %p)\n", ld, debugstr_w(dn),
debugstr_w(mechanism), cred, serverctrls, clientctrls, serverdata ); debugstr_w(mechanism), cred, serverctrls, clientctrls, serverdata );
if (!ld || !dn || !mechanism || !cred || !serverdata) return LDAP_PARAM_ERROR; if (!ld || !dn || !mechanism || !cred || !serverdata) return WLDAP32_LDAP_PARAM_ERROR;
if (!(dnU = strWtoU( dn ))) goto exit; if (!(dnU = strWtoU( dn ))) goto exit;
if (!(mechanismU = strWtoU( mechanism ))) goto exit; if (!(mechanismU = strWtoU( mechanism ))) goto exit;
...@@ -327,10 +327,10 @@ ULONG CDECL ldap_sasl_bind_sW( LDAP *ld, const PWCHAR dn, const PWCHAR mechanism ...@@ -327,10 +327,10 @@ ULONG CDECL ldap_sasl_bind_sW( LDAP *ld, const PWCHAR dn, const PWCHAR mechanism
struct ldap_sasl_bind_s_params params = { CTX(ld), dnU, mechanismU, &credU, serverctrlsU, clientctrlsU, &dataU }; struct ldap_sasl_bind_s_params params = { CTX(ld), dnU, mechanismU, &credU, serverctrlsU, clientctrlsU, &dataU };
ret = map_error( LDAP_CALL( ldap_sasl_bind_s, &params )); ret = map_error( LDAP_CALL( ldap_sasl_bind_s, &params ));
} }
if (ret == LDAP_SUCCESS) if (ret == WLDAP32_LDAP_SUCCESS)
{ {
BERVAL *ptr; BERVAL *ptr;
if (!(ptr = bervalUtoW( dataU ))) ret = LDAP_NO_MEMORY; if (!(ptr = bervalUtoW( dataU ))) ret = WLDAP32_LDAP_NO_MEMORY;
else *serverdata = ptr; else *serverdata = ptr;
LDAP_CALL( ber_bvfree, dataU ); LDAP_CALL( ber_bvfree, dataU );
} }
...@@ -348,7 +348,7 @@ exit: ...@@ -348,7 +348,7 @@ exit:
*/ */
ULONG CDECL ldap_simple_bindA( LDAP *ld, char *dn, char *passwd ) ULONG CDECL ldap_simple_bindA( LDAP *ld, char *dn, char *passwd )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *dnW = NULL, *passwdW = NULL; WCHAR *dnW = NULL, *passwdW = NULL;
TRACE( "(%p, %s, %p)\n", ld, debugstr_a(dn), passwd ); TRACE( "(%p, %s, %p)\n", ld, debugstr_a(dn), passwd );
...@@ -371,7 +371,7 @@ exit: ...@@ -371,7 +371,7 @@ exit:
*/ */
ULONG CDECL ldap_simple_bindW( LDAP *ld, WCHAR *dn, WCHAR *passwd ) ULONG CDECL ldap_simple_bindW( LDAP *ld, WCHAR *dn, WCHAR *passwd )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL, *passwdU = NULL; char *dnU = NULL, *passwdU = NULL;
struct bervalU pwd = { 0, NULL }; struct bervalU pwd = { 0, NULL };
int msg; int msg;
...@@ -392,7 +392,7 @@ ULONG CDECL ldap_simple_bindW( LDAP *ld, WCHAR *dn, WCHAR *passwd ) ...@@ -392,7 +392,7 @@ ULONG CDECL ldap_simple_bindW( LDAP *ld, WCHAR *dn, WCHAR *passwd )
struct ldap_sasl_bind_params params = { CTX(ld), dnU, 0, &pwd, NULL, NULL, &msg }; struct ldap_sasl_bind_params params = { CTX(ld), dnU, 0, &pwd, NULL, NULL, &msg };
ret = map_error( LDAP_CALL( ldap_sasl_bind, &params )); ret = map_error( LDAP_CALL( ldap_sasl_bind, &params ));
} }
if (ret == LDAP_SUCCESS) if (ret == WLDAP32_LDAP_SUCCESS)
ret = msg; ret = msg;
else else
ret = ~0u; ret = ~0u;
...@@ -408,12 +408,12 @@ exit: ...@@ -408,12 +408,12 @@ exit:
*/ */
ULONG CDECL ldap_simple_bind_sA( LDAP *ld, char *dn, char *passwd ) ULONG CDECL ldap_simple_bind_sA( LDAP *ld, char *dn, char *passwd )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *dnW = NULL, *passwdW = NULL; WCHAR *dnW = NULL, *passwdW = NULL;
TRACE( "(%p, %s, %p)\n", ld, debugstr_a(dn), passwd ); TRACE( "(%p, %s, %p)\n", ld, debugstr_a(dn), passwd );
if (!ld) return LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) goto exit; if (dn && !(dnW = strAtoW( dn ))) goto exit;
if (passwd && !(passwdW = strAtoW( passwd ))) goto exit; if (passwd && !(passwdW = strAtoW( passwd ))) goto exit;
...@@ -431,13 +431,13 @@ exit: ...@@ -431,13 +431,13 @@ exit:
*/ */
ULONG CDECL ldap_simple_bind_sW( LDAP *ld, WCHAR *dn, WCHAR *passwd ) ULONG CDECL ldap_simple_bind_sW( LDAP *ld, WCHAR *dn, WCHAR *passwd )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL, *passwdU = NULL; char *dnU = NULL, *passwdU = NULL;
struct bervalU pwd = { 0, NULL }; struct bervalU pwd = { 0, NULL };
TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), passwd ); TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), passwd );
if (!ld) return LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
if (dn && !(dnU = strWtoU( dn ))) goto exit; if (dn && !(dnU = strWtoU( dn ))) goto exit;
if (passwd) if (passwd)
...@@ -472,7 +472,7 @@ ULONG CDECL WLDAP32_ldap_unbind( LDAP *ld ) ...@@ -472,7 +472,7 @@ ULONG CDECL WLDAP32_ldap_unbind( LDAP *ld )
struct ldap_unbind_ext_params params = { CTX(ld), NULL, NULL }; struct ldap_unbind_ext_params params = { CTX(ld), NULL, NULL };
ret = map_error( LDAP_CALL( ldap_unbind_ext, &params )); ret = map_error( LDAP_CALL( ldap_unbind_ext, &params ));
} }
else return LDAP_PARAM_ERROR; else return WLDAP32_LDAP_PARAM_ERROR;
if (SERVER_CTRLS(ld)) LDAP_CALL( ldap_value_free_len, SERVER_CTRLS(ld) ); if (SERVER_CTRLS(ld)) LDAP_CALL( ldap_value_free_len, SERVER_CTRLS(ld) );
...@@ -494,7 +494,7 @@ ULONG CDECL WLDAP32_ldap_unbind_s( LDAP *ld ) ...@@ -494,7 +494,7 @@ ULONG CDECL WLDAP32_ldap_unbind_s( LDAP *ld )
struct ldap_unbind_ext_s_params params = { CTX(ld), NULL, NULL }; struct ldap_unbind_ext_s_params params = { CTX(ld), NULL, NULL };
ret = map_error( LDAP_CALL( ldap_unbind_ext_s, &params )); ret = map_error( LDAP_CALL( ldap_unbind_ext_s, &params ));
} }
else return LDAP_PARAM_ERROR; else return WLDAP32_LDAP_PARAM_ERROR;
if (SERVER_CTRLS(ld)) LDAP_CALL( ldap_value_free_len, SERVER_CTRLS(ld) ); if (SERVER_CTRLS(ld)) LDAP_CALL( ldap_value_free_len, SERVER_CTRLS(ld) );
......
...@@ -64,7 +64,7 @@ ULONG CDECL ldap_compareW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value ) ...@@ -64,7 +64,7 @@ ULONG CDECL ldap_compareW( 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) );
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 == LDAP_SUCCESS) return msg; if (ret == WLDAP32_LDAP_SUCCESS) return msg;
return ~0u; return ~0u;
} }
...@@ -75,14 +75,14 @@ ULONG CDECL ldap_compare_extA( LDAP *ld, char *dn, char *attr, char *value, ...@@ -75,14 +75,14 @@ ULONG CDECL ldap_compare_extA( LDAP *ld, char *dn, char *attr, char *value,
struct berval *data, LDAPControlA **serverctrls, LDAPControlA **clientctrls, struct berval *data, LDAPControlA **serverctrls, LDAPControlA **clientctrls,
ULONG *message ) ULONG *message )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld || !message) return WLDAP32_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;
...@@ -107,7 +107,7 @@ exit: ...@@ -107,7 +107,7 @@ exit:
ULONG CDECL ldap_compare_extW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, struct berval *data, ULONG CDECL ldap_compare_extW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, struct berval *data,
LDAPControlW **serverctrls, LDAPControlW **clientctrls, ULONG *message ) LDAPControlW **serverctrls, LDAPControlW **clientctrls, ULONG *message )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL, *attrU = NULL, *valueU = NULL; char *dnU = NULL, *attrU = NULL, *valueU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
struct bervalU *dataU = NULL, val = { 0, NULL }; struct bervalU *dataU = NULL, val = { 0, NULL };
...@@ -115,8 +115,8 @@ ULONG CDECL ldap_compare_extW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, s ...@@ -115,8 +115,8 @@ ULONG CDECL ldap_compare_extW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, s
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 LDAP_PARAM_ERROR; if (!ld || !message) return WLDAP32_LDAP_PARAM_ERROR;
if (!attr) return LDAP_NO_MEMORY; if (!attr) return WLDAP32_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;
...@@ -155,14 +155,14 @@ exit: ...@@ -155,14 +155,14 @@ exit:
ULONG CDECL ldap_compare_ext_sA( LDAP *ld, char *dn, char *attr, char *value, struct berval *data, ULONG CDECL ldap_compare_ext_sA( LDAP *ld, char *dn, char *attr, char *value, struct berval *data,
LDAPControlA **serverctrls, LDAPControlA **clientctrls ) LDAPControlA **serverctrls, LDAPControlA **clientctrls )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
...@@ -187,7 +187,7 @@ exit: ...@@ -187,7 +187,7 @@ exit:
ULONG CDECL ldap_compare_ext_sW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, struct berval *data, ULONG CDECL ldap_compare_ext_sW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, struct berval *data,
LDAPControlW **serverctrls, LDAPControlW **clientctrls ) LDAPControlW **serverctrls, LDAPControlW **clientctrls )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL, *attrU = NULL, *valueU = NULL; char *dnU = NULL, *attrU = NULL, *valueU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
struct bervalU *dataU = NULL, val = { 0, NULL }; struct bervalU *dataU = NULL, val = { 0, NULL };
...@@ -195,7 +195,7 @@ ULONG CDECL ldap_compare_ext_sW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value, ...@@ -195,7 +195,7 @@ ULONG CDECL ldap_compare_ext_sW( LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *value,
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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
...@@ -232,12 +232,12 @@ exit: ...@@ -232,12 +232,12 @@ exit:
*/ */
ULONG CDECL ldap_compare_sA( LDAP *ld, PCHAR dn, PCHAR attr, PCHAR value ) ULONG CDECL ldap_compare_sA( LDAP *ld, PCHAR dn, PCHAR attr, PCHAR value )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
......
...@@ -36,7 +36,7 @@ ULONG CDECL ldap_control_freeA( LDAPControlA *control ) ...@@ -36,7 +36,7 @@ ULONG CDECL ldap_control_freeA( LDAPControlA *control )
{ {
TRACE( "(%p)\n", control ); TRACE( "(%p)\n", control );
controlfreeA( control ); controlfreeA( control );
return LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -46,7 +46,7 @@ ULONG CDECL ldap_control_freeW( LDAPControlW *control ) ...@@ -46,7 +46,7 @@ ULONG CDECL ldap_control_freeW( LDAPControlW *control )
{ {
TRACE( "(%p)\n", control ); TRACE( "(%p)\n", control );
controlfreeW( control ); controlfreeW( control );
return LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -56,7 +56,7 @@ ULONG CDECL ldap_controls_freeA( LDAPControlA **controls ) ...@@ -56,7 +56,7 @@ ULONG CDECL ldap_controls_freeA( LDAPControlA **controls )
{ {
TRACE( "(%p)\n", controls ); TRACE( "(%p)\n", controls );
controlarrayfreeA( controls ); controlarrayfreeA( controls );
return LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -66,7 +66,7 @@ ULONG CDECL ldap_controls_freeW( LDAPControlW **controls ) ...@@ -66,7 +66,7 @@ ULONG CDECL ldap_controls_freeW( LDAPControlW **controls )
{ {
TRACE( "(%p)\n", controls ); TRACE( "(%p)\n", controls );
controlarrayfreeW( controls ); controlarrayfreeW( controls );
return LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -80,16 +80,16 @@ ULONG CDECL ldap_create_sort_controlA( LDAP *ld, LDAPSortKeyA **sortkey, UCHAR c ...@@ -80,16 +80,16 @@ ULONG CDECL ldap_create_sort_controlA( LDAP *ld, LDAPSortKeyA **sortkey, UCHAR c
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 LDAP_PARAM_ERROR; if (!ld || !sortkey || !control) return WLDAP32_LDAP_PARAM_ERROR;
if (!(sortkeyW = sortkeyarrayAtoW( sortkey ))) return LDAP_NO_MEMORY; if (!(sortkeyW = sortkeyarrayAtoW( sortkey ))) return WLDAP32_LDAP_NO_MEMORY;
ret = ldap_create_sort_controlW( ld, sortkeyW, critical, &controlW ); ret = ldap_create_sort_controlW( ld, sortkeyW, critical, &controlW );
if (ret == LDAP_SUCCESS) if (ret == WLDAP32_LDAP_SUCCESS)
{ {
LDAPControlA *controlA = controlWtoA( controlW ); LDAPControlA *controlA = controlWtoA( controlW );
if (controlA) *control = controlA; if (controlA) *control = controlA;
else ret = LDAP_NO_MEMORY; else ret = WLDAP32_LDAP_NO_MEMORY;
ldap_control_freeW( controlW ); ldap_control_freeW( controlW );
} }
...@@ -108,20 +108,20 @@ ULONG CDECL ldap_create_sort_controlW( LDAP *ld, LDAPSortKeyW **sortkey, UCHAR c ...@@ -108,20 +108,20 @@ ULONG CDECL ldap_create_sort_controlW( LDAP *ld, LDAPSortKeyW **sortkey, UCHAR c
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 LDAP_PARAM_ERROR; if (!ld || !sortkey || !control) return WLDAP32_LDAP_PARAM_ERROR;
if ((sortkeyU = sortkeyarrayWtoU( sortkey ))) if ((sortkeyU = sortkeyarrayWtoU( sortkey )))
{ {
struct ldap_create_sort_control_params params = { CTX(ld), sortkeyU, critical, &controlU }; struct ldap_create_sort_control_params params = { CTX(ld), sortkeyU, critical, &controlU };
ret = map_error( LDAP_CALL( ldap_create_sort_control, &params )); ret = map_error( LDAP_CALL( ldap_create_sort_control, &params ));
} }
else return LDAP_NO_MEMORY; else return WLDAP32_LDAP_NO_MEMORY;
if (ret == LDAP_SUCCESS) if (ret == WLDAP32_LDAP_SUCCESS)
{ {
LDAPControlW *controlW = controlUtoW( controlU ); LDAPControlW *controlW = controlUtoW( controlU );
if (controlW) *control = controlW; if (controlW) *control = controlW;
else ret = LDAP_NO_MEMORY; else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ldap_control_free, controlU ); LDAP_CALL( ldap_control_free, controlU );
} }
...@@ -142,11 +142,11 @@ INT CDECL ldap_create_vlv_controlA( LDAP *ld, LDAPVLVInfo *info, UCHAR critical, ...@@ -142,11 +142,11 @@ INT CDECL ldap_create_vlv_controlA( LDAP *ld, LDAPVLVInfo *info, UCHAR critical,
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 == LDAP_SUCCESS) if (ret == WLDAP32_LDAP_SUCCESS)
{ {
LDAPControlA *controlA = controlWtoA( controlW ); LDAPControlA *controlA = controlWtoA( controlW );
if (controlA) *control = controlA; if (controlA) *control = controlA;
else ret = LDAP_NO_MEMORY; else ret = WLDAP32_LDAP_NO_MEMORY;
ldap_control_freeW( controlW ); ldap_control_freeW( controlW );
} }
...@@ -166,17 +166,17 @@ INT CDECL ldap_create_vlv_controlW( LDAP *ld, LDAPVLVInfo *info, UCHAR critical, ...@@ -166,17 +166,17 @@ INT CDECL ldap_create_vlv_controlW( LDAP *ld, LDAPVLVInfo *info, UCHAR critical,
if (!ld || !control) return ~0u; if (!ld || !control) return ~0u;
if (info && !(infoU = vlvinfoWtoU( info ))) return LDAP_NO_MEMORY; if (info && !(infoU = vlvinfoWtoU( info ))) return WLDAP32_LDAP_NO_MEMORY;
else else
{ {
struct ldap_create_vlv_control_params params = { CTX(ld), infoU, &controlU }; struct ldap_create_vlv_control_params params = { CTX(ld), infoU, &controlU };
ret = map_error( LDAP_CALL( ldap_create_vlv_control, &params )); ret = map_error( LDAP_CALL( ldap_create_vlv_control, &params ));
} }
if (ret == LDAP_SUCCESS) if (ret == WLDAP32_LDAP_SUCCESS)
{ {
LDAPControlW *controlW = controlUtoW( controlU ); LDAPControlW *controlW = controlUtoW( controlU );
if (controlW) *control = controlW; if (controlW) *control = controlW;
else ret = LDAP_NO_MEMORY; else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ldap_control_free, controlU ); LDAP_CALL( ldap_control_free, controlU );
} }
...@@ -203,7 +203,7 @@ ULONG CDECL ldap_encode_sort_controlA( LDAP *ld, LDAPSortKeyA **sortkeys, LDAPCo ...@@ -203,7 +203,7 @@ ULONG CDECL ldap_encode_sort_controlA( LDAP *ld, LDAPSortKeyA **sortkeys, LDAPCo
LDAPControlA *control; LDAPControlA *control;
ULONG result; ULONG result;
if ((result = ldap_create_sort_controlA( ld, sortkeys, critical, &control )) == LDAP_SUCCESS) if ((result = ldap_create_sort_controlA( ld, sortkeys, critical, &control )) == WLDAP32_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 );
...@@ -221,7 +221,7 @@ ULONG CDECL ldap_encode_sort_controlW( LDAP *ld, LDAPSortKeyW **sortkeys, LDAPCo ...@@ -221,7 +221,7 @@ ULONG CDECL ldap_encode_sort_controlW( LDAP *ld, LDAPSortKeyW **sortkeys, LDAPCo
LDAPControlW *control; LDAPControlW *control;
ULONG result; ULONG result;
if ((result = ldap_create_sort_controlW( ld, sortkeys, critical, &control )) == LDAP_SUCCESS) if ((result = ldap_create_sort_controlW( ld, sortkeys, critical, &control )) == WLDAP32_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 );
......
...@@ -40,7 +40,7 @@ ULONG CDECL ldap_deleteA( LDAP *ld, char *dn ) ...@@ -40,7 +40,7 @@ ULONG CDECL ldap_deleteA( 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 LDAP_NO_MEMORY; if (dn && !(dnW = strAtoW( dn ))) return WLDAP32_LDAP_NO_MEMORY;
ret = ldap_deleteW( ld, dnW ); ret = ldap_deleteW( ld, dnW );
free( dnW ); free( dnW );
...@@ -57,7 +57,7 @@ ULONG CDECL ldap_deleteW( LDAP *ld, WCHAR *dn ) ...@@ -57,7 +57,7 @@ ULONG CDECL ldap_deleteW( LDAP *ld, WCHAR *dn )
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 == LDAP_SUCCESS) return msg; if (ret == WLDAP32_LDAP_SUCCESS) return msg;
return ~0u; return ~0u;
} }
...@@ -67,13 +67,13 @@ ULONG CDECL ldap_deleteW( LDAP *ld, WCHAR *dn ) ...@@ -67,13 +67,13 @@ ULONG CDECL ldap_deleteW( LDAP *ld, WCHAR *dn )
ULONG CDECL ldap_delete_extA( LDAP *ld, char *dn, LDAPControlA **serverctrls, LDAPControlA **clientctrls, ULONG CDECL ldap_delete_extA( LDAP *ld, char *dn, LDAPControlA **serverctrls, LDAPControlA **clientctrls,
ULONG *message ) ULONG *message )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
...@@ -94,13 +94,13 @@ exit: ...@@ -94,13 +94,13 @@ exit:
ULONG CDECL ldap_delete_extW( LDAP *ld, WCHAR *dn, LDAPControlW **serverctrls, LDAPControlW **clientctrls, ULONG CDECL ldap_delete_extW( LDAP *ld, WCHAR *dn, LDAPControlW **serverctrls, LDAPControlW **clientctrls,
ULONG *message ) ULONG *message )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
...@@ -123,13 +123,13 @@ exit: ...@@ -123,13 +123,13 @@ exit:
*/ */
ULONG CDECL ldap_delete_ext_sA( LDAP *ld, char *dn, LDAPControlA **serverctrls, LDAPControlA **clientctrls ) ULONG CDECL ldap_delete_ext_sA( LDAP *ld, char *dn, LDAPControlA **serverctrls, LDAPControlA **clientctrls )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
...@@ -149,13 +149,13 @@ exit: ...@@ -149,13 +149,13 @@ exit:
*/ */
ULONG CDECL ldap_delete_ext_sW( LDAP *ld, WCHAR *dn, LDAPControlW **serverctrls, LDAPControlW **clientctrls ) ULONG CDECL ldap_delete_ext_sW( LDAP *ld, WCHAR *dn, LDAPControlW **serverctrls, LDAPControlW **clientctrls )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
...@@ -183,8 +183,8 @@ ULONG CDECL ldap_delete_sA( LDAP *ld, char *dn ) ...@@ -183,8 +183,8 @@ ULONG CDECL ldap_delete_sA( LDAP *ld, char *dn )
TRACE( "(%p, %s)\n", ld, debugstr_a(dn) ); TRACE( "(%p, %s)\n", ld, debugstr_a(dn) );
if (!ld) return LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
if (dn && !(dnW = strAtoW( dn ))) return LDAP_NO_MEMORY; if (dn && !(dnW = strAtoW( dn ))) return WLDAP32_LDAP_NO_MEMORY;
ret = ldap_delete_sW( ld, dnW ); ret = ldap_delete_sW( ld, dnW );
free( dnW ); free( dnW );
......
...@@ -164,16 +164,16 @@ ULONG CDECL ldap_ufn2dnA( char *ufn, char **dn ) ...@@ -164,16 +164,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 LDAP_PARAM_ERROR; if (!dn) return WLDAP32_LDAP_PARAM_ERROR;
*dn = NULL; *dn = NULL;
if (ufn && !(ufnW = strAtoW( ufn ))) return LDAP_NO_MEMORY; if (ufn && !(ufnW = strAtoW( ufn ))) return WLDAP32_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 = LDAP_NO_MEMORY; if (!(str = strWtoA( dnW ))) ret = WLDAP32_LDAP_NO_MEMORY;
else *dn = str; else *dn = str;
} }
...@@ -187,21 +187,21 @@ ULONG CDECL ldap_ufn2dnA( char *ufn, char **dn ) ...@@ -187,21 +187,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 = LDAP_SUCCESS; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!dn) return WLDAP32_LDAP_PARAM_ERROR;
*dn = NULL; *dn = NULL;
if (ufn) if (ufn)
{ {
WCHAR *str; WCHAR *str;
if (!(ufnU = strWtoU( ufn ))) return LDAP_NO_MEMORY; if (!(ufnU = strWtoU( ufn ))) return WLDAP32_LDAP_NO_MEMORY;
/* FIXME: do more than just a copy */ /* FIXME: do more than just a copy */
if (!(str = strUtoW( ufnU ))) ret = LDAP_NO_MEMORY; if (!(str = strUtoW( ufnU ))) ret = WLDAP32_LDAP_NO_MEMORY;
else *dn = str; else *dn = str;
} }
......
...@@ -36,24 +36,24 @@ ULONG map_error( int error ) ...@@ -36,24 +36,24 @@ ULONG map_error( int error )
{ {
switch (error) switch (error)
{ {
case 0: return LDAP_SUCCESS; case 0: return WLDAP32_LDAP_SUCCESS;
case -1: return LDAP_SERVER_DOWN; case -1: return WLDAP32_LDAP_SERVER_DOWN;
case -2: return LDAP_LOCAL_ERROR; case -2: return WLDAP32_LDAP_LOCAL_ERROR;
case -3: return LDAP_ENCODING_ERROR; case -3: return WLDAP32_LDAP_ENCODING_ERROR;
case -4: return LDAP_DECODING_ERROR; case -4: return WLDAP32_LDAP_DECODING_ERROR;
case -5: return LDAP_TIMEOUT; case -5: return WLDAP32_LDAP_TIMEOUT;
case -6: return LDAP_AUTH_UNKNOWN; case -6: return WLDAP32_LDAP_AUTH_UNKNOWN;
case -7: return LDAP_FILTER_ERROR; case -7: return WLDAP32_LDAP_FILTER_ERROR;
case -8: return LDAP_USER_CANCELLED; case -8: return WLDAP32_LDAP_USER_CANCELLED;
case -9: return LDAP_PARAM_ERROR; case -9: return WLDAP32_LDAP_PARAM_ERROR;
case -10: return LDAP_NO_MEMORY; case -10: return WLDAP32_LDAP_NO_MEMORY;
case -11: return LDAP_CONNECT_ERROR; case -11: return WLDAP32_LDAP_CONNECT_ERROR;
case -12: return LDAP_NOT_SUPPORTED; case -12: return WLDAP32_LDAP_NOT_SUPPORTED;
case -13: return LDAP_CONTROL_NOT_FOUND; case -13: return WLDAP32_LDAP_CONTROL_NOT_FOUND;
case -14: return LDAP_NO_RESULTS_RETURNED; case -14: return WLDAP32_LDAP_NO_RESULTS_RETURNED;
case -15: return LDAP_MORE_RESULTS_TO_RETURN; case -15: return WLDAP32_LDAP_MORE_RESULTS_TO_RETURN;
case -16: return LDAP_CLIENT_LOOP; case -16: return WLDAP32_LDAP_CLIENT_LOOP;
case -17: return LDAP_REFERRAL_LIMIT_EXCEEDED; case -17: return WLDAP32_LDAP_REFERRAL_LIMIT_EXCEEDED;
default: return error; default: return error;
} }
} }
...@@ -67,10 +67,10 @@ char * CDECL ldap_err2stringA( ULONG err ) ...@@ -67,10 +67,10 @@ char * CDECL ldap_err2stringA( ULONG err )
TRACE( "(%#lx)\n", err ); TRACE( "(%#lx)\n", err );
if (err <= LDAP_REFERRAL_LIMIT_EXCEEDED) if (err <= WLDAP32_LDAP_REFERRAL_LIMIT_EXCEEDED)
LoadStringA( hwldap32, err, buf, 256 ); LoadStringA( hwldap32, err, buf, 256 );
else else
LoadStringA( hwldap32, LDAP_LOCAL_ERROR, buf, 256 ); LoadStringA( hwldap32, WLDAP32_LDAP_LOCAL_ERROR, buf, 256 );
return buf; return buf;
} }
...@@ -84,10 +84,10 @@ WCHAR * CDECL ldap_err2stringW( ULONG err ) ...@@ -84,10 +84,10 @@ WCHAR * CDECL ldap_err2stringW( ULONG err )
TRACE( "(%#lx)\n", err ); TRACE( "(%#lx)\n", err );
if (err <= LDAP_REFERRAL_LIMIT_EXCEEDED) if (err <= WLDAP32_LDAP_REFERRAL_LIMIT_EXCEEDED)
LoadStringW( hwldap32, err, buf, 256 ); LoadStringW( hwldap32, err, buf, 256 );
else else
LoadStringW( hwldap32, LDAP_LOCAL_ERROR, buf, 256 ); LoadStringW( hwldap32, WLDAP32_LDAP_LOCAL_ERROR, buf, 256 );
return buf; return buf;
} }
......
...@@ -36,8 +36,8 @@ ULONG CDECL ldap_close_extended_op( LDAP *ld, ULONG msgid ) ...@@ -36,8 +36,8 @@ ULONG CDECL ldap_close_extended_op( LDAP *ld, ULONG msgid )
{ {
TRACE( "(%p, %#lx)\n", ld, msgid ); TRACE( "(%p, %#lx)\n", ld, msgid );
if (!ld) return LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
return LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -46,13 +46,13 @@ ULONG CDECL ldap_close_extended_op( LDAP *ld, ULONG msgid ) ...@@ -46,13 +46,13 @@ ULONG CDECL ldap_close_extended_op( LDAP *ld, ULONG msgid )
ULONG CDECL ldap_extended_operationA( LDAP *ld, char *oid, struct berval *data, LDAPControlA **serverctrls, ULONG CDECL ldap_extended_operationA( LDAP *ld, char *oid, struct berval *data, LDAPControlA **serverctrls,
LDAPControlA **clientctrls, ULONG *message ) LDAPControlA **clientctrls, ULONG *message )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld || !message) return WLDAP32_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;
...@@ -73,14 +73,14 @@ exit: ...@@ -73,14 +73,14 @@ exit:
ULONG CDECL ldap_extended_operationW( LDAP *ld, WCHAR *oid, struct berval *data, LDAPControlW **serverctrls, ULONG CDECL ldap_extended_operationW( LDAP *ld, WCHAR *oid, struct berval *data, LDAPControlW **serverctrls,
LDAPControlW **clientctrls, ULONG *message ) LDAPControlW **clientctrls, ULONG *message )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld || !message) return WLDAP32_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;
...@@ -106,13 +106,13 @@ exit: ...@@ -106,13 +106,13 @@ exit:
ULONG CDECL ldap_extended_operation_sA( LDAP *ld, char *oid, struct berval *data, LDAPControlA **serverctrls, ULONG CDECL ldap_extended_operation_sA( LDAP *ld, char *oid, struct berval *data, LDAPControlA **serverctrls,
LDAPControlA **clientctrls, char **retoid, struct berval **retdata ) LDAPControlA **clientctrls, char **retoid, struct berval **retdata )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
...@@ -123,7 +123,7 @@ ULONG CDECL ldap_extended_operation_sA( LDAP *ld, char *oid, struct berval *data ...@@ -123,7 +123,7 @@ ULONG CDECL ldap_extended_operation_sA( LDAP *ld, char *oid, struct berval *data
{ {
char *str = strWtoA( retoidW ); char *str = strWtoA( retoidW );
if (str) *retoid = str; if (str) *retoid = str;
else ret = LDAP_NO_MEMORY; else ret = WLDAP32_LDAP_NO_MEMORY;
ldap_memfreeW( retoidW ); ldap_memfreeW( retoidW );
} }
...@@ -140,14 +140,14 @@ exit: ...@@ -140,14 +140,14 @@ exit:
ULONG CDECL ldap_extended_operation_sW( LDAP *ld, WCHAR *oid, struct berval *data, LDAPControlW **serverctrls, ULONG CDECL ldap_extended_operation_sW( LDAP *ld, WCHAR *oid, struct berval *data, LDAPControlW **serverctrls,
LDAPControlW **clientctrls, WCHAR **retoid, struct berval **retdata ) LDAPControlW **clientctrls, WCHAR **retoid, struct berval **retdata )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
...@@ -163,14 +163,14 @@ ULONG CDECL ldap_extended_operation_sW( LDAP *ld, WCHAR *oid, struct berval *dat ...@@ -163,14 +163,14 @@ ULONG CDECL ldap_extended_operation_sW( LDAP *ld, WCHAR *oid, struct berval *dat
{ {
WCHAR *str = strUtoW( retoidU ); WCHAR *str = strUtoW( retoidU );
if (str) *retoid = str; if (str) *retoid = str;
else ret = LDAP_NO_MEMORY; else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ldap_memfree, retoidU ); LDAP_CALL( ldap_memfree, retoidU );
} }
if (retdata && retdataU) if (retdata && retdataU)
{ {
struct berval *bv = bervalUtoW( retdataU ); struct berval *bv = bervalUtoW( retdataU );
if (bv) *retdata = bv; if (bv) *retdata = bv;
else ret = LDAP_NO_MEMORY; else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ber_bvfree, retdataU ); LDAP_CALL( ber_bvfree, retdataU );
} }
......
...@@ -190,19 +190,18 @@ static char *urlify_hostnames( const char *scheme, char *hostnames, ULONG port ) ...@@ -190,19 +190,18 @@ static char *urlify_hostnames( const char *scheme, char *hostnames, ULONG port )
return url; return url;
} }
static LDAP *create_context( const char *url ) static LDAP *create_context( const char *url )
{ {
LDAP *ld; LDAP *ld;
int version = LDAP_VERSION3; int version = WLDAP32_LDAP_VERSION3;
struct ldap_initialize_params params; struct ldap_initialize_params params;
if (!(ld = calloc( 1, sizeof( *ld )))) return NULL; if (!(ld = calloc( 1, sizeof( *ld )))) return NULL;
params.ld = &CTX(ld); params.ld = &CTX(ld);
params.url = url; params.url = url;
if (map_error( LDAP_CALL( ldap_initialize, &params )) == LDAP_SUCCESS) if (map_error( LDAP_CALL( ldap_initialize, &params )) == WLDAP32_LDAP_SUCCESS)
{ {
struct ldap_set_option_params opt_params = { CTX(ld), LDAP_OPT_PROTOCOL_VERSION, &version }; struct ldap_set_option_params opt_params = { CTX(ld), WLDAP32_LDAP_OPT_PROTOCOL_VERSION, &version };
LDAP_CALL( ldap_set_option, &opt_params ); LDAP_CALL( ldap_set_option, &opt_params );
return ld; return ld;
} }
...@@ -256,8 +255,8 @@ ULONG CDECL WLDAP32_ldap_connect( LDAP *ld, struct l_timeval *timeout ) ...@@ -256,8 +255,8 @@ ULONG CDECL WLDAP32_ldap_connect( LDAP *ld, struct l_timeval *timeout )
{ {
TRACE( "(%p, %p)\n", ld, timeout ); TRACE( "(%p, %p)\n", ld, timeout );
if (!ld) return LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
return LDAP_SUCCESS; /* FIXME: do something, e.g. ping the host */ return WLDAP32_LDAP_SUCCESS; /* FIXME: do something, e.g. ping the host */
} }
/*********************************************************************** /***********************************************************************
...@@ -388,7 +387,7 @@ exit: ...@@ -388,7 +387,7 @@ exit:
ULONG CDECL ldap_start_tls_sA( LDAP *ld, ULONG *retval, LDAPMessage **result, LDAPControlA **serverctrls, ULONG CDECL ldap_start_tls_sA( LDAP *ld, ULONG *retval, LDAPMessage **result, LDAPControlA **serverctrls,
LDAPControlA **clientctrls ) LDAPControlA **clientctrls )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 );
...@@ -412,7 +411,7 @@ exit: ...@@ -412,7 +411,7 @@ exit:
ULONG CDECL ldap_start_tls_sW( LDAP *ld, ULONG *retval, LDAPMessage **result, LDAPControlW **serverctrls, ULONG CDECL ldap_start_tls_sW( LDAP *ld, ULONG *retval, LDAPMessage **result, LDAPControlW **serverctrls,
LDAPControlW **clientctrls ) LDAPControlW **clientctrls )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 );
...@@ -444,7 +443,7 @@ exit: ...@@ -444,7 +443,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 LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
......
...@@ -55,8 +55,8 @@ ULONG CDECL ldap_check_filterA( LDAP *ld, char *filter ) ...@@ -55,8 +55,8 @@ ULONG CDECL ldap_check_filterA( LDAP *ld, char *filter )
TRACE( "(%p, %s)\n", ld, debugstr_a(filter) ); TRACE( "(%p, %s)\n", ld, debugstr_a(filter) );
if (!ld) return LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
if (filter && !(filterW = strAtoW( filter ))) return LDAP_NO_MEMORY; if (filter && !(filterW = strAtoW( filter ))) return WLDAP32_LDAP_NO_MEMORY;
ret = ldap_check_filterW( ld, filterW ); ret = ldap_check_filterW( ld, filterW );
...@@ -71,8 +71,8 @@ ULONG CDECL ldap_check_filterW( LDAP *ld, WCHAR *filter ) ...@@ -71,8 +71,8 @@ ULONG CDECL ldap_check_filterW( LDAP *ld, WCHAR *filter )
{ {
TRACE( "(%p, %s)\n", ld, debugstr_w(filter) ); TRACE( "(%p, %s)\n", ld, debugstr_w(filter) );
if (!ld) return LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
return LDAP_SUCCESS; /* FIXME: do some checks */ return WLDAP32_LDAP_SUCCESS; /* FIXME: do some checks */
} }
/*********************************************************************** /***********************************************************************
...@@ -81,7 +81,7 @@ ULONG CDECL ldap_check_filterW( LDAP *ld, WCHAR *filter ) ...@@ -81,7 +81,7 @@ ULONG CDECL ldap_check_filterW( LDAP *ld, WCHAR *filter )
ULONG CDECL ldap_cleanup( HANDLE instance ) ULONG CDECL ldap_cleanup( HANDLE instance )
{ {
TRACE( "(%p)\n", instance ); TRACE( "(%p)\n", instance );
return LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -172,10 +172,10 @@ ULONG CDECL ldap_escape_filter_elementA( char *src, ULONG srclen, char *dst, ULO ...@@ -172,10 +172,10 @@ ULONG CDECL ldap_escape_filter_elementA( char *src, ULONG srclen, char *dst, ULO
TRACE( "(%p, %#lx, %p, %#lx)\n", src, srclen, dst, dstlen ); TRACE( "(%p, %#lx, %p, %#lx)\n", src, srclen, dst, dstlen );
if (!dst) return len; if (!dst) return len;
if (!src || dstlen < len) return LDAP_PARAM_ERROR; if (!src || dstlen < len) return WLDAP32_LDAP_PARAM_ERROR;
escape_filter_element( src, srclen, dst ); escape_filter_element( src, srclen, dst );
return LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -190,7 +190,7 @@ ULONG CDECL ldap_escape_filter_elementW( char *src, ULONG srclen, WCHAR *dst, UL ...@@ -190,7 +190,7 @@ ULONG CDECL ldap_escape_filter_elementW( char *src, ULONG srclen, WCHAR *dst, UL
if (!dst) return len; if (!dst) return len;
/* no matter what you throw at it, this is what native returns */ /* no matter what you throw at it, this is what native returns */
return LDAP_PARAM_ERROR; return WLDAP32_LDAP_PARAM_ERROR;
} }
/*********************************************************************** /***********************************************************************
...@@ -314,7 +314,7 @@ ULONG CDECL WLDAP32_ldap_msgfree( LDAPMessage *res ) ...@@ -314,7 +314,7 @@ ULONG CDECL WLDAP32_ldap_msgfree( LDAPMessage *res )
TRACE( "(%p)\n", res ); TRACE( "(%p)\n", res );
if (!res) return LDAP_SUCCESS; if (!res) return WLDAP32_LDAP_SUCCESS;
LDAP_CALL( ldap_msgfree, MSG(res) ); LDAP_CALL( ldap_msgfree, MSG(res) );
while (list) while (list)
...@@ -324,7 +324,7 @@ ULONG CDECL WLDAP32_ldap_msgfree( LDAPMessage *res ) ...@@ -324,7 +324,7 @@ ULONG CDECL WLDAP32_ldap_msgfree( LDAPMessage *res )
free( entry ); free( entry );
} }
return LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
......
...@@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32); ...@@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
*/ */
ULONG CDECL ldap_modifyA( LDAP *ld, char *dn, LDAPModA **mods ) ULONG CDECL ldap_modifyA( LDAP *ld, char *dn, LDAPModA **mods )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *dnW = NULL; WCHAR *dnW = NULL;
LDAPModW **modsW = NULL; LDAPModW **modsW = NULL;
...@@ -63,7 +63,7 @@ ULONG CDECL ldap_modifyW( LDAP *ld, WCHAR *dn, LDAPModW **mods ) ...@@ -63,7 +63,7 @@ ULONG CDECL ldap_modifyW( 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 );
ret = ldap_modify_extW( ld, dn, mods, NULL, NULL, &msg ); ret = ldap_modify_extW( ld, dn, mods, NULL, NULL, &msg );
if (ret == LDAP_SUCCESS) return msg; if (ret == WLDAP32_LDAP_SUCCESS) return msg;
return ~0u; return ~0u;
} }
...@@ -73,7 +73,7 @@ ULONG CDECL ldap_modifyW( LDAP *ld, WCHAR *dn, LDAPModW **mods ) ...@@ -73,7 +73,7 @@ ULONG CDECL ldap_modifyW( LDAP *ld, WCHAR *dn, LDAPModW **mods )
ULONG CDECL ldap_modify_extA( LDAP *ld, char *dn, LDAPModA **mods, LDAPControlA **serverctrls, ULONG CDECL ldap_modify_extA( LDAP *ld, char *dn, LDAPModA **mods, LDAPControlA **serverctrls,
LDAPControlA **clientctrls, ULONG *message ) LDAPControlA **clientctrls, ULONG *message )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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;
...@@ -103,7 +103,7 @@ exit: ...@@ -103,7 +103,7 @@ exit:
ULONG CDECL ldap_modify_extW( LDAP *ld, WCHAR *dn, LDAPModW **mods, LDAPControlW **serverctrls, ULONG CDECL ldap_modify_extW( LDAP *ld, WCHAR *dn, LDAPModW **mods, LDAPControlW **serverctrls,
LDAPControlW **clientctrls, ULONG *message ) LDAPControlW **clientctrls, ULONG *message )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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;
...@@ -136,14 +136,14 @@ exit: ...@@ -136,14 +136,14 @@ exit:
ULONG CDECL ldap_modify_ext_sA( LDAP *ld, char *dn, LDAPModA **mods, LDAPControlA **serverctrls, ULONG CDECL ldap_modify_ext_sA( LDAP *ld, char *dn, LDAPModA **mods, LDAPControlA **serverctrls,
LDAPControlA **clientctrls ) LDAPControlA **clientctrls )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
...@@ -166,14 +166,14 @@ exit: ...@@ -166,14 +166,14 @@ exit:
ULONG CDECL ldap_modify_ext_sW( LDAP *ld, WCHAR *dn, LDAPModW **mods, LDAPControlW **serverctrls, ULONG CDECL ldap_modify_ext_sW( LDAP *ld, WCHAR *dn, LDAPModW **mods, LDAPControlW **serverctrls,
LDAPControlW **clientctrls ) LDAPControlW **clientctrls )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
...@@ -198,13 +198,13 @@ exit: ...@@ -198,13 +198,13 @@ exit:
*/ */
ULONG CDECL ldap_modify_sA( LDAP *ld, char *dn, LDAPModA **mods ) ULONG CDECL ldap_modify_sA( LDAP *ld, char *dn, LDAPModA **mods )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
......
...@@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32); ...@@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
*/ */
ULONG CDECL ldap_modrdnA( LDAP *ld, char *dn, char *newdn ) ULONG CDECL ldap_modrdnA( LDAP *ld, char *dn, char *newdn )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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) );
...@@ -66,7 +66,7 @@ ULONG CDECL ldap_modrdnW( LDAP *ld, WCHAR *dn, WCHAR *newdn ) ...@@ -66,7 +66,7 @@ ULONG CDECL ldap_modrdnW( LDAP *ld, WCHAR *dn, WCHAR *newdn )
*/ */
ULONG CDECL ldap_modrdn2A( LDAP *ld, char *dn, char *newdn, int delete ) ULONG CDECL ldap_modrdn2A( LDAP *ld, char *dn, char *newdn, int delete )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 );
...@@ -89,7 +89,7 @@ exit: ...@@ -89,7 +89,7 @@ exit:
*/ */
ULONG CDECL ldap_modrdn2W( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete ) ULONG CDECL ldap_modrdn2W( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL, *newdnU = NULL; char *dnU = NULL, *newdnU = NULL;
ULONG msg; ULONG msg;
...@@ -97,13 +97,13 @@ ULONG CDECL ldap_modrdn2W( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete ) ...@@ -97,13 +97,13 @@ ULONG CDECL ldap_modrdn2W( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete )
if (!ld || !newdn) return ~0u; if (!ld || !newdn) return ~0u;
if (dn && !(dnU = strWtoU( dn ))) return LDAP_NO_MEMORY; if (dn && !(dnU = strWtoU( dn ))) return WLDAP32_LDAP_NO_MEMORY;
if ((newdnU = strWtoU( newdn ))) if ((newdnU = strWtoU( newdn )))
{ {
struct ldap_rename_params params = { CTX(ld), dnU, newdnU, NULL, delete, NULL, NULL, &msg }; struct ldap_rename_params params = { CTX(ld), dnU, newdnU, NULL, delete, NULL, NULL, &msg };
ret = LDAP_CALL( ldap_rename, &params ); ret = LDAP_CALL( ldap_rename, &params );
if (ret == LDAP_SUCCESS) if (ret == WLDAP32_LDAP_SUCCESS)
ret = msg; ret = msg;
else else
ret = ~0u; ret = ~0u;
...@@ -118,12 +118,12 @@ ULONG CDECL ldap_modrdn2W( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete ) ...@@ -118,12 +118,12 @@ ULONG CDECL ldap_modrdn2W( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete )
*/ */
ULONG CDECL ldap_modrdn2_sA( LDAP *ld, char *dn, char *newdn, int delete ) ULONG CDECL ldap_modrdn2_sA( LDAP *ld, char *dn, char *newdn, int delete )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld || !newdn) return WLDAP32_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;
...@@ -141,14 +141,14 @@ exit: ...@@ -141,14 +141,14 @@ exit:
*/ */
ULONG CDECL ldap_modrdn2_sW( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete ) ULONG CDECL ldap_modrdn2_sW( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld || !newdn) return WLDAP32_LDAP_PARAM_ERROR;
if (dn && !(dnU = strWtoU( dn ))) return LDAP_NO_MEMORY; if (dn && !(dnU = strWtoU( dn ))) return WLDAP32_LDAP_NO_MEMORY;
if ((newdnU = strWtoU( newdn ))) if ((newdnU = strWtoU( newdn )))
{ {
...@@ -165,12 +165,12 @@ ULONG CDECL ldap_modrdn2_sW( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete ) ...@@ -165,12 +165,12 @@ ULONG CDECL ldap_modrdn2_sW( LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete )
*/ */
ULONG CDECL ldap_modrdn_sA( LDAP *ld, char *dn, char *newdn ) ULONG CDECL ldap_modrdn_sA( LDAP *ld, char *dn, char *newdn )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld || !newdn) return WLDAP32_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;
......
...@@ -45,10 +45,10 @@ ULONG CDECL ldap_create_page_controlA( LDAP *ld, ULONG pagesize, struct berval * ...@@ -45,10 +45,10 @@ ULONG CDECL ldap_create_page_controlA( LDAP *ld, ULONG pagesize, struct berval *
TRACE( "(%p, %#lx, %p, 0x%02x, %p)\n", ld, pagesize, cookie, critical, control ); TRACE( "(%p, %#lx, %p, 0x%02x, %p)\n", ld, pagesize, cookie, critical, control );
if (!ld || !control || pagesize > INT_MAX) return LDAP_PARAM_ERROR; if (!ld || !control || pagesize > INT_MAX) return WLDAP32_LDAP_PARAM_ERROR;
ret = ldap_create_page_controlW( ld, pagesize, cookie, critical, &controlW ); ret = ldap_create_page_controlW( ld, pagesize, cookie, critical, &controlW );
if (ret == LDAP_SUCCESS) if (ret == WLDAP32_LDAP_SUCCESS)
{ {
*control = controlWtoA( controlW ); *control = controlWtoA( controlW );
ldap_control_freeW( controlW ); ldap_control_freeW( controlW );
...@@ -65,7 +65,7 @@ static ULONG create_page_control( ULONG pagesize, struct berval *cookie, UCHAR c ...@@ -65,7 +65,7 @@ static ULONG create_page_control( ULONG pagesize, struct berval *cookie, UCHAR c
int ret, len; int ret, len;
char *val; char *val;
if (!(ber = WLDAP32_ber_alloc_t( LBER_USE_DER ))) return LDAP_NO_MEMORY; if (!(ber = WLDAP32_ber_alloc_t( LBER_USE_DER ))) return WLDAP32_LDAP_NO_MEMORY;
vec[1] = NULL; vec[1] = NULL;
if (cookie) if (cookie)
...@@ -77,11 +77,11 @@ static ULONG create_page_control( ULONG pagesize, struct berval *cookie, UCHAR c ...@@ -77,11 +77,11 @@ static ULONG create_page_control( ULONG pagesize, struct berval *cookie, UCHAR c
ret = WLDAP32_ber_flatten( ber, &berval ); ret = WLDAP32_ber_flatten( ber, &berval );
WLDAP32_ber_free( ber, 1 ); WLDAP32_ber_free( ber, 1 );
if (len == LBER_ERROR) return LDAP_ENCODING_ERROR; if (len == WLDAP32_LBER_ERROR) return WLDAP32_LDAP_ENCODING_ERROR;
if (ret == -1) return LDAP_NO_MEMORY; if (ret == -1) return WLDAP32_LDAP_NO_MEMORY;
/* copy the berval so it can be properly freed by the caller */ /* copy the berval so it can be properly freed by the caller */
if (!(val = malloc( berval->bv_len ))) return LDAP_NO_MEMORY; if (!(val = malloc( berval->bv_len ))) return WLDAP32_LDAP_NO_MEMORY;
len = berval->bv_len; len = berval->bv_len;
memcpy( val, berval->bv_val, len ); memcpy( val, berval->bv_val, len );
...@@ -90,20 +90,20 @@ static ULONG create_page_control( ULONG pagesize, struct berval *cookie, UCHAR c ...@@ -90,20 +90,20 @@ static ULONG create_page_control( ULONG pagesize, struct berval *cookie, UCHAR c
if (!(ctrl = malloc( sizeof(*ctrl) ))) if (!(ctrl = malloc( sizeof(*ctrl) )))
{ {
free( val ); free( val );
return LDAP_NO_MEMORY; return WLDAP32_LDAP_NO_MEMORY;
} }
if (!(ctrl->ldctl_oid = strAtoW( LDAP_PAGED_RESULT_OID_STRING ))) if (!(ctrl->ldctl_oid = strAtoW( LDAP_PAGED_RESULT_OID_STRING )))
{ {
free( val ); free( val );
free( ctrl ); free( ctrl );
return LDAP_NO_MEMORY; return WLDAP32_LDAP_NO_MEMORY;
} }
ctrl->ldctl_value.bv_len = len; ctrl->ldctl_value.bv_len = len;
ctrl->ldctl_value.bv_val = val; ctrl->ldctl_value.bv_val = val;
ctrl->ldctl_iscritical = critical; ctrl->ldctl_iscritical = critical;
*control = ctrl; *control = ctrl;
return LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -114,7 +114,7 @@ ULONG CDECL ldap_create_page_controlW( LDAP *ld, ULONG pagesize, struct berval * ...@@ -114,7 +114,7 @@ ULONG CDECL ldap_create_page_controlW( LDAP *ld, ULONG pagesize, struct berval *
{ {
TRACE( "(%p, %#lx, %p, 0x%02x, %p)\n", ld, pagesize, cookie, critical, control ); TRACE( "(%p, %#lx, %p, 0x%02x, %p)\n", ld, pagesize, cookie, critical, control );
if (!ld || !control || pagesize > INT_MAX) return LDAP_PARAM_ERROR; if (!ld || !control || pagesize > INT_MAX) return WLDAP32_LDAP_PARAM_ERROR;
return create_page_control( pagesize, cookie, critical, control ); return create_page_control( pagesize, cookie, critical, control );
} }
...@@ -123,7 +123,7 @@ ULONG CDECL ldap_get_next_page( LDAP *ld, LDAPSearch *search, ULONG pagesize, UL ...@@ -123,7 +123,7 @@ ULONG CDECL ldap_get_next_page( LDAP *ld, LDAPSearch *search, ULONG pagesize, UL
FIXME( "(%p, %p, %#lx, %p)\n", ld, search, pagesize, message ); FIXME( "(%p, %p, %#lx, %p)\n", ld, search, pagesize, message );
if (!ld) return ~0u; if (!ld) return ~0u;
return LDAP_NOT_SUPPORTED; return WLDAP32_LDAP_NOT_SUPPORTED;
} }
ULONG CDECL ldap_get_next_page_s( LDAP *ld, LDAPSearch *search, struct l_timeval *timeout, ULONG pagesize, ULONG CDECL ldap_get_next_page_s( LDAP *ld, LDAPSearch *search, struct l_timeval *timeout, ULONG pagesize,
...@@ -140,7 +140,7 @@ ULONG CDECL ldap_get_next_page_s( LDAP *ld, LDAPSearch *search, struct l_timeval ...@@ -140,7 +140,7 @@ ULONG CDECL ldap_get_next_page_s( LDAP *ld, LDAPSearch *search, struct l_timeval
/* end of paged results */ /* end of paged results */
*count = 0; *count = 0;
*results = NULL; *results = NULL;
return LDAP_NO_RESULTS_RETURNED; return WLDAP32_LDAP_NO_RESULTS_RETURNED;
} }
if (search->serverctrls[0]) if (search->serverctrls[0])
...@@ -151,12 +151,12 @@ ULONG CDECL ldap_get_next_page_s( LDAP *ld, LDAPSearch *search, struct l_timeval ...@@ -151,12 +151,12 @@ ULONG CDECL ldap_get_next_page_s( LDAP *ld, LDAPSearch *search, struct l_timeval
TRACE("search->cookie: %s\n", search->cookie ? debugstr_an(search->cookie->bv_val, search->cookie->bv_len) : "NULL"); TRACE("search->cookie: %s\n", search->cookie ? debugstr_an(search->cookie->bv_val, search->cookie->bv_len) : "NULL");
ret = ldap_create_page_controlW( ld, pagesize, search->cookie, 1, &search->serverctrls[0] ); ret = ldap_create_page_controlW( ld, pagesize, search->cookie, 1, &search->serverctrls[0] );
if (ret != LDAP_SUCCESS) return ret; if (ret != WLDAP32_LDAP_SUCCESS) return ret;
ret = ldap_search_ext_sW( ld, search->dn, search->scope, search->filter, search->attrs, search->attrsonly, ret = ldap_search_ext_sW( ld, search->dn, search->scope, search->filter, search->attrs, search->attrsonly,
search->serverctrls, search->clientctrls, search->serverctrls, search->clientctrls,
search->timeout.tv_sec ? &search->timeout : NULL, search->sizelimit, results ); search->timeout.tv_sec ? &search->timeout : NULL, search->sizelimit, results );
if (ret != LDAP_SUCCESS) return ret; if (ret != WLDAP32_LDAP_SUCCESS) return ret;
return ldap_get_paged_count( ld, search, count, *results ); return ldap_get_paged_count( ld, search, count, *results );
} }
...@@ -168,24 +168,24 @@ ULONG CDECL ldap_get_paged_count( LDAP *ld, LDAPSearch *search, ULONG *count, LD ...@@ -168,24 +168,24 @@ ULONG CDECL ldap_get_paged_count( LDAP *ld, LDAPSearch *search, ULONG *count, LD
TRACE( "(%p, %p, %p, %p)\n", ld, search, count, results ); TRACE( "(%p, %p, %p, %p)\n", ld, search, count, results );
if (!ld || !count || !results) return LDAP_PARAM_ERROR; if (!ld || !count || !results) return WLDAP32_LDAP_PARAM_ERROR;
*count = 0; *count = 0;
ret = ldap_parse_resultW( ld, results, NULL, NULL, NULL, NULL, &server_ctrls, 0 ); ret = ldap_parse_resultW( ld, results, NULL, NULL, NULL, NULL, &server_ctrls, 0 );
if (ret != LDAP_SUCCESS) return ret; if (ret != WLDAP32_LDAP_SUCCESS) return ret;
if (!server_ctrls) /* assume end of paged results */ if (!server_ctrls) /* assume end of paged results */
{ {
search->cookie = &null_cookieW; search->cookie = &null_cookieW;
return LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
free( search->cookie ); free( search->cookie );
search->cookie = NULL; search->cookie = NULL;
ret = ldap_parse_page_controlW( ld, server_ctrls, count, &search->cookie ); ret = ldap_parse_page_controlW( ld, server_ctrls, count, &search->cookie );
if (ret == LDAP_SUCCESS) if (ret == WLDAP32_LDAP_SUCCESS)
TRACE( "new search->cookie: %s, count %lu\n", TRACE( "new search->cookie: %s, count %lu\n",
debugstr_an(search->cookie->bv_val, search->cookie->bv_len), *count ); debugstr_an(search->cookie->bv_val, search->cookie->bv_len), *count );
...@@ -203,9 +203,9 @@ ULONG CDECL ldap_parse_page_controlA( LDAP *ld, LDAPControlA **ctrls, ULONG *cou ...@@ -203,9 +203,9 @@ ULONG CDECL ldap_parse_page_controlA( LDAP *ld, LDAPControlA **ctrls, ULONG *cou
TRACE( "(%p, %p, %p, %p)\n", ld, ctrls, count, cookie ); TRACE( "(%p, %p, %p, %p)\n", ld, ctrls, count, cookie );
if (!ld || !ctrls || !count || !cookie) return LDAP_PARAM_ERROR; if (!ld || !ctrls || !count || !cookie) return WLDAP32_LDAP_PARAM_ERROR;
if (!(ctrlsW = controlarrayAtoW( ctrls ))) return LDAP_NO_MEMORY; if (!(ctrlsW = controlarrayAtoW( ctrls ))) return WLDAP32_LDAP_NO_MEMORY;
ret = ldap_parse_page_controlW( ld, ctrlsW, count, cookie ); ret = ldap_parse_page_controlW( ld, ctrlsW, count, cookie );
controlarrayfreeW( ctrlsW ); controlarrayfreeW( ctrlsW );
return ret; return ret;
...@@ -225,24 +225,24 @@ ULONG CDECL ldap_parse_page_controlW( LDAP *ld, LDAPControlW **ctrls, ULONG *ret ...@@ -225,24 +225,24 @@ ULONG CDECL ldap_parse_page_controlW( LDAP *ld, LDAPControlW **ctrls, ULONG *ret
TRACE( "(%p, %p, %p, %p)\n", ld, ctrls, ret_count, ret_cookie ); TRACE( "(%p, %p, %p, %p)\n", ld, ctrls, ret_count, ret_cookie );
if (!ld || !ctrls || !ret_count || !ret_cookie) return LDAP_PARAM_ERROR; if (!ld || !ctrls || !ret_count || !ret_cookie) return WLDAP32_LDAP_PARAM_ERROR;
for (i = 0; ctrls[i]; i++) for (i = 0; ctrls[i]; i++)
{ {
if (!wcscmp( LDAP_PAGED_RESULT_OID_STRING_W, ctrls[i]->ldctl_oid )) if (!wcscmp( LDAP_PAGED_RESULT_OID_STRING_W, ctrls[i]->ldctl_oid ))
control = ctrls[i]; control = ctrls[i];
} }
if (!control) return LDAP_CONTROL_NOT_FOUND; if (!control) return WLDAP32_LDAP_CONTROL_NOT_FOUND;
if (!(ber = WLDAP32_ber_init( &control->ldctl_value ))) return LDAP_NO_MEMORY; if (!(ber = WLDAP32_ber_init( &control->ldctl_value ))) return WLDAP32_LDAP_NO_MEMORY;
tag = WLDAP32_ber_scanf( ber, (char *)"{iO}", &count, &cookie ); tag = WLDAP32_ber_scanf( ber, (char *)"{iO}", &count, &cookie );
if (tag == LBER_ERROR) ret = LDAP_DECODING_ERROR; if (tag == WLDAP32_LBER_ERROR) ret = WLDAP32_LDAP_DECODING_ERROR;
else else
{ {
*ret_count = count; *ret_count = count;
*ret_cookie = cookie; *ret_cookie = cookie;
ret = LDAP_SUCCESS; ret = WLDAP32_LDAP_SUCCESS;
} }
WLDAP32_ber_free( ber, 1 ); WLDAP32_ber_free( ber, 1 );
...@@ -269,7 +269,7 @@ ULONG CDECL ldap_search_abandon_page( LDAP *ld, LDAPSearch *search ) ...@@ -269,7 +269,7 @@ ULONG CDECL ldap_search_abandon_page( LDAP *ld, LDAPSearch *search )
if (search->cookie && search->cookie != &null_cookieW) free( search->cookie ); if (search->cookie && search->cookie != &null_cookieW) free( search->cookie );
free( search ); free( search );
return LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
LDAPSearch * CDECL ldap_search_init_pageA( LDAP *ld, char *dn, ULONG scope, char *filter, char **attrs, LDAPSearch * CDECL ldap_search_init_pageA( LDAP *ld, char *dn, ULONG scope, char *filter, char **attrs,
...@@ -293,7 +293,7 @@ LDAPSearch * CDECL ldap_search_init_pageW( LDAP *ld, WCHAR *dn, ULONG scope, WCH ...@@ -293,7 +293,7 @@ LDAPSearch * CDECL ldap_search_init_pageW( LDAP *ld, WCHAR *dn, ULONG scope, WCH
if (!(search = calloc( 1, sizeof(*search) ))) if (!(search = calloc( 1, sizeof(*search) )))
{ {
ld->ld_errno = LDAP_NO_MEMORY; ld->ld_errno = WLDAP32_LDAP_NO_MEMORY;
return NULL; return NULL;
} }
...@@ -330,6 +330,6 @@ LDAPSearch * CDECL ldap_search_init_pageW( LDAP *ld, WCHAR *dn, ULONG scope, WCH ...@@ -330,6 +330,6 @@ LDAPSearch * CDECL ldap_search_init_pageW( LDAP *ld, WCHAR *dn, ULONG scope, WCH
fail: fail:
ldap_search_abandon_page( ld, search ); ldap_search_abandon_page( ld, search );
ld->ld_errno = LDAP_NO_MEMORY; ld->ld_errno = WLDAP32_LDAP_NO_MEMORY;
return NULL; return NULL;
} }
...@@ -40,15 +40,15 @@ ULONG CDECL ldap_parse_extended_resultA( LDAP *ld, LDAPMessage *result, char **o ...@@ -40,15 +40,15 @@ ULONG CDECL ldap_parse_extended_resultA( LDAP *ld, LDAPMessage *result, char **o
TRACE( "(%p, %p, %p, %p, 0x%02x)\n", ld, result, oid, data, free ); TRACE( "(%p, %p, %p, %p, 0x%02x)\n", ld, result, oid, data, free );
if (!ld) return LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
if (!result) return LDAP_NO_RESULTS_RETURNED; if (!result) return WLDAP32_LDAP_NO_RESULTS_RETURNED;
ret = ldap_parse_extended_resultW( ld, result, &oidW, data, free ); ret = ldap_parse_extended_resultW( ld, result, &oidW, data, free );
if (oid && oidW) if (oid && oidW)
{ {
char *str; char *str;
if ((str = strWtoA( oidW ))) *oid = str; if ((str = strWtoA( oidW ))) *oid = str;
else ret = LDAP_NO_MEMORY; else ret = WLDAP32_LDAP_NO_MEMORY;
ldap_memfreeW( oidW ); ldap_memfreeW( oidW );
} }
return ret; return ret;
...@@ -66,8 +66,8 @@ ULONG CDECL ldap_parse_extended_resultW( LDAP *ld, LDAPMessage *result, WCHAR ** ...@@ -66,8 +66,8 @@ ULONG CDECL ldap_parse_extended_resultW( LDAP *ld, LDAPMessage *result, WCHAR **
TRACE( "(%p, %p, %p, %p, 0x%02x)\n", ld, result, oid, data, free ); TRACE( "(%p, %p, %p, %p, 0x%02x)\n", ld, result, oid, data, free );
if (!ld) return LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
if (!result) return LDAP_NO_RESULTS_RETURNED; if (!result) return WLDAP32_LDAP_NO_RESULTS_RETURNED;
else else
{ {
struct ldap_parse_extended_result_params params = { CTX(ld), result, &oidU, &dataU, free }; struct ldap_parse_extended_result_params params = { CTX(ld), result, &oidU, &dataU, free };
...@@ -77,14 +77,14 @@ ULONG CDECL ldap_parse_extended_resultW( LDAP *ld, LDAPMessage *result, WCHAR ** ...@@ -77,14 +77,14 @@ ULONG CDECL ldap_parse_extended_resultW( LDAP *ld, LDAPMessage *result, WCHAR **
{ {
WCHAR *str; WCHAR *str;
if ((str = strUtoW( oidU ))) *oid = str; if ((str = strUtoW( oidU ))) *oid = str;
else ret = LDAP_NO_MEMORY; else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ldap_memfree, oidU ); LDAP_CALL( ldap_memfree, oidU );
} }
if (data && dataU) if (data && dataU)
{ {
struct berval *bv; struct berval *bv;
if ((bv = bervalUtoW( dataU ))) *data = bv; if ((bv = bervalUtoW( dataU ))) *data = bv;
else ret = LDAP_NO_MEMORY; else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ber_bvfree, dataU ); LDAP_CALL( ber_bvfree, dataU );
} }
...@@ -108,7 +108,7 @@ ULONG CDECL ldap_parse_referenceA( LDAP *ld, LDAPMessage *message, char ***refer ...@@ -108,7 +108,7 @@ ULONG CDECL ldap_parse_referenceA( LDAP *ld, LDAPMessage *message, char ***refer
{ {
char **ref; char **ref;
if ((ref = strarrayWtoA( referralsW ))) *referrals = ref; if ((ref = strarrayWtoA( referralsW ))) *referrals = ref;
else ret = LDAP_NO_MEMORY; else ret = WLDAP32_LDAP_NO_MEMORY;
ldap_value_freeW( referralsW ); ldap_value_freeW( referralsW );
} }
return ret; return ret;
...@@ -133,7 +133,7 @@ ULONG CDECL ldap_parse_referenceW( LDAP *ld, LDAPMessage *message, WCHAR ***refe ...@@ -133,7 +133,7 @@ ULONG CDECL ldap_parse_referenceW( LDAP *ld, LDAPMessage *message, WCHAR ***refe
{ {
WCHAR **ref; WCHAR **ref;
if ((ref = strarrayUtoW( referralsU ))) *referrals = ref; if ((ref = strarrayUtoW( referralsU ))) *referrals = ref;
else ret = LDAP_NO_MEMORY; else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ldap_memfree, referralsU ); LDAP_CALL( ldap_memfree, referralsU );
} }
return ret; return ret;
...@@ -152,7 +152,7 @@ ULONG CDECL ldap_parse_resultA( LDAP *ld, LDAPMessage *result, ULONG *retcode, c ...@@ -152,7 +152,7 @@ ULONG CDECL ldap_parse_resultA( LDAP *ld, LDAPMessage *result, ULONG *retcode, c
TRACE( "(%p, %p, %p, %p, %p, %p, %p, 0x%02x)\n", ld, result, retcode, matched, error, referrals, serverctrls, TRACE( "(%p, %p, %p, %p, %p, %p, %p, 0x%02x)\n", ld, result, retcode, matched, error, referrals, serverctrls,
free ); free );
if (!ld) return LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
ret = ldap_parse_resultW( ld, result, retcode, &matchedW, &errorW, &referralsW, &serverctrlsW, free ); ret = ldap_parse_resultW( ld, result, retcode, &matchedW, &errorW, &referralsW, &serverctrlsW, free );
...@@ -187,7 +187,7 @@ ULONG CDECL ldap_parse_resultW( LDAP *ld, LDAPMessage *result, ULONG *retcode, W ...@@ -187,7 +187,7 @@ ULONG CDECL ldap_parse_resultW( LDAP *ld, LDAPMessage *result, ULONG *retcode, W
&errorU, &referralsU, &serverctrlsU, free }; &errorU, &referralsU, &serverctrlsU, free };
ret = map_error( LDAP_CALL( ldap_parse_result, &params )); ret = map_error( LDAP_CALL( ldap_parse_result, &params ));
} }
else return LDAP_PARAM_ERROR; else return WLDAP32_LDAP_PARAM_ERROR;
if (matched) *matched = strUtoW( matchedU ); if (matched) *matched = strUtoW( matchedU );
if (error) *error = strUtoW( errorU ); if (error) *error = strUtoW( errorU );
...@@ -212,9 +212,9 @@ ULONG CDECL ldap_parse_sort_controlA( LDAP *ld, LDAPControlA **control, ULONG *r ...@@ -212,9 +212,9 @@ ULONG CDECL ldap_parse_sort_controlA( LDAP *ld, LDAPControlA **control, ULONG *r
TRACE( "(%p, %p, %p, %p)\n", ld, control, result, attr ); TRACE( "(%p, %p, %p, %p)\n", ld, control, result, attr );
if (!ld) return LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
if (!control) return LDAP_CONTROL_NOT_FOUND; if (!control) return WLDAP32_LDAP_CONTROL_NOT_FOUND;
if (!(controlW = controlarrayAtoW( control ))) return LDAP_NO_MEMORY; if (!(controlW = controlarrayAtoW( control ))) return WLDAP32_LDAP_NO_MEMORY;
ret = ldap_parse_sort_controlW( ld, controlW, result, &attrW ); ret = ldap_parse_sort_controlW( ld, controlW, result, &attrW );
...@@ -236,9 +236,9 @@ ULONG CDECL ldap_parse_sort_controlW( LDAP *ld, LDAPControlW **control, ULONG *r ...@@ -236,9 +236,9 @@ ULONG CDECL ldap_parse_sort_controlW( LDAP *ld, LDAPControlW **control, ULONG *r
TRACE( "(%p, %p, %p, %p)\n", ld, control, result, attr ); TRACE( "(%p, %p, %p, %p)\n", ld, control, result, attr );
if (!ld) return LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
if (!control) return LDAP_CONTROL_NOT_FOUND; if (!control) return WLDAP32_LDAP_CONTROL_NOT_FOUND;
if (!(controlU = controlarrayWtoU( control ))) return LDAP_NO_MEMORY; if (!(controlU = controlarrayWtoU( control ))) return WLDAP32_LDAP_NO_MEMORY;
for (i = 0; controlU[i]; i++) for (i = 0; controlU[i]; i++)
{ {
...@@ -248,14 +248,14 @@ ULONG CDECL ldap_parse_sort_controlW( LDAP *ld, LDAPControlW **control, ULONG *r ...@@ -248,14 +248,14 @@ ULONG CDECL ldap_parse_sort_controlW( LDAP *ld, LDAPControlW **control, ULONG *r
if (!sortcontrol) if (!sortcontrol)
{ {
controlarrayfreeU( controlU ); controlarrayfreeU( controlU );
return LDAP_CONTROL_NOT_FOUND; return WLDAP32_LDAP_CONTROL_NOT_FOUND;
} }
else else
{ {
struct ldap_parse_sortresponse_control_params params = { CTX(ld), sortcontrol, &res, &attrU }; struct ldap_parse_sortresponse_control_params params = { CTX(ld), sortcontrol, &res, &attrU };
ret = map_error( LDAP_CALL( ldap_parse_sortresponse_control, &params )); ret = map_error( LDAP_CALL( ldap_parse_sortresponse_control, &params ));
} }
if (ret == LDAP_SUCCESS) if (ret == WLDAP32_LDAP_SUCCESS)
{ {
WCHAR *str; WCHAR *str;
if ((str = strUtoW( attrU ))) if ((str = strUtoW( attrU )))
...@@ -263,7 +263,7 @@ ULONG CDECL ldap_parse_sort_controlW( LDAP *ld, LDAPControlW **control, ULONG *r ...@@ -263,7 +263,7 @@ ULONG CDECL ldap_parse_sort_controlW( LDAP *ld, LDAPControlW **control, ULONG *r
*attr = str; *attr = str;
*result = res; *result = res;
} }
else ret = LDAP_NO_MEMORY; else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ldap_memfree, attrU ); LDAP_CALL( ldap_memfree, attrU );
} }
...@@ -275,7 +275,7 @@ ULONG CDECL ldap_parse_sort_controlW( LDAP *ld, LDAPControlW **control, ULONG *r ...@@ -275,7 +275,7 @@ ULONG CDECL ldap_parse_sort_controlW( LDAP *ld, LDAPControlW **control, ULONG *r
* ldap_parse_vlv_controlA (WLDAP32.@) * ldap_parse_vlv_controlA (WLDAP32.@)
*/ */
int CDECL ldap_parse_vlv_controlA( LDAP *ld, LDAPControlA **control, ULONG *targetpos, ULONG *listcount, int CDECL ldap_parse_vlv_controlA( LDAP *ld, LDAPControlA **control, ULONG *targetpos, ULONG *listcount,
struct berval **context, int *errcode ) struct berval **context, int *errcode )
{ {
int ret; int ret;
LDAPControlW **controlW = NULL; LDAPControlW **controlW = NULL;
...@@ -284,7 +284,7 @@ int CDECL ldap_parse_vlv_controlA( LDAP *ld, LDAPControlA **control, ULONG *targ ...@@ -284,7 +284,7 @@ int CDECL ldap_parse_vlv_controlA( LDAP *ld, LDAPControlA **control, ULONG *targ
if (!ld) return ~0u; if (!ld) return ~0u;
if (control && !(controlW = controlarrayAtoW( control ))) return LDAP_NO_MEMORY; if (control && !(controlW = controlarrayAtoW( control ))) return WLDAP32_LDAP_NO_MEMORY;
ret = ldap_parse_vlv_controlW( ld, controlW, targetpos, listcount, context, errcode ); ret = ldap_parse_vlv_controlW( ld, controlW, targetpos, listcount, context, errcode );
controlarrayfreeW( controlW ); controlarrayfreeW( controlW );
return ret; return ret;
...@@ -305,7 +305,7 @@ int CDECL ldap_parse_vlv_controlW( LDAP *ld, LDAPControlW **control, ULONG *targ ...@@ -305,7 +305,7 @@ int CDECL ldap_parse_vlv_controlW( LDAP *ld, LDAPControlW **control, ULONG *targ
if (!ld || !control) return ~0u; if (!ld || !control) return ~0u;
if (!(controlU = controlarrayWtoU( control ))) return LDAP_NO_MEMORY; if (!(controlU = controlarrayWtoU( control ))) return WLDAP32_LDAP_NO_MEMORY;
for (i = 0; controlU[i]; i++) for (i = 0; controlU[i]; i++)
{ {
...@@ -315,14 +315,14 @@ int CDECL ldap_parse_vlv_controlW( LDAP *ld, LDAPControlW **control, ULONG *targ ...@@ -315,14 +315,14 @@ int CDECL ldap_parse_vlv_controlW( LDAP *ld, LDAPControlW **control, ULONG *targ
if (!vlvcontrolU) if (!vlvcontrolU)
{ {
controlarrayfreeU( controlU ); controlarrayfreeU( controlU );
return LDAP_CONTROL_NOT_FOUND; return WLDAP32_LDAP_CONTROL_NOT_FOUND;
} }
else else
{ {
struct ldap_parse_vlvresponse_control_params params = { CTX(ld), vlvcontrolU, &pos, &count, &ctxU, errcode }; struct ldap_parse_vlvresponse_control_params params = { CTX(ld), vlvcontrolU, &pos, &count, &ctxU, errcode };
ret = map_error( LDAP_CALL( ldap_parse_vlvresponse_control, &params )); ret = map_error( LDAP_CALL( ldap_parse_vlvresponse_control, &params ));
} }
if (ret == LDAP_SUCCESS) if (ret == WLDAP32_LDAP_SUCCESS)
{ {
struct berval *bv; struct berval *bv;
if ((bv = bervalUtoW( ctxU ))) if ((bv = bervalUtoW( ctxU )))
...@@ -331,7 +331,7 @@ int CDECL ldap_parse_vlv_controlW( LDAP *ld, LDAPControlW **control, ULONG *targ ...@@ -331,7 +331,7 @@ int CDECL ldap_parse_vlv_controlW( LDAP *ld, LDAPControlW **control, ULONG *targ
*targetpos = pos; *targetpos = pos;
*listcount = count; *listcount = count;
} }
else ret = LDAP_NO_MEMORY; else ret = WLDAP32_LDAP_NO_MEMORY;
LDAP_CALL( ber_bvfree, ctxU ); LDAP_CALL( ber_bvfree, ctxU );
} }
......
...@@ -35,14 +35,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32); ...@@ -35,14 +35,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
ULONG CDECL ldap_rename_extA( LDAP *ld, char *dn, char *newrdn, char *newparent, int delete, ULONG CDECL ldap_rename_extA( LDAP *ld, char *dn, char *newrdn, char *newparent, int delete,
LDAPControlA **serverctrls, LDAPControlA **clientctrls, ULONG *message ) LDAPControlA **serverctrls, LDAPControlA **clientctrls, ULONG *message )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld || !message) return WLDAP32_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;
...@@ -67,14 +67,14 @@ exit: ...@@ -67,14 +67,14 @@ exit:
ULONG CDECL ldap_rename_extW( LDAP *ld, WCHAR *dn, WCHAR *newrdn, WCHAR *newparent, int delete, ULONG CDECL ldap_rename_extW( LDAP *ld, WCHAR *dn, WCHAR *newrdn, WCHAR *newparent, int delete,
LDAPControlW **serverctrls, LDAPControlW **clientctrls, ULONG *message ) LDAPControlW **serverctrls, LDAPControlW **clientctrls, ULONG *message )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *dnU = NULL, *newrdnU = NULL, *newparentU = NULL; char *dnU = NULL, *newrdnU = NULL, *newparentU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; 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 LDAP_PARAM_ERROR; if (!ld || !message) return WLDAP32_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;
...@@ -101,14 +101,14 @@ exit: ...@@ -101,14 +101,14 @@ exit:
ULONG CDECL ldap_rename_ext_sA( LDAP *ld, char *dn, char *newrdn, char *newparent, int delete, ULONG CDECL ldap_rename_ext_sA( LDAP *ld, char *dn, char *newrdn, char *newparent, int delete,
LDAPControlA **serverctrls, LDAPControlA **clientctrls ) LDAPControlA **serverctrls, LDAPControlA **clientctrls )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
...@@ -133,14 +133,14 @@ exit: ...@@ -133,14 +133,14 @@ exit:
ULONG CDECL ldap_rename_ext_sW( LDAP *ld, WCHAR *dn, WCHAR *newrdn, WCHAR *newparent, int delete, ULONG CDECL ldap_rename_ext_sW( LDAP *ld, WCHAR *dn, WCHAR *newrdn, WCHAR *newparent, int delete,
LDAPControlW **serverctrls, LDAPControlW **clientctrls ) LDAPControlW **serverctrls, LDAPControlW **clientctrls )
{ {
ULONG ret = LDAP_PARAM_ERROR; ULONG ret = WLDAP32_LDAP_PARAM_ERROR;
char *dnU = NULL, *newrdnU = NULL, *newparentU = NULL; char *dnU = NULL, *newrdnU = NULL, *newparentU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; 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 LDAP_PARAM_ERROR; if (!ld) return WLDAP32_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;
......
...@@ -35,7 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32); ...@@ -35,7 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
*/ */
ULONG CDECL ldap_searchA( LDAP *ld, char *base, ULONG scope, char *filter, char **attrs, ULONG attrsonly ) ULONG CDECL ldap_searchA( LDAP *ld, char *base, ULONG scope, char *filter, char **attrs, ULONG attrsonly )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL; WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL;
TRACE( "(%p, %s, %#lx, %s, %p, %#lx)\n", ld, debugstr_a(base), scope, debugstr_a(filter), attrs, attrsonly ); TRACE( "(%p, %s, %#lx, %s, %p, %#lx)\n", ld, debugstr_a(base), scope, debugstr_a(filter), attrs, attrsonly );
...@@ -64,7 +64,7 @@ ULONG CDECL ldap_searchW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, WCH ...@@ -64,7 +64,7 @@ ULONG CDECL ldap_searchW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, WCH
TRACE( "(%p, %s, %#lx, %s, %p, %#lx)\n", ld, debugstr_w(base), scope, debugstr_w(filter), attrs, attrsonly ); TRACE( "(%p, %s, %#lx, %s, %p, %#lx)\n", ld, debugstr_w(base), scope, debugstr_w(filter), attrs, attrsonly );
ret = ldap_search_extW( ld, base, scope, filter, attrs, attrsonly, NULL, NULL, 0, 0, &msg ); ret = ldap_search_extW( ld, base, scope, filter, attrs, attrsonly, NULL, NULL, 0, 0, &msg );
if (ret == LDAP_SUCCESS) return msg; if (ret == WLDAP32_LDAP_SUCCESS) return msg;
return ~0u; return ~0u;
} }
...@@ -74,14 +74,14 @@ ULONG CDECL ldap_searchW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, WCH ...@@ -74,14 +74,14 @@ ULONG CDECL ldap_searchW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, WCH
ULONG CDECL ldap_search_extA( LDAP *ld, char *base, ULONG scope, char *filter, char **attrs, ULONG attrsonly, ULONG CDECL ldap_search_extA( LDAP *ld, char *base, ULONG scope, char *filter, char **attrs, ULONG attrsonly,
LDAPControlA **serverctrls, LDAPControlA **clientctrls, ULONG timelimit, ULONG sizelimit, ULONG *message ) LDAPControlA **serverctrls, LDAPControlA **clientctrls, ULONG timelimit, ULONG sizelimit, ULONG *message )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL; WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
TRACE( "(%p, %s, %#lx, %s, %p, %#lx, %p, %p, %#lx, %#lx, %p)\n", ld, debugstr_a(base), scope, TRACE( "(%p, %s, %#lx, %s, %p, %#lx, %p, %p, %#lx, %#lx, %p)\n", ld, debugstr_a(base), scope,
debugstr_a(filter), attrs, attrsonly, serverctrls, clientctrls, timelimit, sizelimit, message ); debugstr_a(filter), attrs, attrsonly, serverctrls, clientctrls, timelimit, sizelimit, message );
if (!ld) return LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
if (base && !(baseW = strAtoW( base ))) goto exit; if (base && !(baseW = strAtoW( base ))) goto exit;
if (filter && !(filterW = strAtoW( filter ))) goto exit; if (filter && !(filterW = strAtoW( filter ))) goto exit;
...@@ -108,7 +108,7 @@ ULONG CDECL ldap_search_extW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, ...@@ -108,7 +108,7 @@ ULONG CDECL ldap_search_extW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter,
ULONG attrsonly, LDAPControlW **serverctrls, LDAPControlW **clientctrls, ULONG timelimit, ULONG sizelimit, ULONG attrsonly, LDAPControlW **serverctrls, LDAPControlW **clientctrls, ULONG timelimit, ULONG sizelimit,
ULONG *message ) ULONG *message )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *baseU = NULL, *filterU = NULL, **attrsU = NULL; char *baseU = NULL, *filterU = NULL, **attrsU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
struct timevalU timevalU; struct timevalU timevalU;
...@@ -148,14 +148,14 @@ ULONG CDECL ldap_search_ext_sA( LDAP *ld, char *base, ULONG scope, char *filter, ...@@ -148,14 +148,14 @@ ULONG CDECL ldap_search_ext_sA( LDAP *ld, char *base, ULONG scope, char *filter,
ULONG attrsonly, LDAPControlA **serverctrls, LDAPControlA **clientctrls, struct l_timeval *timeout, ULONG attrsonly, LDAPControlA **serverctrls, LDAPControlA **clientctrls, struct l_timeval *timeout,
ULONG sizelimit, LDAPMessage **res ) ULONG sizelimit, LDAPMessage **res )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL; WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL;
LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
TRACE( "(%p, %s, %#lx, %s, %p, %#lx, %p, %p, %p, %#lx, %p)\n", ld, debugstr_a(base), scope, TRACE( "(%p, %s, %#lx, %s, %p, %#lx, %p, %p, %p, %#lx, %p)\n", ld, debugstr_a(base), scope,
debugstr_a(filter), attrs, attrsonly, serverctrls, clientctrls, timeout, sizelimit, res ); debugstr_a(filter), attrs, attrsonly, serverctrls, clientctrls, timeout, sizelimit, res );
if (!ld || !res) return LDAP_PARAM_ERROR; if (!ld || !res) return WLDAP32_LDAP_PARAM_ERROR;
if (base && !(baseW = strAtoW( base ))) goto exit; if (base && !(baseW = strAtoW( base ))) goto exit;
if (filter && !(filterW = strAtoW( filter ))) goto exit; if (filter && !(filterW = strAtoW( filter ))) goto exit;
...@@ -182,7 +182,7 @@ ULONG CDECL ldap_search_ext_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filte ...@@ -182,7 +182,7 @@ ULONG CDECL ldap_search_ext_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filte
ULONG attrsonly, LDAPControlW **serverctrls, LDAPControlW **clientctrls, struct l_timeval *timeout, ULONG attrsonly, LDAPControlW **serverctrls, LDAPControlW **clientctrls, struct l_timeval *timeout,
ULONG sizelimit, LDAPMessage **res ) ULONG sizelimit, LDAPMessage **res )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
char *baseU = NULL, *filterU = NULL, **attrsU = NULL; char *baseU = NULL, *filterU = NULL, **attrsU = NULL;
LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL; LDAPControlU **serverctrlsU = NULL, **clientctrlsU = NULL;
struct timevalU timevalU; struct timevalU timevalU;
...@@ -191,7 +191,7 @@ ULONG CDECL ldap_search_ext_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filte ...@@ -191,7 +191,7 @@ ULONG CDECL ldap_search_ext_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filte
TRACE( "(%p, %s, %#lx, %s, %p, %#lx, %p, %p, %p, %#lx, %p)\n", ld, debugstr_w(base), scope, TRACE( "(%p, %s, %#lx, %s, %p, %#lx, %p, %p, %p, %#lx, %p)\n", ld, debugstr_w(base), scope,
debugstr_w(filter), attrs, attrsonly, serverctrls, clientctrls, timeout, sizelimit, res ); debugstr_w(filter), attrs, attrsonly, serverctrls, clientctrls, timeout, sizelimit, res );
if (!ld || !res) return LDAP_PARAM_ERROR; if (!ld || !res) return WLDAP32_LDAP_PARAM_ERROR;
if (base && !(baseU = strWtoU( base ))) goto exit; if (base && !(baseU = strWtoU( base ))) goto exit;
if (filter && !(filterU = strWtoU( filter ))) goto exit; if (filter && !(filterU = strWtoU( filter ))) goto exit;
...@@ -222,7 +222,7 @@ ULONG CDECL ldap_search_ext_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filte ...@@ -222,7 +222,7 @@ ULONG CDECL ldap_search_ext_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filte
else else
{ {
LDAP_CALL( ldap_msgfree, msgU ); LDAP_CALL( ldap_msgfree, msgU );
ret = LDAP_NO_MEMORY; ret = WLDAP32_LDAP_NO_MEMORY;
} }
} }
...@@ -241,13 +241,13 @@ exit: ...@@ -241,13 +241,13 @@ exit:
ULONG CDECL ldap_search_sA( LDAP *ld, char *base, ULONG scope, char *filter, char **attrs, ULONG attrsonly, ULONG CDECL ldap_search_sA( LDAP *ld, char *base, ULONG scope, char *filter, char **attrs, ULONG attrsonly,
LDAPMessage **res ) LDAPMessage **res )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL; WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL;
TRACE( "(%p, %s, %#lx, %s, %p, %#lx, %p)\n", ld, debugstr_a(base), scope, debugstr_a(filter), attrs, TRACE( "(%p, %s, %#lx, %s, %p, %#lx, %p)\n", ld, debugstr_a(base), scope, debugstr_a(filter), attrs,
attrsonly, res ); attrsonly, res );
if (!ld || !res) return LDAP_PARAM_ERROR; if (!ld || !res) return WLDAP32_LDAP_PARAM_ERROR;
if (base && !(baseW = strAtoW( base ))) goto exit; if (base && !(baseW = strAtoW( base ))) goto exit;
if (filter && !(filterW = strAtoW( filter ))) goto exit; if (filter && !(filterW = strAtoW( filter ))) goto exit;
...@@ -279,13 +279,13 @@ ULONG CDECL ldap_search_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, W ...@@ -279,13 +279,13 @@ ULONG CDECL ldap_search_sW( LDAP *ld, WCHAR *base, ULONG scope, WCHAR *filter, W
ULONG CDECL ldap_search_stA( LDAP *ld, const PCHAR base, ULONG scope, const PCHAR filter, char **attrs, ULONG CDECL ldap_search_stA( LDAP *ld, const PCHAR base, ULONG scope, const PCHAR filter, char **attrs,
ULONG attrsonly, struct l_timeval *timeout, LDAPMessage **res ) ULONG attrsonly, struct l_timeval *timeout, LDAPMessage **res )
{ {
ULONG ret = LDAP_NO_MEMORY; ULONG ret = WLDAP32_LDAP_NO_MEMORY;
WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL; WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL;
TRACE( "(%p, %s, %#lx, %s, %p, %#lx, %p, %p)\n", ld, debugstr_a(base), scope, debugstr_a(filter), attrs, TRACE( "(%p, %s, %#lx, %s, %p, %#lx, %p, %p)\n", ld, debugstr_a(base), scope, debugstr_a(filter), attrs,
attrsonly, timeout, res ); attrsonly, timeout, res );
if (!ld || !res) return LDAP_PARAM_ERROR; if (!ld || !res) return WLDAP32_LDAP_PARAM_ERROR;
if (base && !(baseW = strAtoW( base ))) goto exit; if (base && !(baseW = strAtoW( base ))) goto exit;
if (filter && !(filterW = strAtoW( filter ))) goto exit; if (filter && !(filterW = strAtoW( filter ))) goto exit;
......
...@@ -218,7 +218,7 @@ ULONG CDECL WLDAP32_ldap_value_free_len( struct berval **values ) ...@@ -218,7 +218,7 @@ ULONG CDECL WLDAP32_ldap_value_free_len( struct berval **values )
TRACE( "(%p)\n", values ); TRACE( "(%p)\n", values );
bvarrayfreeW( values ); bvarrayfreeW( values );
return LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -229,7 +229,7 @@ ULONG CDECL ldap_value_freeA( char **values ) ...@@ -229,7 +229,7 @@ ULONG CDECL ldap_value_freeA( char **values )
TRACE( "(%p)\n", values ); TRACE( "(%p)\n", values );
strarrayfreeA( values ); strarrayfreeA( values );
return LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
...@@ -240,5 +240,5 @@ ULONG CDECL ldap_value_freeW( WCHAR **values ) ...@@ -240,5 +240,5 @@ ULONG CDECL ldap_value_freeW( WCHAR **values )
TRACE( "(%p)\n", values ); TRACE( "(%p)\n", values );
strarrayfreeW( values ); strarrayfreeW( values );
return LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
...@@ -24,6 +24,158 @@ ...@@ -24,6 +24,158 @@
#include "winnls.h" #include "winnls.h"
#include "libldap.h" #include "libldap.h"
#define WLDAP32_LBER_ERROR (~0l)
typedef enum {
WLDAP32_LDAP_SUCCESS = 0x00,
WLDAP32_LDAP_OPERATIONS_ERROR = 0x01,
WLDAP32_LDAP_PROTOCOL_ERROR = 0x02,
WLDAP32_LDAP_TIMELIMIT_EXCEEDED = 0x03,
WLDAP32_LDAP_SIZELIMIT_EXCEEDED = 0x04,
WLDAP32_LDAP_COMPARE_FALSE = 0x05,
WLDAP32_LDAP_COMPARE_TRUE = 0x06,
WLDAP32_LDAP_AUTH_METHOD_NOT_SUPPORTED = 0x07,
WLDAP32_LDAP_STRONG_AUTH_REQUIRED = 0x08,
WLDAP32_LDAP_REFERRAL_V2 = 0x09,
WLDAP32_LDAP_PARTIAL_RESULTS = 0x09,
WLDAP32_LDAP_REFERRAL = 0x0a,
WLDAP32_LDAP_ADMIN_LIMIT_EXCEEDED = 0x0b,
WLDAP32_LDAP_UNAVAILABLE_CRIT_EXTENSION = 0x0c,
WLDAP32_LDAP_CONFIDENTIALITY_REQUIRED = 0x0d,
WLDAP32_LDAP_SASL_BIND_IN_PROGRESS = 0x0e,
WLDAP32_LDAP_NO_SUCH_ATTRIBUTE = 0x10,
WLDAP32_LDAP_UNDEFINED_TYPE = 0x11,
WLDAP32_LDAP_INAPPROPRIATE_MATCHING = 0x12,
WLDAP32_LDAP_CONSTRAINT_VIOLATION = 0x13,
WLDAP32_LDAP_ATTRIBUTE_OR_VALUE_EXISTS = 0x14,
WLDAP32_LDAP_INVALID_SYNTAX = 0x15,
WLDAP32_LDAP_NO_SUCH_OBJECT = 0x20,
WLDAP32_LDAP_ALIAS_PROBLEM = 0x21,
WLDAP32_LDAP_INVALID_DN_SYNTAX = 0x22,
WLDAP32_LDAP_IS_LEAF = 0x23,
WLDAP32_LDAP_ALIAS_DEREF_PROBLEM = 0x24,
WLDAP32_LDAP_INAPPROPRIATE_AUTH = 0x30,
WLDAP32_LDAP_INVALID_CREDENTIALS = 0x31,
WLDAP32_LDAP_INSUFFICIENT_RIGHTS = 0x32,
WLDAP32_LDAP_BUSY = 0x33,
WLDAP32_LDAP_UNAVAILABLE = 0x34,
WLDAP32_LDAP_UNWILLING_TO_PERFORM = 0x35,
WLDAP32_LDAP_LOOP_DETECT = 0x36,
WLDAP32_LDAP_SORT_CONTROL_MISSING = 0x3C,
WLDAP32_LDAP_OFFSET_RANGE_ERROR = 0x3D,
WLDAP32_LDAP_NAMING_VIOLATION = 0x40,
WLDAP32_LDAP_OBJECT_CLASS_VIOLATION = 0x41,
WLDAP32_LDAP_NOT_ALLOWED_ON_NONLEAF = 0x42,
WLDAP32_LDAP_NOT_ALLOWED_ON_RDN = 0x43,
WLDAP32_LDAP_ALREADY_EXISTS = 0x44,
WLDAP32_LDAP_NO_OBJECT_CLASS_MODS = 0x45,
WLDAP32_LDAP_RESULTS_TOO_LARGE = 0x46,
WLDAP32_LDAP_AFFECTS_MULTIPLE_DSAS = 0x47,
WLDAP32_LDAP_VIRTUAL_LIST_VIEW_ERROR = 0x4c,
WLDAP32_LDAP_OTHER = 0x50,
WLDAP32_LDAP_SERVER_DOWN = 0x51,
WLDAP32_LDAP_LOCAL_ERROR = 0x52,
WLDAP32_LDAP_ENCODING_ERROR = 0x53,
WLDAP32_LDAP_DECODING_ERROR = 0x54,
WLDAP32_LDAP_TIMEOUT = 0x55,
WLDAP32_LDAP_AUTH_UNKNOWN = 0x56,
WLDAP32_LDAP_FILTER_ERROR = 0x57,
WLDAP32_LDAP_USER_CANCELLED = 0x58,
WLDAP32_LDAP_PARAM_ERROR = 0x59,
WLDAP32_LDAP_NO_MEMORY = 0x5a,
WLDAP32_LDAP_CONNECT_ERROR = 0x5b,
WLDAP32_LDAP_NOT_SUPPORTED = 0x5c,
WLDAP32_LDAP_CONTROL_NOT_FOUND = 0x5d,
WLDAP32_LDAP_NO_RESULTS_RETURNED = 0x5e,
WLDAP32_LDAP_MORE_RESULTS_TO_RETURN = 0x5f,
WLDAP32_LDAP_CLIENT_LOOP = 0x60,
WLDAP32_LDAP_REFERRAL_LIMIT_EXCEEDED = 0x61
} WLDAP32_LDAP_RETCODE;
#define WLDAP32_LDAP_SCOPE_BASE 0x00
#define WLDAP32_LDAP_SCOPE_ONELEVEL 0x01
#define WLDAP32_LDAP_SCOPE_SUBTREE 0x02
#define WLDAP32_LBER_USE_DER 0x01
#define WLDAP32_LDAP_OPT_API_INFO 0x00
#define WLDAP32_LDAP_OPT_DESC 0x01
#define WLDAP32_LDAP_OPT_DEREF 0x02
#define WLDAP32_LDAP_OPT_SIZELIMIT 0x03
#define WLDAP32_LDAP_OPT_TIMELIMIT 0x04
#define WLDAP32_LDAP_OPT_THREAD_FN_PTRS 0x05
#define WLDAP32_LDAP_OPT_REBIND_FN 0x06
#define WLDAP32_LDAP_OPT_REBIND_ARG 0x07
#define WLDAP32_LDAP_OPT_REFERRALS 0x08
#define WLDAP32_LDAP_OPT_RESTART 0x09
#define WLDAP32_LDAP_OPT_SSL 0x0a
#define WLDAP32_LDAP_OPT_IO_FN_PTRS 0x0b
#define WLDAP32_LDAP_OPT_CACHE_FN_PTRS 0x0d
#define WLDAP32_LDAP_OPT_CACHE_STRATEGY 0x0e
#define WLDAP32_LDAP_OPT_CACHE_ENABLE 0x0f
#define WLDAP32_LDAP_OPT_REFERRAL_HOP_LIMIT 0x10
#define WLDAP32_LDAP_OPT_PROTOCOL_VERSION 0x11
#define WLDAP32_LDAP_OPT_VERSION 0x11
#define WLDAP32_LDAP_OPT_SERVER_CONTROLS 0x12
#define WLDAP32_LDAP_OPT_API_FEATURE_INFO 0x15
#define WLDAP32_LDAP_OPT_HOST_NAME 0x30
#define WLDAP32_LDAP_OPT_ERROR_NUMBER 0x31
#define WLDAP32_LDAP_OPT_ERROR_STRING 0x32
#define WLDAP32_LDAP_OPT_SERVER_ERROR 0x33
#define WLDAP32_LDAP_OPT_SERVER_EXT_ERROR 0x34
#define WLDAP32_LDAP_OPT_PING_KEEP_ALIVE 0x36
#define WLDAP32_LDAP_OPT_PING_WAIT_TIME 0x37
#define WLDAP32_LDAP_OPT_PING_LIMIT 0x38
#define WLDAP32_LDAP_OPT_DNSDOMAIN_NAME 0x3b
#define WLDAP32_LDAP_OPT_GETDSNAME_FLAGS 0x3d
#define WLDAP32_LDAP_OPT_HOST_REACHABLE 0x3e
#define WLDAP32_LDAP_OPT_PROMPT_CREDENTIALS 0x3f
#define WLDAP32_LDAP_OPT_TCP_KEEPALIVE 0x40
#define WLDAP32_LDAP_OPT_FAST_CONCURRENT_BIND 0x41
#define WLDAP32_LDAP_OPT_SEND_TIMEOUT 0x42
#define WLDAP32_LDAP_OPT_REFERRAL_CALLBACK 0x70
#define WLDAP32_LDAP_OPT_CLIENT_CERTIFICATE 0x80
#define WLDAP32_LDAP_OPT_SERVER_CERTIFICATE 0x81
#define WLDAP32_LDAP_OPT_AUTO_RECONNECT 0x91
#define WLDAP32_LDAP_OPT_SSPI_FLAGS 0x92
#define WLDAP32_LDAP_OPT_SSL_INFO 0x93
#define WLDAP32_LDAP_OPT_REF_DEREF_CONN_PER_MSG 0x94
#define WLDAP32_LDAP_OPT_TLS LDAP_OPT_SSL
#define WLDAP32_LDAP_OPT_TLS_INFO LDAP_OPT_SSL_INFO
#define WLDAP32_LDAP_OPT_SIGN 0x95
#define WLDAP32_LDAP_OPT_ENCRYPT 0x96
#define WLDAP32_LDAP_OPT_SASL_METHOD 0x97
#define WLDAP32_LDAP_OPT_AREC_EXCLUSIVE 0x98
#define WLDAP32_LDAP_OPT_SECURITY_CONTEXT 0x99
#define WLDAP32_LDAP_OPT_ROOTDSE_CACHE 0x9a
#define WLDAP32_LDAP_OPT_ON ((void *)1)
#define WLDAP32_LDAP_OPT_OFF ((void *)0)
#define WLDAP32_LDAP_VERSION1 1
#define WLDAP32_LDAP_VERSION2 2
#define WLDAP32_LDAP_VERSION3 3
#define WLDAP32_LDAP_VERSION WLDAP32_LDAP_VERSION2
#define WLDAP32_LDAP_AUTH_SIMPLE 0x80
#define WLDAP32_LDAP_AUTH_SASL 0x83
#define WLDAP32_LDAP_AUTH_OTHERKIND 0x86
#define WLDAP32_LDAP_AUTH_EXTERNAL (WLDAP32_LDAP_AUTH_OTHERKIND | 0x0020)
#define WLDAP32_LDAP_AUTH_SICILY (WLDAP32_LDAP_AUTH_OTHERKIND | 0x0200)
#define WLDAP32_LDAP_AUTH_NEGOTIATE (WLDAP32_LDAP_AUTH_OTHERKIND | 0x0400)
#define WLDAP32_LDAP_AUTH_MSN (WLDAP32_LDAP_AUTH_OTHERKIND | 0x0800)
#define WLDAP32_LDAP_AUTH_NTLM (WLDAP32_LDAP_AUTH_OTHERKIND | 0x1000)
#define WLDAP32_LDAP_AUTH_DPA (WLDAP32_LDAP_AUTH_OTHERKIND | 0x2000)
#define WLDAP32_LDAP_AUTH_DIGEST (WLDAP32_LDAP_AUTH_OTHERKIND | 0x4000)
typedef struct WLDAP32_berelement typedef struct WLDAP32_berelement
{ {
char *opaque; char *opaque;
......
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