[SHELL32][BROWSEUI] -Demote some uselass error prints and promote some others that...
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Wed, 30 Aug 2017 12:29:43 +0000 (12:29 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Wed, 30 Aug 2017 12:29:43 +0000 (12:29 +0000)
svn path=/trunk/; revision=75712

reactos/dll/win32/browseui/shellbrowser.cpp
reactos/dll/win32/browseui/travellog.cpp
reactos/dll/win32/shell32/wine/changenotify.c
reactos/dll/win32/shell32/wine/shellord.c

index be978ae..25df806 100644 (file)
@@ -1379,18 +1379,22 @@ LRESULT CALLBACK CShellBrowser::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam,
     previousMessage = pThis->m_pCurrentMsg;
     pThis->m_pCurrentMsg = &msg;
 
-    CComPtr<IMenuBand> menuBand;
-    hResult = pThis->GetMenuBand(IID_PPV_ARG(IMenuBand, &menuBand));
-    if (SUCCEEDED(hResult) && menuBand.p != NULL)
-    {
-        hResult = menuBand->TranslateMenuMessage(&msg, &lResult);
-        if (hResult == S_OK)
-            return lResult;
-        uMsg = msg.message;
-        wParam = msg.wParam;
-        lParam = msg.lParam;
-    }
-    menuBand.Release();
+    /* If the shell browser is initialized, let the menu band preprocess the messages */
+    if (pThis->fCurrentDirectoryPIDL)
+    {
+        CComPtr<IMenuBand> menuBand;
+        hResult = pThis->GetMenuBand(IID_PPV_ARG(IMenuBand, &menuBand));
+        if (SUCCEEDED(hResult) && menuBand.p != NULL)
+        {
+            hResult = menuBand->TranslateMenuMessage(&msg, &lResult);
+            if (hResult == S_OK)
+                return lResult;
+            uMsg = msg.message;
+            wParam = msg.wParam;
+            lParam = msg.lParam;
+        }
+        menuBand.Release();
+    }
 
     handled = pThis->ProcessWindowMessage(hWnd, uMsg, wParam, lParam, lResult, 0);
     ATLASSERT(pThis->m_pCurrentMsg == &msg);
index 67f5a65..275ec52 100644 (file)
@@ -400,7 +400,7 @@ HRESULT STDMETHODCALLTYPE CTravelLog::GetTravelEntry(IUnknown *punk, int iOffset
     HRESULT                                 hResult;
     
     hResult = FindRelativeEntry(iOffset, &destinationEntry);
-    if (FAILED_UNEXPECTEDLY(hResult))
+    if (FAILED(hResult))
         return hResult;
     hResult = destinationEntry->QueryInterface(IID_PPV_ARG(ITravelEntry, ppte));
     if (FAILED_UNEXPECTEDLY(hResult))
index 737c4d2..d3c75ee 100644 (file)
@@ -34,6 +34,7 @@
 #include <wine/debug.h>
 #include <wine/list.h>
 #include <process.h>
+#include <shellutils.h>
 
 #include "pidl.h"
 
@@ -170,7 +171,7 @@ static void DeleteNode(LPNOTIFICATIONLIST item)
     queued = InterlockedCompareExchange(&item->wQueuedCount, 0, 0);
     if (queued != 0)
     {
-        TRACE("Not freeing, still %d queued events\n", queued);
+        ERR("Not freeing, still %d queued events\n", queued);
         return;
     }
     TRACE("Freeing for real! %p (%d) \n", item, item->cidl);
@@ -276,13 +277,6 @@ SHChangeNotifyRegister(
                 InterlockedIncrement(&item->wQueuedCount);
                 QueueUserAPC( _AddDirectoryProc, m_hThread, (ULONG_PTR) &item->apidl[i] );
             }
-            else
-            {
-                CHAR buffer[MAX_PATH];
-                if (!SHGetPathFromIDListA( item->apidl[i].pidl, buffer ))
-                    strcpy( buffer, "<unknown>" );
-                ERR("_OpenDirectory failed for %s\n", buffer);
-            }
         }
 #endif
     }
@@ -661,16 +655,16 @@ BOOL _OpenDirectory(LPNOTIFYREGISTER item)
         return TRUE;
 
     hr = SHGetDesktopFolder(&psfDesktop);
-    if (!SUCCEEDED(hr))
+    if (FAILED_UNEXPECTEDLY(hr))
         return FALSE;
 
     hr = IShellFolder_GetDisplayNameOf(psfDesktop, item->pidl, SHGDN_FORPARSING, &strFile);
     IShellFolder_Release(psfDesktop);
-    if (!SUCCEEDED(hr))
+    if (FAILED_UNEXPECTEDLY(hr))
         return FALSE;
 
     hr = StrRetToBufW(&strFile, NULL, item->wstrDirectory, _countof(item->wstrDirectory));
-    if (!SUCCEEDED(hr))
+    if (FAILED_UNEXPECTEDLY(hr))
         return FALSE;
 
     TRACE("_OpenDirectory %s\n", debugstr_w(item->wstrDirectory));
@@ -685,6 +679,7 @@ BOOL _OpenDirectory(LPNOTIFYREGISTER item)
 
     if (item->hDirectory == INVALID_HANDLE_VALUE)
     {
+        ERR("_OpenDirectory failed for %s\n", debugstr_w(item->wstrDirectory));
         return FALSE;
     }
     return TRUE;
index cf5796e..e0bfb46 100644 (file)
@@ -1245,7 +1245,7 @@ BOOL WINAPI ReadCabinetState(CABINETSTATE *cs, int length)
        if ( (r != ERROR_SUCCESS) || (cs->cLength < sizeof(*cs)) ||
                (cs->cLength != length) )
        {
-               ERR("Initializing shell cabinet settings\n");
+               TRACE("Initializing shell cabinet settings\n");
                memset(cs, 0, sizeof(*cs));
                cs->cLength          = sizeof(*cs);
                cs->nVersion         = 2;