Author: gadamopoulos
Date: Sat Jul 30 11:53:16 2016
New Revision: 72053
URL:
http://svn.reactos.org/svn/reactos?rev=72053&view=rev
Log:
[BROWSEUI]
- Use the _CreateInstance postfix for all functions that instantiate a class.
- Move the the CreateInstance functions of the exported classes to browseui.h where we can
select uniformly which built in classes we use.
Added:
trunk/reactos/dll/win32/browseui/browseui.h (with props)
Modified:
trunk/reactos/dll/win32/browseui/addressband.cpp
trunk/reactos/dll/win32/browseui/addresseditbox.cpp
trunk/reactos/dll/win32/browseui/bandproxy.cpp
trunk/reactos/dll/win32/browseui/basebar.cpp
trunk/reactos/dll/win32/browseui/basebarsite.cpp
trunk/reactos/dll/win32/browseui/brandband.cpp
trunk/reactos/dll/win32/browseui/explorerband.cpp
trunk/reactos/dll/win32/browseui/explorerband.h
trunk/reactos/dll/win32/browseui/internettoolbar.cpp
trunk/reactos/dll/win32/browseui/internettoolbar.h
trunk/reactos/dll/win32/browseui/precomp.h
trunk/reactos/dll/win32/browseui/shellbrowser.cpp
trunk/reactos/dll/win32/browseui/toolsband.cpp
trunk/reactos/dll/win32/browseui/travellog.cpp
Modified: trunk/reactos/dll/win32/browseui/addressband.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/address…
==============================================================================
--- trunk/reactos/dll/win32/browseui/addressband.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/addressband.cpp [iso-8859-1] Sat Jul 30 11:53:16
2016
@@ -27,8 +27,6 @@
#include <shlwapi_undoc.h>
#include <shellapi.h>
-HRESULT CreateAddressEditBox(REFIID riid, void **ppv);
-
/*
TODO:
****Add command handler for show/hide Go button to OnWinEvent
@@ -155,19 +153,9 @@
fEditControl = reinterpret_cast<HWND>(SendMessage(CBEM_GETEDITCONTROL, 0, 0));
fComboBox = reinterpret_cast<HWND>(SendMessage(CBEM_GETCOMBOCONTROL, 0, 0));
-#if 1
- hResult = CoCreateInstance(CLSID_AddressEditBox, NULL, CLSCTX_INPROC_SERVER,
- IID_PPV_ARG(IAddressEditBox, &fAddressEditBox));
-#else
- hResult = E_FAIL;
-#endif
- if (FAILED_UNEXPECTEDLY(hResult))
- {
- // instantiate new version
- hResult = CreateAddressEditBox(IID_PPV_ARG(IAddressEditBox,
&fAddressEditBox));
- if (FAILED_UNEXPECTEDLY(hResult))
- return hResult;
- }
+ hResult = CAddressEditBox_CreateInstance(IID_PPV_ARG(IAddressEditBox,
&fAddressEditBox));
+ if (FAILED_UNEXPECTEDLY(hResult))
+ return hResult;
hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IShellService,
&shellService));
if (FAILED_UNEXPECTEDLY(hResult))
@@ -642,11 +630,6 @@
return 0;
}
-HRESULT CreateAddressBand(REFIID riid, void **ppv)
-{
- return ShellObjectCreator<CAddressBand>(riid, ppv);
-}
-
void CAddressBand::CreateGoButton()
{
const TBBUTTON buttonInfo [] = { { 0, 1, TBSTATE_ENABLED, 0 } };
Modified: trunk/reactos/dll/win32/browseui/addresseditbox.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/address…
==============================================================================
--- trunk/reactos/dll/win32/browseui/addresseditbox.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/addresseditbox.cpp [iso-8859-1] Sat Jul 30 11:53:16
2016
@@ -330,8 +330,3 @@
{
return E_NOTIMPL;
}
-
-HRESULT CreateAddressEditBox(REFIID riid, void **ppv)
-{
- return ShellObjectCreator<CAddressEditBox>(riid, ppv);
-}
Modified: trunk/reactos/dll/win32/browseui/bandproxy.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/bandpro…
==============================================================================
--- trunk/reactos/dll/win32/browseui/bandproxy.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/bandproxy.cpp [iso-8859-1] Sat Jul 30 11:53:16 2016
@@ -125,8 +125,3 @@
{
return E_NOTIMPL;
}
-
-HRESULT CreateBandProxy(REFIID riid, void **ppv)
-{
- return ShellObjectCreator<CBandProxy>(riid, ppv);
-}
Modified: trunk/reactos/dll/win32/browseui/basebar.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/basebar…
==============================================================================
--- trunk/reactos/dll/win32/browseui/basebar.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/basebar.cpp [iso-8859-1] Sat Jul 30 11:53:16 2016
@@ -548,7 +548,7 @@
return 0;
}
-HRESULT CreateBaseBar(REFIID riid, void **ppv, BOOL vertical)
+HRESULT CBaseBar_CreateInstance(REFIID riid, void **ppv, BOOL vertical)
{
return ShellObjectCreatorInit<CBaseBar, BOOL>(vertical, riid, ppv);
}
Modified: trunk/reactos/dll/win32/browseui/basebarsite.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/basebar…
==============================================================================
--- trunk/reactos/dll/win32/browseui/basebarsite.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/basebarsite.cpp [iso-8859-1] Sat Jul 30 11:53:16
2016
@@ -830,7 +830,7 @@
return S_OK;
}
-HRESULT CreateBaseBarSite(REFIID riid, void **ppv, BOOL bVertical)
+HRESULT CBaseBarSite_CreateInstance(REFIID riid, void **ppv, BOOL bVertical)
{
return ShellObjectCreatorInit<CBaseBarSite, BOOL>(bVertical, riid, ppv);
}
Modified: trunk/reactos/dll/win32/browseui/brandband.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/brandba…
==============================================================================
--- trunk/reactos/dll/win32/browseui/brandband.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/brandband.cpp [iso-8859-1] Sat Jul 30 11:53:16 2016
@@ -456,8 +456,3 @@
Invalidate(FALSE);
return 0;
}
-
-HRESULT CreateBrandBand(REFIID riid, void **ppv)
-{
- return ShellObjectCreator<CBrandBand>(riid, ppv);
-}
Added: trunk/reactos/dll/win32/browseui/browseui.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/browseu…
==============================================================================
--- trunk/reactos/dll/win32/browseui/browseui.h (added)
+++ trunk/reactos/dll/win32/browseui/browseui.h [iso-8859-1] Sat Jul 30 11:53:16 2016
@@ -0,0 +1,122 @@
+#pragma once
+
+#define USE_CUSTOM_MENUBAND 1
+#define USE_CUSTOM_MERGEDFOLDER 1
+#define USE_CUSTOM_ADDRESSBAND 1
+#define USE_CUSTOM_ADDRESSEDITBOX 1
+#define USE_CUSTOM_BANDPROXY 1
+#define USE_CUSTOM_BRANDBAND 1
+#define USE_CUSTOM_EXPLORERBAND 1
+#define USE_CUSTOM_INTERNETTOOLBAR 1
+
+/* Constructors for the classes that are not exported */
+HRESULT CTravelLog_CreateInstance(REFIID riid, void **ppv);
+HRESULT CBaseBar_CreateInstance(REFIID riid, void **ppv, BOOL vertical);
+HRESULT CBaseBarSite_CreateInstance(REFIID riid, void **ppv, BOOL bVertical);
+HRESULT CToolsBand_CreateInstance(REFIID riid, void **ppv);
+
+static inline
+HRESULT CAddressBand_CreateInstance(REFIID riid, void **ppv)
+{
+#if USE_CUSTOM_ADDRESSBAND
+ return ShellObjectCreator<CAddressBand>(riid, ppv);
+#else
+ return CoCreateInstance(CLSID_SH_AddressBand, NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IUnknown, toolsBar));
+#endif
+}
+
+static inline
+HRESULT CAddressEditBox_CreateInstance(REFIID riid, void **ppv)
+{
+#if USE_CUSTOM_ADDRESSEDITBOX
+ return ShellObjectCreator<CAddressEditBox>(riid, ppv);
+#else
+ return CoCreateInstance(CLSID_AddressEditBox, NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARG(riid, &ppv));
+#endif
+}
+
+static inline
+HRESULT CBandProxy_CreateInstance(REFIID riid, void **ppv)
+{
+#if USE_CUSTOM_BANDPROXY
+ return ShellObjectCreator<CBandProxy>(riid, ppv);
+#else
+ return CoCreateInstance(CLSID_BandProxy, NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARG(riid, &ppv));
+#endif
+}
+
+static inline
+HRESULT CBrandBand_CreateInstance(REFIID riid, void **ppv)
+{
+#if USE_CUSTOM_BRANDBAND
+ return ShellObjectCreator<CBrandBand>(riid, ppv);
+#else
+ return CoCreateInstance(CLSID_BrandBand, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
+#endif
+}
+
+static inline
+HRESULT WINAPI CExplorerBand_CreateInstance(REFIID riid, LPVOID *ppv)
+{
+#if USE_CUSTOM_EXPLORERBAND
+ return ShellObjectCreator<CExplorerBand>(riid, ppv);
+#else
+ return CoCreateInstance(CLSID_ExplorerBand, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
+#endif
+}
+
+static inline
+HRESULT CInternetToolbar_CreateInstance(REFIID riid, void **ppv)
+{
+#if USE_CUSTOM_INTERNETTOOLBAR
+ return ShellObjectCreator<CInternetToolbar>(riid, ppv);
+#else
+ return CoCreateInstance(CLSID_InternetToolbar, NULL, CLSCTX_INPROC_SERVER, riid,
ppv);
+#endif
+}
+
+typedef HRESULT(WINAPI * PMENUBAND_CONSTRUCTOR)(REFIID riid, void **ppv);
+typedef HRESULT(WINAPI * PMERGEDFOLDER_CONSTRUCTOR)(REFIID riid, void **ppv);
+
+static inline
+HRESULT CMergedFolder_CreateInstance(REFIID riid, void **ppv)
+{
+#if USE_CUSTOM_MERGEDFOLDER
+ HMODULE hRShell = GetModuleHandle(L"rshell.dll");
+ if (!hRShell)
+ hRShell = LoadLibrary(L"rshell.dll");
+
+ if (hRShell)
+ {
+ PMERGEDFOLDER_CONSTRUCTOR pCMergedFolder_Constructor =
(PMERGEDFOLDER_CONSTRUCTOR)
+ GetProcAddress(hRShell, "CMergedFolder_Constructor");
+
+ if (pCMergedFolder_Constructor)
+ {
+ return pCMergedFolder_Constructor(riid, ppv);
+ }
+ }
+#endif
+ return CoCreateInstance(CLSID_MergedFolder, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
+}
+
+static inline
+HRESULT CMenuBand_CreateInstance(REFIID iid, LPVOID *ppv)
+{
+#if USE_CUSTOM_MENUBAND
+ HMODULE hRShell = GetModuleHandleW(L"rshell.dll");
+
+ if (!hRShell)
+ hRShell = LoadLibraryW(L"rshell.dll");
+
+ if (hRShell)
+ {
+ PMENUBAND_CONSTRUCTOR func = (PMENUBAND_CONSTRUCTOR) GetProcAddress(hRShell,
"CMenuBand_Constructor");
+ if (func)
+ {
+ return func(iid , ppv);
+ }
+ }
+#endif
+ return CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER, iid, ppv);
+}
Propchange: trunk/reactos/dll/win32/browseui/browseui.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/win32/browseui/explorerband.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/explore…
==============================================================================
--- trunk/reactos/dll/win32/browseui/explorerband.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/explorerband.cpp [iso-8859-1] Sat Jul 30 11:53:16
2016
@@ -27,12 +27,6 @@
#define UNIMPLEMENTED DbgPrint("%s is UNIMPLEMENTED!\n", __FUNCTION__)
#endif
-
-extern "C"
-HRESULT WINAPI CExplorerBand_Constructor(REFIID riid, LPVOID *ppv)
-{
- return ShellObjectCreator<CExplorerBand>(riid, ppv);
-}
CExplorerBand::CExplorerBand() :
pSite(NULL), fVisible(FALSE), bNavigating(FALSE), dwBandID(0)
Modified: trunk/reactos/dll/win32/browseui/explorerband.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/explore…
==============================================================================
--- trunk/reactos/dll/win32/browseui/explorerband.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/explorerband.h [iso-8859-1] Sat Jul 30 11:53:16 2016
@@ -184,6 +184,3 @@
MESSAGE_HANDLER(WM_RBUTTONDOWN, ContextMenuHack)
END_MSG_MAP()
};
-
-extern "C"
-HRESULT WINAPI CExplorerBand_Constructor(REFIID riid, LPVOID *ppv);
Modified: trunk/reactos/dll/win32/browseui/internettoolbar.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/interne…
==============================================================================
--- trunk/reactos/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] Sat Jul 30 11:53:16
2016
@@ -78,10 +78,6 @@
*/
extern HRESULT WINAPI SHBindToFolder(LPCITEMIDLIST path, IShellFolder **newFolder);
-extern HRESULT CreateToolsBar(REFIID riid, void **ppv);
-extern HRESULT CreateBrandBand(REFIID riid, void **ppv);
-extern HRESULT CreateBandProxy(REFIID riid, void **ppv);
-extern HRESULT CreateAddressBand(REFIID riid, void **ppv);
HRESULT IUnknown_RelayWinEvent(IUnknown * punk, HWND hWnd, UINT uMsg, WPARAM wParam,
LPARAM lParam, LRESULT *theResult)
{
@@ -442,7 +438,7 @@
if (FAILED_UNEXPECTEDLY(hr))
return hr;
- hr = CreateMergedFolder(IID_PPV_ARG(IAugmentedShellFolder, &pasf));
+ hr = CMergedFolder_CreateInstance(IID_PPV_ARG(IAugmentedShellFolder, &pasf));
if (FAILED_UNEXPECTEDLY(hr))
{
*ppsfFavorites = psfUserFavorites.Detach();
@@ -503,7 +499,7 @@
if (fFavoritesMenu.p == NULL)
{
- hResult = CreateMenuBand(IID_PPV_ARG(IShellMenu, &newMenu));
+ hResult = CMenuBand_CreateInstance(IID_PPV_ARG(IShellMenu, &newMenu));
if (FAILED_UNEXPECTEDLY(hResult))
return hResult;
hResult = newMenu->Initialize(this, FCIDM_MENU_FAVORITES, -1, SMINIT_VERTICAL
| SMINIT_CACHED);
@@ -671,7 +667,7 @@
*pMenuBar = NULL;
- hResult = CreateMenuBand(IID_PPV_ARG(IShellMenu, &menubar));
+ hResult = CMenuBand_CreateInstance(IID_PPV_ARG(IShellMenu, &menubar));
if (FAILED_UNEXPECTEDLY(hResult))
return hResult;
@@ -717,29 +713,6 @@
*pMenuBar = menubar.Detach();
return S_OK;
-}
-
-HRESULT CInternetToolbar::CreateBrandBand(IUnknown **logoBar)
-{
-#if 1
- return ::CreateBrandBand(IID_PPV_ARG(IUnknown, logoBar));
-#else
- return CoCreateInstance(CLSID_BrandBand, NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IUnknown, logoBar));
-#endif
-}
-
-HRESULT CInternetToolbar::CreateToolsBar(IUnknown **toolsBar)
-{
- return ::CreateToolsBar(IID_PPV_ARG(IUnknown, toolsBar));
-}
-
-HRESULT CInternetToolbar::CreateAddressBand(IUnknown **toolsBar)
-{
-#if 1
- return ::CreateAddressBand(IID_PPV_ARG(IUnknown, toolsBar));
-#else
- return CoCreateInstance(CLSID_SH_AddressBand, NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IUnknown, toolsBar));
-#endif
}
HRESULT CInternetToolbar::LockUnlockToolbars(bool locked)
@@ -817,7 +790,7 @@
hResult = serviceProvider->QueryService(SID_IBandProxy, IID_PPV_ARG(IBandProxy,
&fBandProxy));
if (FAILED_UNEXPECTEDLY(hResult))
{
- hResult = CreateBandProxy(IID_PPV_ARG(IBandProxy, &fBandProxy));
+ hResult = CBandProxy_CreateInstance(IID_PPV_ARG(IBandProxy, &fBandProxy));
if (FAILED_UNEXPECTEDLY(hResult))
return hResult;
hResult = fBandProxy->SetSite(fSite);
@@ -1048,7 +1021,7 @@
// and it will put them in their own row, sized to take up the whole row.
#if 0
/* Create and attach the brand/logo to the rebar */
- hResult = CreateBrandBand(&logoBar);
+ hResult = CBrandBand_CreateInstance(IID_PPV_ARG(IUnknown, &logoBar));
if (FAILED_UNEXPECTEDLY(hResult))
return hResult;
AddDockItem(logoBar, ITBBID_BRANDBAND, CDockSite::ITF_NOGRIPPER |
CDockSite::ITF_NOTITLE | CDockSite::ITF_FIXEDSIZE);
@@ -1056,7 +1029,7 @@
#endif
/* Create and attach the standard toolbar to the rebar */
- hResult = CreateToolsBar(&toolsBar);
+ hResult = CToolsBand_CreateInstance(IID_PPV_ARG(IUnknown, &toolsBar));
if (FAILED_UNEXPECTEDLY(hResult))
return hResult;
AddDockItem(toolsBar, ITBBID_TOOLSBAND, CDockSite::ITF_NOTITLE |
CDockSite::ITF_NEWBANDALWAYS | CDockSite::ITF_GRIPPERALWAYS);
@@ -1066,7 +1039,7 @@
return hResult;
/* Create and attach the address/navigation toolbar to the rebar */
- hResult = CreateAddressBand(&navigationBar);
+ hResult = CAddressBand_CreateInstance(IID_PPV_ARG(IUnknown, &navigationBar));
if (FAILED_UNEXPECTEDLY(hResult))
return hResult;
AddDockItem(navigationBar, ITBBID_ADDRESSBAND, CDockSite::ITF_NEWBANDALWAYS |
CDockSite::ITF_GRIPPERALWAYS);
@@ -1875,7 +1848,3 @@
return 0;
}
-HRESULT CreateInternetToolbar(REFIID riid, void **ppv)
-{
- return ShellObjectCreator<CInternetToolbar>(riid, ppv);
-}
Modified: trunk/reactos/dll/win32/browseui/internettoolbar.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/interne…
==============================================================================
--- trunk/reactos/dll/win32/browseui/internettoolbar.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/internettoolbar.h [iso-8859-1] Sat Jul 30 11:53:16
2016
@@ -98,9 +98,7 @@
void AddDockItem(IUnknown *newItem, int bandID, int flags);
HRESULT ReserveBorderSpace(LONG maxHeight = -1);
HRESULT CreateMenuBar(IShellMenu **menuBar);
- HRESULT CreateBrandBand(IUnknown **logoBar);
HRESULT CreateToolsBar(IUnknown **toolsBar);
- HRESULT CreateAddressBand(IUnknown **toolsBar);
HRESULT LockUnlockToolbars(bool locked);
HRESULT CommandStateChanged(bool newValue, int commandID);
HRESULT CreateAndInitBandProxy();
Modified: trunk/reactos/dll/win32/browseui/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/precomp…
==============================================================================
--- trunk/reactos/dll/win32/browseui/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/precomp.h [iso-8859-1] Sat Jul 30 11:53:16 2016
@@ -49,57 +49,9 @@
#include "regtreeoptions.h"
#include "explorerband.h"
#include "CProgressDialog.h"
+#include "browseui.h"
#include <stdio.h>
WINE_DEFAULT_DEBUG_CHANNEL(browseui);
-
-#define USE_CUSTOM_MENUBAND 1
-
-typedef HRESULT(WINAPI * PMENUBAND_CONSTRUCTOR)(REFIID riid, void **ppv);
-typedef HRESULT(WINAPI * PMERGEDFOLDER_CONSTRUCTOR)(REFIID riid, void **ppv);
-
-static inline
-HRESULT CreateMergedFolder(REFIID riid, void **ppv)
-{
-#if 1
- HMODULE hRShell = GetModuleHandle(L"rshell.dll");
- if (!hRShell)
- hRShell = LoadLibrary(L"rshell.dll");
-
- if (hRShell)
- {
- PMERGEDFOLDER_CONSTRUCTOR pCMergedFolder_Constructor =
(PMERGEDFOLDER_CONSTRUCTOR)
- GetProcAddress(hRShell, "CMergedFolder_Constructor");
-
- if (pCMergedFolder_Constructor)
- {
- return pCMergedFolder_Constructor(riid, ppv);
- }
- }
-#endif
- return CoCreateInstance(CLSID_MergedFolder, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
-}
-
-static inline
-HRESULT CreateMenuBand(REFIID iid, LPVOID *ppv)
-{
-#if USE_CUSTOM_MENUBAND
- HMODULE hRShell = GetModuleHandleW(L"rshell.dll");
-
- if (!hRShell)
- hRShell = LoadLibraryW(L"rshell.dll");
-
- if (hRShell)
- {
- PMENUBAND_CONSTRUCTOR func = (PMENUBAND_CONSTRUCTOR) GetProcAddress(hRShell,
"CMenuBand_Constructor");
- if (func)
- {
- return func(iid , ppv);
- }
- }
-#endif
- return CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER, iid, ppv);
-}
-
#endif /* _BROWSEUI_PCH_ */
Modified: trunk/reactos/dll/win32/browseui/shellbrowser.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/shellbr…
==============================================================================
--- trunk/reactos/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] Sat Jul 30 11:53:16
2016
@@ -23,8 +23,6 @@
#include <shellapi.h>
#include <htiframe.h>
#include <strsafe.h>
-
-#define USE_CUSTOM_EXPLORERBAND 1
extern HRESULT IUnknown_ShowDW(IUnknown * punk, BOOL fShow);
@@ -128,14 +126,6 @@
// this class is private to browseui.dll and is not registered externally?
//DEFINE_GUID(CLSID_ShellFldSetExt, 0x6D5313C0, 0x8C62, 0x11D1, 0xB2, 0xCD, 0x00, 0x60,
0x97, 0xDF, 0x8C, 0x11);
-
-
-extern HRESULT CreateTravelLog(REFIID riid, void **ppv);
-extern HRESULT CreateBaseBar(REFIID riid, void **ppv, BOOL vertical);
-extern HRESULT CreateBaseBarSite(REFIID riid, void **ppv, BOOL vertical);
-
-// temporary
-extern HRESULT CreateInternetToolbar(REFIID riid, void **ppv);
void DeleteMenuItems(HMENU theMenu, unsigned int firstIDToDelete, unsigned int
lastIDToDelete)
{
@@ -325,7 +315,7 @@
HRESULT BrowseToPath(IShellFolder *newShellFolder, LPCITEMIDLIST absolutePIDL,
FOLDERSETTINGS *folderSettings, long flags);
HRESULT GetMenuBand(REFIID riid, void **shellMenu);
- HRESULT GetBaseBar(bool vertical, IUnknown **theBaseBar);
+ HRESULT GetBaseBar(bool vertical, REFIID riid, void **theBaseBar);
BOOL IsBandLoaded(const CLSID clsidBand, bool verticali, DWORD *pdwBandID);
HRESULT ShowBand(const CLSID &classID, bool vertical);
HRESULT NavigateToParent();
@@ -740,15 +730,9 @@
if (m_hWnd == NULL)
return E_FAIL;
-#if 0
- hResult = CoCreateInstance(CLSID_InternetToolbar, NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IUnknown, &fClientBars[BIInternetToolbar].clientBar));
+ hResult = CInternetToolbar_CreateInstance(IID_PPV_ARG(IUnknown, &clientBar));
if (FAILED_UNEXPECTEDLY(hResult))
return hResult;
-#else
- hResult = CreateInternetToolbar(IID_PPV_ARG(IUnknown, &clientBar));
- if (FAILED_UNEXPECTEDLY(hResult))
- return hResult;
-#endif
fClientBars[BIInternetToolbar].clientBar = clientBar;
@@ -1105,7 +1089,7 @@
return deskBand->QueryInterface(riid, shellMenu);
}
-HRESULT CShellBrowser::GetBaseBar(bool vertical, IUnknown **theBaseBar)
+HRESULT CShellBrowser::GetBaseBar(bool vertical, REFIID riid, void **theBaseBar)
{
CComPtr<IUnknown> newBaseBar;
CComPtr<IDeskBar> deskBar;
@@ -1120,10 +1104,10 @@
cache = &fClientBars[BIHorizontalBaseBar].clientBar.p;
if (*cache == NULL)
{
- hResult = CreateBaseBar(IID_PPV_ARG(IUnknown, &newBaseBar), vertical);
+ hResult = CBaseBar_CreateInstance(IID_PPV_ARG(IUnknown, &newBaseBar),
vertical);
if (FAILED_UNEXPECTEDLY(hResult))
return hResult;
- hResult = CreateBaseBarSite(IID_PPV_ARG(IUnknown, &newBaseBarSite),
vertical);
+ hResult = CBaseBarSite_CreateInstance(IID_PPV_ARG(IUnknown, &newBaseBarSite),
vertical);
if (FAILED_UNEXPECTEDLY(hResult))
return hResult;
@@ -1152,13 +1136,12 @@
return hResult;
}
- return (*cache)->QueryInterface(IID_PPV_ARG(IUnknown, theBaseBar));
+ return (*cache)->QueryInterface(riid, theBaseBar);
}
BOOL CShellBrowser::IsBandLoaded(const CLSID clsidBand, bool vertical, DWORD *pdwBandID)
{
HRESULT hResult;
- CComPtr<IUnknown> baseBar;
CComPtr<IDeskBar> deskBar;
CComPtr<IUnknown> baseBarSite;
CComPtr<IBandSite> bandSite;
@@ -1168,10 +1151,7 @@
DWORD i;
/* Get our basebarsite to be able to enumerate bands */
- hResult = GetBaseBar(vertical, &baseBar);
- if (FAILED_UNEXPECTEDLY(hResult))
- return FALSE;
- hResult = baseBar->QueryInterface(IID_PPV_ARG(IDeskBar, &deskBar));
+ hResult = GetBaseBar(vertical, IID_PPV_ARG(IDeskBar, &deskBar));
if (FAILED_UNEXPECTEDLY(hResult))
return FALSE;
hResult = deskBar->GetClient(&baseBarSite);
@@ -1213,41 +1193,34 @@
CComPtr<IDockingWindow> dockingWindow;
CComPtr<IUnknown> baseBarSite;
CComPtr<IUnknown> newBand;
- CComPtr<IUnknown> theBaseBar;
CComPtr<IDeskBar> deskBar;
VARIANT vaIn;
HRESULT hResult;
DWORD dwBandID;
- hResult = GetBaseBar(vertical, (IUnknown **)&theBaseBar);
+ hResult = GetBaseBar(vertical, IID_PPV_ARG(IDeskBar, &deskBar));
if (FAILED_UNEXPECTEDLY(hResult))
return hResult;
- hResult = theBaseBar->QueryInterface(IID_PPV_ARG(IDeskBar, &deskBar));
+ hResult = deskBar->GetClient(&baseBarSite);
if (FAILED_UNEXPECTEDLY(hResult))
return hResult;
- hResult = deskBar->GetClient(&baseBarSite);
- if (FAILED_UNEXPECTEDLY(hResult))
- return hResult;
-
- hResult = theBaseBar->QueryInterface(IID_PPV_ARG(IDockingWindow,
&dockingWindow));
+ hResult = deskBar->QueryInterface(IID_PPV_ARG(IDockingWindow,
&dockingWindow));
if (FAILED_UNEXPECTEDLY(hResult))
return hResult;
if (!IsBandLoaded(classID, vertical, &dwBandID))
{
-#if USE_CUSTOM_EXPLORERBAND
TRACE("ShowBand called for CLSID %s, vertical=%d...\n",
wine_dbgstr_guid(&classID), vertical);
if (IsEqualCLSID(CLSID_ExplorerBand, classID))
{
TRACE("CLSID_ExplorerBand requested, building internal band.\n");
- hResult = CExplorerBand_Constructor(IID_PPV_ARG(IUnknown, &newBand));
+ hResult = CExplorerBand_CreateInstance(IID_PPV_ARG(IUnknown, &newBand));
if (FAILED_UNEXPECTEDLY(hResult))
return hResult;
}
else
-#endif
{
TRACE("A different CLSID requested, using CoCreateInstance.\n");
hResult = CoCreateInstance(classID, NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IUnknown, &newBand));
@@ -2388,7 +2361,7 @@
*pptl = NULL;
if (fTravelLog.p == NULL)
{
- hResult = CreateTravelLog(IID_PPV_ARG(ITravelLog, &fTravelLog));
+ hResult = CTravelLog_CreateInstance(IID_PPV_ARG(ITravelLog, &fTravelLog));
if (FAILED_UNEXPECTEDLY(hResult))
return hResult;
}
Modified: trunk/reactos/dll/win32/browseui/toolsband.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/toolsba…
==============================================================================
--- trunk/reactos/dll/win32/browseui/toolsband.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/toolsband.cpp [iso-8859-1] Sat Jul 30 11:53:16 2016
@@ -433,7 +433,7 @@
return 0;
}
-HRESULT CreateToolsBar(REFIID riid, void **ppv)
+HRESULT CToolsBand_CreateInstance(REFIID riid, void **ppv)
{
return ShellObjectCreator<CToolsBand>(riid, ppv);
}
Modified: trunk/reactos/dll/win32/browseui/travellog.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/travell…
==============================================================================
--- trunk/reactos/dll/win32/browseui/travellog.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/travellog.cpp [iso-8859-1] Sat Jul 30 11:53:16 2016
@@ -624,7 +624,7 @@
return E_NOTIMPL;
}
-HRESULT CreateTravelLog(REFIID riid, void **ppv)
+HRESULT CTravelLog_CreateInstance(REFIID riid, void **ppv)
{
return ShellObjectCreatorInit<CTravelLog>(riid, ppv);
}