大网数据广告活动
域与目录服务

Win32 Error Codes for ADSI

· 52CE 我爱测

Standard Win32 error codes are also used to return ADSI error messages.

Standard Win32 error codes are also used to return ADSI error messages. Specifically, 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.

To convert the HRESULT value of an ADSI error code, returned by your application, to the corresponding the Win32 error DWORD value, as defined in the header files above, use the following procedure.

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 to the corresponding the Win32 error DWORD value

  1. Convert the HRESULT value to a hexadecimal number if starting with a decimal value as you may get from a Visual Basic application.
  2. Drop the 0x8007 part produce the remainder.
  3. Convert the remainder to a decimal number.
  4. Look up the decimal remainder in Winerror.h.
  5. If not found in Winerror.h, subtract 2100 from the decimal remainder and look up the result in Lmerr.h.

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:

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。