From 19d18f0e5cedc9c83d9c70a39a7f2305d84b3552 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Tue, 7 Oct 2008 13:58:47 -0500 Subject: [PATCH] browseui: Update AutoComplete Multi to have a stub implemntation of CLSID_ACListISF and IID_IACList2. --- dlls/browseui/Makefile.in | 1 + dlls/browseui/aclsource.c | 147 ++++++++++++++++++++++++++++++++++++++++++ dlls/browseui/browseui.h | 1 + dlls/browseui/browseui_main.c | 1 + dlls/browseui/regsvr.c | 7 ++ include/shlguid.h | 1 + include/shlobj.h | 26 ++++++++ 7 files changed, 184 insertions(+) create mode 100644 dlls/browseui/aclsource.c diff --git a/dlls/browseui/Makefile.in b/dlls/browseui/Makefile.in index c1e85cc6f05..845e66a5e72 100644 --- a/dlls/browseui/Makefile.in +++ b/dlls/browseui/Makefile.in @@ -8,6 +8,7 @@ EXTRADEFS = -DCOM_NO_WINDOWS_H C_SRCS = \ aclmulti.c \ + aclsource.c \ browseui_main.c \ compcatcachedaemon.c \ progressdlg.c \ diff --git a/dlls/browseui/aclsource.c b/dlls/browseui/aclsource.c new file mode 100644 index 00000000000..4788ad62cff --- /dev/null +++ b/dlls/browseui/aclsource.c @@ -0,0 +1,147 @@ +/* + * Shell AutoComplete list + * + * Copyright 2008 CodeWeavers, Aric Stewart + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" + +#include + +#define COBJMACROS + +#include "wine/debug.h" +#include "windef.h" +#include "winbase.h" +#include "winreg.h" +#include "winuser.h" +#include "shlwapi.h" +#include "winerror.h" +#include "objbase.h" + +#include "shlguid.h" +#include "shlobj.h" + +#include "wine/unicode.h" + +#include "browseui.h" + +WINE_DEFAULT_DEBUG_CHANNEL(browseui); + +typedef struct tagACLMulti { + const IACList2Vtbl *acl2Vtbl; + LONG refCount; + DWORD dwOptions; +} ACLShellSource; + +static void ACLShellSource_Destructor(ACLShellSource *This) +{ + TRACE("destroying %p\n", This); + heap_free(This); +} + +static HRESULT WINAPI ACLShellSource_QueryInterface(IACList2 *iface, REFIID iid, LPVOID *ppvOut) +{ + ACLShellSource *This = (ACLShellSource *)iface; + *ppvOut = NULL; + + if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IACList2) || + IsEqualIID(iid, &IID_IACList)) + { + *ppvOut = This; + } + + if (*ppvOut) + { + IUnknown_AddRef(iface); + return S_OK; + } + + WARN("unsupported interface: %s\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI ACLShellSource_AddRef(IACList2 *iface) +{ + ACLShellSource *This = (ACLShellSource *)iface; + return InterlockedIncrement(&This->refCount); +} + +static ULONG WINAPI ACLShellSource_Release(IACList2 *iface) +{ + ACLShellSource *This = (ACLShellSource *)iface; + ULONG ret; + + ret = InterlockedDecrement(&This->refCount); + if (ret == 0) + ACLShellSource_Destructor(This); + return ret; +} + +static HRESULT WINAPI ACLShellSource_Expand(IACList2 *iface, LPCWSTR wstr) +{ + ACLShellSource *This = (ACLShellSource *)iface; + FIXME("STUB:(%p) %s\n",This,debugstr_w(wstr)); + return E_NOTIMPL; +} + + +static HRESULT WINAPI ACLShellSource_GetOptions(IACList2 *iface, + DWORD *pdwFlag) +{ + ACLShellSource *This = (ACLShellSource *)iface; + *pdwFlag = This->dwOptions; + return S_OK; +} + +static HRESULT WINAPI ACLShellSource_SetOptions(IACList2 *iface, + DWORD dwFlag) +{ + ACLShellSource *This = (ACLShellSource *)iface; + This->dwOptions = dwFlag; + return S_OK; +} + +static const IACList2Vtbl ACLMulti_ACList2Vtbl = +{ + ACLShellSource_QueryInterface, + ACLShellSource_AddRef, + ACLShellSource_Release, + + ACLShellSource_Expand, + + ACLShellSource_SetOptions, + ACLShellSource_GetOptions +}; + +HRESULT ACLShellSource_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) +{ + ACLShellSource *This; + if (pUnkOuter) + return CLASS_E_NOAGGREGATION; + + This = heap_alloc_zero(sizeof(ACLShellSource)); + if (This == NULL) + return E_OUTOFMEMORY; + + This->acl2Vtbl = &ACLMulti_ACList2Vtbl; + This->refCount = 1; + + TRACE("returning %p\n", This); + *ppOut = (IUnknown *)This; + return S_OK; +} diff --git a/dlls/browseui/browseui.h b/dlls/browseui/browseui.h index 28086470a48..923aadbe1a5 100644 --- a/dlls/browseui/browseui.h +++ b/dlls/browseui/browseui.h @@ -27,6 +27,7 @@ extern HINSTANCE BROWSEUI_hinstance; extern HRESULT ACLMulti_Constructor(IUnknown *punkOuter, IUnknown **ppOut); extern HRESULT ProgressDialog_Constructor(IUnknown *punkOuter, IUnknown **ppOut); extern HRESULT CompCatCacheDaemon_Constructor(IUnknown *punkOuter, IUnknown **ppOut); +extern HRESULT ACLShellSource_Constructor(IUnknown *punkOuter, IUnknown **ppOut); extern const GUID CLSID_CompCatCacheDaemon; diff --git a/dlls/browseui/browseui_main.c b/dlls/browseui/browseui_main.c index 10757c18ffd..447e4f7a1f7 100644 --- a/dlls/browseui/browseui_main.c +++ b/dlls/browseui/browseui_main.c @@ -53,6 +53,7 @@ static const struct { {&CLSID_ACLMulti, ACLMulti_Constructor}, {&CLSID_ProgressDialog, ProgressDialog_Constructor}, {&CLSID_CompCatCacheDaemon, CompCatCacheDaemon_Constructor}, + {&CLSID_ACListISF, ACLShellSource_Constructor}, {NULL, NULL} }; diff --git a/dlls/browseui/regsvr.c b/dlls/browseui/regsvr.c index 746e20bbc19..5c265f466cb 100644 --- a/dlls/browseui/regsvr.c +++ b/dlls/browseui/regsvr.c @@ -462,6 +462,13 @@ static struct regsvr_coclass const coclass_list[] = { "browseui.dll", "Both" }, + { + &CLSID_ACListISF, + "Shell Folder AutoComplete List", + NULL, + "browseui.dll", + "Both" + }, { NULL } /* list terminator */ }; diff --git a/include/shlguid.h b/include/shlguid.h index 23cce286e00..d9685e61786 100644 --- a/include/shlguid.h +++ b/include/shlguid.h @@ -127,6 +127,7 @@ DEFINE_GUID(CLSID_DragDropHelper, 0x4657278a, 0x411b, 0x11d2, 0x83, 0x9a, 0x00, DEFINE_GUID(CLSID_AutoComplete, 0x00bb2763, 0x6a77, 0x11d0, 0xa5, 0x35, 0x00, 0xc0, 0x4f, 0xd7, 0xd0, 0x62); DEFINE_GUID(CLSID_ACLMulti, 0x00bb2765, 0x6a77, 0x11d0, 0xa5, 0x35, 0x00, 0xc0, 0x4f, 0xd7, 0xd0, 0x62); +DEFINE_GUID(CLSID_ACListISF, 0x03c036f1, 0xa186, 0x11d0, 0x82, 0x4a, 0x00, 0xaa, 0x00, 0x5b, 0x043, 0x83); DEFINE_GUID(CLSID_ProgressDialog, 0xf8383852, 0xfcd3, 0x11d1, 0xa6, 0xb9, 0x0, 0x60, 0x97, 0xdf, 0x5b, 0xd4); diff --git a/include/shlobj.h b/include/shlobj.h index 284a0205d85..5ed49782f38 100644 --- a/include/shlobj.h +++ b/include/shlobj.h @@ -487,6 +487,32 @@ DECLARE_INTERFACE_(IACList,IUnknown) #define IACList_Expand(p,a) (p)->lpVtbl->Expand(p,a) #endif +/* IACList2 interface */ +#define INTERFACE IACList2 +DECLARE_INTERFACE_(IACList2,IACList) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IACList methods ***/ + STDMETHOD(Expand)(THIS_ LPCOLESTR str) PURE; + /*** IACList2 methods ***/ + STDMETHOD(SetOptions)(THIS_ DWORD dwFlag) PURE; + STDMETHOD(GetOptions)(THIS_ DWORD* pdwFlag) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IACList2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IACList2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IACList2_Release(p) (p)->lpVtbl->Release(p) +/*** IACList2 methods ***/ +#define IACList2_GetOptions(p,a) (p)->lpVtbl->GetOptions(p,a) +#define IACList2_SetOptions(p,a) (p)->lpVtbl->SetOptions(p,a) +#endif + /* IProgressDialog interface */ #define PROGDLG_NORMAL 0x00000000 #define PROGDLG_MODAL 0x00000001 -- 2.11.4.GIT