Commit 25c70891 authored by Alexandre Julliard's avatar Alexandre Julliard

wldap32: Map Unix error codes to Windows ones for all functions.

parent 316f3fc6
...@@ -244,8 +244,8 @@ ULONG CDECL ldap_add_extW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[], ...@@ -244,8 +244,8 @@ ULONG CDECL ldap_add_extW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[],
if (!clientctrlsU) goto exit; if (!clientctrlsU) goto exit;
} }
ret = ldap_add_ext( ld, dn ? dnU : "", attrs ? attrsU : nullattrs, serverctrlsU, ret = map_error( ldap_add_ext( ld, dn ? dnU : "", attrs ? attrsU : nullattrs, serverctrlsU,
clientctrlsU, message ? (int *)message : &dummy ); clientctrlsU, message ? (int *)message : &dummy ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
...@@ -361,8 +361,8 @@ ULONG CDECL ldap_add_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[], ...@@ -361,8 +361,8 @@ ULONG CDECL ldap_add_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[],
if (!clientctrlsU) goto exit; if (!clientctrlsU) goto exit;
} }
ret = ldap_add_ext_s( ld, dn ? dnU : "", attrs ? attrsU : nullattrs, ret = map_error( ldap_add_ext_s( ld, dn ? dnU : "", attrs ? attrsU : nullattrs,
serverctrlsU, clientctrlsU ); serverctrlsU, clientctrlsU ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
...@@ -448,7 +448,7 @@ ULONG CDECL ldap_add_sW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[] ) ...@@ -448,7 +448,7 @@ ULONG CDECL ldap_add_sW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[] )
if (!attrsU) goto exit; if (!attrsU) goto exit;
} }
ret = ldap_add_ext_s( ld, dn ? dnU : "", attrs ? attrsU : nullattrs, NULL, NULL ); ret = map_error( ldap_add_ext_s( ld, dn ? dnU : "", attrs ? attrsU : nullattrs, NULL, NULL ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
......
...@@ -211,7 +211,7 @@ ULONG CDECL ldap_bind_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR cred, ULONG method ...@@ -211,7 +211,7 @@ ULONG CDECL ldap_bind_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR cred, ULONG method
pwd.bv_val = credU; pwd.bv_val = credU;
} }
ret = ldap_sasl_bind_s( ld, dnU, LDAP_SASL_SIMPLE, &pwd, NULL, NULL, NULL ); ret = map_error( ldap_sasl_bind_s( ld, dnU, LDAP_SASL_SIMPLE, &pwd, NULL, NULL, NULL ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
...@@ -328,8 +328,8 @@ ULONG CDECL ldap_sasl_bindW( WLDAP32_LDAP *ld, const PWCHAR dn, ...@@ -328,8 +328,8 @@ ULONG CDECL ldap_sasl_bindW( WLDAP32_LDAP *ld, const PWCHAR dn,
credU.bv_len = cred->bv_len; credU.bv_len = cred->bv_len;
credU.bv_val = cred->bv_val; credU.bv_val = cred->bv_val;
ret = ldap_sasl_bind( ld, dnU, mechanismU, &credU, ret = map_error( ldap_sasl_bind( ld, dnU, mechanismU, &credU,
serverctrlsU, clientctrlsU, message ); serverctrlsU, clientctrlsU, message ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
...@@ -448,8 +448,8 @@ ULONG CDECL ldap_sasl_bind_sW( WLDAP32_LDAP *ld, const PWCHAR dn, ...@@ -448,8 +448,8 @@ ULONG CDECL ldap_sasl_bind_sW( WLDAP32_LDAP *ld, const PWCHAR dn,
credU.bv_len = cred->bv_len; credU.bv_len = cred->bv_len;
credU.bv_val = cred->bv_val; credU.bv_val = cred->bv_val;
ret = ldap_sasl_bind_s( ld, dnU, mechanismU, &credU, ret = map_error( ldap_sasl_bind_s( ld, dnU, mechanismU, &credU,
serverctrlsU, clientctrlsU, (struct berval **)serverdata ); serverctrlsU, clientctrlsU, (struct berval **)serverdata ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
...@@ -633,7 +633,7 @@ ULONG CDECL ldap_simple_bind_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR passwd ) ...@@ -633,7 +633,7 @@ ULONG CDECL ldap_simple_bind_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR passwd )
pwd.bv_val = passwdU; pwd.bv_val = passwdU;
} }
ret = ldap_sasl_bind_s( ld, dnU, LDAP_SASL_SIMPLE, &pwd, NULL, NULL, NULL ); ret = map_error( ldap_sasl_bind_s( ld, dnU, LDAP_SASL_SIMPLE, &pwd, NULL, NULL, NULL ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
...@@ -663,7 +663,7 @@ ULONG CDECL WLDAP32_ldap_unbind( WLDAP32_LDAP *ld ) ...@@ -663,7 +663,7 @@ ULONG CDECL WLDAP32_ldap_unbind( WLDAP32_LDAP *ld )
TRACE( "(%p)\n", ld ); TRACE( "(%p)\n", ld );
if (ld) if (ld)
ret = ldap_unbind_ext( ld, NULL, NULL ); ret = map_error( ldap_unbind_ext( ld, NULL, NULL ));
else else
ret = WLDAP32_LDAP_PARAM_ERROR; ret = WLDAP32_LDAP_PARAM_ERROR;
...@@ -691,7 +691,7 @@ ULONG CDECL WLDAP32_ldap_unbind_s( WLDAP32_LDAP *ld ) ...@@ -691,7 +691,7 @@ ULONG CDECL WLDAP32_ldap_unbind_s( WLDAP32_LDAP *ld )
TRACE( "(%p)\n", ld ); TRACE( "(%p)\n", ld );
if (ld) if (ld)
ret = ldap_unbind_ext_s( ld, NULL, NULL ); ret = map_error( ldap_unbind_ext_s( ld, NULL, NULL ));
else else
ret = WLDAP32_LDAP_PARAM_ERROR; ret = WLDAP32_LDAP_PARAM_ERROR;
......
...@@ -268,8 +268,8 @@ ULONG CDECL ldap_compare_extW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR attr, PWCHAR ...@@ -268,8 +268,8 @@ ULONG CDECL ldap_compare_extW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR attr, PWCHAR
if (!clientctrlsU) goto exit; if (!clientctrlsU) goto exit;
} }
ret = ldap_compare_ext( ld, dn ? dnU : "", attrU, data ? (struct berval *)data : &val, ret = map_error( ldap_compare_ext( ld, dn ? dnU : "", attrU, data ? (struct berval *)data : &val,
serverctrlsU, clientctrlsU, (int *)message ); serverctrlsU, clientctrlsU, (int *)message ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
...@@ -404,9 +404,9 @@ ULONG CDECL ldap_compare_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR attr, PWCHA ...@@ -404,9 +404,9 @@ ULONG CDECL ldap_compare_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR attr, PWCHA
if (!clientctrlsU) goto exit; if (!clientctrlsU) goto exit;
} }
ret = ldap_compare_ext_s( ld, dn ? dnU : "", attr ? attrU : "", ret = map_error( ldap_compare_ext_s( ld, dn ? dnU : "", attr ? attrU : "",
data ? (struct berval *)data : &val, data ? (struct berval *)data : &val,
serverctrlsU, clientctrlsU ); serverctrlsU, clientctrlsU ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
...@@ -506,7 +506,7 @@ ULONG CDECL ldap_compare_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR attr, PWCHAR va ...@@ -506,7 +506,7 @@ ULONG CDECL ldap_compare_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR attr, PWCHAR va
val.bv_val = valueU; val.bv_val = valueU;
} }
ret = ldap_compare_ext_s( ld, dn ? dnU : "", attr ? attrU : "", &val, NULL, NULL ); ret = map_error( ldap_compare_ext_s( ld, dn ? dnU : "", attr ? attrU : "", &val, NULL, NULL ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
......
...@@ -189,7 +189,7 @@ ULONG CDECL ldap_create_sort_controlW( WLDAP32_LDAP *ld, PLDAPSortKeyW *sortkey, ...@@ -189,7 +189,7 @@ ULONG CDECL ldap_create_sort_controlW( WLDAP32_LDAP *ld, PLDAPSortKeyW *sortkey,
sortkeyU = sortkeyarrayWtoU( sortkey ); sortkeyU = sortkeyarrayWtoU( sortkey );
if (!sortkeyU) return WLDAP32_LDAP_NO_MEMORY; if (!sortkeyU) return WLDAP32_LDAP_NO_MEMORY;
ret = ldap_create_sort_control( ld, sortkeyU, critical, &controlU ); ret = map_error( ldap_create_sort_control( ld, sortkeyU, critical, &controlU ));
*control = controlUtoW( controlU ); *control = controlUtoW( controlU );
if (!*control) ret = WLDAP32_LDAP_NO_MEMORY; if (!*control) ret = WLDAP32_LDAP_NO_MEMORY;
...@@ -263,9 +263,9 @@ INT CDECL ldap_create_vlv_controlW( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info, ...@@ -263,9 +263,9 @@ INT CDECL ldap_create_vlv_controlW( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info,
if (!ld || !control) return ~0UL; if (!ld || !control) return ~0UL;
ret = ldap_create_vlv_control( ld, (LDAPVLVInfo *)info, &controlU ); ret = map_error( ldap_create_vlv_control( ld, (LDAPVLVInfo *)info, &controlU ));
if (ret == LDAP_SUCCESS) if (ret == WLDAP32_LDAP_SUCCESS)
{ {
*control = controlUtoW( controlU ); *control = controlUtoW( controlU );
if (!*control) ret = WLDAP32_LDAP_NO_MEMORY; if (!*control) ret = WLDAP32_LDAP_NO_MEMORY;
......
...@@ -206,8 +206,8 @@ ULONG CDECL ldap_delete_extW( WLDAP32_LDAP *ld, PWCHAR dn, PLDAPControlW *server ...@@ -206,8 +206,8 @@ ULONG CDECL ldap_delete_extW( WLDAP32_LDAP *ld, PWCHAR dn, PLDAPControlW *server
if (!clientctrlsU) goto exit; if (!clientctrlsU) goto exit;
} }
ret = ldap_delete_ext( ld, dn ? dnU : "", serverctrlsU, clientctrlsU, ret = map_error( ldap_delete_ext( ld, dn ? dnU : "", serverctrlsU, clientctrlsU,
message ? (int *)message : &dummy ); message ? (int *)message : &dummy ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
...@@ -305,7 +305,7 @@ ULONG CDECL ldap_delete_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, PLDAPControlW *serv ...@@ -305,7 +305,7 @@ ULONG CDECL ldap_delete_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, PLDAPControlW *serv
if (!clientctrlsU) goto exit; if (!clientctrlsU) goto exit;
} }
ret = ldap_delete_ext_s( ld, dn ? dnU : "", serverctrlsU, clientctrlsU ); ret = map_error( ldap_delete_ext_s( ld, dn ? dnU : "", serverctrlsU, clientctrlsU ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
...@@ -371,7 +371,7 @@ ULONG CDECL ldap_delete_sW( WLDAP32_LDAP *ld, PWCHAR dn ) ...@@ -371,7 +371,7 @@ ULONG CDECL ldap_delete_sW( WLDAP32_LDAP *ld, PWCHAR dn )
if (!dnU) return WLDAP32_LDAP_NO_MEMORY; if (!dnU) return WLDAP32_LDAP_NO_MEMORY;
} }
ret = ldap_delete_ext_s( ld, dn ? dnU : "", NULL, NULL ); ret = map_error( ldap_delete_ext_s( ld, dn ? dnU : "", NULL, NULL ));
strfreeU( dnU ); strfreeU( dnU );
#endif #endif
......
...@@ -160,8 +160,8 @@ ULONG CDECL ldap_extended_operationW( WLDAP32_LDAP *ld, PWCHAR oid, struct WLDAP ...@@ -160,8 +160,8 @@ ULONG CDECL ldap_extended_operationW( WLDAP32_LDAP *ld, PWCHAR oid, struct WLDAP
if (!clientctrlsU) goto exit; if (!clientctrlsU) goto exit;
} }
ret = ldap_extended_operation( ld, oid ? oidU : "", (struct berval *)data, ret = map_error( ldap_extended_operation( ld, oid ? oidU : "", (struct berval *)data,
serverctrlsU, clientctrlsU, (int *)message ); serverctrlsU, clientctrlsU, (int *)message ));
exit: exit:
strfreeU( oidU ); strfreeU( oidU );
...@@ -277,8 +277,8 @@ ULONG CDECL ldap_extended_operation_sW( WLDAP32_LDAP *ld, PWCHAR oid, struct WLD ...@@ -277,8 +277,8 @@ ULONG CDECL ldap_extended_operation_sW( WLDAP32_LDAP *ld, PWCHAR oid, struct WLD
if (!clientctrlsU) goto exit; if (!clientctrlsU) goto exit;
} }
ret = ldap_extended_operation_s( ld, oid ? oidU : "", (struct berval *)data, serverctrlsU, ret = map_error( ldap_extended_operation_s( ld, oid ? oidU : "", (struct berval *)data, serverctrlsU,
clientctrlsU, &retoidU, (struct berval **)retdata ); clientctrlsU, &retoidU, (struct berval **)retdata ));
if (retoid && retoidU) { if (retoid && retoidU) {
*retoid = strUtoW( retoidU ); *retoid = strUtoW( retoidU );
......
...@@ -646,7 +646,7 @@ ULONG CDECL ldap_start_tls_sW( WLDAP32_LDAP *ld, PULONG retval, WLDAP32_LDAPMess ...@@ -646,7 +646,7 @@ ULONG CDECL ldap_start_tls_sW( WLDAP32_LDAP *ld, PULONG retval, WLDAP32_LDAPMess
if (!clientctrlsU) goto exit; if (!clientctrlsU) goto exit;
} }
ret = ldap_start_tls_s( ld, serverctrlsU, clientctrlsU ); ret = map_error( ldap_start_tls_s( ld, serverctrlsU, clientctrlsU ));
exit: exit:
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
......
...@@ -60,7 +60,7 @@ ULONG CDECL WLDAP32_ldap_abandon( WLDAP32_LDAP *ld, ULONG msgid ) ...@@ -60,7 +60,7 @@ ULONG CDECL WLDAP32_ldap_abandon( WLDAP32_LDAP *ld, ULONG msgid )
TRACE( "(%p, 0x%08x)\n", ld, msgid ); TRACE( "(%p, 0x%08x)\n", ld, msgid );
if (!ld) return ~0UL; if (!ld) return ~0UL;
ret = ldap_abandon_ext( ld, msgid, NULL, NULL ); ret = map_error( ldap_abandon_ext( ld, msgid, NULL, NULL ));
#endif #endif
return ret; return ret;
......
...@@ -245,8 +245,8 @@ ULONG CDECL ldap_modify_extW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *mods[], ...@@ -245,8 +245,8 @@ ULONG CDECL ldap_modify_extW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *mods[],
if (!clientctrlsU) goto exit; if (!clientctrlsU) goto exit;
} }
ret = ldap_modify_ext( ld, dn ? dnU : "", mods ? modsU : nullmods, serverctrlsU, ret = map_error( ldap_modify_ext( ld, dn ? dnU : "", mods ? modsU : nullmods, serverctrlsU,
clientctrlsU, message ? (int *)message : &dummy ); clientctrlsU, message ? (int *)message : &dummy ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
...@@ -362,8 +362,8 @@ ULONG CDECL ldap_modify_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *mods[], ...@@ -362,8 +362,8 @@ ULONG CDECL ldap_modify_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *mods[],
if (!clientctrlsU) goto exit; if (!clientctrlsU) goto exit;
} }
ret = ldap_modify_ext_s( ld, dn ? dnU : "", mods ? modsU : nullmods, ret = map_error( ldap_modify_ext_s( ld, dn ? dnU : "", mods ? modsU : nullmods,
serverctrlsU, clientctrlsU ); serverctrlsU, clientctrlsU ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
...@@ -449,7 +449,7 @@ ULONG CDECL ldap_modify_sW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *mods[] ) ...@@ -449,7 +449,7 @@ ULONG CDECL ldap_modify_sW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *mods[] )
if (!modsU) goto exit; if (!modsU) goto exit;
} }
ret = ldap_modify_ext_s( ld, dn ? dnU : "", mods ? modsU : nullmods, NULL, NULL ); ret = map_error( ldap_modify_ext_s( ld, dn ? dnU : "", mods ? modsU : nullmods, NULL, NULL ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
......
...@@ -289,7 +289,7 @@ ULONG CDECL ldap_modrdn2_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newdn, INT dele ...@@ -289,7 +289,7 @@ ULONG CDECL ldap_modrdn2_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newdn, INT dele
newdnU = strWtoU( newdn ); newdnU = strWtoU( newdn );
if (!newdnU) goto exit; if (!newdnU) goto exit;
ret = ldap_rename_s( ld, dn ? dnU : "", newdnU, NULL, delete, NULL, NULL ); ret = map_error( ldap_rename_s( ld, dn ? dnU : "", newdnU, NULL, delete, NULL, NULL ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
...@@ -368,7 +368,7 @@ ULONG CDECL ldap_modrdn_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newdn ) ...@@ -368,7 +368,7 @@ ULONG CDECL ldap_modrdn_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newdn )
newdnU = strWtoU( newdn ); newdnU = strWtoU( newdn );
if (!newdnU) goto exit; if (!newdnU) goto exit;
ret = ldap_rename_s( ld, dn ? dnU : "", newdnU, NULL, 1, NULL, NULL ); ret = map_error( ldap_rename_s( ld, dn ? dnU : "", newdnU, NULL, 1, NULL, NULL ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
......
...@@ -206,7 +206,7 @@ ULONG CDECL ldap_get_optionW( WLDAP32_LDAP *ld, int option, void *value ) ...@@ -206,7 +206,7 @@ ULONG CDECL ldap_get_optionW( WLDAP32_LDAP *ld, int option, void *value )
if (!featureU.ldapaif_name) return WLDAP32_LDAP_NO_MEMORY; if (!featureU.ldapaif_name) return WLDAP32_LDAP_NO_MEMORY;
ret = ldap_get_option( ld, option, &featureU ); ret = map_error( ldap_get_option( ld, option, &featureU ));
featureW->ldapaif_version = featureU.ldapaif_version; featureW->ldapaif_version = featureU.ldapaif_version;
strfreeU( featureU.ldapaif_name ); strfreeU( featureU.ldapaif_name );
...@@ -220,7 +220,7 @@ ULONG CDECL ldap_get_optionW( WLDAP32_LDAP *ld, int option, void *value ) ...@@ -220,7 +220,7 @@ ULONG CDECL ldap_get_optionW( WLDAP32_LDAP *ld, int option, void *value )
memset( &infoU, 0, sizeof(LDAPAPIInfo) ); memset( &infoU, 0, sizeof(LDAPAPIInfo) );
infoU.ldapai_info_version = infoW->ldapai_info_version; infoU.ldapai_info_version = infoW->ldapai_info_version;
ret = ldap_get_option( ld, option, &infoU ); ret = map_error( ldap_get_option( ld, option, &infoU ));
infoW->ldapai_api_version = infoU.ldapai_api_version; infoW->ldapai_api_version = infoU.ldapai_api_version;
infoW->ldapai_protocol_version = infoU.ldapai_protocol_version; infoW->ldapai_protocol_version = infoU.ldapai_protocol_version;
...@@ -253,7 +253,7 @@ ULONG CDECL ldap_get_optionW( WLDAP32_LDAP *ld, int option, void *value ) ...@@ -253,7 +253,7 @@ ULONG CDECL ldap_get_optionW( WLDAP32_LDAP *ld, int option, void *value )
case WLDAP32_LDAP_OPT_REFERRALS: case WLDAP32_LDAP_OPT_REFERRALS:
case WLDAP32_LDAP_OPT_SIZELIMIT: case WLDAP32_LDAP_OPT_SIZELIMIT:
case WLDAP32_LDAP_OPT_TIMELIMIT: case WLDAP32_LDAP_OPT_TIMELIMIT:
return ldap_get_option( ld, option, value ); return map_error( ldap_get_option( ld, option, value ));
case WLDAP32_LDAP_OPT_CACHE_ENABLE: case WLDAP32_LDAP_OPT_CACHE_ENABLE:
case WLDAP32_LDAP_OPT_CACHE_FN_PTRS: case WLDAP32_LDAP_OPT_CACHE_FN_PTRS:
...@@ -433,7 +433,7 @@ ULONG CDECL ldap_set_optionW( WLDAP32_LDAP *ld, int option, void *value ) ...@@ -433,7 +433,7 @@ ULONG CDECL ldap_set_optionW( WLDAP32_LDAP *ld, int option, void *value )
ctrlsU = controlarrayWtoU( (LDAPControlW **)value ); ctrlsU = controlarrayWtoU( (LDAPControlW **)value );
if (!ctrlsU) return WLDAP32_LDAP_NO_MEMORY; if (!ctrlsU) return WLDAP32_LDAP_NO_MEMORY;
ret = ldap_set_option( ld, option, ctrlsU ); ret = map_error( ldap_set_option( ld, option, ctrlsU ));
controlarrayfreeU( ctrlsU ); controlarrayfreeU( ctrlsU );
return ret; return ret;
} }
...@@ -444,7 +444,7 @@ ULONG CDECL ldap_set_optionW( WLDAP32_LDAP *ld, int option, void *value ) ...@@ -444,7 +444,7 @@ ULONG CDECL ldap_set_optionW( WLDAP32_LDAP *ld, int option, void *value )
case WLDAP32_LDAP_OPT_REFERRALS: case WLDAP32_LDAP_OPT_REFERRALS:
case WLDAP32_LDAP_OPT_SIZELIMIT: case WLDAP32_LDAP_OPT_SIZELIMIT:
case WLDAP32_LDAP_OPT_TIMELIMIT: case WLDAP32_LDAP_OPT_TIMELIMIT:
return ldap_set_option( ld, option, value ); return map_error( ldap_set_option( ld, option, value ));
case WLDAP32_LDAP_OPT_CACHE_ENABLE: case WLDAP32_LDAP_OPT_CACHE_ENABLE:
case WLDAP32_LDAP_OPT_CACHE_FN_PTRS: case WLDAP32_LDAP_OPT_CACHE_FN_PTRS:
......
...@@ -99,7 +99,7 @@ ULONG CDECL ldap_parse_extended_resultW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage * ...@@ -99,7 +99,7 @@ ULONG CDECL ldap_parse_extended_resultW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
if (!result) return WLDAP32_LDAP_NO_RESULTS_RETURNED; if (!result) return WLDAP32_LDAP_NO_RESULTS_RETURNED;
ret = ldap_parse_extended_result( ld, result, &oidU, (struct berval **)data, free ); ret = map_error( ldap_parse_extended_result( ld, result, &oidU, (struct berval **)data, free ) );
if (oid) { if (oid) {
*oid = strUtoW( oidU ); *oid = strUtoW( oidU );
...@@ -164,7 +164,7 @@ ULONG CDECL ldap_parse_referenceW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *messag ...@@ -164,7 +164,7 @@ ULONG CDECL ldap_parse_referenceW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *messag
if (!ld) return ~0UL; if (!ld) return ~0UL;
ret = ldap_parse_reference( ld, message, &referralsU, NULL, 0 ); ret = map_error( ldap_parse_reference( ld, message, &referralsU, NULL, 0 ));
*referrals = strarrayUtoW( referralsU ); *referrals = strarrayUtoW( referralsU );
ldap_memfree( referralsU ); ldap_memfree( referralsU );
...@@ -249,8 +249,8 @@ ULONG CDECL ldap_parse_resultW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *result, ...@@ -249,8 +249,8 @@ ULONG CDECL ldap_parse_resultW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *result,
if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
ret = ldap_parse_result( ld, result, (int *)retcode, &matchedU, &errorU, ret = map_error( ldap_parse_result( ld, result, (int *)retcode, &matchedU, &errorU,
&referralsU, &serverctrlsU, free ); &referralsU, &serverctrlsU, free ));
if (matched) *matched = strUtoW( matchedU ); if (matched) *matched = strUtoW( matchedU );
if (error) *error = strUtoW( errorU ); if (error) *error = strUtoW( errorU );
...@@ -264,7 +264,7 @@ ULONG CDECL ldap_parse_resultW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *result, ...@@ -264,7 +264,7 @@ ULONG CDECL ldap_parse_resultW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *result,
ldap_controls_free( serverctrlsU ); ldap_controls_free( serverctrlsU );
#endif #endif
return map_error( ret ); return ret;
} }
/*********************************************************************** /***********************************************************************
...@@ -470,5 +470,5 @@ INT CDECL ldap_parse_vlv_controlW( WLDAP32_LDAP *ld, PLDAPControlW *control, ...@@ -470,5 +470,5 @@ INT CDECL ldap_parse_vlv_controlW( WLDAP32_LDAP *ld, PLDAPControlW *control,
controlarrayfreeU( controlU ); controlarrayfreeU( controlU );
#endif #endif
return ret; return map_error( ret );
} }
...@@ -157,8 +157,8 @@ ULONG CDECL ldap_rename_extW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newrdn, ...@@ -157,8 +157,8 @@ ULONG CDECL ldap_rename_extW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newrdn,
if (!clientctrlsU) goto exit; if (!clientctrlsU) goto exit;
} }
ret = ldap_rename( ld, dn ? dnU : "", newrdn ? newrdnU : "", newparentU, ret = map_error( ldap_rename( ld, dn ? dnU : "", newrdn ? newrdnU : "", newparentU,
delete, serverctrlsU, clientctrlsU, (int *)message ); delete, serverctrlsU, clientctrlsU, (int *)message ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
...@@ -283,8 +283,8 @@ ULONG CDECL ldap_rename_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newrdn, ...@@ -283,8 +283,8 @@ ULONG CDECL ldap_rename_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newrdn,
if (!clientctrlsU) goto exit; if (!clientctrlsU) goto exit;
} }
ret = ldap_rename_s( ld, dn ? dnU : "", newrdn ? newrdnU : "", newparentU, ret = map_error( ldap_rename_s( ld, dn ? dnU : "", newrdn ? newrdnU : "", newparentU,
delete, serverctrlsU, clientctrlsU ); delete, serverctrlsU, clientctrlsU ));
exit: exit:
strfreeU( dnU ); strfreeU( dnU );
......
...@@ -277,8 +277,8 @@ ULONG CDECL ldap_search_extW( WLDAP32_LDAP *ld, PWCHAR base, ULONG scope, ...@@ -277,8 +277,8 @@ ULONG CDECL ldap_search_extW( WLDAP32_LDAP *ld, PWCHAR base, ULONG scope,
tv.tv_sec = timelimit; tv.tv_sec = timelimit;
tv.tv_usec = 0; tv.tv_usec = 0;
ret = ldap_search_ext( ld, baseU, scope, filterU, attrsU, attrsonly, ret = map_error( ldap_search_ext( ld, baseU, scope, filterU, attrsU, attrsonly,
serverctrlsU, clientctrlsU, &tv, sizelimit, (int *)message ); serverctrlsU, clientctrlsU, &tv, sizelimit, (int *)message ));
exit: exit:
strfreeU( baseU ); strfreeU( baseU );
...@@ -412,8 +412,9 @@ ULONG CDECL ldap_search_ext_sW( WLDAP32_LDAP *ld, PWCHAR base, ULONG scope, ...@@ -412,8 +412,9 @@ ULONG CDECL ldap_search_ext_sW( WLDAP32_LDAP *ld, PWCHAR base, ULONG scope,
if (!clientctrlsU) goto exit; if (!clientctrlsU) goto exit;
} }
ret = ldap_search_ext_s( ld, baseU, scope, filterU, attrsU, attrsonly, ret = map_error( ldap_search_ext_s( ld, baseU, scope, filterU, attrsU, attrsonly,
serverctrlsU, clientctrlsU, (struct timeval *)timeout, sizelimit, res ); serverctrlsU, clientctrlsU, (struct timeval *)timeout,
sizelimit, res ));
exit: exit:
strfreeU( baseU ); strfreeU( baseU );
...@@ -518,8 +519,8 @@ ULONG CDECL ldap_search_sW( WLDAP32_LDAP *ld, PWCHAR base, ULONG scope, PWCHAR f ...@@ -518,8 +519,8 @@ ULONG CDECL ldap_search_sW( WLDAP32_LDAP *ld, PWCHAR base, ULONG scope, PWCHAR f
if (!attrsU) goto exit; if (!attrsU) goto exit;
} }
ret = ldap_search_ext_s( ld, baseU, scope, filterU, attrsU, attrsonly, ret = map_error( ldap_search_ext_s( ld, baseU, scope, filterU, attrsU, attrsonly,
NULL, NULL, NULL, 0, res ); NULL, NULL, NULL, 0, res ));
exit: exit:
strfreeU( baseU ); strfreeU( baseU );
...@@ -628,8 +629,8 @@ ULONG CDECL ldap_search_stW( WLDAP32_LDAP *ld, const PWCHAR base, ULONG scope, ...@@ -628,8 +629,8 @@ ULONG CDECL ldap_search_stW( WLDAP32_LDAP *ld, const PWCHAR base, ULONG scope,
if (!attrsU) goto exit; if (!attrsU) goto exit;
} }
ret = ldap_search_ext_s( ld, baseU, scope, filterU, attrsU, attrsonly, ret = map_error( ldap_search_ext_s( ld, baseU, scope, filterU, attrsU, attrsonly,
NULL, NULL, (struct timeval *)timeout, 0, res ); NULL, NULL, (struct timeval *)timeout, 0, res ));
exit: exit:
strfreeU( baseU ); strfreeU( baseU );
......
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