Huw Davies : ole32: TYMED_NULL is not valid.
Alexandre Julliard
julliard at winehq.org
Tue Oct 31 13:16:02 CDT 2017
Module: wine
Branch: master
Commit: c3fe4b87d6e5f1635241faf8146ee0dddd054177
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c3fe4b87d6e5f1635241faf8146ee0dddd054177
Author: Huw Davies <huw at codeweavers.com>
Date: Tue Oct 31 13:23:31 2017 +0000
ole32: TYMED_NULL is not valid.
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 | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c
index 2bb0948..9f9fdd3 100644
--- a/dlls/ole32/datacache.c
+++ b/dlls/ole32/datacache.c
@@ -328,7 +328,7 @@ static HRESULT check_valid_formatetc( const FORMATETC *fmt )
if (fmt->dwAspect == DVASPECT_ICON && fmt->cfFormat != CF_METAFILEPICT)
return DV_E_FORMATETC;
- if (!fmt->cfFormat || !fmt->tymed ||
+ if (!fmt->cfFormat ||
(fmt->cfFormat == CF_METAFILEPICT && fmt->tymed == TYMED_MFPICT) ||
(fmt->cfFormat == CF_BITMAP && fmt->tymed == TYMED_GDI) ||
(fmt->cfFormat == CF_DIB && fmt->tymed == TYMED_HGLOBAL) ||
diff --git a/dlls/ole32/tests/ole2.c b/dlls/ole32/tests/ole2.c
index 4f72622..aaee677 100644
--- a/dlls/ole32/tests/ole2.c
+++ b/dlls/ole32/tests/ole2.c
@@ -2332,6 +2332,13 @@ static void test_data_cache_cache(void)
hr = IOleCache2_Uncache( cache, conn );
ok( hr == S_OK, "got %08x\n", hr );
+ /* tymed == 0 */
+ fmt.cfFormat = CF_ENHMETAFILE;
+ fmt.dwAspect = DVASPECT_CONTENT;
+ fmt.tymed = 0;
+ hr = IOleCache2_Cache( cache, &fmt, 0, &conn );
+ ok( hr == DV_E_TYMED, "got %08x\n", hr );
+
IDataObject_Release( data );
IOleCache2_Release( cache );
}
More information about the wine-cvs
mailing list