diff --git a/dlls/wldap32/ber.c b/dlls/wldap32/ber.c index e99202b1d7c..53534982798 100644 --- a/dlls/wldap32/ber.c +++ b/dlls/wldap32/ber.c @@ -20,72 +20,159 @@ #include "config.h" -#ifndef HAVE_LDAP - #include #include "windef.h" #include "winbase.h" #include "winldap.h" -#define LBER_ERROR (~0U) +#ifndef LBER_ERROR +# define LBER_ERROR (~0U) +#endif -BerElement *ber_alloc_t( INT options ) +/*********************************************************************** + * ber_alloc_t (WLDAP32.@) + */ +BerElement *WLDAP32_ber_alloc_t( INT options ) { +#ifdef HAVE_LDAP + return ber_alloc_t( options ); +#else return NULL; +#endif } -BERVAL *ber_bvdup( BERVAL *berval ) + +/*********************************************************************** + * ber_bvdup (WLDAP32.@) + */ +BERVAL *WLDAP32_ber_bvdup( BERVAL *berval ) { +#ifdef HAVE_LDAP + return ber_bvdup( berval ); +#else return NULL; +#endif } -void ber_bvecfree( PBERVAL *berval ) + +/*********************************************************************** + * ber_bvecfree (WLDAP32.@) + */ +void WLDAP32_ber_bvecfree( PBERVAL *berval ) { +#ifdef HAVE_LDAP + ber_bvecfree( berval ); +#endif } -void ber_bvfree( BERVAL *berval ) + +/*********************************************************************** + * ber_bvfree (WLDAP32.@) + */ +void WLDAP32_ber_bvfree( BERVAL *berval ) { +#ifdef HAVE_LDAP + ber_bvfree( berval ); +#endif } -ULONG ber_first_element( BerElement *berelement, ULONG *len, CHAR **opaque ) + +/*********************************************************************** + * ber_first_element (WLDAP32.@) + */ +ULONG WLDAP32_ber_first_element( BerElement *berelement, ULONG *len, CHAR **opaque ) { +#ifdef HAVE_LDAP + return ber_first_element( berelement, len, opaque ); +#else return LBER_ERROR; +#endif } -INT ber_flatten( BerElement *berelement, PBERVAL *berval ) + +/*********************************************************************** + * ber_flatten (WLDAP32.@) + */ +INT WLDAP32_ber_flatten( BerElement *berelement, PBERVAL *berval ) { +#ifdef HAVE_LDAP + return ber_flatten( berelement, berval ); +#else return LBER_ERROR; +#endif } -void ber_free( BerElement *berelement, INT buf ) + +/*********************************************************************** + * ber_free (WLDAP32.@) + */ +void WLDAP32_ber_free( BerElement *berelement, INT buf ) { +#ifdef HAVE_LDAP + ber_free( berelement, buf ); +#endif } -BerElement *ber_init( BERVAL *berval ) + +/*********************************************************************** + * ber_init (WLDAP32.@) + */ +BerElement *WLDAP32_ber_init( BERVAL *berval ) { +#ifdef HAVE_LDAP + return ber_init( berval ); +#else return NULL; +#endif } -ULONG ber_next_element( BerElement *berelement, ULONG *len, CHAR *opaque ) + +/*********************************************************************** + * ber_next_element (WLDAP32.@) + */ +ULONG WLDAP32_ber_next_element( BerElement *berelement, ULONG *len, CHAR *opaque ) { +#ifdef HAVE_LDAP + return ber_next_element( berelement, len, opaque ); +#else return LBER_ERROR; +#endif } -ULONG ber_peek_tag( BerElement *berelement, ULONG *len ) + +/*********************************************************************** + * ber_peek_tag (WLDAP32.@) + */ +ULONG WLDAP32_ber_peek_tag( BerElement *berelement, ULONG *len ) { +#ifdef HAVE_LDAP + return ber_peek_tag( berelement, len ); +#else return LBER_ERROR; +#endif } + +/*********************************************************************** + * ber_skip_tag (WLDAP32.@) + */ +ULONG WLDAP32_ber_skip_tag( BerElement *berelement, ULONG *len ) +{ +#ifdef HAVE_LDAP + return ber_skip_tag( berelement, len ); +#else + return LBER_ERROR; +#endif +} + + +#ifndef HAVE_LDAP + INT ber_printf( BerElement *berelement, PCHAR fmt, ... ) { return LBER_ERROR; } -ULONG ber_skip_tag( BerElement *berelement, ULONG *len ) -{ - return LBER_ERROR; -} - INT ber_scanf( BerElement *berelement, PCHAR fmt, ... ) { return LBER_ERROR; diff --git a/dlls/wldap32/wldap32.spec b/dlls/wldap32/wldap32.spec index 180c44457c9..93d4b188002 100644 --- a/dlls/wldap32/wldap32.spec +++ b/dlls/wldap32/wldap32.spec @@ -41,7 +41,7 @@ 51 cdecl ldap_search_st(ptr str long str ptr long ptr ptr) ldap_search_stA 52 cdecl ldap_compare_s(ptr str str str) ldap_compare_sA 53 cdecl LdapUnicodeToUTF8(wstr long ptr long) - 54 cdecl ber_bvfree(ptr) + 54 cdecl ber_bvfree(ptr) WLDAP32_ber_bvfree 55 cdecl cldap_openA(str long) 56 cdecl ldap_addA(ptr str ptr) 57 cdecl ldap_add_ext(ptr str ptr ptr ptr ptr) ldap_add_extA @@ -215,16 +215,16 @@ 230 cdecl ldap_check_filterA(ptr str) 231 cdecl ldap_check_filterW(ptr wstr) 232 cdecl ldap_dn2ufnA(str) -300 cdecl ber_init(ptr) -301 cdecl ber_free(ptr long) -302 cdecl ber_bvecfree(ptr) -303 cdecl ber_bvdup(ptr) -304 cdecl ber_alloc_t(long) -305 cdecl ber_skip_tag(ptr ptr) -306 cdecl ber_peek_tag(ptr ptr) -307 cdecl ber_first_element(ptr ptr ptr) -308 cdecl ber_next_element(ptr ptr ptr) -309 cdecl ber_flatten(ptr ptr) +300 cdecl ber_init(ptr) WLDAP32_ber_init +301 cdecl ber_free(ptr long) WLDAP32_ber_free +302 cdecl ber_bvecfree(ptr) WLDAP32_ber_bvecfree +303 cdecl ber_bvdup(ptr) WLDAP32_ber_bvdup +304 cdecl ber_alloc_t(long) WLDAP32_ber_alloc_t +305 cdecl ber_skip_tag(ptr ptr) WLDAP32_ber_skip_tag +306 cdecl ber_peek_tag(ptr ptr) WLDAP32_ber_peek_tag +307 cdecl ber_first_element(ptr ptr ptr) WLDAP32_ber_first_element +308 cdecl ber_next_element(ptr ptr ptr) WLDAP32_ber_next_element +309 cdecl ber_flatten(ptr ptr) WLDAP32_ber_flatten 310 varargs ber_printf(ptr str) 311 varargs ber_scanf(ptr str) 312 cdecl ldap_conn_from_msg(ptr ptr)