Piotr Caban : ole32: Get CLSID from IStorage object in WriteFmtUserTypeStg.

Alexandre Julliard julliard at winehq.org
Mon Apr 7 13:20:08 CDT 2014


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Mon Apr  7 18:55:50 2014 +0200

ole32: Get CLSID from IStorage object in WriteFmtUserTypeStg.

---

 dlls/ole32/storage32.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 8ad3ff9..864a5ec 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -8760,9 +8760,10 @@ static HRESULT STORAGE_WriteCompObj( LPSTORAGE pstg, CLSID *clsid,
 HRESULT WINAPI WriteFmtUserTypeStg(
 	  LPSTORAGE pstg, CLIPFORMAT cf, LPOLESTR lpszUserType)
 {
+    STATSTG stat;
     HRESULT r;
     WCHAR szwClipName[0x40];
-    CLSID clsid = CLSID_NULL;
+    CLSID clsid;
     LPWSTR wstrProgID = NULL;
     DWORD n;
 
@@ -8778,12 +8779,12 @@ HRESULT WINAPI WriteFmtUserTypeStg(
 
     TRACE("Clipboard name is %s\n", debugstr_w(szwClipName));
 
-    /* FIXME: There's room to save a CLSID and its ProgID, but
-       the CLSID is not looked up in the registry and in all the
-       tests I wrote it was CLSID_NULL.  Where does it come from?
-    */
+    r = IStorage_Stat(pstg, &stat, STATFLAG_NONAME);
+    if(SUCCEEDED(r))
+        clsid = stat.clsid;
+    else
+        clsid = CLSID_NULL;
 
-    /* get the real program ID.  This may fail, but that's fine */
     ProgIDFromCLSID(&clsid, &wstrProgID);
 
     TRACE("progid is %s\n",debugstr_w(wstrProgID));




More information about the wine-cvs mailing list