Huw Davies : ole32: Implement IOleCache_InitCache().

Alexandre Julliard julliard at winehq.org
Tue Oct 31 13:16:02 CDT 2017


Module: wine
Branch: master
Commit: 525a7ab1df800f7b43f993d79145204ef73db29c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=525a7ab1df800f7b43f993d79145204ef73db29c

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue Oct 31 13:23:34 2017 +0000

ole32: Implement IOleCache_InitCache().

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 2c5e451..2907426 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 9b96570..1a982b4 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 );
 }
 




More information about the wine-cvs mailing list