[PATCH] shell32: Added stub implementation of ICustomDestinationList
Nikolay Sivov
nsivov at codeweavers.com
Tue Nov 29 00:22:54 CST 2016
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
For https://bugs.winehq.org/show_bug.cgi?id=39161
dlls/shell32/shell32_classes.idl | 6 ++
dlls/shell32/shell32_main.h | 2 +
dlls/shell32/shellitem.c | 171 ++++++++++++++++++++++++++++++++++++++-
dlls/shell32/shellole.c | 1 +
4 files changed, 179 insertions(+), 1 deletion(-)
diff --git a/dlls/shell32/shell32_classes.idl b/dlls/shell32/shell32_classes.idl
index f0131e7..68ce2b5 100644
--- a/dlls/shell32/shell32_classes.idl
+++ b/dlls/shell32/shell32_classes.idl
@@ -148,3 +148,9 @@ coclass KnownFolderManager { interface IKnownFolderManager; }
threading(apartment),
uuid(53bd6b4e-3780-4693-afc3-7161c2f3ee9c)
] coclass MruLongList { }
+
+[
+ helpstring("Custom Destination List"),
+ threading(apartment),
+ uuid(77f10cf0-3db5-4966-b520-b7c54fd35ed6)
+] coclass DestinationList { interface ICustomDestinationList; }
diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h
index 8cd1318..47be9c9 100644
--- a/dlls/shell32/shell32_main.h
+++ b/dlls/shell32/shell32_main.h
@@ -110,6 +110,8 @@ HRESULT IShellLink_ConstructFromFile(IUnknown * pUnkOuter, REFIID riid, LPCITEMI
LPEXTRACTICONA IExtractIconA_Constructor(LPCITEMIDLIST) DECLSPEC_HIDDEN;
LPEXTRACTICONW IExtractIconW_Constructor(LPCITEMIDLIST) DECLSPEC_HIDDEN;
+HRESULT WINAPI CustomDestinationList_Constructor(IUnknown *outer, REFIID riid, void **obj) DECLSPEC_HIDDEN;
+
/* initialisation for FORMATETC */
#define InitFormatEtc(fe, cf, med) \
{\
diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c
index b0af6d6..57f5fa6 100644
--- a/dlls/shell32/shellitem.c
+++ b/dlls/shell32/shellitem.c
@@ -44,17 +44,25 @@ typedef struct _ShellItem {
IPersistIDList IPersistIDList_iface;
} ShellItem;
+typedef struct _CustomDestinationList {
+ ICustomDestinationList ICustomDestinationList_iface;
+ LONG ref;
+} CustomDestinationList;
+
static inline ShellItem *impl_from_IShellItem2(IShellItem2 *iface)
{
return CONTAINING_RECORD(iface, ShellItem, IShellItem2_iface);
}
-
static inline ShellItem *impl_from_IPersistIDList( IPersistIDList *iface )
{
return CONTAINING_RECORD(iface, ShellItem, IPersistIDList_iface);
}
+static inline CustomDestinationList *impl_from_ICustomDestinationList( ICustomDestinationList *iface )
+{
+ return CONTAINING_RECORD(iface, CustomDestinationList, ICustomDestinationList_iface);
+}
static HRESULT WINAPI ShellItem_QueryInterface(IShellItem2 *iface, REFIID riid,
void **ppv)
@@ -1322,3 +1330,164 @@ HRESULT WINAPI SHCreateShellItemArrayFromIDLists(UINT cidl,
*psia = NULL;
return ret;
}
+
+static HRESULT WINAPI CustomDestinationList_QueryInterface(ICustomDestinationList *iface, REFIID riid, void **obj)
+{
+ CustomDestinationList *This = impl_from_ICustomDestinationList(iface);
+
+ TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), obj);
+
+ if (IsEqualIID(&IID_ICustomDestinationList, riid) || IsEqualIID(&IID_IUnknown, riid))
+ {
+ *obj = &This->ICustomDestinationList_iface;
+ }
+ else {
+ FIXME("not implemented for %s\n", shdebugstr_guid(riid));
+ *obj = NULL;
+ return E_NOINTERFACE;
+ }
+
+ IUnknown_AddRef((IUnknown*)*obj);
+ return S_OK;
+}
+
+static ULONG WINAPI CustomDestinationList_AddRef(ICustomDestinationList *iface)
+{
+ CustomDestinationList *This = impl_from_ICustomDestinationList(iface);
+ ULONG ref = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p), new refcount=%i\n", This, ref);
+
+ return ref;
+}
+
+static ULONG WINAPI CustomDestinationList_Release(ICustomDestinationList *iface)
+{
+ CustomDestinationList *This = impl_from_ICustomDestinationList(iface);
+ ULONG ref = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p), new refcount=%i\n", This, ref);
+
+ if (ref == 0)
+ HeapFree(GetProcessHeap(), 0, This);
+
+ return ref;
+}
+
+static HRESULT WINAPI CustomDestinationList_SetAppID(ICustomDestinationList *iface, const WCHAR *appid)
+{
+ CustomDestinationList *This = impl_from_ICustomDestinationList(iface);
+
+ FIXME("%p (%s): stub\n", This, debugstr_w(appid));
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI CustomDestinationList_BeginList(ICustomDestinationList *iface, UINT *min_slots, REFIID riid, void **obj)
+{
+ CustomDestinationList *This = impl_from_ICustomDestinationList(iface);
+
+ FIXME("%p (%p %s %p): stub\n", This, min_slots, debugstr_guid(riid), obj);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI CustomDestinationList_AppendCategory(ICustomDestinationList *iface, const WCHAR *category, IObjectArray *array)
+{
+ CustomDestinationList *This = impl_from_ICustomDestinationList(iface);
+
+ FIXME("%p (%s %p): stub\n", This, debugstr_w(category), array);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI CustomDestinationList_AppendKnownCategory(ICustomDestinationList *iface, KNOWNDESTCATEGORY category)
+{
+ CustomDestinationList *This = impl_from_ICustomDestinationList(iface);
+
+ FIXME("%p (%d): stub\n", This, category);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI CustomDestinationList_AddUserTasks(ICustomDestinationList *iface, IObjectArray *tasks)
+{
+ CustomDestinationList *This = impl_from_ICustomDestinationList(iface);
+
+ FIXME("%p (%p): stub\n", This, tasks);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI CustomDestinationList_CommitList(ICustomDestinationList *iface)
+{
+ CustomDestinationList *This = impl_from_ICustomDestinationList(iface);
+
+ FIXME("%p: stub\n", This);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI CustomDestinationList_GetRemovedDestinations(ICustomDestinationList *iface, REFIID riid, void **obj)
+{
+ CustomDestinationList *This = impl_from_ICustomDestinationList(iface);
+
+ FIXME("%p (%s %p): stub\n", This, debugstr_guid(riid), obj);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI CustomDestinationList_DeleteList(ICustomDestinationList *iface, const WCHAR *appid)
+{
+ CustomDestinationList *This = impl_from_ICustomDestinationList(iface);
+
+ FIXME("%p (%s): stub\n", This, debugstr_w(appid));
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI CustomDestinationList_AbortList(ICustomDestinationList *iface)
+{
+ CustomDestinationList *This = impl_from_ICustomDestinationList(iface);
+
+ FIXME("%p: stub\n", This);
+
+ return E_NOTIMPL;
+}
+
+static const ICustomDestinationListVtbl CustomDestinationListVtbl =
+{
+ CustomDestinationList_QueryInterface,
+ CustomDestinationList_AddRef,
+ CustomDestinationList_Release,
+ CustomDestinationList_SetAppID,
+ CustomDestinationList_BeginList,
+ CustomDestinationList_AppendCategory,
+ CustomDestinationList_AppendKnownCategory,
+ CustomDestinationList_AddUserTasks,
+ CustomDestinationList_CommitList,
+ CustomDestinationList_GetRemovedDestinations,
+ CustomDestinationList_DeleteList,
+ CustomDestinationList_AbortList
+};
+
+HRESULT WINAPI CustomDestinationList_Constructor(IUnknown *outer, REFIID riid, void **obj)
+{
+ CustomDestinationList *list;
+ HRESULT hr;
+
+ TRACE("%p %s %p\n", outer, debugstr_guid(riid), obj);
+
+ if (outer)
+ return CLASS_E_NOAGGREGATION;
+
+ if(!(list = HeapAlloc(GetProcessHeap(), 0, sizeof(*list))))
+ return E_OUTOFMEMORY;
+
+ list->ICustomDestinationList_iface.lpVtbl = &CustomDestinationListVtbl;
+ list->ref = 1;
+
+ hr = ICustomDestinationList_QueryInterface(&list->ICustomDestinationList_iface, riid, obj);
+ ICustomDestinationList_Release(&list->ICustomDestinationList_iface);
+ return hr;
+}
diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c
index f034951..dd54900 100644
--- a/dlls/shell32/shellole.c
+++ b/dlls/shell32/shellole.c
@@ -83,6 +83,7 @@ static const struct {
{&CLSID_ExplorerBrowser,ExplorerBrowser_Constructor},
{&CLSID_KnownFolderManager, KnownFolderManager_Constructor},
{&CLSID_Shell, IShellDispatch_Constructor},
+ {&CLSID_DestinationList, CustomDestinationList_Constructor},
{NULL, NULL}
};
--
2.10.2
More information about the wine-patches
mailing list