From: Dmitry Timoshkov dmitry@baikal.ru
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/adsldp/adsldp.c | 17 +++++++++++++++++ dlls/adsldp/tests/ldap.c | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/dlls/adsldp/adsldp.c b/dlls/adsldp/adsldp.c index 2c56349a725..e9b9b70c2a8 100644 --- a/dlls/adsldp/adsldp.c +++ b/dlls/adsldp/adsldp.c @@ -1231,6 +1231,7 @@ static HRESULT WINAPI openobj_OpenDSObject(IADsOpenDSObject *iface, BSTR path, B if (hr == S_OK) { LDAP_namespace *ldap = impl_from_IADs(ads); + ldap->ld = ld; ldap->host = host; ldap->port = port; @@ -1238,8 +1239,24 @@ static HRESULT WINAPI openobj_OpenDSObject(IADsOpenDSObject *iface, BSTR path, B ldap->at = at; ldap->at_single_count = at_single_count; ldap->at_multiple_count = at_multiple_count; + + /* Windows fails to create IADs if it doesn't have an associated schema attribute */ + if (object && wcsicmp(object, L"rootDSE") != 0) + { + BSTR schema; + + if (IADs_get_Schema(ads, &schema) != S_OK) + { + IADs_Release(ads); + return E_ADS_BAD_PATHNAME; + } + + SysFreeString(schema); + } + hr = IADs_QueryInterface(ads, &IID_IDispatch, (void **)obj); IADs_Release(ads); + return hr; }
diff --git a/dlls/adsldp/tests/ldap.c b/dlls/adsldp/tests/ldap.c index af965000e26..19e1f94d73e 100644 --- a/dlls/adsldp/tests/ldap.c +++ b/dlls/adsldp/tests/ldap.c @@ -207,7 +207,7 @@ static void test_ParseDisplayName(void) server_down = TRUE; break; } - todo_wine_if(i == 0 || i == 1 || i == 11 || i == 12) + todo_wine_if(i == 0 || i == 1) ok(hr == test[i].hr, "%d: got %#lx, expected %#lx\n", i, hr, test[i].hr); if (hr == S_OK) {