Robert Shearman : ole32: Call IRunnableObject_Run and IOleCache_Cache from OleCreate if the render option is specified as draw or format .

Alexandre Julliard julliard at wine.codeweavers.com
Thu Sep 7 05:07:15 CDT 2006


Module: wine
Branch: master
Commit: 53be8cc861461e5635854befdf1e4eb74f92add1
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=53be8cc861461e5635854befdf1e4eb74f92add1

Author: Robert Shearman <rob at codeweavers.com>
Date:   Thu Aug 31 17:16:28 2006 +0100

ole32: Call IRunnableObject_Run and IOleCache_Cache from OleCreate if the render option is specified as draw or format.

This is documented on MSDN and is confirmed by tests.

---

 dlls/ole32/ole2.c |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c
index 4d7c17b..e2d9d9d 100644
--- a/dlls/ole32/ole2.c
+++ b/dlls/ole32/ole2.c
@@ -2341,7 +2341,30 @@ HRESULT WINAPI OleCreate(
 
     if (pOleObject)
         IOleObject_Release(pOleObject);
-    
+
+    if (((renderopt == OLERENDER_DRAW) || (renderopt == OLERENDER_FORMAT)) &&
+        SUCCEEDED(hres))
+    {
+        IRunnableObject *pRunnable;
+        IOleCache *pOleCache;
+
+        hres = IUnknown_QueryInterface(pUnk, &IID_IRunnableObject, (void **)&pRunnable);
+        if (SUCCEEDED(hres))
+        {
+            hres = IRunnableObject_Run(pRunnable, NULL);
+            IRunnableObject_Release(pRunnable);
+        }
+
+        if (SUCCEEDED(hres))
+            hres = IUnknown_QueryInterface(pUnk, &IID_IOleCache, (void **)&pOleCache);
+        if (SUCCEEDED(hres))
+        {
+            DWORD dwConnection;
+            hres = IOleCache_Cache(pOleCache, pFormatEtc, ADVF_PRIMEFIRST, &dwConnection);
+            IOleCache_Release(pOleCache);
+        }
+    }
+
     if (FAILED(hres))
     {
         IUnknown_Release(pUnk);




More information about the wine-cvs mailing list