[SHELL32]
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 19 Jun 2017 14:27:51 +0000 (14:27 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 19 Jun 2017 14:27:51 +0000 (14:27 +0000)
-Rename constructors from Class_Creator to Class_CreateInstance. Prepend the ones that are exported from rshell with RSHELL_. The reasoning is that rshell will always use our code but whether or not internal classes will be used in shellmenu lib will be controlled by preprocessor definitions in shellmenu.h

[BROWSEUI]
-Rename more constructors to use the _CreateInstance suffix.

[RSHELL]
- The functions that let rshell export some objects have the RSHELL_ postfix but they are not exported as such.

[EXPLORER]
- Rename _CStartMenu_Constructor to _CStartMenu_CreateInstance.

svn path=/trunk/; revision=75127

18 files changed:
reactos/base/shell/explorer/precomp.h
reactos/base/shell/explorer/rshell.cpp
reactos/base/shell/explorer/startmnu.cpp
reactos/base/shell/rshell/misc.cpp
reactos/base/shell/rshell/rshell.spec
reactos/dll/win32/browseui/browseui.cpp
reactos/dll/win32/browseui/explorerband.cpp
reactos/dll/win32/browseui/explorerband.h
reactos/dll/win32/browseui/shellbars/CBandSite.cpp
reactos/dll/win32/browseui/shellbars/CBandSiteMenu.cpp
reactos/dll/win32/shell32/shell32.cpp
reactos/dll/win32/shell32/shellmenu/CMenuBand.cpp
reactos/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp
reactos/dll/win32/shell32/shellmenu/CMenuSite.cpp
reactos/dll/win32/shell32/shellmenu/CMenuToolbars.cpp
reactos/dll/win32/shell32/shellmenu/CMergedFolder.cpp
reactos/dll/win32/shell32/shellmenu/CStartMenu.cpp
reactos/dll/win32/shell32/shellmenu/shellmenu.h

index a63c473..f674a2c 100644 (file)
@@ -112,7 +112,7 @@ GetExplorerRegValueSet(IN HKEY hKey,
  */
 
 VOID InitRSHELL(VOID);
-HRESULT WINAPI _CStartMenu_Constructor(REFIID riid, void **ppv);
+HRESULT WINAPI _CStartMenu_CreateInstance(REFIID riid, void **ppv);
 HANDLE WINAPI _SHCreateDesktop(IShellDesktopTray *ShellDesk);
 BOOL WINAPI _SHDesktopMessageLoop(HANDLE hDesktop);
 DWORD WINAPI _WinList_Init(void);
index 1def659..9767c23 100644 (file)
 
 static HINSTANCE ghRShell = NULL;
 
-typedef HRESULT(WINAPI * PSTARTMENU_CONSTRUCTOR)(REFIID riid, void **ppv);
+typedef HRESULT(WINAPI * PSTARTMENU_CREATEINSTANCE)(REFIID riid, void **ppv);
 
 VOID InitRSHELL(VOID)
 {
     ghRShell = LoadLibraryW(L"rshell.dll");
 }
 
-HRESULT WINAPI _CStartMenu_Constructor(REFIID riid, void **ppv)
+HRESULT WINAPI _CStartMenu_CreateInstance(REFIID riid, void **ppv)
 {
     if (ghRShell)
     {
-        PSTARTMENU_CONSTRUCTOR func = (PSTARTMENU_CONSTRUCTOR)GetProcAddress(ghRShell, "CStartMenu_Constructor");
+        PSTARTMENU_CREATEINSTANCE func = (PSTARTMENU_CREATEINSTANCE)GetProcAddress(ghRShell, "CStartMenu_CreateInstance");
         if (func)
         {
             return func(riid, ppv);
index 25969e7..a3355f2 100644 (file)
@@ -59,15 +59,7 @@ CreateStartMenu(IN ITrayWindow *Tray,
     if (FAILED_UNEXPECTEDLY(hr))
         return NULL;
 
-#if 0
-    hr = CoCreateInstance(&CLSID_StartMenu,
-                          NULL,
-                          CLSCTX_INPROC_SERVER,
-                          &IID_IMenuPopup,
-                          (PVOID *)&pMp);
-#else
-    hr = _CStartMenu_Constructor(IID_PPV_ARG(IMenuPopup, &pMp));
-#endif
+    hr = _CStartMenu_CreateInstance(IID_PPV_ARG(IMenuPopup, &pMp));
     if (FAILED_UNEXPECTEDLY(hr))
         return NULL;
 
index de6fc00..ee5b5a2 100644 (file)
@@ -56,11 +56,11 @@ extern "C"
 {
 extern HINSTANCE shell32_hInstance;
 
-HRESULT WINAPI CStartMenu_Constructor(REFIID riid, void **ppv);
-HRESULT WINAPI CMenuDeskBar_Constructor(REFIID riid, LPVOID *ppv);
-HRESULT WINAPI CMenuSite_Constructor(REFIID riid, LPVOID *ppv);
-HRESULT WINAPI CMenuBand_Constructor(REFIID riid, LPVOID *ppv);
-HRESULT WINAPI CMergedFolder_Constructor(REFIID riid, LPVOID *ppv);
+HRESULT WINAPI RSHELL_CStartMenu_CreateInstance(REFIID riid, void **ppv);
+HRESULT WINAPI RSHELL_CMenuDeskBar_CreateInstance(REFIID riid, LPVOID *ppv);
+HRESULT WINAPI RSHELL_CMenuSite_CreateInstance(REFIID riid, LPVOID *ppv);
+HRESULT WINAPI RSHELL_CMenuBand_CreateInstance(REFIID riid, LPVOID *ppv);
+HRESULT WINAPI RSHELL_CMergedFolder_CreateInstance(REFIID riid, LPVOID *ppv);
 }
 
 DWORD WINAPI WinList_Init(void)
@@ -226,19 +226,19 @@ public:
         *ppvObject = NULL;
 
         if (IsEqualCLSID(m_Clsid, CLSID_StartMenu))
-            return CStartMenu_Constructor(riid, ppvObject);
+            return RSHELL_CStartMenu_CreateInstance(riid, ppvObject);
             
         if (IsEqualCLSID(m_Clsid, CLSID_MenuDeskBar))
-            return CMenuDeskBar_Constructor(riid, ppvObject);
+            return RSHELL_CMenuDeskBar_CreateInstance(riid, ppvObject);
 
         if (IsEqualCLSID(m_Clsid, CLSID_MenuBand))
-            return CMenuBand_Constructor(riid, ppvObject);
+            return RSHELL_CMenuBand_CreateInstance(riid, ppvObject);
 
         if (IsEqualCLSID(m_Clsid, CLSID_MenuBandSite))
-            return CMenuSite_Constructor(riid, ppvObject);
+            return RSHELL_CMenuSite_CreateInstance(riid, ppvObject);
 
         if (IsEqualCLSID(m_Clsid, CLSID_MergedFolder))
-            return CMergedFolder_Constructor(riid, ppvObject);
+            return RSHELL_CMergedFolder_CreateInstance(riid, ppvObject);
 
         return E_NOINTERFACE;
     }
index 04e5eaa..eefc273 100644 (file)
@@ -2,13 +2,13 @@
 @ stdcall -private DllGetClassObject(ptr ptr ptr)
 @ stdcall -private DllRegisterServer()
 @ stdcall -private DllUnregisterServer()
-@ stdcall CStartMenu_Constructor(ptr ptr)
-@ stdcall CMenuDeskBar_Constructor(ptr ptr);
-@ stdcall CMenuSite_Constructor(ptr ptr);
-@ stdcall CMenuBand_Constructor(ptr ptr);
-@ stdcall CMergedFolder_Constructor(ptr ptr);
-@ stdcall CBandSite_CreateInstance(ptr ptr ptr)
-@ stdcall CBandSiteMenu_CreateInstance(ptr ptr)
+@ stdcall CStartMenu_CreateInstance(ptr ptr) RSHELL_CStartMenu_CreateInstance
+@ stdcall CMenuDeskBar_CreateInstance(ptr ptr) RSHELL_CMenuDeskBar_CreateInstance
+@ stdcall CMenuSite_CreateInstance(ptr ptr) RSHELL_CMenuSite_CreateInstance
+@ stdcall CMenuBand_CreateInstance(ptr ptr) RSHELL_CMenuBand_CreateInstance
+@ stdcall CMergedFolder_CreateInstance(ptr ptr) RSHELL_CMergedFolder_CreateInstance
+@ stdcall CBandSite_CreateInstance(ptr ptr ptr) RSHELL_CBandSite_CreateInstance
+@ stdcall CBandSiteMenu_CreateInstance(ptr ptr) RSHELL_CBandSiteMenu_CreateInstance
 @ stdcall ShellDDEInit(long);
 @ stdcall SHCreateDesktop(ptr);
 @ stdcall SHDesktopMessageLoop(ptr);
index d9e05ec..35ab36f 100644 (file)
@@ -75,8 +75,8 @@ HRESULT CInternetToolbar_CreateInstance(REFIID riid, void **ppv)
 #endif
 }
 
-typedef HRESULT(WINAPI * PMENUBAND_CONSTRUCTOR)(REFIID riid, void **ppv);
-typedef HRESULT(WINAPI * PMERGEDFOLDER_CONSTRUCTOR)(REFIID riid, void **ppv);
+typedef HRESULT(WINAPI * PMENUBAND_CREATEINSTANCE)(REFIID riid, void **ppv);
+typedef HRESULT(WINAPI * PMERGEDFOLDER_CREATEINSTANCE)(REFIID riid, void **ppv);
 
 HRESULT CMergedFolder_CreateInstance(REFIID riid, void **ppv)
 {
@@ -87,12 +87,12 @@ HRESULT CMergedFolder_CreateInstance(REFIID riid, void **ppv)
 
     if (hRShell)
     {
-        PMERGEDFOLDER_CONSTRUCTOR pCMergedFolder_Constructor = (PMERGEDFOLDER_CONSTRUCTOR)
-             GetProcAddress(hRShell, "CMergedFolder_Constructor");
+        PMERGEDFOLDER_CREATEINSTANCE pCMergedFolder_CreateInstance = (PMERGEDFOLDER_CREATEINSTANCE)
+             GetProcAddress(hRShell, "CMergedFolder_CreateInstance");
 
-        if (pCMergedFolder_Constructor)
+        if (pCMergedFolder_CreateInstance)
         {
-            return pCMergedFolder_Constructor(riid, ppv);
+            return pCMergedFolder_CreateInstance(riid, ppv);
         }
     }
 #endif
@@ -109,7 +109,7 @@ HRESULT CMenuBand_CreateInstance(REFIID iid, LPVOID *ppv)
 
     if (hRShell)
     {
-        PMENUBAND_CONSTRUCTOR func = (PMENUBAND_CONSTRUCTOR) GetProcAddress(hRShell, "CMenuBand_Constructor");
+        PMENUBAND_CREATEINSTANCE func = (PMENUBAND_CREATEINSTANCE) GetProcAddress(hRShell, "CMenuBand_CreateInstance");
         if (func)
         {
             return func(iid , ppv);
index 46b02bf..f64ca9a 100644 (file)
@@ -86,16 +86,6 @@ HRESULT GetDisplayName(LPCITEMIDLIST pidlDirectory,TCHAR *szDisplayName,UINT cch
     return hr;
 }
 
-extern "C"
-HRESULT WINAPI CExplorerBand_Constructor(REFIID riid, LPVOID *ppv)
-{
-#ifdef __REACTOS__
-    return ShellObjectCreator<CExplorerBand>(riid, ppv);
-#else
-    return S_OK;
-#endif
-}
-
 /*
  This is a Windows hack, because shell event messages in Windows gives an 
  ill-formed PIDL stripped from useful data that parses incorrectly with SHGetFileInfo.
index 3c2a1af..33d84dd 100644 (file)
@@ -205,6 +205,3 @@ public:
         // MESSAGE_HANDLER(WM_KILLFOCUS, OnKillFocus)
     END_MSG_MAP()
 };
-
-extern "C"
-HRESULT WINAPI CExplorerBand_Constructor(REFIID riid, LPVOID *ppv);
index efd3c99..eddd7cb 100644 (file)
@@ -831,7 +831,7 @@ HRESULT STDMETHODCALLTYPE CBandSiteBase::SaveToStreamBS(IUnknown *, IStream *)
 }
 
 extern "C"
-HRESULT WINAPI CBandSite_CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, void **ppv)
+HRESULT WINAPI RSHELL_CBandSite_CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, void **ppv)
 {
     return CBandSite::_CreatorClass::CreateInstance(pUnkOuter, riid, ppv);
 }
index c32032f..a76d5d4 100644 (file)
@@ -223,7 +223,7 @@ HRESULT STDMETHODCALLTYPE CBandSiteMenu::HandleMenuMsg2(UINT uMsg, WPARAM wParam
 }
 
 extern "C"
-HRESULT WINAPI CBandSiteMenu_CreateInstance(REFIID riid, void **ppv)
+HRESULT WINAPI RSHELL_CBandSiteMenu_CreateInstance(REFIID riid, void **ppv)
 {
     return ShellObjectCreator<CBandSiteMenu>(riid, ppv);
 }
index a4a363e..e3acf73 100644 (file)
@@ -208,7 +208,7 @@ public:
             *ppv = NULL;
             if (pv != NULL)
                 return CLASS_E_NOAGGREGATION;
-            return CStartMenu_Constructor(riid, ppv);
+            return RSHELL_CStartMenu_CreateInstance(riid, ppv);
         }
     };
 };
index ca0f0d4..aaa21b7 100644 (file)
@@ -32,12 +32,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(CMenuBand);
 
 #define UNIMPLEMENTED TRACE("%s is UNIMPLEMENTED!\n", __FUNCTION__)
 
-extern "C"
-HRESULT WINAPI CMenuBand_Constructor(REFIID riid, LPVOID *ppv)
-{
-    return ShellObjectCreator<CMenuBand>(riid, ppv);
-}
-
 CMenuBand::CMenuBand() :
     m_staticToolbar(NULL),
     m_SFToolbar(NULL),
@@ -1056,25 +1050,11 @@ HRESULT CMenuBand::_OnPopupSubMenu(IShellMenu * childShellMenu, POINTL * pAt, RE
     CComPtr<IDeskBar> pDeskBar;
 
     // Create the necessary objects
-#if USE_SYSTEM_MENUSITE
-    hr = CoCreateInstance(CLSID_MenuBandSite,
-        NULL,
-        CLSCTX_INPROC_SERVER,
-        IID_PPV_ARG(IBandSite, &pBandSite));
-#else
-    hr = CMenuSite_Constructor(IID_PPV_ARG(IBandSite, &pBandSite));
-#endif
+    hr = CMenuSite_CreateInstance(IID_PPV_ARG(IBandSite, &pBandSite));
     if (FAILED_UNEXPECTEDLY(hr))
         return hr;
 
-#if USE_SYSTEM_MENUDESKBAR
-    hr = CoCreateInstance(CLSID_MenuDeskBar,
-        NULL,
-        CLSCTX_INPROC_SERVER,
-        IID_PPV_ARG(IDeskBar, &pDeskBar));
-#else
-    hr = CMenuDeskBar_Constructor(IID_PPV_ARG(IDeskBar, &pDeskBar));
-#endif
+    hr = CMenuDeskBar_CreateInstance(IID_PPV_ARG(IDeskBar, &pDeskBar));
     if (FAILED_UNEXPECTEDLY(hr))
         return hr;
 
@@ -1319,3 +1299,9 @@ HRESULT STDMETHODCALLTYPE CMenuBand::QueryStatus(const GUID *pguidCmdGroup, ULON
     UNIMPLEMENTED;
     return S_OK;
 }
+
+extern "C"
+HRESULT WINAPI RSHELL_CMenuBand_CreateInstance(REFIID riid, LPVOID *ppv)
+{
+    return ShellObjectCreator<CMenuBand>(riid, ppv);
+}
index 9b63fed..2b0777d 100644 (file)
 
 WINE_DEFAULT_DEBUG_CHANNEL(CMenuDeskBar);
 
-extern "C"
-HRESULT WINAPI CMenuDeskBar_Constructor(REFIID riid, LPVOID *ppv)
-{
-    return ShellObjectCreator<CMenuDeskBar>(riid, ppv);
-}
-
 CMenuDeskBar::CMenuDeskBar() :
     m_Client(NULL),
     m_ClientWindow(NULL),
@@ -852,3 +846,9 @@ HRESULT CMenuDeskBar::_AdjustForTheme(BOOL bFlatStyle)
     SHSetWindowBits(m_hWnd, GWL_STYLE, mask, style);
     return S_OK;
 }
+
+extern "C"
+HRESULT WINAPI RSHELL_CMenuDeskBar_CreateInstance(REFIID riid, LPVOID *ppv)
+{
+    return ShellObjectCreator<CMenuDeskBar>(riid, ppv);
+}
index 0a68160..25b0803 100644 (file)
 
 WINE_DEFAULT_DEBUG_CHANNEL(menusite);
 
-extern "C"
-HRESULT WINAPI CMenuSite_Constructor(REFIID riid, LPVOID *ppv)
-{
-    return ShellObjectCreator<CMenuSite>(riid, ppv);
-}
-
 CMenuSite::CMenuSite() :
     m_DeskBarSite(NULL),
     m_BandObject(NULL),
@@ -362,3 +356,9 @@ HRESULT STDMETHODCALLTYPE CMenuSite::OnFocusChangeIS(IUnknown *punkObj, BOOL fSe
 {
     return S_OK;
 }
+
+extern "C"
+HRESULT WINAPI RSHELL_CMenuSite_CreateInstance(REFIID riid, LPVOID *ppv)
+{
+    return ShellObjectCreator<CMenuSite>(riid, ppv);
+}
index 38f8b62..3d046ba 100644 (file)
@@ -1467,7 +1467,7 @@ HRESULT CMenuSFToolbar::InternalPopupItem(INT iItem, INT index, DWORD_PTR dwData
     if (!pidl)
         return E_FAIL;
 
-    hr = CMenuBand_Constructor(IID_PPV_ARG(IShellMenu, &shellMenu));
+    hr = CMenuBand_CreateInstance(IID_PPV_ARG(IShellMenu, &shellMenu));
     if (FAILED_UNEXPECTEDLY(hr))
         return hr;
 
index 83b92b9..892c501 100644 (file)
@@ -383,12 +383,6 @@ HRESULT STDMETHODCALLTYPE CEnumMergedFolder::Clone(
 //-----------------------------------------------------------------------------
 // CMergedFolder
 
-extern "C"
-HRESULT WINAPI CMergedFolder_Constructor(REFIID riid, LPVOID *ppv)
-{
-    return ShellObjectCreator<CMergedFolder>(riid, ppv);
-}
-
 CMergedFolder::CMergedFolder() :
     m_UserLocal(NULL),
     m_AllUsers(NULL),
@@ -546,7 +540,7 @@ HRESULT STDMETHODCALLTYPE CMergedFolder::BindToObject(
         return hr;
 
     CComPtr<IAugmentedShellFolder> pasf;
-    hr = CMergedFolder_Constructor(IID_PPV_ARG(IAugmentedShellFolder, &pasf));
+    hr = CMergedFolder_CreateInstance(IID_PPV_ARG(IAugmentedShellFolder, &pasf));
     if (FAILED_UNEXPECTEDLY(hr))
         return hr;
 
@@ -814,3 +808,9 @@ HRESULT STDMETHODCALLTYPE CMergedFolder::QueryNameSpace2(ULONG, QUERYNAMESPACEIN
     UNIMPLEMENTED;
     return E_NOTIMPL;
 }
+
+extern "C"
+HRESULT WINAPI RSHELL_CMergedFolder_CreateInstance(REFIID riid, LPVOID *ppv)
+{
+    return ShellObjectCreator<CMergedFolder>(riid, ppv);
+}
index f01957d..c853cb4 100644 (file)
@@ -155,14 +155,7 @@ private:
         int csidl = 0;
         IShellMenu *pShellMenu;
 
-#if USE_SYSTEM_MENUBAND
-        hr = CoCreateInstance(CLSID_MenuBand,
-                              NULL,
-                              CLSCTX_INPROC_SERVER,
-                              IID_PPV_ARG(IShellMenu, &pShellMenu));
-#else
-        hr = CMenuBand_Constructor(IID_PPV_ARG(IShellMenu, &pShellMenu));
-#endif
+        hr = CMenuBand_CreateInstance(IID_PPV_ARG(IShellMenu, &pShellMenu));
         if (FAILED_UNEXPECTEDLY(hr))
             return hr;
 
@@ -384,11 +377,7 @@ static HRESULT GetMergedFolder(int folder1, int folder2, IShellFolder ** ppsfSta
     if (FAILED_UNEXPECTEDLY(hr))
         return hr;
 
-#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));
-#endif
+    hr = CMergedFolder_CreateInstance(IID_PPV_ARG(IAugmentedShellFolder, &pasf));
     if (FAILED_UNEXPECTEDLY(hr))
     {
         *ppsfStartMenu = psfUserStartMenu.Detach();
@@ -426,7 +415,7 @@ static HRESULT GetProgramsFolder(IShellFolder ** ppsfStartMenu)
 
 extern "C"
 HRESULT WINAPI
-CStartMenu_Constructor(REFIID riid, void **ppv)
+RSHELL_CStartMenu_CreateInstance(REFIID riid, void **ppv)
 {
     CComPtr<IShellMenu> pShellMenu;
     CComPtr<IBandSite> pBandSite;
@@ -439,36 +428,15 @@ CStartMenu_Constructor(REFIID riid, void **ppv)
     LPITEMIDLIST pidlPrograms;
     CComPtr<IShellFolder> psfPrograms;
 
-#if USE_SYSTEM_MENUBAND
-    hr = CoCreateInstance(CLSID_MenuBand,
-                          NULL,
-                          CLSCTX_INPROC_SERVER,
-                          IID_PPV_ARG(IShellMenu, &pShellMenu));
-#else
-    hr = CMenuBand_Constructor(IID_PPV_ARG(IShellMenu, &pShellMenu));
-#endif
+    hr = CMenuBand_CreateInstance(IID_PPV_ARG(IShellMenu, &pShellMenu));
     if (FAILED_UNEXPECTEDLY(hr))
         return hr;
 
-#if USE_SYSTEM_MENUSITE
-    hr = CoCreateInstance(CLSID_MenuBandSite,
-                          NULL,
-                          CLSCTX_INPROC_SERVER,
-                          IID_PPV_ARG(IBandSite, &pBandSite));
-#else
-    hr = CMenuSite_Constructor(IID_PPV_ARG(IBandSite, &pBandSite));
-#endif
+    hr = CMenuSite_CreateInstance(IID_PPV_ARG(IBandSite, &pBandSite));
     if (FAILED_UNEXPECTEDLY(hr))
         return hr;
 
-#if USE_SYSTEM_MENUDESKBAR
-    hr = CoCreateInstance(CLSID_MenuDeskBar,
-                          NULL,
-                          CLSCTX_INPROC_SERVER,
-                          IID_PPV_ARG(IDeskBar, &pDeskBar));
-#else
-    hr = CMenuDeskBar_Constructor(IID_PPV_ARG(IDeskBar, &pDeskBar));
-#endif
+    hr = CMenuDeskBar_CreateInstance(IID_PPV_ARG(IDeskBar, &pDeskBar));
     if (FAILED_UNEXPECTEDLY(hr))
         return hr;
 
@@ -476,6 +444,7 @@ CStartMenu_Constructor(REFIID riid, void **ppv)
     hr = CComObject<CShellMenuCallback>::CreateInstance(&pCallback);
     if (FAILED_UNEXPECTEDLY(hr))
         return hr;
+
     pCallback->AddRef(); // CreateInstance returns object with 0 ref count */
     pCallback->Initialize(pShellMenu, pBandSite, pDeskBar);
 
index cc1ca88..1cc7c7a 100644 (file)
 #pragma warning(disable:4512) // assignment operator could not be gernerated
 #endif
 
-#define USE_SYSTEM_MENUDESKBAR 0
-#define USE_SYSTEM_MENUSITE 0
-#define USE_SYSTEM_MENUBAND 0
-#define USE_SYSTEM_MERGED_FOLDERS 0
-
-#define MERGE_FOLDERS 1
-
 #include <stdio.h>
 #include <tchar.h>
 
 #pragma warning(pop)
 #endif
 
+#define USE_SYSTEM_MENUDESKBAR 0
+#define USE_SYSTEM_MENUSITE 0
+#define USE_SYSTEM_MENUBAND 0
+#define USE_SYSTEM_MERGED_FOLDERS 0
+
+#define MERGE_FOLDERS 1
+
+#if USE_SYSTEM_MENUDESKBAR
+#define CMenuDeskBar_CreateInstance(riid, ppv) (CoCreateInstance(CLSID_MenuDeskBar, NULL, CLSCTX_INPROC_SERVER,riid, ppv))
+#else
+#define CMenuDeskBar_CreateInstance RSHELL_CMenuDeskBar_CreateInstance
+#endif
+
+#if USE_SYSTEM_MENUBAND
+#define CMenuBand_CreateInstance(riid, ppv) (CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER,riid, ppv))
+#else
+#define CMenuBand_CreateInstance RSHELL_CMenuBand_CreateInstance
+#endif
+
+#if USE_SYSTEM_MENUSITE
+#define CMenuSite_CreateInstance(riid, ppv) (CoCreateInstance(CLSID_MenuBandSite, NULL, CLSCTX_INPROC_SERVER,riid, ppv))
+#else
+#define CMenuSite_CreateInstance RSHELL_CMenuSite_CreateInstance
+#endif
+
+#if USE_SYSTEM_MERGED_FOLDERS
+#define CMergedFolder_CreateInstance(riid, ppv) (CoCreateInstance(CLSID_MergedFolder, NULL, CLSCTX_INPROC_SERVER,riid, ppv))
+#else
+#define CMergedFolder_CreateInstance RSHELL_CMergedFolder_CreateInstance
+#endif
+
 extern "C"
 {
 extern HINSTANCE shell32_hInstance;
 
-HRESULT WINAPI CStartMenu_Constructor(REFIID riid, void **ppv);
-HRESULT WINAPI CMenuDeskBar_Constructor(REFIID riid, LPVOID *ppv);
-HRESULT WINAPI CMenuSite_Constructor(REFIID riid, LPVOID *ppv);
-HRESULT WINAPI CMenuBand_Constructor(REFIID riid, LPVOID *ppv);
-HRESULT WINAPI CMergedFolder_Constructor(REFIID riid, LPVOID *ppv);
+HRESULT WINAPI RSHELL_CStartMenu_CreateInstance(REFIID riid, void **ppv);
+HRESULT WINAPI RSHELL_CMenuDeskBar_CreateInstance(REFIID riid, LPVOID *ppv);
+HRESULT WINAPI RSHELL_CMenuSite_CreateInstance(REFIID riid, LPVOID *ppv);
+HRESULT WINAPI RSHELL_CMenuBand_CreateInstance(REFIID riid, LPVOID *ppv);
+HRESULT WINAPI RSHELL_CMergedFolder_CreateInstance(REFIID riid, LPVOID *ppv);
 
 }