[PATCH 5/8] adsldp: Add special column "ADsPath" at the end of the entry.

Dmitry Timoshkov dmitry at baikal.ru
Thu Mar 26 02:10:04 CDT 2020


Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 dlls/adsldp/adsldp.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/dlls/adsldp/adsldp.c b/dlls/adsldp/adsldp.c
index b59b31b21a..859d42546f 100644
--- a/dlls/adsldp/adsldp.c
+++ b/dlls/adsldp/adsldp.c
@@ -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;
-- 
2.25.1




More information about the wine-devel mailing list