Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/adsldp/adsldp.c | 47 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-)
diff --git a/dlls/adsldp/adsldp.c b/dlls/adsldp/adsldp.c index 7cc23438f1..03f7571afd 100644 --- a/dlls/adsldp/adsldp.c +++ b/dlls/adsldp/adsldp.c @@ -569,7 +569,7 @@ static HRESULT WINAPI ldapns_Get(IADs *iface, BSTR name, VARIANT *prop) { if (!wcsicmp(name, ldap->attrs[i].name)) { - ULONG count = ldap_count_valuesW(ldap->attrs[i].values); + LONG count = ldap_count_valuesW(ldap->attrs[i].values); if (!count) { V_BSTR(prop) = NULL; @@ -578,12 +578,45 @@ static HRESULT WINAPI ldapns_Get(IADs *iface, BSTR name, VARIANT *prop) }
if (count > 1) - FIXME("attr %s has %u values\n", debugstr_w(ldap->attrs[i].name), count); - - V_BSTR(prop) = SysAllocString(ldap->attrs[i].values[0]); - if (!V_BSTR(prop)) return E_OUTOFMEMORY; - V_VT(prop) = VT_BSTR; - return S_OK; + { + SAFEARRAY *sa; + VARIANT item; + LONG idx; + + TRACE("attr %s has %u values\n", debugstr_w(ldap->attrs[i].name), count); + + sa = SafeArrayCreateVector(VT_VARIANT, 0, count); + if (!sa) return E_OUTOFMEMORY; + + for (idx = 0; idx < count; idx++) + { + V_VT(&item) = VT_BSTR; + V_BSTR(&item) = SysAllocString(ldap->attrs[i].values[idx]); + if (!V_BSTR(&item)) + { + hr = E_OUTOFMEMORY; + goto fail; + } + + hr = SafeArrayPutElement(sa, &idx, &item); + SysFreeString(V_BSTR(&item)); + if (hr != S_OK) goto fail; + } + + V_VT(prop) = VT_ARRAY | VT_VARIANT; + V_ARRAY(prop) = sa; + return S_OK; +fail: + SafeArrayDestroy(sa); + return hr; + } + else + { + V_BSTR(prop) = SysAllocString(ldap->attrs[i].values[0]); + if (!V_BSTR(prop)) return E_OUTOFMEMORY; + V_VT(prop) = VT_BSTR; + return S_OK; + } } }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=68065
Your paranoid android.
=== debiant (build log) ===
error: patch failed: dlls/wldap32/value.c:229 error: patch failed: dlls/adsldp/adsldp.c:27 error: patch failed: include/winldap.h:184 error: patch failed: dlls/adsldp/adsldp.c:1091 error: patch failed: dlls/adsldp/Makefile.in:1 error: patch failed: dlls/adsldp/adsldp.c:29 error: patch failed: dlls/adsldp/adsldp.c:40 error: patch failed: dlls/adsldp/adsldp_private.h:19 error: patch failed: dlls/adsldp/adsldp.c:551 error: patch failed: dlls/adsldp/adsldp.c:569 Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: dlls/wldap32/value.c:229 error: patch failed: dlls/adsldp/adsldp.c:27 error: patch failed: include/winldap.h:184 error: patch failed: dlls/adsldp/adsldp.c:1091 error: patch failed: dlls/adsldp/Makefile.in:1 error: patch failed: dlls/adsldp/adsldp.c:29 error: patch failed: dlls/adsldp/adsldp.c:40 error: patch failed: dlls/adsldp/adsldp_private.h:19 error: patch failed: dlls/adsldp/adsldp.c:551 error: patch failed: dlls/adsldp/adsldp.c:569 Task: Patch failed to apply