diff --git a/dlls/adsldp/adsldp.c b/dlls/adsldp/adsldp.c index 792a3bc034b..dce462d685a 100644 --- a/dlls/adsldp/adsldp.c +++ b/dlls/adsldp/adsldp.c @@ -1286,6 +1286,7 @@ static HRESULT WINAPI search_ExecuteSearch(IDirectorySearch *iface, LPWSTR filte LDAP_namespace *ldap = impl_from_IDirectorySearch(iface); ULONG err, i; WCHAR **props; + LDAPControlW **ctrls = NULL, *ctrls_a[2], tombstone; struct ldap_search_context *ldap_ctx; TRACE("%p,%s,%p,%u,%p\n", iface, debugstr_w(filter), names, count, res); @@ -1317,7 +1318,19 @@ static HRESULT WINAPI search_ExecuteSearch(IDirectorySearch *iface, LPWSTR filte props[count] = NULL; } - err = ldap_search_sW(ldap->ld, ldap->object, ldap->search.scope, filter, props, ldap->search.attribtypes_only, &ldap_ctx->res); + if (ldap->search.tombstone) + { + tombstone.ldctl_oid = (WCHAR *)L"1.2.840.113556.1.4.417"; + tombstone.ldctl_iscritical = TRUE; + tombstone.ldctl_value.bv_val = NULL; + tombstone.ldctl_value.bv_len = 0; + ctrls_a[0] = &tombstone; + ctrls_a[1] = NULL; + ctrls = ctrls_a; + } + + err = ldap_search_ext_sW(ldap->ld, ldap->object, ldap->search.scope, filter, props, + ldap->search.attribtypes_only, ctrls, NULL, NULL, 0, &ldap_ctx->res); heap_free(props); if (err != LDAP_SUCCESS) { diff --git a/dlls/adsldp/tests/ldap.c b/dlls/adsldp/tests/ldap.c index e76bd2e0b63..c43d2989e6b 100644 --- a/dlls/adsldp/tests/ldap.c +++ b/dlls/adsldp/tests/ldap.c @@ -515,6 +515,25 @@ todo_wine hr = IDirectorySearch_CloseSearchHandle(ds, sh); ok(hr == S_OK, "got %#x\n", hr); + pref[0].dwSearchPref = ADS_SEARCHPREF_TOMBSTONE; + pref[0].vValue.dwType = ADSTYPE_BOOLEAN; + pref[0].vValue.Integer = 1; + pref[0].dwStatus = 0xdeadbeef; + hr = IDirectorySearch_SetSearchPreference(ds, pref, 1); + ok(hr == S_OK, "got %#x\n", hr); + ok(pref[0].dwStatus == ADS_STATUS_S_OK, "got %d\n", pref[0].dwStatus); + + hr = IDirectorySearch_ExecuteSearch(ds, (WCHAR *)L"(objectClass=*)", NULL, ~0, &sh); + ok(hr == HRESULT_FROM_WIN32(ERROR_DS_UNAVAILABLE_CRIT_EXTENSION) || broken(hr == S_OK) /* XP */, "got %#x\n", hr); + if (hr == S_OK) + { + hr = IDirectorySearch_GetNextRow(ds, sh); + ok(hr == HRESULT_FROM_WIN32(ERROR_DS_UNAVAILABLE_CRIT_EXTENSION), "got %#x\n", hr); + + hr = IDirectorySearch_CloseSearchHandle(ds, sh); + ok(hr == S_OK, "got %#x\n", hr); + } + IDirectorySearch_Release(ds); IDirectoryObject_Release(dirobj); }