Commit 3d2c8ef4 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32: Respond to CLSID in class moniker interface query.

parent a7ca3518
......@@ -60,24 +60,22 @@ static inline ClassMoniker *impl_from_IROTData(IROTData *iface)
/*******************************************************************************
* ClassMoniker_QueryInterface
*******************************************************************************/
static HRESULT WINAPI ClassMoniker_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject)
static HRESULT WINAPI ClassMoniker_QueryInterface(IMoniker *iface, REFIID riid, void **ppvObject)
{
ClassMoniker *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);
/* Perform a sanity check on the parameters.*/
if (!ppvObject)
return E_POINTER;
/* 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_ClassMoniker, riid))
{
*ppvObject = iface;
}
......@@ -93,11 +91,9 @@ static HRESULT WINAPI ClassMoniker_QueryInterface(IMoniker* iface,REFIID riid,vo
return IUnknown_QueryInterface(This->pMarshal, riid, ppvObject);
}
/* Check that we obtained an interface.*/
if (!*ppvObject)
return E_NOINTERFACE;
/* Query Interface always increases the reference count by one when it is successful */
IMoniker_AddRef(iface);
return S_OK;
......
......@@ -1773,13 +1773,9 @@ static void test_class_moniker(void)
ok_ole_success(hr, CreateClassMoniker);
hr = IMoniker_QueryInterface(moniker, &CLSID_ClassMoniker, (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);
}
test_moniker("class moniker", moniker,
expected_class_moniker_marshal_data, sizeof(expected_class_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