Directory Services

ldap_err2string

The ldap_err2string function converts a numeric LDAP error code into a null-terminated character string that describes the error.

PCHAR ldap_err2string(
  ULONG err
);

Parameters

err
[in] An LDAP error code as returned by another LDAP function.

Return Values

If the function succeeds, a pointer to a null-terminated character string that describes the error, is returned.

If the function fails, a pointer to NULL is returned.

Remarks

Call ldap_err2string to convert any numeric LDAP error code into an informative, null-terminated character string message that describes the error. Be aware that some of the asynchronous calls return -1. In this case, use LdapGetLastError to retrieve the LDAP error code, and then use ldap_err2string on that value.

The return value is a static pointer to the character string. Do not free this string.

Requirements

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.

See Also

Functions, Return Values