Commit 274e3991 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wldap32: Move support for parse functions to the Unix library.

parent d9c5b213
......@@ -338,6 +338,11 @@ void CDECL wrap_ldap_control_free( LDAPControlU *control )
ldap_control_free( (LDAPControl *)control );
}
void CDECL wrap_ldap_controls_free( LDAPControlU **control )
{
ldap_controls_free( (LDAPControl **)control );
}
int CDECL wrap_ldap_count_entries( void *ld, void *chain )
{
return ldap_count_entries( ld, chain );
......@@ -481,12 +486,34 @@ void * CDECL wrap_ldap_next_reference( void *ld, void *entry )
return ldap_next_reference( ld, entry );
}
int CDECL wrap_ldap_parse_extended_result( void *ld, void *result, char **retoid, struct bervalU **retdata, int free )
{
return ldap_parse_extended_result( ld, result, retoid, (struct berval **)retdata, free );
}
int CDECL wrap_ldap_parse_reference( void *ld, void *ref, char ***referrals, LDAPControlU ***serverctrls, int free )
{
return ldap_parse_reference( ld, ref, referrals, (LDAPControl ***)serverctrls, free );
}
int CDECL wrap_ldap_parse_result( void *ld, void *res, int *errcode, char **matcheddn, char **errmsg,
char ***referrals, LDAPControlU ***serverctrls, int free )
{
return ldap_parse_result( ld, res, errcode, matcheddn, errmsg, referrals, (LDAPControl ***)serverctrls, free );
}
int CDECL wrap_ldap_parse_sortresponse_control( void *ld, LDAPControlU *ctrl, int *result, char **attr )
{
return ldap_parse_sortresponse_control( ld, (LDAPControl *)ctrl, result, attr );
}
int CDECL wrap_ldap_parse_vlvresponse_control( void *ld, LDAPControlU *ctrls, int *target_pos, int *list_count,
struct bervalU **ctx, int *errcode )
{
return ldap_parse_vlvresponse_control( ld, (LDAPControl *)ctrls, target_pos, list_count, (struct berval **)ctx,
errcode );
}
int CDECL wrap_ldap_rename( void *ld, const char *dn, const char *newrdn, const char *newparent, int delete,
LDAPControlU **clientctrls, LDAPControlU **serverctrls, ULONG *msg )
{
......@@ -598,6 +625,7 @@ static const struct ldap_funcs funcs =
wrap_ldap_compare_ext,
wrap_ldap_compare_ext_s,
wrap_ldap_control_free,
wrap_ldap_controls_free,
wrap_ldap_count_entries,
wrap_ldap_count_references,
wrap_ldap_count_values_len,
......@@ -624,7 +652,11 @@ static const struct ldap_funcs funcs =
wrap_ldap_next_attribute,
wrap_ldap_next_entry,
wrap_ldap_next_reference,
wrap_ldap_parse_extended_result,
wrap_ldap_parse_reference,
wrap_ldap_parse_result,
wrap_ldap_parse_sortresponse_control,
wrap_ldap_parse_vlvresponse_control,
wrap_ldap_rename,
wrap_ldap_rename_s,
wrap_ldap_result,
......
......@@ -123,6 +123,7 @@ extern int CDECL wrap_ldap_compare_ext(void *, const char *, const char *, struc
extern int CDECL wrap_ldap_compare_ext_s(void *, const char *, const char *, struct bervalU *, LDAPControlU **,
LDAPControlU **) DECLSPEC_HIDDEN;
extern void CDECL wrap_ldap_control_free(LDAPControlU *) DECLSPEC_HIDDEN;
extern void CDECL wrap_ldap_controls_free(LDAPControlU **) DECLSPEC_HIDDEN;
extern int CDECL wrap_ldap_count_entries(void *, void *) DECLSPEC_HIDDEN;
extern int CDECL wrap_ldap_count_references(void *, void *) DECLSPEC_HIDDEN;
extern int CDECL wrap_ldap_count_values_len(struct bervalU **) DECLSPEC_HIDDEN;
......@@ -153,8 +154,13 @@ extern int CDECL wrap_ldap_msgfree(void *) DECLSPEC_HIDDEN;
extern char * CDECL wrap_ldap_next_attribute(void *, void *, void *) DECLSPEC_HIDDEN;
extern void * CDECL wrap_ldap_next_entry(void *, void *) DECLSPEC_HIDDEN;
extern void * CDECL wrap_ldap_next_reference(void *, void *) DECLSPEC_HIDDEN;
extern int CDECL wrap_ldap_parse_extended_result(void *, void *, char **, struct bervalU **, int) DECLSPEC_HIDDEN;
extern int CDECL wrap_ldap_parse_reference(void *, void *, char ***, LDAPControlU ***, int) DECLSPEC_HIDDEN;
extern int CDECL wrap_ldap_parse_result(void *, void *, int *, char **, char **, char ***, LDAPControlU ***,
int) DECLSPEC_HIDDEN;
extern int CDECL wrap_ldap_parse_sortresponse_control(void *, LDAPControlU *, int *, char **) DECLSPEC_HIDDEN;
extern int CDECL wrap_ldap_parse_vlvresponse_control(void *, LDAPControlU *, int *, int *, struct bervalU **,
int *) DECLSPEC_HIDDEN;
extern int CDECL wrap_ldap_rename(void *, const char *, const char *, const char *, int, LDAPControlU **,
LDAPControlU **, ULONG *) DECLSPEC_HIDDEN;
extern int CDECL wrap_ldap_rename_s(void *, const char *, const char *, const char *, int, LDAPControlU **,
......@@ -199,6 +205,7 @@ struct ldap_funcs
int (CDECL *ldap_compare_ext_s)(void *, const char *, const char *, struct bervalU *, LDAPControlU **,
LDAPControlU **);
void (CDECL *ldap_control_free)(LDAPControlU *);
void (CDECL *ldap_controls_free)(LDAPControlU **);
int (CDECL *ldap_count_entries)(void *, void *);
int (CDECL *ldap_count_references)(void *, void *);
int (CDECL *ldap_count_values_len)(struct bervalU **);
......@@ -227,7 +234,11 @@ struct ldap_funcs
char * (CDECL *ldap_next_attribute)(void *, void *, void *);
void * (CDECL *ldap_next_entry)(void *, void *);
void * (CDECL *ldap_next_reference)(void *, void *);
int (CDECL *ldap_parse_extended_result)(void *, void *, char **, struct bervalU **, int);
int (CDECL *ldap_parse_reference)(void *, void *, char ***, LDAPControlU ***, int);
int (CDECL *ldap_parse_result)(void *, void *, int *, char **, char **, char ***, LDAPControlU ***, int);
int (CDECL *ldap_parse_sortresponse_control)(void *, LDAPControlU *, int *, char **);
int (CDECL *ldap_parse_vlvresponse_control)(void *, LDAPControlU *, int *, int *, struct bervalU **, int *);
int (CDECL *ldap_rename)(void *, const char *, const char *, const char *, int, LDAPControlU **, LDAPControlU **,
ULONG *);
int (CDECL *ldap_rename_s)(void *, const char *, const char *, const char *, int, LDAPControlU **, LDAPControlU **);
......
......@@ -1237,6 +1237,26 @@ static inline LDAPControlW **controlarraydupW( LDAPControlW **controlarray )
return controlarrayW;
}
static inline LDAPControlA **controlarrayWtoA( LDAPControlW **controlarray )
{
LDAPControlA **controlarrayA = NULL;
DWORD size;
if (controlarray)
{
size = sizeof(LDAPControlA *) * (controlarraylenW( controlarray ) + 1);
if ((controlarrayA = RtlAllocateHeap( GetProcessHeap(), 0, size )))
{
LDAPControlW **p = controlarray;
LDAPControlA **q = controlarrayA;
while (*p) *q++ = controlWtoA( *p++ );
*q = NULL;
}
}
return controlarrayA;
}
static inline WCHAR *strUtoW( const char *str )
{
WCHAR *ret = NULL;
......@@ -1322,6 +1342,26 @@ static inline LDAPControlW *controlUtoW( const LDAPControlU *control )
return controlW;
}
static inline LDAPControlW **controlarrayUtoW( LDAPControlU **controlarray )
{
LDAPControlW **controlarrayW = NULL;
DWORD size;
if (controlarray)
{
size = sizeof(LDAPControlW *) * (controlarraylenU( controlarray ) + 1);
if ((controlarrayW = RtlAllocateHeap( GetProcessHeap(), 0, size )))
{
LDAPControlU **p = controlarray;
LDAPControlW **q = controlarrayW;
while (*p) *q++ = controlUtoW( *p++ );
*q = NULL;
}
}
return controlarrayW;
}
static inline DWORD sortkeyarraylenA( LDAPSortKeyA **sortkeyarray )
{
LDAPSortKeyA **p = sortkeyarray;
......
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