Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/adsldp/adsldp.c | 5 +++-- dlls/adsldp/tests/ldap.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/dlls/adsldp/adsldp.c b/dlls/adsldp/adsldp.c index 9a3ac63407..b2a8e61815 100644 --- a/dlls/adsldp/adsldp.c +++ b/dlls/adsldp/adsldp.c @@ -1573,6 +1573,8 @@ static inline LDAP_namespace *impl_from_IDirectoryObject(IDirectoryObject *iface
static HRESULT WINAPI dirobj_QueryInterface(IDirectoryObject *iface, REFIID riid, void **obj) { + LDAP_namespace *ldap = impl_from_IDirectoryObject(iface); + TRACE("%p,%s,%p\n", iface, debugstr_guid(riid), obj);
if (!riid || !obj) return E_INVALIDARG; @@ -1585,8 +1587,7 @@ static HRESULT WINAPI dirobj_QueryInterface(IDirectoryObject *iface, REFIID riid return S_OK; }
- FIXME("interface %s is not implemented\n", debugstr_guid(riid)); - return E_NOINTERFACE; + return IADs_QueryInterface(&ldap->IADs_iface, riid, obj); }
static ULONG WINAPI dirobj_AddRef(IDirectoryObject *iface) diff --git a/dlls/adsldp/tests/ldap.c b/dlls/adsldp/tests/ldap.c index 120e77053a..998581e2f8 100644 --- a/dlls/adsldp/tests/ldap.c +++ b/dlls/adsldp/tests/ldap.c @@ -459,6 +459,37 @@ todo_wine do_search(&scientists_subtree); }
+static void test_DirectoryObject(void) +{ + HRESULT hr; + IDirectoryObject *dirobj; + IUnknown *unk; + IDirectorySearch *ds; + + hr = ADsGetObject(L"LDAP://ldap.forumsys.com/OU=scientists,DC=example,DC=com", &IID_IDirectoryObject, (void **)&dirobj); + if (hr == HRESULT_FROM_WIN32(ERROR_DS_SERVER_DOWN)) + { + skip("server is down\n"); + return; + } + ok(hr == S_OK, "got %#x\n", hr); + + hr = IDirectoryObject_QueryInterface(dirobj, &IID_IADsOpenDSObject, (void **)&unk); +todo_wine + ok(hr == E_NOINTERFACE, "got %#x\n", hr); + hr = IDirectoryObject_QueryInterface(dirobj, &IID_IDispatch, (void **)&unk); + ok(hr == S_OK, "got %#x\n", hr); + IUnknown_Release(unk); + hr = IDirectoryObject_QueryInterface(dirobj, &IID_IADs, (void **)&unk); + ok(hr == S_OK, "got %#x\n", hr); + IUnknown_Release(unk); + hr = IDirectoryObject_QueryInterface(dirobj, &IID_IDirectorySearch, (void **)&ds); + ok(hr == S_OK, "got %#x\n", hr); + IDirectorySearch_Release(ds); + + IDirectoryObject_Release(dirobj); +} + START_TEST(ldap) { HRESULT hr; @@ -469,6 +500,7 @@ START_TEST(ldap) test_LDAP(); test_ParseDisplayName(); test_DirectorySearch(); + test_DirectoryObject();
CoUninitialize(); }