[2/2] ole32: Fallback to parsing the Presentation streams ff parsing of the "CONTENTS" stream fails.

Dmitry Timoshkov dmitry at baikal.ru
Fri Oct 23 05:32:22 CDT 2015


I have an application that tries to load an existing object from the file
using OleLoad() and fails because the "CONTENTS" stream has clsid set to
"Microsoft Photo Editor 3.0 Picture". I've dumped the contents of the OLE
storage to disk for investigation, and under Windows (where Microsoft Photo
Editor is not installed, and registry has no traces of its class guids)
OleLoad() is able to load objects from this storage, and after that OleDraw()
successfully paints the object contents on the screen. I've written an
application to play with the dumped storage, and under Windows the "CONTENTS"
stream also can't be loaded, but the storage also contains the "OlePres000"
stream which contains an object in CF_METAFILEPICT format, and this one can be
loaded and painted.

This patch allows an application that I have here successfully load and
paint the objects from its existing storage.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 dlls/ole32/datacache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c
index 3db0edf..77e2eb1 100644
--- a/dlls/ole32/datacache.c
+++ b/dlls/ole32/datacache.c
@@ -1368,7 +1368,8 @@ static HRESULT WINAPI DataCache_Load( IPersistStorage *iface, IStorage *pStg )
         hr = parse_contents_stream( This, pStg, stm );
         IStream_Release( stm );
     }
-    else
+
+    if (FAILED(hr))
         hr = parse_pres_streams( This, pStg );
 
     if (SUCCEEDED( hr ))
-- 
2.6.2




More information about the wine-patches mailing list