Hi Huw,
Huw Davies huw@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?