From 2d4d571ffc02112dfc671b6711ce77086758a27c Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg Date: Mon, 16 Jan 2012 00:06:15 +0100 Subject: [PATCH] shell32: Add a stub for IApplicationAssociationRegistration. --- dlls/shell32/assoc.c | 143 +++++++++++++++++++++++++++++++++++++++ dlls/shell32/shell32_classes.idl | 6 ++ dlls/shell32/shell32_main.h | 2 + dlls/shell32/shellole.c | 1 + 4 files changed, 152 insertions(+) diff --git a/dlls/shell32/assoc.c b/dlls/shell32/assoc.c index 942e7969350..d7161caeeb4 100644 --- a/dlls/shell32/assoc.c +++ b/dlls/shell32/assoc.c @@ -28,6 +28,7 @@ #include "objbase.h" #include "shlguid.h" #include "shlwapi.h" +#include "shobjidl.h" #include "shell32_main.h" #include "ver.h" #include "wine/unicode.h" @@ -65,6 +66,13 @@ typedef struct HKEY hkeyProgID; } IQueryAssociationsImpl; +typedef struct +{ + IApplicationAssociationRegistration IApplicationAssociationRegistration_iface; + LONG ref; +} IApplicationAssociationRegistrationImpl; + + static inline IQueryAssociationsImpl *impl_from_IQueryAssociations(IQueryAssociations *iface) { return CONTAINING_RECORD(iface, IQueryAssociationsImpl, IQueryAssociations_iface); @@ -711,6 +719,114 @@ static const IQueryAssociationsVtbl IQueryAssociations_vtbl = }; /************************************************************************** + * IApplicationAssociationRegistration implementation + */ +static inline IApplicationAssociationRegistrationImpl *impl_from_IApplicationAssociationRegistration(IApplicationAssociationRegistration *iface) +{ + return CONTAINING_RECORD(iface, IApplicationAssociationRegistrationImpl, IApplicationAssociationRegistration_iface); +} + +static HRESULT WINAPI ApplicationAssociationRegistration_QueryInterface( + IApplicationAssociationRegistration* iface, REFIID riid, LPVOID *ppv) +{ + IApplicationAssociationRegistrationImpl *This = impl_from_IApplicationAssociationRegistration(iface); + + TRACE("(%p, %s, %p)\n",This, debugstr_guid(riid), ppv); + + if (ppv == NULL) + return E_POINTER; + + if (IsEqualGUID(&IID_IUnknown, riid) || + IsEqualGUID(&IID_IApplicationAssociationRegistration, riid)) { + *ppv = &This->IApplicationAssociationRegistration_iface; + IUnknown_AddRef((IUnknown*)*ppv); + TRACE("returning IApplicationAssociationRegistration: %p\n", *ppv); + return S_OK; + } + + *ppv = NULL; + FIXME("(%p)->(%s %p) interface not supported\n", This, debugstr_guid(riid), ppv); + return E_NOINTERFACE; +} + +static ULONG WINAPI ApplicationAssociationRegistration_AddRef(IApplicationAssociationRegistration *iface) +{ + IApplicationAssociationRegistrationImpl *This = impl_from_IApplicationAssociationRegistration(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + return ref; +} + +static ULONG WINAPI ApplicationAssociationRegistration_Release(IApplicationAssociationRegistration *iface) +{ + IApplicationAssociationRegistrationImpl *This = impl_from_IApplicationAssociationRegistration(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if (!ref) { + SHFree(This); + } + return ref; +} + +static HRESULT WINAPI ApplicationAssociationRegistration_QueryCurrentDefault(IApplicationAssociationRegistration* This, LPCWSTR query, + ASSOCIATIONTYPE type, ASSOCIATIONLEVEL level, LPWSTR *association) +{ + FIXME("(%p)->(%s, %d, %d, %p)\n", This, debugstr_w(query), type, level, association); + return E_NOTIMPL; +} + +static HRESULT WINAPI ApplicationAssociationRegistration_QueryAppIsDefault(IApplicationAssociationRegistration* This, LPCWSTR query, + ASSOCIATIONTYPE type, ASSOCIATIONLEVEL level, LPCWSTR appname, BOOL *is_default) +{ + FIXME("(%p)->(%s, %d, %d, %s, %p)\n", This, debugstr_w(query), type, level, debugstr_w(appname), is_default); + return E_NOTIMPL; +} + +static HRESULT WINAPI ApplicationAssociationRegistration_QueryAppIsDefaultAll(IApplicationAssociationRegistration* This, ASSOCIATIONLEVEL level, + LPCWSTR appname, BOOL *is_default) +{ + FIXME("(%p)->(%d, %s, %p)\n", This, level, debugstr_w(appname), is_default); + return E_NOTIMPL; +} + +static HRESULT WINAPI ApplicationAssociationRegistration_SetAppAsDefault(IApplicationAssociationRegistration* This, LPCWSTR appname, + LPCWSTR set, ASSOCIATIONTYPE set_type) +{ + FIXME("(%p)->(%s, %s, %d)\n", This, debugstr_w(appname), debugstr_w(set), set_type); + return E_NOTIMPL; +} + +static HRESULT WINAPI ApplicationAssociationRegistration_SetAppAsDefaultAll(IApplicationAssociationRegistration* This, LPCWSTR appname) +{ + FIXME("(%p)->(%s)\n", This, debugstr_w(appname)); + return E_NOTIMPL; +} + + +static HRESULT WINAPI ApplicationAssociationRegistration_ClearUserAssociations(IApplicationAssociationRegistration* This) +{ + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + + +static const IApplicationAssociationRegistrationVtbl IApplicationAssociationRegistration_vtbl = +{ + ApplicationAssociationRegistration_QueryInterface, + ApplicationAssociationRegistration_AddRef, + ApplicationAssociationRegistration_Release, + ApplicationAssociationRegistration_QueryCurrentDefault, + ApplicationAssociationRegistration_QueryAppIsDefault, + ApplicationAssociationRegistration_QueryAppIsDefaultAll, + ApplicationAssociationRegistration_SetAppAsDefault, + ApplicationAssociationRegistration_SetAppAsDefaultAll, + ApplicationAssociationRegistration_ClearUserAssociations +}; + +/************************************************************************** * IQueryAssociations_Constructor [internal] * * Construct a new IQueryAssociations object. @@ -731,3 +847,30 @@ HRESULT WINAPI QueryAssociations_Constructor(IUnknown *pUnkOuter, REFIID riid, L TRACE("returning %p\n", *ppOutput); return ret; } + +/************************************************************************** + * ApplicationAssociationRegistration_Constructor [internal] + * + * Construct a IApplicationAssociationRegistration object. + */ +HRESULT WINAPI ApplicationAssociationRegistration_Constructor(IUnknown *outer, REFIID riid, LPVOID *ppv) +{ + IApplicationAssociationRegistrationImpl *This; + HRESULT hr; + + if (outer) + return CLASS_E_NOAGGREGATION; + + if (!(This = SHAlloc(sizeof(*This)))) + return E_OUTOFMEMORY; + + This->IApplicationAssociationRegistration_iface.lpVtbl = &IApplicationAssociationRegistration_vtbl; + This->ref = 0; + + hr = IUnknown_QueryInterface(&This->IApplicationAssociationRegistration_iface, riid, ppv); + if (FAILED(hr)) + SHFree(This); + + TRACE("returning 0x%x with %p\n", hr, *ppv); + return hr; +} diff --git a/dlls/shell32/shell32_classes.idl b/dlls/shell32/shell32_classes.idl index ae3e619eccd..3c96e79eab5 100644 --- a/dlls/shell32/shell32_classes.idl +++ b/dlls/shell32/shell32_classes.idl @@ -61,6 +61,12 @@ coclass KnownFolderManager { interface IKnownFolderManager; } ] coclass QueryAssociations { interface IQueryAssociations; } [ + helpstring("Manage Application associations"), + threading(apartment), + uuid(591209c7-767b-42b2-9fba-44ee4615f2c7) +] coclass ApplicationAssociationRegistration { interface IApplicationAssociationRegistration; } + +[ helpstring("Shell Drag and Drop Helper"), threading(apartment), uuid(4657278a-411b-11d2-839a-00c04fd918d0) diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h index 88a89a77850..ece186361e2 100644 --- a/dlls/shell32/shell32_main.h +++ b/dlls/shell32/shell32_main.h @@ -107,6 +107,8 @@ HRESULT WINAPI CPanel_ExtractIconA(LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIcon HRESULT WINAPI CPanel_ExtractIconW(LPITEMIDLIST pidl, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) DECLSPEC_HIDDEN; HRESULT WINAPI IAutoComplete_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv) DECLSPEC_HIDDEN; +HRESULT WINAPI ApplicationAssociationRegistration_Constructor(IUnknown *outer, REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN; + LPEXTRACTICONA IExtractIconA_Constructor(LPCITEMIDLIST) DECLSPEC_HIDDEN; LPEXTRACTICONW IExtractIconW_Constructor(LPCITEMIDLIST) DECLSPEC_HIDDEN; diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index fbf917d5915..b3f847c53f6 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -63,6 +63,7 @@ static const struct { LPFNCREATEINSTANCE lpfnCI; } InterfaceTable[] = { + {&CLSID_ApplicationAssociationRegistration, ApplicationAssociationRegistration_Constructor}, {&CLSID_AutoComplete, IAutoComplete_Constructor}, {&CLSID_ControlPanel, IControlPanel_Constructor}, {&CLSID_DragDropHelper, IDropTargetHelper_Constructor}, -- 2.11.4.GIT