Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function returns the first reference from a message.

Syntax

LDAPMessage* ldap_first_reference(
  LDAP* 
ld,
  LDAPMessage* 
res
);

Parameters

ld

[in] Session handle.

res

[in] Search result, as obtained by a call to one of the synchronous search routines or ldap_result.

Return Value

If this function succeeds, it returns the reference. If no reference exists in the result set, 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_next_referenceto step through and retrieve a list of continuation references from a search result chain.

This function returns subordinate referrals (references) that are returned in search responses. A subordinate referral is one in which the server has returned some data and the referral has been passed to other naming contexts below the current level in the tree. To step through external references in which the naming context does not reside on the server, use the ldap_parse_resultfunction instead.

You do not have to explicitly free the returned reference as it is freed when the message itself is freed.

Requirements

Header winldap.h
Library wldap32.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also