Directory Services |
Standard Win32 error codes are also used to return ADSI error messages. In particular, the ADSI LDAP provider maps all the LDAP error codes to Win32 error codes. The HRESULT values of these error codes are of the 0x8007XXXX format, where the last four hexadecimal digits, XXXX, corresponds to the DWORD values of the appropriate Win32 error code. For example, the ADSI error value 0x80072020 gives the Win32 error value of 0x2020 in hexadecimal or 8224 in decimal.
Most of the Win32 error codes for ADSI are defined in Winerror.h or Lmerr.h. The error values are listed as decimal values in these files. To convert the HRESULT value of an ADSI error code (produced by your application) to the corresponding the Win32 errors DWORD value (defined in the header files above), do the following:
ADSI 2.0 maps the LDAP error codes to a set of Win32 error codes that is different from that used in ADSI for Windows 2000 and DS Client. The differences are listed in the two tables below: