Huw Davies : ole32: Add support for retrieving data from IPersistStorage.

Alexandre Julliard julliard at winehq.org
Tue May 19 09:23:10 CDT 2009


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Mon May 11 13:51:49 2009 +0100

ole32: Add support for retrieving data from IPersistStorage.

---

 dlls/ole32/ole2impl.c |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/dlls/ole32/ole2impl.c b/dlls/ole32/ole2impl.c
index dd65e88..b37ced6 100644
--- a/dlls/ole32/ole2impl.c
+++ b/dlls/ole32/ole2impl.c
@@ -98,13 +98,15 @@ static inline void init_fmtetc(FORMATETC *fmt, CLIPFORMAT cf, TYMED tymed)
  *
  * Retrieve an object's storage from a variety of sources.
  *
- * FIXME: CF_EMBEDDEDOBJECT, CF_FILENAME, IPersistStorage.
+ * FIXME: CF_EMBEDDEDOBJECT, CF_FILENAME.
  */
 static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf)
 {
     HRESULT hr;
     FORMATETC fmt;
     STGMEDIUM med;
+    IPersistStorage *persist;
+    CLSID clsid;
 
     *src_cf = 0;
 
@@ -119,6 +121,24 @@ static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf)
         return hr;
     }
 
+    /* IPersistStorage */
+    hr = IDataObject_QueryInterface(data, &IID_IPersistStorage, (void**)&persist);
+    if(FAILED(hr)) return hr;
+
+    hr = IPersistStorage_GetClassID(persist, &clsid);
+    if(FAILED(hr)) goto end;
+
+    hr = IStorage_SetClass(stg, &clsid);
+    if(FAILED(hr)) goto end;
+
+    hr = IPersistStorage_Save(persist, stg, FALSE);
+    if(FAILED(hr)) goto end;
+
+    hr = IPersistStorage_SaveCompleted(persist, NULL);
+
+end:
+    IPersistStorage_Release(persist);
+
     return hr;
 }
 




More information about the wine-cvs mailing list