Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/adsldp/adsldp.c | 14 +++----------- dlls/adsldp/tests/ldap.c | 6 ++++-- 2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/dlls/adsldp/adsldp.c b/dlls/adsldp/adsldp.c index 5ab7948b1f..e0a14f2c70 100644 --- a/dlls/adsldp/adsldp.c +++ b/dlls/adsldp/adsldp.c @@ -437,6 +437,9 @@ static HRESULT WINAPI ldapns_QueryInterface(IADs *iface, REFIID riid, void **obj
if (IsEqualGUID(riid, &IID_IDirectorySearch)) { + if (!ldap->ld || (ldap->object && !wcsicmp(ldap->object, L"rootDSE"))) + return E_NOINTERFACE; + IADs_AddRef(iface); *obj = &ldap->IDirectorySearch_iface; return S_OK; @@ -1167,8 +1170,6 @@ static HRESULT WINAPI search_ExecuteSearch(IDirectorySearch *iface, LPWSTR filte
TRACE("%p,%s,%p,%u,%p\n", iface, debugstr_w(filter), names, count, res);
- if (!ldap->ld) return E_NOTIMPL; - if (!res) return E_ADS_BAD_PARAMETER;
ldap_ctx = heap_alloc_zero(sizeof(*ldap_ctx)); @@ -1217,13 +1218,10 @@ static HRESULT WINAPI search_AbandonSearch(IDirectorySearch *iface, ADS_SEARCH_H
static HRESULT WINAPI search_GetFirstRow(IDirectorySearch *iface, ADS_SEARCH_HANDLE res) { - 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->entry = NULL; @@ -1238,8 +1236,6 @@ static HRESULT WINAPI search_GetNextRow(IDirectorySearch *iface, ADS_SEARCH_HAND
TRACE("%p,%p\n", iface, res);
- if (!ldap->ld) return E_NOTIMPL; - if (!res) return E_ADS_BAD_PARAMETER;
if (!ldap_ctx->entry) @@ -1283,8 +1279,6 @@ static HRESULT WINAPI search_GetNextColumnName(IDirectorySearch *iface, ADS_SEAR
TRACE("%p,%p,%p\n", iface, res, name);
- if (!ldap->ld) return E_NOTIMPL; - if (!name || !ldap_ctx || !ldap_ctx->entry) return E_ADS_BAD_PARAMETER;
if (!ldap_ctx->ber) @@ -1393,8 +1387,6 @@ static HRESULT WINAPI search_GetColumn(IDirectorySearch *iface, ADS_SEARCH_HANDL
TRACE("%p,%p,%s,%p\n", iface, res, debugstr_w(name), col);
- if (!ldap->ld) return E_NOTIMPL; - if (!res || !name || !ldap_ctx->entry) return E_ADS_BAD_PARAMETER;
if (!wcsicmp(name, L"ADsPath")) diff --git a/dlls/adsldp/tests/ldap.c b/dlls/adsldp/tests/ldap.c index b3cb489d58..3c1d47755d 100644 --- a/dlls/adsldp/tests/ldap.c +++ b/dlls/adsldp/tests/ldap.c @@ -344,8 +344,10 @@ static void test_DirectorySearch(void) ADS_SEARCH_COLUMN col; LPWSTR name;
+ hr = ADsGetObject(L"LDAP:", &IID_IDirectorySearch, (void **)&ds); + ok(hr == E_NOINTERFACE, "got %#x\n", hr); + hr = ADsGetObject(L"LDAP://ldap.forumsys.com/rootDSE", &IID_IDirectorySearch, (void **)&ds); -todo_wine ok(hr == E_NOINTERFACE, "got %#x\n", hr);
hr = ADsGetObject(L"LDAP://ldap.forumsys.com", &IID_IDirectorySearch, (void **)&ds); @@ -439,7 +441,7 @@ todo_wine memset(&col, 0x55, sizeof(col)); hr = IDirectorySearch_GetColumn(ds, sh, (WCHAR *)L"deadbeef", &col); ok(hr == E_ADS_COLUMN_NOT_SET, "got %#x\n", hr); - ok(!col.pszAttrName, "got %p\n", col.pszAttrName); + ok(!col.pszAttrName || broken(col.pszAttrName != NULL) /* XP */, "got %p\n", col.pszAttrName); ok(col.dwADsType == ADSTYPE_INVALID || broken(col.dwADsType != ADSTYPE_INVALID) /* XP */, "got %d\n", col.dwADsType); ok(!col.pADsValues, "got %p\n", col.pADsValues); ok(!col.dwNumValues, "got %u\n", col.dwNumValues);
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=68540
Your paranoid android.
=== w1064v1507 (32 bit report) ===
adsldp: ldap.c:238: Test failed: got 0x8007203a
=== debiant (32 bit Chinese:China report) ===
adsldp: ldap.c:194: Test failed: 10: got 0x8007203a, expected 0