/*********************************************************************** * ldap_search_extA (WLDAP32.@) * * See ldap_search_extW. */ ULONG CDECL ldap_search_extA( WLDAP32_LDAP *ld, PCHAR base, ULONG scope, PCHAR filter, PCHAR attrs[], ULONG attrsonly, PLDAPControlA *serverctrls, PLDAPControlA *clientctrls, ULONG timelimit, ULONG sizelimit, ULONG *message ) { ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED; #ifdef HAVE_LDAP WCHAR *baseW = NULL, *filterW = NULL, **attrsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; ret = WLDAP32_LDAP_NO_MEMORY; TRACE( "(%p, %s, 0x%08x, %s, %p, 0x%08x, %p, %p, 0x%08x, 0x%08x, %p)\n", ld, debugstr_a(base), scope, debugstr_a(filter), attrs, attrsonly, serverctrls, clientctrls, timelimit, sizelimit, message ); if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (base) { baseW = strAtoW( base ); if (!baseW) goto exit; } if (filter) { filterW = strAtoW( filter ); if (!filterW) goto exit; } if (attrs) { attrsW = strarrayAtoW( attrs ); if (!attrsW) goto exit; } if (serverctrls) { serverctrlsW = controlarrayAtoW( serverctrls ); if (!serverctrlsW) goto exit; } if (clientctrls) { clientctrlsW = controlarrayAtoW( clientctrls ); if (!clientctrlsW) goto exit; } ret = ldap_search_extW( ld, baseW, scope, filterW, attrsW, attrsonly, serverctrlsW, clientctrlsW, timelimit, sizelimit, message ); exit: strfreeW( baseW ); strfreeW( filterW ); strarrayfreeW( attrsW ); controlarrayfreeW( serverctrlsW ); controlarrayfreeW( clientctrlsW ); #endif return ret; }
/*********************************************************************** * ldap_compare_extA (WLDAP32.@) * * See ldap_compare_extW. */ ULONG CDECL ldap_compare_extA( WLDAP32_LDAP *ld, PCHAR dn, PCHAR attr, PCHAR value, struct WLDAP32_berval *data, PLDAPControlA *serverctrls, PLDAPControlA *clientctrls, ULONG *message ) { ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED; #ifdef HAVE_LDAP WCHAR *dnW = NULL, *attrW = NULL, *valueW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; ret = WLDAP32_LDAP_NO_MEMORY; TRACE( "(%p, %s, %s, %s, %p, %p, %p, %p)\n", ld, debugstr_a(dn), debugstr_a(attr), debugstr_a(value), data, serverctrls, clientctrls, message ); if (!ld || !message) return WLDAP32_LDAP_PARAM_ERROR; if (dn) { dnW = strAtoW( dn ); if (!dnW) goto exit; } if (attr) { attrW = strAtoW( attr ); if (!attrW) goto exit; } if (value) { valueW = strAtoW( value ); if (!valueW) goto exit; } if (serverctrls) { serverctrlsW = controlarrayAtoW( serverctrls ); if (!serverctrlsW) goto exit; } if (clientctrls) { clientctrlsW = controlarrayAtoW( clientctrls ); if (!clientctrlsW) goto exit; } ret = ldap_compare_extW( ld, dnW, attrW, valueW, data, serverctrlsW, clientctrlsW, message ); exit: strfreeW( dnW ); strfreeW( attrW ); strfreeW( valueW ); controlarrayfreeW( serverctrlsW ); controlarrayfreeW( clientctrlsW ); #endif return ret; }
INT CDECL ldap_parse_vlv_controlA( WLDAP32_LDAP *ld, PLDAPControlA *control, PULONG targetpos, PULONG listcount, struct WLDAP32_berval **context, PINT errcode ) { int ret = LDAP_NOT_SUPPORTED; #ifdef HAVE_LDAP LDAPControlW **controlW = NULL; TRACE( "(%p, %p, %p, %p, %p, %p)\n", ld, control, targetpos, listcount, context, errcode ); if (!ld) return ~0UL; if (control) { controlW = controlarrayAtoW( control ); if (!controlW) return WLDAP32_LDAP_NO_MEMORY; } ret = ldap_parse_vlv_controlW( ld, controlW, targetpos, listcount, context, errcode ); controlarrayfreeW( controlW ); #endif return ret; }
ULONG CDECL ldap_parse_sort_controlA( WLDAP32_LDAP *ld, PLDAPControlA *control, ULONG *result, PCHAR *attr ) { ULONG ret = LDAP_NOT_SUPPORTED; #ifdef HAVE_LDAP WCHAR *attrW = NULL; LDAPControlW **controlW = NULL; TRACE( "(%p, %p, %p, %p)\n", ld, control, result, attr ); if (!ld) return ~0UL; if (control) { controlW = controlarrayAtoW( control ); if (!controlW) return WLDAP32_LDAP_NO_MEMORY; } ret = ldap_parse_sort_controlW( ld, controlW, result, &attrW ); *attr = strWtoA( attrW ); controlarrayfreeW( controlW ); #endif return ret; }
/*********************************************************************** * ldap_extended_operation_sA (WLDAP32.@) * * See ldap_extended_operation_sW. */ ULONG CDECL ldap_extended_operation_sA( WLDAP32_LDAP *ld, PCHAR oid, struct WLDAP32_berval *data, PLDAPControlA *serverctrls, PLDAPControlA *clientctrls, PCHAR *retoid, struct WLDAP32_berval **retdata ) { ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED; #ifdef HAVE_LDAP WCHAR *oidW = NULL, *retoidW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; ret = WLDAP32_LDAP_NO_MEMORY; TRACE( "(%p, %s, %p, %p, %p, %p, %p)\n", ld, debugstr_a(oid), data, serverctrls, clientctrls, retoid, retdata ); if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (oid) { oidW = strAtoW( oid ); if (!oidW) goto exit; } if (serverctrls) { serverctrlsW = controlarrayAtoW( serverctrls ); if (!serverctrlsW) goto exit; } if (clientctrls) { clientctrlsW = controlarrayAtoW( clientctrls ); if (!clientctrlsW) goto exit; } ret = ldap_extended_operation_sW( ld, oidW, data, serverctrlsW, clientctrlsW, &retoidW, retdata ); if (retoid && retoidW) { *retoid = strWtoA( retoidW ); if (!*retoid) ret = WLDAP32_LDAP_NO_MEMORY; ldap_memfreeW( retoidW ); } exit: strfreeW( oidW ); controlarrayfreeW( serverctrlsW ); controlarrayfreeW( clientctrlsW ); #endif return ret; }
/*********************************************************************** * ldap_add_ext_sA (WLDAP32.@) * * See ldap_add_ext_sW. */ ULONG CDECL ldap_add_ext_sA( WLDAP32_LDAP *ld, PCHAR dn, LDAPModA *attrs[], PLDAPControlA *serverctrls, PLDAPControlA *clientctrls ) { ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED; #ifdef HAVE_LDAP WCHAR *dnW = NULL; LDAPModW **attrsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; ret = WLDAP32_LDAP_NO_MEMORY; TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_a(dn), attrs, serverctrls, clientctrls ); if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (dn) { dnW = strAtoW( dn ); if (!dnW) goto exit; } if (attrs) { attrsW = modarrayAtoW( attrs ); if (!attrsW) goto exit; } if (serverctrls) { serverctrlsW = controlarrayAtoW( serverctrls ); if (!serverctrlsW) goto exit; } if (clientctrls) { clientctrlsW = controlarrayAtoW( clientctrls ); if (!clientctrlsW) goto exit; } ret = ldap_add_ext_sW( ld, dnW, attrsW, serverctrlsW, clientctrlsW ); exit: strfreeW( dnW ); modarrayfreeW( attrsW ); controlarrayfreeW( serverctrlsW ); controlarrayfreeW( clientctrlsW ); #endif return ret; }
/*********************************************************************** * ldap_modify_extA (WLDAP32.@) * * See ldap_modify_extW. */ ULONG CDECL ldap_modify_extA( WLDAP32_LDAP *ld, PCHAR dn, LDAPModA *mods[], PLDAPControlA *serverctrls, PLDAPControlA *clientctrls, ULONG *message ) { ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED; #ifdef HAVE_LDAP WCHAR *dnW = NULL; LDAPModW **modsW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; ret = WLDAP32_LDAP_NO_MEMORY; TRACE( "(%p, %s, %p, %p, %p, %p)\n", ld, debugstr_a(dn), mods, serverctrls, clientctrls, message ); if (!ld) return ~0u; if (dn) { dnW = strAtoW( dn ); if (!dnW) goto exit; } if (mods) { modsW = modarrayAtoW( mods ); if (!modsW) goto exit; } if (serverctrls) { serverctrlsW = controlarrayAtoW( serverctrls ); if (!serverctrlsW) goto exit; } if (clientctrls) { clientctrlsW = controlarrayAtoW( clientctrls ); if (!clientctrlsW) goto exit; } ret = ldap_modify_extW( ld, dnW, modsW, serverctrlsW, clientctrlsW, message ); exit: strfreeW( dnW ); modarrayfreeW( modsW ); controlarrayfreeW( serverctrlsW ); controlarrayfreeW( clientctrlsW ); #endif return ret; }
/*********************************************************************** * ldap_sasl_bind_sA (WLDAP32.@) * * See ldap_sasl_bind_sW. */ ULONG CDECL ldap_sasl_bind_sA( WLDAP32_LDAP *ld, const PCHAR dn, const PCHAR mechanism, const BERVAL *cred, PLDAPControlA *serverctrls, PLDAPControlA *clientctrls, PBERVAL *serverdata ) { ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED; #ifdef HAVE_LDAP WCHAR *dnW, *mechanismW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; ret = WLDAP32_LDAP_NO_MEMORY; TRACE( "(%p, %s, %s, %p, %p, %p, %p)\n", ld, debugstr_a(dn), debugstr_a(mechanism), cred, serverctrls, clientctrls, serverdata ); if (!ld || !dn || !mechanism || !cred || !serverdata) return WLDAP32_LDAP_PARAM_ERROR; dnW = strAtoW( dn ); if (!dnW) goto exit; mechanismW = strAtoW( mechanism ); if (!mechanismW) goto exit; if (serverctrls) { serverctrlsW = controlarrayAtoW( serverctrls ); if (!serverctrlsW) goto exit; } if (clientctrls) { clientctrlsW = controlarrayAtoW( clientctrls ); if (!clientctrlsW) goto exit; } ret = ldap_sasl_bind_sW( ld, dnW, mechanismW, cred, serverctrlsW, clientctrlsW, serverdata ); exit: strfreeW( dnW ); strfreeW( mechanismW ); controlarrayfreeW( serverctrlsW ); controlarrayfreeW( clientctrlsW ); #endif return ret; }
/*********************************************************************** * ldap_extended_operationA (WLDAP32.@) * * See ldap_extended_operationW. */ ULONG CDECL ldap_extended_operationA( WLDAP32_LDAP *ld, PCHAR oid, struct WLDAP32_berval *data, PLDAPControlA *serverctrls, PLDAPControlA *clientctrls, ULONG *message ) { ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED; #ifdef HAVE_LDAP WCHAR *oidW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; ret = WLDAP32_LDAP_NO_MEMORY; TRACE( "(%p, %s, %p, %p, %p, %p)\n", ld, debugstr_a(oid), data, serverctrls, clientctrls, message ); if (!ld || !message) return WLDAP32_LDAP_PARAM_ERROR; if (oid) { oidW = strAtoW( oid ); if (!oidW) goto exit; } if (serverctrls) { serverctrlsW = controlarrayAtoW( serverctrls ); if (!serverctrlsW) goto exit; } if (clientctrls) { clientctrlsW = controlarrayAtoW( clientctrls ); if (!clientctrlsW) goto exit; } ret = ldap_extended_operationW( ld, oidW, data, serverctrlsW, clientctrlsW, message ); exit: strfreeW( oidW ); controlarrayfreeW( serverctrlsW ); controlarrayfreeW( clientctrlsW ); #endif return ret; }
/*********************************************************************** * ldap_delete_extA (WLDAP32.@) * * See ldap_delete_extW. */ ULONG CDECL ldap_delete_extA( WLDAP32_LDAP *ld, PCHAR dn, PLDAPControlA *serverctrls, PLDAPControlA *clientctrls, ULONG *message ) { ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED; #ifdef HAVE_LDAP WCHAR *dnW = NULL; LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL; TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_a(dn), serverctrls, clientctrls, message ); ret = WLDAP32_LDAP_NO_MEMORY; if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (dn) { dnW = strAtoW( dn ); if (!dnW) goto exit; } if (serverctrls) { serverctrlsW = controlarrayAtoW( serverctrls ); if (!serverctrlsW) goto exit; } if (clientctrls) { clientctrlsW = controlarrayAtoW( clientctrls ); if (!clientctrlsW) goto exit; } ret = ldap_delete_extW( ld, dnW, serverctrlsW, clientctrlsW, message ); exit: strfreeW( dnW ); controlarrayfreeW( serverctrlsW ); controlarrayfreeW( clientctrlsW ); #endif return ret; }
/*********************************************************************** * ldap_parse_page_controlA (WLDAP32.@) */ ULONG CDECL ldap_parse_page_controlA( WLDAP32_LDAP *ld, PLDAPControlA *ctrls, ULONG *count, struct WLDAP32_berval **cookie ) { ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED; #ifdef HAVE_LDAP LDAPControlW **ctrlsW = NULL; TRACE( "(%p, %p, %p, %p)\n", ld, ctrls, count, cookie ); if (!ld || !ctrls || !count || !cookie) return WLDAP32_LDAP_PARAM_ERROR; ctrlsW = controlarrayAtoW( ctrls ); if (!ctrlsW) return WLDAP32_LDAP_NO_MEMORY; ret = ldap_parse_page_controlW( ld, ctrlsW, count, cookie ); controlarrayfreeW( ctrlsW ); #endif return ret; }
/*********************************************************************** * ldap_set_optionA (WLDAP32.@) * * See ldap_set_optionW. */ ULONG CDECL ldap_set_optionA( WLDAP32_LDAP *ld, int option, void *value ) { ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED; #ifdef HAVE_LDAP TRACE( "(%p, 0x%08x, %p)\n", ld, option, value ); if (!ld) return WLDAP32_LDAP_PARAM_ERROR; switch (option) { case WLDAP32_LDAP_OPT_SERVER_CONTROLS: { LDAPControlW **ctrlsW; ctrlsW = controlarrayAtoW( value ); if (!ctrlsW) return WLDAP32_LDAP_NO_MEMORY; ret = ldap_set_optionW( ld, option, ctrlsW ); controlarrayfreeW( ctrlsW ); return ret; } case WLDAP32_LDAP_OPT_DEREF: case WLDAP32_LDAP_OPT_DESC: case WLDAP32_LDAP_OPT_ERROR_NUMBER: case WLDAP32_LDAP_OPT_PROTOCOL_VERSION: case WLDAP32_LDAP_OPT_REFERRALS: case WLDAP32_LDAP_OPT_SIZELIMIT: case WLDAP32_LDAP_OPT_TIMELIMIT: return ldap_set_optionW( ld, option, value ); case WLDAP32_LDAP_OPT_CACHE_ENABLE: case WLDAP32_LDAP_OPT_CACHE_FN_PTRS: case WLDAP32_LDAP_OPT_CACHE_STRATEGY: case WLDAP32_LDAP_OPT_IO_FN_PTRS: case WLDAP32_LDAP_OPT_REBIND_ARG: case WLDAP32_LDAP_OPT_REBIND_FN: case WLDAP32_LDAP_OPT_RESTART: case WLDAP32_LDAP_OPT_THREAD_FN_PTRS: return WLDAP32_LDAP_LOCAL_ERROR; case WLDAP32_LDAP_OPT_API_FEATURE_INFO: case WLDAP32_LDAP_OPT_API_INFO: return WLDAP32_LDAP_UNWILLING_TO_PERFORM; case WLDAP32_LDAP_OPT_AREC_EXCLUSIVE: case WLDAP32_LDAP_OPT_AUTO_RECONNECT: case WLDAP32_LDAP_OPT_CLIENT_CERTIFICATE: case WLDAP32_LDAP_OPT_DNSDOMAIN_NAME: case WLDAP32_LDAP_OPT_ENCRYPT: case WLDAP32_LDAP_OPT_ERROR_STRING: case WLDAP32_LDAP_OPT_FAST_CONCURRENT_BIND: case WLDAP32_LDAP_OPT_GETDSNAME_FLAGS: case WLDAP32_LDAP_OPT_HOST_NAME: case WLDAP32_LDAP_OPT_HOST_REACHABLE: case WLDAP32_LDAP_OPT_PING_KEEP_ALIVE: case WLDAP32_LDAP_OPT_PING_LIMIT: case WLDAP32_LDAP_OPT_PING_WAIT_TIME: case WLDAP32_LDAP_OPT_PROMPT_CREDENTIALS: case WLDAP32_LDAP_OPT_REF_DEREF_CONN_PER_MSG: case WLDAP32_LDAP_OPT_REFERRAL_CALLBACK: case WLDAP32_LDAP_OPT_REFERRAL_HOP_LIMIT: case WLDAP32_LDAP_OPT_ROOTDSE_CACHE: case WLDAP32_LDAP_OPT_SASL_METHOD: case WLDAP32_LDAP_OPT_SECURITY_CONTEXT: case WLDAP32_LDAP_OPT_SEND_TIMEOUT: case WLDAP32_LDAP_OPT_SERVER_CERTIFICATE: case WLDAP32_LDAP_OPT_SERVER_ERROR: case WLDAP32_LDAP_OPT_SERVER_EXT_ERROR: case WLDAP32_LDAP_OPT_SIGN: case WLDAP32_LDAP_OPT_SSL: case WLDAP32_LDAP_OPT_SSL_INFO: case WLDAP32_LDAP_OPT_SSPI_FLAGS: case WLDAP32_LDAP_OPT_TCP_KEEPALIVE: FIXME( "Unsupported option: 0x%02x\n", option ); return WLDAP32_LDAP_NOT_SUPPORTED; default: FIXME( "Unknown option: 0x%02x\n", option ); return WLDAP32_LDAP_LOCAL_ERROR; } #endif return ret; }