Nikolay Sivov : shell32: Added a stub for SHAssocEnumHandlers().

Alexandre Julliard julliard at wine.codeweavers.com
Fri Dec 5 15:36:55 CST 2014


Module: wine
Branch: master
Commit: 717385b0ba2cc63410e06805c50d857220522e64
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=717385b0ba2cc63410e06805c50d857220522e64

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Fri Dec  5 13:30:08 2014 +0300

shell32: Added a stub for SHAssocEnumHandlers().

---

 dlls/shell32/assoc.c      | 90 +++++++++++++++++++++++++++++++++++++++++++++++
 dlls/shell32/shell32.spec |  1 +
 2 files changed, 91 insertions(+)

diff --git a/dlls/shell32/assoc.c b/dlls/shell32/assoc.c
index b0d815a..39e210d 100644
--- a/dlls/shell32/assoc.c
+++ b/dlls/shell32/assoc.c
@@ -77,6 +77,17 @@ static inline IQueryAssociationsImpl *impl_from_IQueryAssociations(IQueryAssocia
   return CONTAINING_RECORD(iface, IQueryAssociationsImpl, IQueryAssociations_iface);
 }
 
+struct enumassochandlers
+{
+    IEnumAssocHandlers IEnumAssocHandlers_iface;
+    LONG ref;
+};
+
+static inline struct enumassochandlers *impl_from_IEnumAssocHandlers(IEnumAssocHandlers *iface)
+{
+  return CONTAINING_RECORD(iface, struct enumassochandlers, IEnumAssocHandlers_iface);
+}
+
 /**************************************************************************
  *  IQueryAssociations_QueryInterface
  *
@@ -965,3 +976,82 @@ HRESULT WINAPI ApplicationAssociationRegistration_Constructor(IUnknown *outer, R
     TRACE("returning 0x%x with %p\n", hr, *ppv);
     return hr;
 }
+
+static HRESULT WINAPI enumassochandlers_QueryInterface(IEnumAssocHandlers *iface, REFIID riid, void **obj)
+{
+    struct enumassochandlers *This = impl_from_IEnumAssocHandlers(iface);
+
+    TRACE("(%p %s %p)\n", This, debugstr_guid(riid), obj);
+
+    if (IsEqualIID(riid, &IID_IEnumAssocHandlers) ||
+        IsEqualIID(riid, &IID_IUnknown))
+    {
+        *obj = iface;
+        IEnumAssocHandlers_AddRef(iface);
+        return S_OK;
+    }
+
+    *obj = NULL;
+    return E_NOINTERFACE;
+}
+
+static ULONG WINAPI enumassochandlers_AddRef(IEnumAssocHandlers *iface)
+{
+    struct enumassochandlers *This = impl_from_IEnumAssocHandlers(iface);
+    ULONG ref = InterlockedIncrement(&This->ref);
+
+    TRACE("(%p)->(%u)\n", This, ref);
+    return ref;
+}
+
+static ULONG WINAPI enumassochandlers_Release(IEnumAssocHandlers *iface)
+{
+    struct enumassochandlers *This = impl_from_IEnumAssocHandlers(iface);
+    ULONG ref = InterlockedDecrement(&This->ref);
+
+    TRACE("(%p)->(%u)\n", This, ref);
+
+    if (!ref)
+        SHFree(This);
+
+    return ref;
+}
+
+static HRESULT WINAPI enumassochandlers_Next(IEnumAssocHandlers *iface, ULONG count, IAssocHandler **handlers,
+    ULONG *fetched)
+{
+    struct enumassochandlers *This = impl_from_IEnumAssocHandlers(iface);
+
+    FIXME("(%p)->(%u %p %p): stub\n", This, count, handlers, fetched);
+
+    return E_NOTIMPL;
+}
+
+static const IEnumAssocHandlersVtbl enumassochandlersvtbl = {
+    enumassochandlers_QueryInterface,
+    enumassochandlers_AddRef,
+    enumassochandlers_Release,
+    enumassochandlers_Next
+};
+
+/**************************************************************************
+ * SHAssocEnumHandlers            [SHELL32.@]
+ */
+HRESULT WINAPI SHAssocEnumHandlers(const WCHAR *extra, ASSOC_FILTER filter, IEnumAssocHandlers **enumhandlers)
+{
+    struct enumassochandlers *enumassoc;
+
+    FIXME("(%s %d %p\n): stub", debugstr_w(extra), filter, enumhandlers);
+
+    *enumhandlers = NULL;
+
+    enumassoc = SHAlloc(sizeof(*enumassoc));
+    if (!enumassoc)
+        return E_OUTOFMEMORY;
+
+    enumassoc->IEnumAssocHandlers_iface.lpVtbl = &enumassochandlersvtbl;
+    enumassoc->ref = 1;
+
+    *enumhandlers = &enumassoc->IEnumAssocHandlers_iface;
+    return S_OK;
+}
diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec
index e6858c8..0a8d448 100644
--- a/dlls/shell32/shell32.spec
+++ b/dlls/shell32/shell32.spec
@@ -328,6 +328,7 @@
 @ stdcall SetCurrentProcessExplicitAppUserModelID(wstr)
 @ stdcall SHAddToRecentDocs (long ptr)
 @ stdcall SHAppBarMessage(long ptr)
+@ stdcall SHAssocEnumHandlers(wstr long ptr)
 @ stdcall SHBindToParent(ptr ptr ptr ptr)
 @ stdcall SHBrowseForFolder(ptr) SHBrowseForFolderA
 @ stdcall SHBrowseForFolderA(ptr)




More information about the wine-cvs mailing list