[EXPLORER-NEW]
[reactos.git] / base / shell / explorer-new / tbsite.c
index 7a7e4e0..b29879d 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <precomp.h>
+#include "precomp.h"
+
+#include <shdeprecated.h>
+
+#include "undoc.h"
 
 /*****************************************************************************
  ** ITrayBandSite ************************************************************
@@ -131,24 +135,20 @@ ITrayBandSiteImpl_QueryInterface(IN OUT ITrayBandSite *iface,
 
     This = ITrayBandSiteImpl_from_ITrayBandSite(iface);
 
-    if (IsEqualIID(riid,
-                   &IID_IUnknown) ||
-        IsEqualIID(riid,
-                   &IID_IBandSiteStreamCallback))
+    if (IsEqualIID(riid, &IID_IUnknown) ||
+        IsEqualIID(riid, &IID_IBandSiteStreamCallback))
     {
         /* NOTE: IID_IBandSiteStreamCallback is queried by the shell, we
                  implement this interface directly */
         *ppvObj = IUnknown_from_ITrayBandSiteImpl(This);
     }
-    else if (IsEqualIID(riid,
-                        &IID_IBandSite))
+    else if (IsEqualIID(riid, &IID_IBandSite))
     {
         *ppvObj = IBandSite_from_ITrayBandSiteImpl(This);
     }
-    else if (IsEqualIID(riid,
-                        &IID_IWinEventHandler))
+    else if (IsEqualIID(riid, &IID_IWinEventHandler))
     {
-        DbgPrint("ITaskBandSite: IWinEventHandler queried!\n");
+        TRACE("ITaskBandSite: IWinEventHandler queried!\n");
         *ppvObj = NULL;
         return E_NOINTERFACE;
     }
@@ -227,7 +227,7 @@ ITrayBandSiteImpl_OnLoad(IN OUT ITrayBandSite *iface,
                 if (SUCCEEDED(hRet))
                 {
                     /* Load the stream */
-                    DbgPrint("IBandSiteStreamCallback::OnLoad intercepted the task band CLSID!\n");
+                    TRACE("IBandSiteStreamCallback::OnLoad intercepted the task band CLSID!\n");
                 }
 
                 return hRet;
@@ -250,7 +250,7 @@ ITrayBandSiteImpl_OnLoad(IN OUT ITrayBandSite *iface,
 
     if (!SUCCEEDED(hRet))
     {
-        DbgPrint("IBandSiteStreamCallback::OnLoad(0x%p, 0x%p, 0x%p) returns 0x%x\n", pStm, riid, pvObj, hRet);
+        TRACE("IBandSiteStreamCallback::OnLoad(0x%p, 0x%p, 0x%p) returns 0x%x\n", pStm, riid, pvObj, hRet);
     }
 
     return hRet;
@@ -265,7 +265,7 @@ ITrayBandSiteImpl_OnSave(IN OUT ITrayBandSite *iface,
              stream. We use it to intercept the default behavior when the task
              band is saved to the stream */
     /* FIXME: Implement */
-    DbgPrint("IBandSiteStreamCallback::OnSave(0x%p, 0x%p) returns E_NOTIMPL\n", pUnk, pStm);
+    TRACE("IBandSiteStreamCallback::OnSave(0x%p, 0x%p) returns E_NOTIMPL\n", pUnk, pStm);
     return E_NOTIMPL;
 }
 
@@ -349,7 +349,7 @@ ITrayBandSiteImpl_ProcessMessage(IN OUT ITrayBandSite *iface,
                 }
             }
 
-            //DbgPrint("ITrayBandSite::ProcessMessage: WM_NOTIFY for 0x%p, From: 0x%p, Code: NM_FIRST-%u...\n", hWnd, nmh->hwndFrom, NM_FIRST - nmh->code);
+            //TRACE("ITrayBandSite::ProcessMessage: WM_NOTIFY for 0x%p, From: 0x%p, Code: NM_FIRST-%u...\n", hWnd, nmh->hwndFrom, NM_FIRST - nmh->code);
             break;
         }
     };
@@ -358,7 +358,7 @@ ITrayBandSiteImpl_ProcessMessage(IN OUT ITrayBandSite *iface,
        shell behavior! */
     if (This->WindowEventHandler != NULL)
     {
-        /*DbgPrint("Calling IWinEventHandler::ProcessMessage(0x%p, 0x%x, 0x%p, 0x%p, 0x%p) This->hWndRebar=0x%p\n", hWnd, uMsg, wParam, lParam, plResult, This->hWndRebar);*/
+        /*TRACE("Calling IWinEventHandler::ProcessMessage(0x%p, 0x%x, 0x%p, 0x%p, 0x%p) This->hWndRebar=0x%p\n", hWnd, uMsg, wParam, lParam, plResult, This->hWndRebar);*/
         hRet = IWinEventHandler_OnWinEvent(This->WindowEventHandler,
                                                   hWnd,
                                                   uMsg,
@@ -370,11 +370,11 @@ ITrayBandSiteImpl_ProcessMessage(IN OUT ITrayBandSite *iface,
             if (uMsg == WM_NOTIFY)
             {
                 const NMHDR *nmh = (const NMHDR *)lParam;
-                DbgPrint("ITrayBandSite->IWinEventHandler::ProcessMessage: WM_NOTIFY for 0x%p, From: 0x%p, Code: NM_FIRST-%u returned 0x%x\n", hWnd, nmh->hwndFrom, NM_FIRST - nmh->code, hRet);
+                TRACE("ITrayBandSite->IWinEventHandler::ProcessMessage: WM_NOTIFY for 0x%p, From: 0x%p, Code: NM_FIRST-%u returned 0x%x\n", hWnd, nmh->hwndFrom, NM_FIRST - nmh->code, hRet);
             }
             else
             {
-                DbgPrint("ITrayBandSite->IWinEventHandler::ProcessMessage(0x%p,0x%x,0x%p,0x%p,0x%p->0x%p) returned: 0x%x\n", hWnd, uMsg, wParam, lParam, plResult, *plResult, hRet);
+                TRACE("ITrayBandSite->IWinEventHandler::ProcessMessage(0x%p,0x%x,0x%p,0x%p,0x%p->0x%p) returned: 0x%x\n", hWnd, uMsg, wParam, lParam, plResult, *plResult, hRet);
             }
         }
     }
@@ -405,7 +405,7 @@ ITrayBandSiteImpl_AddContextMenus(IN OUT ITrayBandSite *iface,
                                 CLSCTX_INPROC_SERVER,
                                 &IID_IShellService,
                                 (PVOID*)&pSs);
-        DbgPrint("CoCreateInstance(CLSID_IShellBandSiteMenu) for IShellService returned: 0x%x\n", hRet);
+        TRACE("CoCreateInstance(CLSID_IShellBandSiteMenu) for IShellService returned: 0x%x\n", hRet);
         if (!SUCCEEDED(hRet))
             return hRet;
 
@@ -806,7 +806,7 @@ ITrayBandSiteImpl_LoadFromStream(IN OUT ITrayBandSiteImpl *This,
     {
         hRet = IPersistStream_Load(pPStm,
                                    pStm);
-        DbgPrint("IPersistStream_Load() returned 0x%x\n", hRet);
+        TRACE("IPersistStream_Load() returned 0x%x\n", hRet);
         IPersistStream_Release(pPStm);
     }
 
@@ -868,7 +868,7 @@ ITrayBandSiteImpl_Load(IN OUT ITrayBandSiteImpl *This)
         hRet = ITrayBandSiteImpl_LoadFromStream(This,
                                                 pStm);
 
-        DbgPrint("Loaded user bands settings: 0x%x\n", hRet);
+        TRACE("Loaded user bands settings: 0x%x\n", hRet);
         IStream_Release(pStm);
     }
     else
@@ -885,7 +885,7 @@ ITrayBandSiteImpl_Load(IN OUT ITrayBandSiteImpl *This)
             hRet = ITrayBandSiteImpl_LoadFromStream(This,
                                                     pStm);
 
-            DbgPrint("Loaded default user bands settings: 0x%x\n", hRet);
+            TRACE("Loaded default user bands settings: 0x%x\n", hRet);
             IStream_Release(pStm);
         }
         else
@@ -910,13 +910,11 @@ ITrayBandSiteImpl_Construct(IN OUT ITrayWindow *Tray,
     *phwndTaskSwitch = NULL;
 
     This = HeapAlloc(hProcessHeap,
-                     0,
+                     HEAP_ZERO_MEMORY,
                      sizeof(*This));
     if (This == NULL)
         return NULL;
 
-    ZeroMemory(This,
-               sizeof(*This));
     This->lpVtbl = &ITrayBandSiteImpl_Vtbl;
     This->lpBandSiteVtbl = &IBandSiteImpl_Vtbl;
     This->Ref = 1;