Directory Services |
The cldap_open function establishes a session with an LDAP server over a connectionless User Datagram Protocol (UDP) service.
LDAP* cldap_open( PCHAR HostName, ULONG PortNumber );
If the function succeeds, a session handle, in the form of a pointer to an LDAP structure is returned. Free the session handle with a call to ldap_unbind when it is no longer required.
If the function fails, the return value is NULL. To get the error code, call LdapGetLastError or the Win32 function GetLastError.
The cldap_open function, unlike ldap_open, creates a connection block for UDP-based connectionless LDAP services. No TCP session is maintained. Like ldap_open, cldap_open allocates an LDAP structure to maintain state data for the session, and then attempts to make the connection before returning to the caller. The call returns a session handle, which you pass to subsequent LDAP function calls in the course of the session. When finished with the session, always free the allocated session handle by using ldap_unbind.
Multithreading: Calls to cldap_open are thread-safe.
Client: Included in Windows XP and
Windows 2000 Professional.
Server: Included in Windows Server 2003 and
Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension
on Windows NT 4.0 SP6a and Windows 95/98/Me.
Unicode: Implemented as Unicode and ANSI versions on all
platforms.
Header: Declared in Winldap.h.
Library: Use Wldap32.lib.
Functions, GetLastError, ldap_open, LdapGetLastError, ldap_unbind