From 66897b455ca9d3f4bdbf8afcb847f91b2578eca4 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Wed, 25 Mar 2020 11:17:42 +0800 Subject: [PATCH] adsldp: Add IDirectorySearch stubs. Signed-off-by: Dmitry Timoshkov Signed-off-by: Alexandre Julliard --- dlls/adsldp/adsldp.c | 123 +++++++++++++++++++++++++++++++++++++++++++ include/iads.idl | 4 +- 2 files changed, 124 insertions(+), 3 deletions(-) diff --git a/dlls/adsldp/adsldp.c b/dlls/adsldp/adsldp.c index c49f9ef70b0..caf404c3c6f 100644 --- a/dlls/adsldp/adsldp.c +++ b/dlls/adsldp/adsldp.c @@ -381,6 +381,7 @@ typedef struct { IADs IADs_iface; IADsOpenDSObject IADsOpenDSObject_iface; + IDirectorySearch IDirectorySearch_iface; LONG ref; LDAP *ld; BSTR host; @@ -419,6 +420,13 @@ static HRESULT WINAPI ldapns_QueryInterface(IADs *iface, REFIID riid, void **obj return S_OK; } + if (IsEqualGUID(riid, &IID_IDirectorySearch)) + { + IADs_AddRef(iface); + *obj = &ldap->IDirectorySearch_iface; + return S_OK; + } + FIXME("interface %s is not implemented\n", debugstr_guid(riid)); return E_NOINTERFACE; } @@ -1046,6 +1054,120 @@ static const IADsOpenDSObjectVtbl IADsOpenDSObject_vtbl = openobj_OpenDSObject }; +static inline LDAP_namespace *impl_from_IDirectorySearch(IDirectorySearch *iface) +{ + return CONTAINING_RECORD(iface, LDAP_namespace, IDirectorySearch_iface); +} + +static HRESULT WINAPI search_QueryInterface(IDirectorySearch *iface, REFIID riid, void **obj) +{ + TRACE("%p,%s,%p\n", iface, debugstr_guid(riid), obj); + + if (!riid || !obj) return E_INVALIDARG; + + if (IsEqualGUID(riid, &IID_IDirectorySearch) || + IsEqualGUID(riid, &IID_IUnknown)) + { + IDirectorySearch_AddRef(iface); + *obj = iface; + return S_OK; + } + + FIXME("interface %s is not implemented\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI search_AddRef(IDirectorySearch *iface) +{ + LDAP_namespace *ldap = impl_from_IDirectorySearch(iface); + return IADs_AddRef(&ldap->IADs_iface); +} + +static ULONG WINAPI search_Release(IDirectorySearch *iface) +{ + LDAP_namespace *ldap = impl_from_IDirectorySearch(iface); + return IADs_Release(&ldap->IADs_iface); +} + +static HRESULT WINAPI search_SetSearchPreference(IDirectorySearch *iface, PADS_SEARCHPREF_INFO prefs, DWORD count) +{ + FIXME("%p,%p,%u: stub\n", iface, prefs, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI search_ExecuteSearch(IDirectorySearch *iface, LPWSTR filter, LPWSTR *names, + DWORD count, PADS_SEARCH_HANDLE res) +{ + FIXME("%p,%s,%p,%u,%p: stub\n", iface, debugstr_w(filter), names, count, res); + return E_NOTIMPL; +} + +static HRESULT WINAPI search_AbandonSearch(IDirectorySearch *iface, ADS_SEARCH_HANDLE res) +{ + FIXME("%p,%p: stub\n", iface, res); + return E_NOTIMPL; +} + +static HRESULT WINAPI search_GetFirstRow(IDirectorySearch *iface, ADS_SEARCH_HANDLE res) +{ + FIXME("%p,%p: stub\n", iface, res); + return E_NOTIMPL; +} + +static HRESULT WINAPI search_GetNextRow(IDirectorySearch *iface, ADS_SEARCH_HANDLE res) +{ + FIXME("%p,%p: stub\n", iface, res); + return E_NOTIMPL; +} + +static HRESULT WINAPI search_GetPreviousRow(IDirectorySearch *iface, ADS_SEARCH_HANDLE res) +{ + FIXME("%p,%p: stub\n", iface, res); + return E_NOTIMPL; +} + +static HRESULT WINAPI search_GetNextColumnName(IDirectorySearch *iface, ADS_SEARCH_HANDLE res, LPWSTR *names) +{ + FIXME("%p,%p,%p: stub\n", iface, res, names); + return E_NOTIMPL; +} + +static HRESULT WINAPI search_GetColumn(IDirectorySearch *iface, ADS_SEARCH_HANDLE res, + LPWSTR name, PADS_SEARCH_COLUMN col) +{ + FIXME("%p,%p,%s,%p: stub\n", iface, res, debugstr_w(name), col); + return E_NOTIMPL; +} + +static HRESULT WINAPI search_FreeColumn(IDirectorySearch *iface, PADS_SEARCH_COLUMN col) +{ + FIXME("%p,%p: stub\n", iface, col); + return E_NOTIMPL; +} + +static HRESULT WINAPI search_CloseSearchHandle(IDirectorySearch *iface, ADS_SEARCH_HANDLE res) +{ + FIXME("%p,%p: stub\n", iface, res); + return E_NOTIMPL; +} + +static const IDirectorySearchVtbl IDirectorySearch_vtbl = +{ + search_QueryInterface, + search_AddRef, + search_Release, + search_SetSearchPreference, + search_ExecuteSearch, + search_AbandonSearch, + search_GetFirstRow, + search_GetNextRow, + search_GetPreviousRow, + search_GetNextColumnName, + search_GetColumn, + search_FreeColumn, + search_CloseSearchHandle +}; + static HRESULT LDAPNamespace_create(REFIID riid, void **obj) { LDAP_namespace *ldap; @@ -1056,6 +1178,7 @@ static HRESULT LDAPNamespace_create(REFIID riid, void **obj) ldap->IADs_iface.lpVtbl = &IADs_vtbl; ldap->IADsOpenDSObject_iface.lpVtbl = &IADsOpenDSObject_vtbl; + ldap->IDirectorySearch_iface.lpVtbl = &IDirectorySearch_vtbl; ldap->ref = 1; ldap->ld = NULL; ldap->host = NULL; diff --git a/include/iads.idl b/include/iads.idl index 8553a03d8c2..fdee17859d1 100644 --- a/include/iads.idl +++ b/include/iads.idl @@ -99,8 +99,6 @@ typedef enum ADS_SEARCHPREF_EXTENDED_DN } ADS_SEARCHPREF_ENUM; -typedef ADS_SEARCHPREF_ENUM *PADS_SEARCHPREF_INFO; - typedef enum { ADS_STATUS_S_OK, @@ -328,7 +326,7 @@ typedef struct ads_searchpref_info ADS_SEARCHPREF dwSearchPref; ADSVALUE vValue; ADS_STATUS dwStatus; -} ADS_SEARCHPREF_INFO; +} ADS_SEARCHPREF_INFO, *PADS_SEARCHPREF_INFO; typedef struct ads_search_column {