[PATCH 6/6] ole32: Implement IOleCache_InitCache().

Huw Davies huw at codeweavers.com
Tue Oct 31 08:23:34 CDT 2017


Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 dlls/ole32/datacache.c  |  8 +++-----
 dlls/ole32/tests/ole2.c | 17 +++++++++++++----
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c
index 2c5e45134e..2907426f62 100644
--- a/dlls/ole32/datacache.c
+++ b/dlls/ole32/datacache.c
@@ -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(
diff --git a/dlls/ole32/tests/ole2.c b/dlls/ole32/tests/ole2.c
index 9b96570999..1a982b404c 100644
--- a/dlls/ole32/tests/ole2.c
+++ b/dlls/ole32/tests/ole2.c
@@ -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 );
 }
 
-- 
2.12.0




More information about the wine-patches mailing list