Dmitry Timoshkov : adsldp: Implement IDirectorySearch::GetFirstRow().

Alexandre Julliard julliard at winehq.org
Wed Mar 25 17:07:29 CDT 2020


Module: wine
Branch: master
Commit: 6f14d858dee1d1b84f76d27d509a3a7cb800189c
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6f14d858dee1d1b84f76d27d509a3a7cb800189c

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Wed Mar 25 11:18:13 2020 +0800

adsldp: Implement IDirectorySearch::GetFirstRow().

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/adsldp/adsldp.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/dlls/adsldp/adsldp.c b/dlls/adsldp/adsldp.c
index 53f766565c..264408c365 100644
--- a/dlls/adsldp/adsldp.c
+++ b/dlls/adsldp/adsldp.c
@@ -398,7 +398,8 @@ typedef struct
 
 struct ldap_search_context
 {
-    LDAPMessage *res;
+    LDAPMessage *res, *entry;
+    ULONG count, pos;
 };
 
 static inline LDAP_namespace *impl_from_IADs(IADs *iface)
@@ -1197,8 +1198,20 @@ static HRESULT WINAPI search_AbandonSearch(IDirectorySearch *iface, ADS_SEARCH_H
 
 static HRESULT WINAPI search_GetFirstRow(IDirectorySearch *iface, ADS_SEARCH_HANDLE res)
 {
-    FIXME("%p,%p: stub\n", iface, res);
-    return E_NOTIMPL;
+    LDAP_namespace *ldap = impl_from_IDirectorySearch(iface);
+    struct ldap_search_context *ldap_ctx = res;
+
+    TRACE("%p,%p\n", iface, res);
+
+    if (!ldap->ld) return E_NOTIMPL;
+
+    if (!res) return E_ADS_BAD_PARAMETER;
+
+    ldap_ctx->count = ldap_count_entries(ldap->ld, ldap_ctx->res);
+    ldap_ctx->pos = 0;
+    ldap_ctx->entry = ldap_first_entry(ldap->ld, ldap_ctx->res);
+
+    return ldap_ctx->entry ? S_OK : S_ADS_NOMORE_ROWS;
 }
 
 static HRESULT WINAPI search_GetNextRow(IDirectorySearch *iface, ADS_SEARCH_HANDLE res)




More information about the wine-cvs mailing list