adsldp: Add support for ADS_SEARCHPREF_SEARCH_SCOPE to IDirectorySearch::SetSearchPreference().

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2020-03-25 11:17:48 +08:00 committed by Alexandre Julliard
parent 66897b455c
commit 88678882aa
2 changed files with 54 additions and 3 deletions

View File

@ -21,6 +21,7 @@
#include <stdarg.h> #include <stdarg.h>
#define COBJMACROS #define COBJMACROS
#define NONAMELESSUNION
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
@ -389,6 +390,10 @@ typedef struct
ULONG port; ULONG port;
ULONG attrs_count, attrs_count_allocated; ULONG attrs_count, attrs_count_allocated;
struct ldap_attribute *attrs; struct ldap_attribute *attrs;
struct
{
ADS_SCOPEENUM scope;
} search;
} LDAP_namespace; } LDAP_namespace;
static inline LDAP_namespace *impl_from_IADs(IADs *iface) static inline LDAP_namespace *impl_from_IADs(IADs *iface)
@ -1091,8 +1096,46 @@ static ULONG WINAPI search_Release(IDirectorySearch *iface)
static HRESULT WINAPI search_SetSearchPreference(IDirectorySearch *iface, PADS_SEARCHPREF_INFO prefs, DWORD count) static HRESULT WINAPI search_SetSearchPreference(IDirectorySearch *iface, PADS_SEARCHPREF_INFO prefs, DWORD count)
{ {
FIXME("%p,%p,%u: stub\n", iface, prefs, count); LDAP_namespace *ldap = impl_from_IDirectorySearch(iface);
return E_NOTIMPL; DWORD i;
TRACE("%p,%p,%u\n", iface, prefs, count);
for (i = 0; i < count; i++)
{
switch (prefs[i].dwSearchPref)
{
case ADS_SEARCHPREF_SEARCH_SCOPE:
if (prefs[i].vValue.dwType != ADSTYPE_INTEGER)
{
FIXME("ADS_SEARCHPREF_SEACH_SCOPE: not supportd dwType %d\n", prefs[i].vValue.dwType);
prefs[i].dwStatus = ADS_STATUS_INVALID_SEARCHPREFVALUE;
break;
}
switch (prefs[i].vValue.u.Integer)
{
case ADS_SCOPE_BASE:
case ADS_SCOPE_ONELEVEL:
case ADS_SCOPE_SUBTREE:
ldap->search.scope = prefs[i].vValue.u.Integer;
prefs[i].dwStatus = ADS_STATUS_S_OK;
break;
default:
prefs[i].dwStatus = ADS_STATUS_INVALID_SEARCHPREFVALUE;
break;
}
break;
default:
FIXME("pref %d, type %u: stub\n", prefs[i].dwSearchPref, prefs[i].vValue.dwType);
prefs[i].dwStatus = ADS_STATUS_INVALID_SEARCHPREF;
break;
}
}
return S_OK;
} }
static HRESULT WINAPI search_ExecuteSearch(IDirectorySearch *iface, LPWSTR filter, LPWSTR *names, static HRESULT WINAPI search_ExecuteSearch(IDirectorySearch *iface, LPWSTR filter, LPWSTR *names,
@ -1186,6 +1229,7 @@ static HRESULT LDAPNamespace_create(REFIID riid, void **obj)
ldap->attrs_count = 0; ldap->attrs_count = 0;
ldap->attrs_count_allocated = 0; ldap->attrs_count_allocated = 0;
ldap->attrs = NULL; ldap->attrs = NULL;
ldap->search.scope = ADS_SCOPE_SUBTREE;
hr = IADs_QueryInterface(&ldap->IADs_iface, riid, obj); hr = IADs_QueryInterface(&ldap->IADs_iface, riid, obj);
IADs_Release(&ldap->IADs_iface); IADs_Release(&ldap->IADs_iface);

View File

@ -139,6 +139,13 @@ typedef enum
ADSTYPE_DN_WITH_STRING ADSTYPE_DN_WITH_STRING
} ADSTYPEENUM; } ADSTYPEENUM;
typedef enum
{
ADS_SCOPE_BASE,
ADS_SCOPE_ONELEVEL,
ADS_SCOPE_SUBTREE
} ADS_SCOPEENUM;
typedef enum typedef enum
{ {
ADS_PASSWORD_ENCODE_REQUIRE_SSL, ADS_PASSWORD_ENCODE_REQUIRE_SSL,
@ -318,7 +325,7 @@ typedef struct _adsvalue
ADS_NT_SECURITY_DESCRIPTOR SecurityDescriptor; ADS_NT_SECURITY_DESCRIPTOR SecurityDescriptor;
PADS_DN_WITH_BINARY pDNWithBinary; PADS_DN_WITH_BINARY pDNWithBinary;
PADS_DN_WITH_STRING pDNWithString; PADS_DN_WITH_STRING pDNWithString;
}; } DUMMYUNIONNAME;
} ADSVALUE, *PADSVALUE; } ADSVALUE, *PADSVALUE;
typedef struct ads_searchpref_info typedef struct ads_searchpref_info