Huw Davies : ole32: Allow caching of icon aspects for static class caches.
Alexandre Julliard
julliard at winehq.org
Thu Jan 25 17:37:40 CST 2018
Module: wine
Branch: master
Commit: c140cf115b876321242497757612905303d5ea7f
URL: https://source.winehq.org/git/wine.git/?a=commit;h=c140cf115b876321242497757612905303d5ea7f
Author: Huw Davies <huw at codeweavers.com>
Date: Thu Jan 25 11:04:30 2018 +0000
ole32: Allow caching of icon aspects for static class caches.
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ole32/datacache.c | 2 +-
dlls/ole32/tests/ole2.c | 13 ++++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c
index c07633d..325a98b 100644
--- a/dlls/ole32/datacache.c
+++ b/dlls/ole32/datacache.c
@@ -2398,7 +2398,7 @@ static HRESULT WINAPI DataCache_Cache(
return CACHE_S_SAMECACHE;
}
- if (This->clsid_static) return DV_E_FORMATETC;
+ if (This->clsid_static && fmt_cpy.dwAspect != DVASPECT_ICON) return DV_E_FORMATETC;
hr = DataCache_CreateEntry(This, &fmt_cpy, advf, FALSE, &cache_entry);
diff --git a/dlls/ole32/tests/ole2.c b/dlls/ole32/tests/ole2.c
index 1a4fce5..3bd4acc 100644
--- a/dlls/ole32/tests/ole2.c
+++ b/dlls/ole32/tests/ole2.c
@@ -2441,13 +2441,24 @@ static void test_data_cache_cache(void)
hr = IOleCache2_Cache( cache, &fmt, 0, &conn );
ok( FAILED(hr), "got %08x\n", hr );
+ fmt.dwAspect = DVASPECT_DOCPRINT;
+ hr = IOleCache2_Cache( cache, &fmt, 0, &conn );
+ ok( FAILED(hr), "got %08x\n", hr );
+
/* try caching another clip format */
- fmt.dwAspect = DVASPECT_CONTENT;
fmt.cfFormat = CF_METAFILEPICT;
+ fmt.dwAspect = DVASPECT_CONTENT;
fmt.tymed = TYMED_MFPICT;
hr = IOleCache2_Cache( cache, &fmt, 0, &conn );
ok( FAILED(hr), "got %08x\n", hr );
+ /* As an exception, it's possible to add an icon aspect */
+ fmt.cfFormat = CF_METAFILEPICT;
+ fmt.dwAspect = DVASPECT_ICON;
+ fmt.tymed = TYMED_MFPICT;
+ hr = IOleCache2_Cache( cache, &fmt, 0, &conn );
+ ok( hr == S_OK, "got %08x\n", hr );
+
IOleCache2_Release( cache );
}
More information about the wine-cvs
mailing list