ole32: Implement IOleCache_InitCache().

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2017-10-31 13:23:34 +00:00 committed by Alexandre Julliard
parent ca2607db32
commit 525a7ab1df
2 changed files with 16 additions and 9 deletions

View file

@ -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(

View file

@ -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 );
}