Compartilhar via


ldap_next_attribute (Windows CE 5.0)

Send Feedback

This function returns the next attribute for a given entry.

UNICODE PTCHAR ldap_next_attribute(LDAP* ld,LDAPMessage* entry,BerElement* ptr);

Parameters

  • ld
    [in] Session handle.
  • entry
    [in] Entry whose attributes are to be stepped through, as returned by ldap_first_entry or ldap_next_entry.
  • ptr
    [in, out] Address of a pointer used internally to keep track of the current position in the entry.

Return Values

If this function succeeds, it returns a pointer to an allocated buffer containing the current attribute name. If there are no more attributes to step through, it returns NULL.

If this function fails, it returns NULL and sets the session error parameters in the LDAP data structure.

Remarks

Use this function in conjunction with ldap_first_attribute to step through the list of attribute types returned with an entry. You can then pass these attribute names in a call to the ldap_get_values function to retrieve their associated values.

A call to ldap_next_attribute returns, through the ptr parameter, a pointer to a BerElement structure. Pass this pointer to the next call to ldap_next_attribute to keep track of the current position in the list of attributes. When you have finished stepping through a list of attributes, and ptr is non-NULL, free the pointer by calling the ber_free function (ptr, 0).

Note   It is very important to pass the second parameter as 0 (zero) in this call.

The ldap_next_attribute function returns a pointer to an allocated buffer containing the current attribute name. This should be freed when no longer in use by calling the ldap_memfree function.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Winldap.h.
Link Library: Wldap32.lib.

See Also

BerElement | ber_free | ldap_first_attribute | ldap_first_entry | ldap_get_values | ldap_memfree | ldap_next_entry

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.