From: Dmitry Timoshkov dmitry@baikal.ru
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/adsldp/adsldp.c | 38 ++++++++++++++++++++++++++++++++++++-- include/iads.idl | 14 ++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-)
diff --git a/dlls/adsldp/adsldp.c b/dlls/adsldp/adsldp.c index aca677d7b55..79dcca082fe 100644 --- a/dlls/adsldp/adsldp.c +++ b/dlls/adsldp/adsldp.c @@ -458,6 +458,9 @@ static HRESULT WINAPI ldapns_QueryInterface(IADs *iface, REFIID riid, void **obj
if (IsEqualGUID(riid, &IID_IADsObjectOptions)) { + if (!ldap->ld || (ldap->object && wcsicmp(ldap->object, L"rootDSE") != 0)) + return E_NOINTERFACE; + IADs_AddRef(iface); *obj = &ldap->IADsObjectOptions_iface; return S_OK; @@ -2250,8 +2253,39 @@ static HRESULT WINAPI options_Invoke(IADsObjectOptions *iface, DISPID dispid, RE
static HRESULT WINAPI options_GetOption(IADsObjectOptions *iface, LONG option, VARIANT *var) { - FIXME("%p,%ld,%p: stub\n", iface, option, var); - return E_NOTIMPL; + LDAP_namespace *ldap = impl_from_IADsObjectOptions(iface); + LONG err; + + TRACE("%p,%ld,%p\n", iface, option, var); + + if (!ldap->ld) return E_NOTIMPL; + + switch (option) + { + case ADS_OPTION_SERVERNAME: + { + WCHAR *host; + BSTR val; + + err = ldap_get_optionW(ldap->ld, LDAP_OPT_HOST_NAME, &host); + if (err != LDAP_SUCCESS) + return HRESULT_FROM_WIN32(map_ldap_error(err)); + + val = SysAllocString(host); + ldap_memfreeW(host); + if (!val) return E_OUTOFMEMORY; + + V_VT(var) = VT_BSTR; + V_BSTR(var) = val; + return S_OK; + } + + default: + FIXME("%p,%ld,%p: stub\n", iface, option, var); + break; + } + + return E_ADS_BAD_PARAMETER; }
static HRESULT WINAPI options_SetOption(IADsObjectOptions *iface, LONG option, VARIANT var) diff --git a/include/iads.idl b/include/iads.idl index 052aea37776..2e560007014 100644 --- a/include/iads.idl +++ b/include/iads.idl @@ -152,6 +152,20 @@ typedef enum ADS_PASSWORD_ENCODE_CLEAR } ADS_PASSWORD_ENCODING_ENUM;
+typedef enum +{ + ADS_OPTION_SERVERNAME, + ADS_OPTION_REFERRALS, + ADS_OPTION_PAGE_SIZE, + ADS_OPTION_SECURITY_MASK, + ADS_OPTION_MUTUAL_AUTH_STATUS, + ADS_OPTION_QUOTA, + ADS_OPTION_PASSWORD_PORTNUMBER, + ADS_OPTION_PASSWORD_METHOD, + ADS_OPTION_ACCUMULATIVE_MODIFICATION, + ADS_OPTION_SKIP_SID_LOOKUP +} ADS_OPTION_ENUM; + typedef struct _ADS_CASEIGNORE_LIST { struct _ADS_CASEIGNORE_LIST *Next;