Commit 87ccecbf authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

ole32: In the non-aggregated case a request for IUnknown actually returns IOleCache2.

parent 52f686e0
...@@ -1123,7 +1123,10 @@ static HRESULT WINAPI DataCache_NDIUnknown_QueryInterface( ...@@ -1123,7 +1123,10 @@ static HRESULT WINAPI DataCache_NDIUnknown_QueryInterface(
if (IsEqualIID(&IID_IUnknown, riid)) if (IsEqualIID(&IID_IUnknown, riid))
{ {
*ppvObject = iface; if (this->outer_unk == iface) /* non-aggregated, return IUnknown from IOleCache2 */
*ppvObject = &this->IOleCache2_iface;
else
*ppvObject = iface;
} }
else if (IsEqualIID(&IID_IDataObject, riid)) else if (IsEqualIID(&IID_IDataObject, riid))
{ {
......
...@@ -1560,7 +1560,7 @@ static void test_data_cache(void) ...@@ -1560,7 +1560,7 @@ static void test_data_cache(void)
IOleCache2 *pOleCache; IOleCache2 *pOleCache;
IOleCache *olecache; IOleCache *olecache;
IStorage *pStorage; IStorage *pStorage;
IUnknown *unk; IUnknown *unk, *unk2;
IPersistStorage *pPS; IPersistStorage *pPS;
IViewObject *pViewObject; IViewObject *pViewObject;
IOleCacheControl *pOleCacheControl; IOleCacheControl *pOleCacheControl;
...@@ -1651,10 +1651,12 @@ static void test_data_cache(void) ...@@ -1651,10 +1651,12 @@ static void test_data_cache(void)
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IUnknown_QueryInterface(unk, &IID_IOleCache2, (void**)&pOleCache); hr = IUnknown_QueryInterface(unk, &IID_IOleCache2, (void**)&pOleCache);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine { hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void**)&unk2);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(unk == (IUnknown*)olecache, "got %p, expected %p\n", olecache, unk); ok(unk == (IUnknown*)olecache, "got %p, expected %p\n", olecache, unk);
ok(unk == (IUnknown*)pOleCache, "got %p, expected %p\n", pOleCache, unk); ok(unk == (IUnknown*)pOleCache, "got %p, expected %p\n", pOleCache, unk);
} ok(unk == unk2, "got %p, expected %p\n", unk2, unk);
IUnknown_Release(unk2);
IOleCache2_Release(pOleCache); IOleCache2_Release(pOleCache);
IOleCache_Release(olecache); IOleCache_Release(olecache);
IUnknown_Release(unk); IUnknown_Release(unk);
......
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