From 9d2d367f3d01140cbe510ee7e3f7e1c7219a22f7 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 31 Jan 2020 13:37:38 +0300 Subject: [PATCH] ole32: Respond to CLSID in item moniker interface query. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/ole32/itemmoniker.c | 10 ++++++---- dlls/ole32/tests/moniker.c | 8 ++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/dlls/ole32/itemmoniker.c b/dlls/ole32/itemmoniker.c index 78b23ae633e..dee4fc0bf2d 100644 --- a/dlls/ole32/itemmoniker.c +++ b/dlls/ole32/itemmoniker.c @@ -140,21 +140,23 @@ static HRESULT set_container_lock(IOleItemContainer *container, IBindCtx *pbc) /******************************************************************************* * ItemMoniker_QueryInterface *******************************************************************************/ -static HRESULT WINAPI ItemMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject) +static HRESULT WINAPI ItemMonikerImpl_QueryInterface(IMoniker *iface, REFIID riid, void **ppvObject) { ItemMonikerImpl *This = impl_from_IMoniker(iface); - TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject); + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), ppvObject); if (!ppvObject) return E_INVALIDARG; - /* Compare the riid with the interface IDs implemented by this object.*/ if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IPersist, riid) || IsEqualIID(&IID_IPersistStream, riid) || - IsEqualIID(&IID_IMoniker, riid)) + IsEqualIID(&IID_IMoniker, riid) || + IsEqualGUID(&CLSID_ItemMoniker, riid)) + { *ppvObject = iface; + } else if (IsEqualIID(&IID_IROTData, riid)) *ppvObject = &This->IROTData_iface; else if (IsEqualIID(&IID_IMarshal, riid)) diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c index b22cf849461..d4853602152 100644 --- a/dlls/ole32/tests/moniker.c +++ b/dlls/ole32/tests/moniker.c @@ -2087,13 +2087,9 @@ static void test_item_moniker(void) ok(hr == S_OK, "Failed to create item moniker, hr %#x.\n", hr); hr = IMoniker_QueryInterface(moniker, &CLSID_ItemMoniker, (void **)&unknown); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - { - ok(unknown == (IUnknown *)moniker, "Unexpected interface.\n"); - IUnknown_Release(unknown); - } + ok(unknown == (IUnknown *)moniker, "Unexpected interface.\n"); + IUnknown_Release(unknown); test_moniker("item moniker 2", moniker, expected_item_moniker_marshal_data2, sizeof(expected_item_moniker_marshal_data2),