Module: wine Branch: master Commit: 8f34b9e834ce2b6b83b27a6f954f4852be0de9aa URL: https://source.winehq.org/git/wine.git/?a=commit;h=8f34b9e834ce2b6b83b27a6f9...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Fri Jan 31 13:37:34 2020 +0300
ole32: Respond to CLSID in antimoniker interface query.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ole32/antimoniker.c | 10 ++++------ dlls/ole32/tests/moniker.c | 8 ++------ 2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/dlls/ole32/antimoniker.c b/dlls/ole32/antimoniker.c index 7abbfc544f..c0937a8d90 100644 --- a/dlls/ole32/antimoniker.c +++ b/dlls/ole32/antimoniker.c @@ -81,19 +81,19 @@ AntiMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject)
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject);
- /* Perform a sanity check on the parameters.*/ if ( ppvObject==0 ) return E_INVALIDARG;
- /* Initialize the return parameter */ *ppvObject = 0;
- /* 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_AntiMoniker, riid)) + { *ppvObject = iface; + } else if (IsEqualIID(&IID_IROTData, riid)) *ppvObject = &This->IROTData_iface; else if (IsEqualIID(&IID_IMarshal, riid)) @@ -106,11 +106,9 @@ AntiMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject) return IUnknown_QueryInterface(This->pMarshal, riid, ppvObject); }
- /* Check that we obtained an interface.*/ if ((*ppvObject)==0) return E_NOINTERFACE;
- /* always increase the reference count by one when it is successful */ IMoniker_AddRef(iface);
return S_OK; diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c index 7e7d615645..3dd7048ef4 100644 --- a/dlls/ole32/tests/moniker.c +++ b/dlls/ole32/tests/moniker.c @@ -2454,13 +2454,9 @@ static void test_anti_moniker(void) ok_ole_success(hr, CreateAntiMoniker);
hr = IMoniker_QueryInterface(moniker, &CLSID_AntiMoniker, (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("anti moniker", moniker, expected_anti_moniker_marshal_data, sizeof(expected_anti_moniker_marshal_data),