[ros-diffs] [weiden] 33925: More IDeskBar support

weiden at svn.reactos.org weiden at svn.reactos.org
Wed Jun 11 05:52:46 CEST 2008


Author: weiden
Date: Tue Jun 10 22:52:45 2008
New Revision: 33925

URL: http://svn.reactos.org/svn/reactos?rev=33925&view=rev
Log:
More IDeskBar support

Modified:
    trunk/reactos/dll/win32/browseui/bandsite.c

Modified: trunk/reactos/dll/win32/browseui/bandsite.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/bandsite.c?rev=33925&r1=33924&r2=33925&view=diff
==============================================================================
--- trunk/reactos/dll/win32/browseui/bandsite.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/bandsite.c [iso-8859-1] Tue Jun 10 22:52:45 2008
@@ -299,7 +299,8 @@
     INT i;
     LONG NewAllocated;
     struct BandObject *NewBand = NULL;
-    IDeskBand *DeskBand;
+    IDeskBand *DeskBand = NULL;
+    IObjectWithSite *ObjWithSite = NULL;
     HRESULT hRet;
 
     TRACE("(%p, %p)\n", iface, punk);
@@ -311,7 +312,12 @@
                                    &IID_IDeskBand,
                                    (PVOID*)&DeskBand);
     if (!SUCCEEDED(hRet) || DeskBand == NULL)
-        return E_FAIL;
+        goto Cleanup;
+    hRet = IUnknown_QueryInterface(punk,
+                                   &IID_IObjectWithSite,
+                                   (PVOID*)&ObjWithSite);
+    if (!SUCCEEDED(hRet) || ObjWithSite == NULL)
+        goto Cleanup;
 
     hRet = S_OK;
     if (This->BandsAllocated > This->BandsCount)
@@ -387,11 +393,21 @@
 
         This->BandsCount++;
 
+        hRet = ObjWithSite->lpVtbl->SetSite(ObjWithSite,
+                                            (IUnknown*)iface);
+        if (!SUCCEEDED(hRet))
+            ERR("IBandSite::AddBand(): Call to IDeskBand::SetSite() failed: %x\n", hRet);
+
+        if (ObjWithSite != NULL)
+            ObjWithSite->lpVtbl->Release(ObjWithSite);
+
         return (HRESULT)((SHORT)(NewBand - This->Bands));
     }
 Cleanup:
     if (DeskBand != NULL)
         DeskBand->lpVtbl->Release(DeskBand);
+    if (ObjWithSite != NULL)
+        ObjWithSite->lpVtbl->Release(ObjWithSite);
     return hRet;
 }
 



More information about the Ros-diffs mailing list