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

ADSI Extended Error Messages

· 52CE 我爱测

This topic contains a list of topics that explain how to work with ADSI error messages that are returned by IADs, IADsContainer, IDirectoryObject, and IDirectorySearch.

Apart from the HRESULT values, several ADSI system providers (mostly LDAP) return additional error data for operations performed by the following interfaces:

A part of such extended error data is the string sent by the server as a part of the message result.

Call ADsGetLastError to retrieve such extended error messages. The first parameter of this function, lpError, is a DWORD value. For an Active Directory server, ADSI attempts to map an LDAP error message to an appropriate Win32 error code and assigns the Win32 error code value to lpError. Failing to resolve the mapping, ADSI assigns ERROR_INVALID_DATA to lpError, as it does for any other directory server. In all cases, ADSI faithfully relays the string of the error description from the server to the client through lpErrorBuf, the second parameter of the ADsGetLastError function.

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)

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

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