Commit b06281c2 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32: Respond to CLSID in file moniker interface query.

parent 3d2c8ef4
...@@ -64,28 +64,25 @@ static HRESULT FileMonikerImpl_Destroy(FileMonikerImpl* iface); ...@@ -64,28 +64,25 @@ static HRESULT FileMonikerImpl_Destroy(FileMonikerImpl* iface);
/******************************************************************************* /*******************************************************************************
* FileMoniker_QueryInterface * FileMoniker_QueryInterface
*/ */
static HRESULT WINAPI static HRESULT WINAPI FileMonikerImpl_QueryInterface(IMoniker *iface, REFIID riid, void **ppvObject)
FileMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject)
{ {
FileMonikerImpl *This = impl_from_IMoniker(iface); FileMonikerImpl *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)
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_FileMoniker, 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))
...@@ -98,11 +95,9 @@ FileMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject) ...@@ -98,11 +95,9 @@ FileMonikerImpl_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)
if ((*ppvObject)==0)
return E_NOINTERFACE; return E_NOINTERFACE;
/* Query Interface always increases the reference count by one when it is successful */
IMoniker_AddRef(iface); IMoniker_AddRef(iface);
return S_OK; return S_OK;
......
...@@ -1877,13 +1877,9 @@ static void test_file_moniker(WCHAR* path) ...@@ -1877,13 +1877,9 @@ static void test_file_moniker(WCHAR* path)
ok_ole_success(hr, CreateFileMoniker); ok_ole_success(hr, CreateFileMoniker);
hr = IMoniker_QueryInterface(moniker1, &CLSID_FileMoniker, (void **)&unk); hr = IMoniker_QueryInterface(moniker1, &CLSID_FileMoniker, (void **)&unk);
todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
if (SUCCEEDED(hr))
{
ok(unk == (IUnknown *)moniker1, "Unexpected interface.\n"); ok(unk == (IUnknown *)moniker1, "Unexpected interface.\n");
IUnknown_Release(unk); IUnknown_Release(unk);
}
hr = IMoniker_Inverse(moniker1, &inverse); hr = IMoniker_Inverse(moniker1, &inverse);
ok(hr == S_OK, "Failed to get inverse, hr %#x.\n", hr); ok(hr == S_OK, "Failed to get inverse, hr %#x.\n", hr);
......
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