adsldp: Add special column "ADsPath" at the end of the entry.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2020-03-26 15:10:04 +08:00 committed by Alexandre Julliard
parent 3adc9c5b21
commit e53a00944e
1 changed files with 11 additions and 0 deletions

View File

@ -401,6 +401,7 @@ struct ldap_search_context
LDAPMessage *res, *entry;
BerElement *ber;
ULONG count, pos;
BOOL add_ADsPath;
};
static inline LDAP_namespace *impl_from_IADs(IADs *iface)
@ -1274,7 +1275,10 @@ static HRESULT WINAPI search_GetNextColumnName(IDirectorySearch *iface, ADS_SEAR
if (!name || !ldap_ctx || !ldap_ctx->entry) return E_ADS_BAD_PARAMETER;
if (!ldap_ctx->ber)
{
attr = ldap_first_attributeW(ldap->ld, ldap_ctx->entry, &ldap_ctx->ber);
ldap_ctx->add_ADsPath = TRUE;
}
else
attr = ldap_next_attributeW(ldap->ld, ldap_ctx->entry, ldap_ctx->ber);
@ -1285,6 +1289,13 @@ static HRESULT WINAPI search_GetNextColumnName(IDirectorySearch *iface, ADS_SEAR
ldap_memfreeW(attr);
return *name ? S_OK : E_OUTOFMEMORY;
}
else if (ldap_ctx->add_ADsPath)
{
ldap_ctx->add_ADsPath = FALSE;
*name = AllocADsStr((WCHAR *)L"ADsPath");
TRACE("=> %s\n", debugstr_w(*name));
return *name ? S_OK : E_OUTOFMEMORY;
}
*name = NULL;
return S_ADS_NOMORE_COLUMNS;