[3/3] ole32: Use a shortcut in DataCache_Save only if fSameAsLoad set to TRUE.

Huw Davies huw at codeweavers.com
Thu Oct 19 04:42:22 CDT 2017

On Thu, Oct 19, 2017 at 03:52:11PM +0800, Dmitry Timoshkov wrote:
> Hi Huw,
> Huw Davies <huw at codeweavers.com> wrote:
> > No, this isn't a typo.  The idea is to copy the loaded storage to a
> > fresh storage that is passed when fSameAsLoad is FALSE.
> > 
> > I'm aware that there are issues related to the storage handling
> > in both the cache and the default handler.  That's on my list
> > of things to look into, but feel free to investigate further.
> I just sent some tests for data cache behaviour when saving a loaded
> storage, and according to the tests the cache should not blindly copy
> the whole original storage (i.e. should not call IStorage_CopyTo) in
> its Save implementation. Moreover it looks like the cache never saves
> "Contents" streams, and saves only very first "OlePres" stream it has
> encountered for special storage classes. I'm attaching a preliminary
> patch that removes the IStorage_CopyTo optimization and solves some
> of the new tests. What is more important for me this patch also fixes
> the application that I have here (it's an OLE control that creates data
> cache storage with custom content, it uses MFC and according to MFC
> sources it doesn't expect to see "Contents" streams after OleSave()).
> What do you think?

There are a few things going on in that patch, so it would
obviously need splitting, but removing the CopyTo() shortcut
is fine.

Note also that the cache will save to a CONTENTS stream (and not
a presentation stream) if the class id is one of the static
picture classes.


More information about the wine-devel mailing list