shell32: Added IShellExtInit stub for context menus.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2018-02-18 19:10:44 +03:00 committed by Alexandre Julliard
parent 68056a3d27
commit 408f856f02
2 changed files with 46 additions and 4 deletions

View File

@ -45,6 +45,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
typedef struct typedef struct
{ {
IContextMenu3 IContextMenu3_iface; IContextMenu3 IContextMenu3_iface;
IShellExtInit IShellExtInit_iface;
LONG ref; LONG ref;
IShellFolder* parent; IShellFolder* parent;
@ -64,6 +65,11 @@ static inline ContextMenu *impl_from_IContextMenu3(IContextMenu3 *iface)
return CONTAINING_RECORD(iface, ContextMenu, IContextMenu3_iface); return CONTAINING_RECORD(iface, ContextMenu, IContextMenu3_iface);
} }
static inline ContextMenu *impl_from_IShellExtInit(IShellExtInit *iface)
{
return CONTAINING_RECORD(iface, ContextMenu, IShellExtInit_iface);
}
static HRESULT WINAPI ContextMenu_QueryInterface(IContextMenu3 *iface, REFIID riid, LPVOID *ppvObj) static HRESULT WINAPI ContextMenu_QueryInterface(IContextMenu3 *iface, REFIID riid, LPVOID *ppvObj)
{ {
ContextMenu *This = impl_from_IContextMenu3(iface); ContextMenu *This = impl_from_IContextMenu3(iface);
@ -79,9 +85,9 @@ static HRESULT WINAPI ContextMenu_QueryInterface(IContextMenu3 *iface, REFIID ri
{ {
*ppvObj = &This->IContextMenu3_iface; *ppvObj = &This->IContextMenu3_iface;
} }
else if (IsEqualIID(riid, &IID_IShellExtInit)) /*IShellExtInit*/ else if (IsEqualIID(riid, &IID_IShellExtInit))
{ {
FIXME("-- LPSHELLEXTINIT pointer requested\n"); *ppvObj = &This->IShellExtInit_iface;
} }
if(*ppvObj) if(*ppvObj)
@ -580,6 +586,42 @@ static const IContextMenu3Vtbl ItemContextMenuVtbl =
ContextMenu_HandleMenuMsg2 ContextMenu_HandleMenuMsg2
}; };
static HRESULT WINAPI ShellExtInit_QueryInterface(IShellExtInit *iface, REFIID riid, void **obj)
{
ContextMenu *This = impl_from_IShellExtInit(iface);
return IContextMenu3_QueryInterface(&This->IContextMenu3_iface, riid, obj);
}
static ULONG WINAPI ShellExtInit_AddRef(IShellExtInit *iface)
{
ContextMenu *This = impl_from_IShellExtInit(iface);
return IContextMenu3_AddRef(&This->IContextMenu3_iface);
}
static ULONG WINAPI ShellExtInit_Release(IShellExtInit *iface)
{
ContextMenu *This = impl_from_IShellExtInit(iface);
return IContextMenu3_Release(&This->IContextMenu3_iface);
}
static HRESULT WINAPI ShellExtInit_Initialize(IShellExtInit *iface, LPCITEMIDLIST folder,
IDataObject *dataobj, HKEY progidkey)
{
ContextMenu *This = impl_from_IShellExtInit(iface);
FIXME("(%p)->(%p %p %p): stub\n", This, folder, dataobj, progidkey);
return E_NOTIMPL;
}
static const IShellExtInitVtbl ShellExtInitVtbl =
{
ShellExtInit_QueryInterface,
ShellExtInit_AddRef,
ShellExtInit_Release,
ShellExtInit_Initialize
};
HRESULT ItemMenu_Constructor(IShellFolder *parent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *apidl, UINT cidl, HRESULT ItemMenu_Constructor(IShellFolder *parent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *apidl, UINT cidl,
REFIID riid, void **pObj) REFIID riid, void **pObj)
{ {
@ -591,6 +633,7 @@ HRESULT ItemMenu_Constructor(IShellFolder *parent, LPCITEMIDLIST pidl, const LPC
if (!This) return E_OUTOFMEMORY; if (!This) return E_OUTOFMEMORY;
This->IContextMenu3_iface.lpVtbl = &ItemContextMenuVtbl; This->IContextMenu3_iface.lpVtbl = &ItemContextMenuVtbl;
This->IShellExtInit_iface.lpVtbl = &ShellExtInitVtbl;
This->ref = 1; This->ref = 1;
This->parent = parent; This->parent = parent;
if (parent) IShellFolder_AddRef(parent); if (parent) IShellFolder_AddRef(parent);
@ -899,6 +942,7 @@ HRESULT BackgroundMenu_Constructor(IShellFolder *parent, BOOL desktop, REFIID ri
if (!This) return E_OUTOFMEMORY; if (!This) return E_OUTOFMEMORY;
This->IContextMenu3_iface.lpVtbl = &BackgroundContextMenuVtbl; This->IContextMenu3_iface.lpVtbl = &BackgroundContextMenuVtbl;
This->IShellExtInit_iface.lpVtbl = &ShellExtInitVtbl;
This->ref = 1; This->ref = 1;
This->parent = parent; This->parent = parent;

View File

@ -4354,9 +4354,7 @@ static void test_contextmenu(IContextMenu *menu, BOOL background)
HRESULT hr; HRESULT hr;
hr = IContextMenu_QueryInterface(menu, &IID_IShellExtInit, (void **)&unk); hr = IContextMenu_QueryInterface(menu, &IID_IShellExtInit, (void **)&unk);
todo_wine
ok(hr == S_OK, "Failed to get IShellExtInit, hr %#x.\n", hr); ok(hr == S_OK, "Failed to get IShellExtInit, hr %#x.\n", hr);
if (hr == S_OK)
IUnknown_Release(unk); IUnknown_Release(unk);
hr = IContextMenu_QueryInterface(menu, &IID_IObjectWithSite, (void **)&unk); hr = IContextMenu_QueryInterface(menu, &IID_IObjectWithSite, (void **)&unk);