Commit 525a7ab1 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

ole32: Implement IOleCache_InitCache().

parent ca2607db
......@@ -2373,12 +2373,10 @@ fail:
return hr;
}
static HRESULT WINAPI DataCache_InitCache(
IOleCache2* iface,
IDataObject* pDataObject)
static HRESULT WINAPI DataCache_InitCache( IOleCache2 *iface, IDataObject *data )
{
FIXME("stub\n");
return E_NOTIMPL;
TRACE( "(%p %p)\n", iface, data );
return IOleCache2_UpdateCache( iface, data, UPDFCACHE_ALLBUTNODATACACHE, NULL );
}
static HRESULT WINAPI DataCache_IOleCache2_SetData(
......
......@@ -1963,18 +1963,14 @@ static void test_data_cache(void)
DeleteDC(hdcMem);
todo_wine {
hr = IOleCache2_InitCache(pOleCache, &DataObject);
ok(hr == CACHE_E_NOCACHE_UPDATED, "IOleCache_InitCache should have returned CACHE_E_NOCACHE_UPDATED instead of 0x%08x\n", hr);
}
IPersistStorage_Release(pPS);
IViewObject_Release(pViewObject);
IOleCache2_Release(pOleCache);
todo_wine {
CHECK_NO_EXTRA_METHODS();
}
hr = CreateDataCache(NULL, &CLSID_NULL, &IID_IOleCache2, (LPVOID *)&pOleCache);
ok_ole_success(hr, "CreateDataCache");
......@@ -2623,6 +2619,12 @@ static void test_data_cache_updatecache( void )
{ "DataObject_GetData", 0, { CF_DIB, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL } },
{ NULL }
};
static const struct expected_method methods_initcache[] =
{
{ "DataObject_GetData", 0, { CF_DIB, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL } },
{ "DataObject_GetData", 0, { CF_METAFILEPICT, NULL, DVASPECT_CONTENT, -1, TYMED_MFPICT } },
{ NULL }
};
static const struct expected_method methods_empty[] =
{
{ NULL }
......@@ -2841,6 +2843,13 @@ static void test_data_cache_updatecache( void )
CHECK_NO_EXTRA_METHODS();
expected_method_list = methods_initcache;
hr = IOleCache2_InitCache( cache, &DataObject );
ok( hr == S_OK, "got %08x\n", hr );
CHECK_NO_EXTRA_METHODS();
IOleCache2_Release( cache );
}
......
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