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 callback function is an application-defined function. This client-side function determines whether there is a cached connection available for use. The QUERYFORCONNECTIONname for this function is a placeholder for the function name defined by the application.

Syntax

typedef ULONG (_cdecl QUERYFORCONNECTION)(
  PLDAP 
PrimaryConnection,
  PLDAP 
ReferralFromConnection,
  PWCHAR 
NewDN,
  PCHAR 
HostName,
  ULONG 
PortNumber,
  PVOID 
SecAuthIdentity,
  PVOID 
CurrentUserToken,
  PLDAP*
 
ConnectionToUse
);

Parameters

PrimaryConnection

[in] Specifies the primary connection.

ReferralFromConnection

[in] Specifies the connection, which provided the referral.

NewDN

[in] Specifies the distinguished name (DN) of the desired entry in the referred server.

HostName

[in] Specifies the name of the referred server.

PortNumber

[in] Specifies the port number on which to connect.

SecAuthIdentity

[in] Specifies the credentials to pass to the referred server. If this parameter is NULL, use the CurrentUserTokenparameter.

CurrentUserToken

[in] Pointer to the LUID of the current user.

ConnectionToUse

[out] Pointer to the connection to use. This parameter is set to NULL, if there is no connection cached that can be used.

Return Value

The return values are user-defined.

Remarks

If a connection is available, this function should return a pointer to the connection to use in the ConnectionToUseparameter. If no connection is available, the function should set the ConnectionToUseparameter to NULL.

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