Platform SDK: Active Directory, ADSI, and Directory Services

LDAP Error Codes for ADSI

When an LDAP server generates an error and passes it to the client, the error is then translated into a string by the LDAP client. To determine the LDAP error codes for ADSI, you can use the following method, which is similar to that for Win32 error codes for ADSI. For demonstration purposes, the client error code is taken as the WIN32 error 0x80072020.

  1. Drop the 8007 from the win32 error and convert it to the decimal value. In this example the value will be 8224.
  2. Open up Winerror.h file and search for 8224L. The error code is defined as ERROR_DS_OPERATIONS_ERROR.
  3. Replace the ERROR_DS_ with LDAP_ and then search the LDAP-substituted string in Winldap.h.
  4. The LDAP error code sent from the LDAP server is 0x01.