Commit 8f34b9e8 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32: Respond to CLSID in antimoniker interface query.

parent 0024d184
...@@ -81,19 +81,19 @@ AntiMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject) ...@@ -81,19 +81,19 @@ AntiMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject)
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject); TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject);
/* Perform a sanity check on the parameters.*/
if ( ppvObject==0 ) if ( ppvObject==0 )
return E_INVALIDARG; return E_INVALIDARG;
/* Initialize the return parameter */
*ppvObject = 0; *ppvObject = 0;
/* Compare the riid with the interface IDs implemented by this object.*/
if (IsEqualIID(&IID_IUnknown, riid) || if (IsEqualIID(&IID_IUnknown, riid) ||
IsEqualIID(&IID_IPersist, riid) || IsEqualIID(&IID_IPersist, riid) ||
IsEqualIID(&IID_IPersistStream, riid) || IsEqualIID(&IID_IPersistStream, riid) ||
IsEqualIID(&IID_IMoniker, riid)) IsEqualIID(&IID_IMoniker, riid) ||
IsEqualGUID(&CLSID_AntiMoniker, riid))
{
*ppvObject = iface; *ppvObject = iface;
}
else if (IsEqualIID(&IID_IROTData, riid)) else if (IsEqualIID(&IID_IROTData, riid))
*ppvObject = &This->IROTData_iface; *ppvObject = &This->IROTData_iface;
else if (IsEqualIID(&IID_IMarshal, riid)) else if (IsEqualIID(&IID_IMarshal, riid))
...@@ -106,11 +106,9 @@ AntiMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject) ...@@ -106,11 +106,9 @@ AntiMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject)
return IUnknown_QueryInterface(This->pMarshal, riid, ppvObject); return IUnknown_QueryInterface(This->pMarshal, riid, ppvObject);
} }
/* Check that we obtained an interface.*/
if ((*ppvObject)==0) if ((*ppvObject)==0)
return E_NOINTERFACE; return E_NOINTERFACE;
/* always increase the reference count by one when it is successful */
IMoniker_AddRef(iface); IMoniker_AddRef(iface);
return S_OK; return S_OK;
......
...@@ -2454,13 +2454,9 @@ static void test_anti_moniker(void) ...@@ -2454,13 +2454,9 @@ static void test_anti_moniker(void)
ok_ole_success(hr, CreateAntiMoniker); ok_ole_success(hr, CreateAntiMoniker);
hr = IMoniker_QueryInterface(moniker, &CLSID_AntiMoniker, (void **)&unknown); hr = IMoniker_QueryInterface(moniker, &CLSID_AntiMoniker, (void **)&unknown);
todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); 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, test_moniker("anti moniker", moniker,
expected_anti_moniker_marshal_data, sizeof(expected_anti_moniker_marshal_data), expected_anti_moniker_marshal_data, sizeof(expected_anti_moniker_marshal_data),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment