Platform SDK: Active Directory, ADSI, and Directory Services

ldap_get_values_len

The ldap_get_values_len function retrieves the list of values for a given attribute. The LDAP directory service uses this information when parsing a search response.

struct berval** ldap_get_values_len (
  LDAP* ExternalHandle,
  LDAPMessage* Message,
  PCHAR attr
);

Parameters

ExternalHandle
[in] The session handle.
Message
[in] Handle to the LDAPMessage structure.
attr
[in] The attribute whose values are to be retrieved.

Return Values

If the function succeeds, it returns a null-terminated list of pointers to berval structures.

Remarks

Use ldap_get_values_len when parsing a search response to obtain the value or values of an attribute. Use this function when the attribute contains binary data; for attributes whose values are null-terminated character strings, use ldap_get_values instead.

The entry is obtained by calling ldap_first_entry or ldap_next_entry. The attribute should be one returned by a call to ldap_first_attribute, ldap_next_attribute, or a caller-supplied string (for example, "mail").

Call ldap_value_free_len to release the returned value when it is no longer needed.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 SP4 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Winldap.h.
  Library: Use Wldap32.lib.
  Unicode: Declared as Unicode and ANSI prototypes.

See Also

berval, Functions, ldap_first_attribute, ldap_first_entry, ldap_get_values, ldap_next_attribute, ldap_next_entry, ldap_value_free_len, LDAPMessage