ldap_get_values_len 函数 (winldap.h)

ldap_get_values_len 函数检索给定属性的值列表。

语法

WINLDAPAPI berval **LDAPAPI ldap_get_values_len(
  [in] LDAP        *ExternalHandle,
  [in] LDAPMessage *Message,
  [in] const PSTR  attr
);

参数

[in] ExternalHandle

会话句柄。

[in] Message

LDAPMessage 结构的句柄。

[in] attr

指向以 null 结尾的字符串的指针,该字符串包含要检索其值的属性。

返回值

如果函数成功,它将返回指向包含指定特性值的 berval 结构的指针的以 null 结尾的列表。 如果未找到任何属性值,则返回 NULL。 在任一情况下,LDAP 数据结构中的会话错误参数都设置为 0。

如果函数失败,它将返回 NULL ,并且 LDAP 数据结构中的会话错误参数设置为 LDAP 错误代码。

注解

分析搜索响应时,请使用 ldap_get_values_len 来获取特性的值。 当 属性包含二进制数据时使用此函数;对于值为 null 结尾的字符串的属性,请使用 ldap_get_values

通过调用 ldap_first_entryldap_next_entry 获取条目。 该属性应该是通过调用 ldap_first_attributeldap_next_attribute 或调用方提供的字符串 ((例如“mail”) )返回的。

调用 ldap_value_free_len 以在不再需要返回的值时释放它。

要求

要求
最低受支持的客户端 Windows Vista
最低受支持的服务器 Windows Server 2008
目标平台 Windows
标头 winldap.h
Library Wldap32.lib
DLL Wldap32.dll

请参阅

函数

LDAPMessage

berval

ldap_first_attribute

ldap_first_entry

ldap_get_values

ldap_next_attribute

ldap_next_entry

ldap_value_free_len