From abb5d46d889eb93dad4d5f704453d2d724359386 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Mon, 21 Nov 2005 13:33:37 +0000 Subject: [PATCH] Implement ldap_create_vlv_control{A,W}, ldap_encode_sort_control{A,W}. Add a stub for ldap_create_page_control{A,W}. --- dlls/wldap32/control.c | 68 ++++++++++++++++++++++++++++++++++ dlls/wldap32/winldap_private.h | 16 ++++++++ dlls/wldap32/wldap32.spec | 14 +++---- 3 files changed, 91 insertions(+), 7 deletions(-) diff --git a/dlls/wldap32/control.c b/dlls/wldap32/control.c index e8176be419b..82cdc0bfbc4 100644 --- a/dlls/wldap32/control.c +++ b/dlls/wldap32/control.c @@ -89,6 +89,22 @@ ULONG ldap_controls_freeW( LDAPControlW **controls ) return ret; } +ULONG ldap_create_page_controlA( WLDAP32_LDAP *ld, ULONG pagesize, + struct WLDAP32_berval *cookie, UCHAR critical, PLDAPControlA *control ) +{ + FIXME( "(%p, 0x%08lx, %p, 0x%02x, %p)\n", ld, pagesize, cookie, + critical, control ); + return LDAP_NOT_SUPPORTED; +} + +ULONG ldap_create_page_controlW( WLDAP32_LDAP *ld, ULONG pagesize, + struct WLDAP32_berval *cookie, UCHAR critical, PLDAPControlW *control ) +{ + FIXME( "(%p, 0x%08lx, %p, 0x%02x, %p)\n", ld, pagesize, cookie, + critical, control ); + return LDAP_NOT_SUPPORTED; +} + ULONG ldap_create_sort_controlA( WLDAP32_LDAP *ld, PLDAPSortKeyA *sortkey, UCHAR critical, PLDAPControlA *control ) { @@ -145,6 +161,58 @@ ULONG ldap_create_sort_controlW( WLDAP32_LDAP *ld, PLDAPSortKeyW *sortkey, return ret; } +INT ldap_create_vlv_controlA( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info, + char critical, LDAPControlA **control ) +{ + INT ret = LDAP_NOT_SUPPORTED; +#ifdef HAVE_LDAP + LDAPControlW **controlW = NULL; + + TRACE( "(%p, %p, 0x%02x, %p)\n", ld, info, critical, control ); + + if (!ld) return ~0UL; + + ret = ldap_create_vlv_controlW( ld, info, critical, controlW ); + + *control = controlWtoA( *controlW ); + ldap_control_freeW( *controlW ); + +#endif + return ret; +} + +INT ldap_create_vlv_controlW( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info, + char critical, LDAPControlW **control ) +{ + INT ret = LDAP_NOT_SUPPORTED; +#ifdef HAVE_LDAP + LDAPControl **controlU = NULL; + + TRACE( "(%p, %p, 0x%02x, %p)\n", ld, info, critical, control ); + + if (!ld) return ~0UL; + + ret = ldap_create_vlv_control( ld, (LDAPVLVInfo *)info, controlU ); + + *control = controlUtoW( *controlU ); + ldap_control_free( *controlU ); + +#endif + return ret; +} + +ULONG ldap_encode_sort_controlA( WLDAP32_LDAP *ld, PLDAPSortKeyA *sortkeys, + PLDAPControlA control, BOOLEAN critical ) +{ + return ldap_create_sort_controlA( ld, sortkeys, critical, &control ); +} + +ULONG ldap_encode_sort_controlW( WLDAP32_LDAP *ld, PLDAPSortKeyW *sortkeys, + PLDAPControlW control, BOOLEAN critical ) +{ + return ldap_create_sort_controlW( ld, sortkeys, critical, &control ); +} + ULONG ldap_free_controlsA( LDAPControlA **controls ) { return ldap_controls_freeA( controls ); diff --git a/dlls/wldap32/winldap_private.h b/dlls/wldap32/winldap_private.h index 8f995e3c196..2ec256d5a97 100644 --- a/dlls/wldap32/winldap_private.h +++ b/dlls/wldap32/winldap_private.h @@ -187,6 +187,18 @@ typedef struct ldapcontrolW BOOLEAN ldctl_iscritical; } LDAPControlW, *PLDAPControlW; +typedef struct WLDAP32_ldapvlvinfo +{ + int ldvlv_version; + ULONG ldvlv_before_count; + ULONG ldvlv_after_count; + ULONG ldvlv_offset; + ULONG ldvlv_count; + PBERVAL ldvlv_attrvalue; + PBERVAL ldvlv_context; + VOID *ldvlv_extradata; +} WLDAP32_LDAPVLVInfo, *WLDAP32_PLDAPVLVInfo; + typedef struct ldapsearch LDAPSearch, *PLDAPSearch; typedef struct ldapsortkeyA @@ -275,8 +287,12 @@ ULONG WLDAP32_ldap_count_references(WLDAP32_LDAP*,WLDAP32_LDAPMessage*); ULONG ldap_count_valuesA(PCHAR*); ULONG ldap_count_valuesW(PWCHAR*); ULONG WLDAP32_ldap_count_values_len(PBERVAL*); +ULONG ldap_create_page_controlA(WLDAP32_PLDAP,ULONG,struct WLDAP32_berval*,UCHAR,PLDAPControlA*); +ULONG ldap_create_page_controlW(WLDAP32_PLDAP,ULONG,struct WLDAP32_berval*,UCHAR,PLDAPControlW*); ULONG ldap_create_sort_controlA(WLDAP32_PLDAP,PLDAPSortKeyA*,UCHAR,PLDAPControlA*); ULONG ldap_create_sort_controlW(WLDAP32_PLDAP,PLDAPSortKeyW*,UCHAR,PLDAPControlW*); +INT ldap_create_vlv_controlA(WLDAP32_LDAP*,WLDAP32_LDAPVLVInfo*,char,LDAPControlA**); +INT ldap_create_vlv_controlW(WLDAP32_LDAP*,WLDAP32_LDAPVLVInfo*,char,LDAPControlW**); ULONG ldap_deleteA(WLDAP32_LDAP*,PCHAR); ULONG ldap_deleteW(WLDAP32_LDAP*,PWCHAR); ULONG ldap_delete_extA(WLDAP32_LDAP*,PCHAR,PLDAPControlA*,PLDAPControlA*,ULONG*); diff --git a/dlls/wldap32/wldap32.spec b/dlls/wldap32/wldap32.spec index 48ebc28732e..3e9e8a15f6b 100644 --- a/dlls/wldap32/wldap32.spec +++ b/dlls/wldap32/wldap32.spec @@ -85,9 +85,9 @@ 95 cdecl ldap_count_references(ptr ptr) WLDAP32_ldap_count_references 96 cdecl ldap_count_valuesA(ptr) 97 cdecl ldap_count_valuesW(ptr) - 98 stub ldap_create_page_control - 99 stub ldap_create_page_controlA -100 stub ldap_create_page_controlW + 98 cdecl ldap_create_page_control(ptr long ptr long ptr) ldap_create_page_controlA + 99 cdecl ldap_create_page_controlA(ptr long ptr long ptr) +100 cdecl ldap_create_page_controlW(ptr long ptr long ptr) 101 cdecl ldap_create_sort_control(ptr ptr long ptr) ldap_create_sort_controlA 102 cdecl ldap_create_sort_controlA(ptr ptr long ptr) 103 cdecl ldap_create_sort_controlW(ptr ptr long ptr) @@ -102,8 +102,8 @@ 112 cdecl ldap_delete_sA(ptr str) 113 cdecl ldap_delete_sW(ptr wstr) 114 cdecl ldap_dn2ufnW(wstr) -115 stub ldap_encode_sort_controlA -116 stub ldap_encode_sort_controlW +115 cdecl ldap_encode_sort_controlA(ptr ptr ptr long) +116 cdecl ldap_encode_sort_controlW(ptr ptr ptr long) 117 cdecl ldap_err2stringA(long) 118 cdecl ldap_err2stringW(long) 119 cdecl ldap_escape_filter_elementA(str long ptr long) @@ -234,8 +234,8 @@ 316 cdecl ldap_sasl_bind_sA(ptr str str ptr ptr ptr ptr) 317 stub ldap_parse_extended_resultW 318 stub ldap_parse_extended_resultA -319 stub ldap_create_vlv_controlW -320 stub ldap_create_vlv_controlA +319 cdecl ldap_create_vlv_controlW(ptr ptr long ptr) +320 cdecl ldap_create_vlv_controlA(ptr ptr long ptr) 321 stub ldap_parse_vlv_controlW 322 stub ldap_parse_vlv_controlA 329 cdecl ldap_start_tls_sW(ptr ptr ptr ptr ptr)