Huw Davies : ole32: Read the class id from the top-level storage object.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Mar 25 10:13:22 CDT 2015


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Wed Mar 25 08:37:33 2015 +0000

ole32: Read the class id from the top-level storage object.

The cache_entries' storages are just references to the same object anyway.

---

 dlls/ole32/datacache.c | 34 ++++++++++++++--------------------
 1 file changed, 14 insertions(+), 20 deletions(-)

diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c
index 2aae536..d9754a3 100644
--- a/dlls/ole32/datacache.c
+++ b/dlls/ole32/datacache.c
@@ -1182,34 +1182,28 @@ static ULONG WINAPI DataCache_IPersistStorage_Release(
 /************************************************************************
  * DataCache_GetClassID (IPersistStorage)
  *
- * The data cache doesn't implement this method.
  */
-static HRESULT WINAPI DataCache_GetClassID(
-            IPersistStorage* iface,
-	    CLSID*           pClassID)
+static HRESULT WINAPI DataCache_GetClassID(IPersistStorage *iface, CLSID *clsid)
 {
-  DataCache *This = impl_from_IPersistStorage(iface);
-  DataCacheEntry *cache_entry;
+    DataCache *This = impl_from_IPersistStorage( iface );
+    HRESULT hr;
+    STATSTG statstg;
 
-  TRACE("(%p, %p)\n", iface, pClassID);
+    TRACE( "(%p, %p)\n", iface, clsid );
 
-  LIST_FOR_EACH_ENTRY(cache_entry, &This->cache_list, DataCacheEntry, entry)
-  {
-    if (cache_entry->storage != NULL)
+    if (This->presentationStorage)
     {
-      STATSTG statstg;
-      HRESULT hr = IStorage_Stat(cache_entry->storage, &statstg, STATFLAG_NONAME);
-      if (SUCCEEDED(hr))
-      {
-        *pClassID = statstg.clsid;
-        return S_OK;
-      }
+        hr = IStorage_Stat( This->presentationStorage, &statstg, STATFLAG_NONAME );
+        if (SUCCEEDED(hr))
+        {
+            *clsid = statstg.clsid;
+            return S_OK;
+        }
     }
-  }
 
-  *pClassID = CLSID_NULL;
+    *clsid = CLSID_NULL;
 
-  return S_OK;
+    return S_OK;
 }
 
 /************************************************************************




More information about the wine-cvs mailing list