Author: dquintana
Date: Wed Oct 29 11:52:45 2014
New Revision: 65098
URL: http://svn.reactos.org/svn/reactos?rev=65098&view=rev
Log:
[RSHELL]
* Fix assumption that the USER folder will always exist and only the COMMON folder may be missing. Allows the Start Menu to work in livecd.
[BROWSEUI]
* Apply the same fix to the Favorites folder, although the LiveCD does not currently have the folder so it will not work regardless.
Modified:
branches/shell-experiments/base/shell/rshell/CStartMenu.cpp
branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
Modified: branches/shell-experiments/base/shell/rshell/CStartMenu.cpp
URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] Wed Oct 29 11:52:45 2014
@@ -20,6 +20,8 @@
#include "precomp.h"
#include "CMergedFolder.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(CStartMenu);
// TODO: declare these GUIDs and interfaces in the right place (whatever that may be)
IID IID_IAugmentedShellFolder = { 0x91EA3F8C, 0xC99B, 0x11D0, { 0x98, 0x15, 0x00, 0xC0, 0x4F, 0xD9, 0x19, 0x72 } };
@@ -336,15 +338,30 @@
hr = SHGetSpecialFolderLocation(NULL, CSIDL_STARTMENU, &pidlUserStartMenu);
if (FAILED(hr))
- return hr;
-
- if (FAILED(SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_STARTMENU, &pidlCommonStartMenu)))
- {
+ {
+ WARN("Failed to get the USER start menu folder. Trying to run with just the COMMON one.\n");
+
+ hr = SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_STARTMENU, &pidlCommonStartMenu);
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+
+ TRACE("COMMON start menu obtained.\n");
+ hr = BindToDesktop(pidlCommonStartMenu, ppsfStartMenu);
+ ILFree(pidlCommonStartMenu);
+ return hr;
+ }
+
+ hr = SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_STARTMENU, &pidlCommonStartMenu);
+ if (FAILED_UNEXPECTEDLY(hr))
+ {
+ WARN("Failed to get the COMMON start menu folder. Will use only the USER contents.\n");
hr = BindToDesktop(pidlUserStartMenu, ppsfStartMenu);
ILFree(pidlUserStartMenu);
return hr;
}
+ TRACE("Both COMMON and USER statr menu folders obtained, merging them...\n");
+
hr = BindToDesktop(pidlUserStartMenu, &psfUserStartMenu);
if (FAILED_UNEXPECTEDLY(hr))
return hr;
@@ -353,7 +370,7 @@
if (FAILED_UNEXPECTEDLY(hr))
return hr;
-#if 1
+#if !USE_SYSTEM_MERGED_FOLDERS
hr = CMergedFolder_Constructor(IID_PPV_ARG(IAugmentedShellFolder, &pasf));
#else
hr = CoCreateInstance(CLSID_MergedFolder, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IAugmentedShellFolder, &pasf));
@@ -447,8 +464,13 @@
return hr;
hr = SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAMS, &pidlProgramsAbsolute);
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
+ if (FAILED(hr))
+ {
+ WARN("USER Programs folder not found.");
+ hr = SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_PROGRAMS, &pidlProgramsAbsolute);
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+ }
pidlPrograms = ILClone(ILFindLastID(pidlProgramsAbsolute));
ILFree(pidlProgramsAbsolute);
Modified: branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] Wed Oct 29 11:52:45 2014
@@ -446,14 +446,29 @@
hr = SHGetSpecialFolderLocation(NULL, CSIDL_FAVORITES, &pidlUserFavorites);
if (FAILED(hr))
+ {
+ WARN("Failed to get the USER favorites folder. Trying to run with just the COMMON one.\n");
+
+ hr = SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_FAVORITES, &pidlCommonFavorites);
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+
+ TRACE("COMMON start menu obtained.\n");
+ *ppidl = pidlCommonFavorites;
+ hr = BindToDesktop(pidlCommonFavorites, ppsfFavorites);
return hr;
-
- if (FAILED(SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_FAVORITES, &pidlCommonFavorites)))
- {
+ }
+
+ hr = SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_FAVORITES, &pidlCommonFavorites);
+ if (FAILED_UNEXPECTEDLY(hr))
+ {
+ WARN("Failed to get the COMMON favorites folder. Will use only the USER contents.\n");
+ *ppidl = pidlCommonFavorites;
hr = BindToDesktop(pidlUserFavorites, ppsfFavorites);
- *ppidl = pidlUserFavorites;
return hr;
}
+
+ TRACE("Both COMMON and USER favorites folders obtained, merging them...\n");
hr = BindToDesktop(pidlUserFavorites, &psfUserFavorites);
if (FAILED_UNEXPECTEDLY(hr))