ReactOS  0.4.14-dev-49-gfb4591c
browseui.cpp
Go to the documentation of this file.
1 /*
2  * ReactOS Explorer
3  *
4  * Copyright 2009 Andrew Hill <ash77 at domain reactos.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 
21 #include "precomp.h"
22 
23 
25 {
26 #if USE_CUSTOM_ADDRESSBAND
27  return ShellObjectCreator<CAddressBand>(riid, ppv);
28 #else
29  return CoCreateInstance(CLSID_SH_AddressBand, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IUnknown, toolsBar));
30 #endif
31 }
32 
34 {
35 #if USE_CUSTOM_ADDRESSEDITBOX
36  return ShellObjectCreator<CAddressEditBox>(riid, ppv);
37 #else
38  return CoCreateInstance(CLSID_AddressEditBox, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(riid, &ppv));
39 #endif
40 }
41 
43 {
44 #if USE_CUSTOM_BANDPROXY
45  return ShellObjectCreator<CBandProxy>(riid, ppv);
46 #else
47  return CoCreateInstance(CLSID_BandProxy, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(riid, &ppv));
48 #endif
49 }
50 
52 {
53 #if USE_CUSTOM_BRANDBAND
54  return ShellObjectCreator<CBrandBand>(riid, ppv);
55 #else
56  return CoCreateInstance(CLSID_BrandBand, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
57 #endif
58 }
59 
61 {
62 #if USE_CUSTOM_SEARCHBAND
63  return ShellObjectCreator<CSearchBar>(riid, ppv);
64 #else
65  return CoCreateInstance(CLSID_FileSearchBand, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
66 #endif
67 }
68 
70 {
71 #if USE_CUSTOM_EXPLORERBAND
72  return ShellObjectCreator<CExplorerBand>(riid, ppv);
73 #else
74  return CoCreateInstance(CLSID_ExplorerBand, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
75 #endif
76 }
77 
79 {
80 #if USE_CUSTOM_INTERNETTOOLBAR
81  return ShellObjectCreator<CInternetToolbar>(riid, ppv);
82 #else
83  return CoCreateInstance(CLSID_InternetToolbar, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
84 #endif
85 }
86 
89 
91 {
92 #if USE_CUSTOM_MERGEDFOLDER
93  HMODULE hRShell = GetModuleHandle(L"rshell.dll");
94  if (!hRShell)
95  hRShell = LoadLibrary(L"rshell.dll");
96 
97  if (hRShell)
98  {
99  PMERGEDFOLDER_CREATEINSTANCE pCMergedFolder_CreateInstance = (PMERGEDFOLDER_CREATEINSTANCE)
100  GetProcAddress(hRShell, "CMergedFolder_CreateInstance");
101 
102  if (pCMergedFolder_CreateInstance)
103  {
104  return pCMergedFolder_CreateInstance(riid, ppv);
105  }
106  }
107 #endif
108  return CoCreateInstance(CLSID_MergedFolder, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
109 }
110 
112 {
113 #if USE_CUSTOM_MENUBAND
114  HMODULE hRShell = GetModuleHandleW(L"rshell.dll");
115 
116  if (!hRShell)
117  hRShell = LoadLibraryW(L"rshell.dll");
118 
119  if (hRShell)
120  {
121  PMENUBAND_CREATEINSTANCE func = (PMENUBAND_CREATEINSTANCE) GetProcAddress(hRShell, "CMenuBand_CreateInstance");
122  if (func)
123  {
124  return func(iid , ppv);
125  }
126  }
127 #endif
128  return CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER, iid, ppv);
129 }
130 
131 
133 {
134 public:
135 };
136 
137 
138 BEGIN_OBJECT_MAP(ObjectMap)
139 OBJECT_ENTRY(CLSID_ACLCustomMRU, CACLCustomMRU)
140 OBJECT_ENTRY(CLSID_AutoComplete, CAutoComplete)
141 OBJECT_ENTRY(CLSID_ACLMulti, CACLMulti)
142 OBJECT_ENTRY(CLSID_ACListISF, CACListISF)
143 OBJECT_ENTRY(CLSID_SH_AddressBand, CAddressBand)
144 OBJECT_ENTRY(CLSID_AddressEditBox, CAddressEditBox)
145 OBJECT_ENTRY(CLSID_BandProxy, CBandProxy)
146 OBJECT_ENTRY(CLSID_RebarBandSite, CBandSite)
147 OBJECT_ENTRY(CLSID_BandSiteMenu, CBandSiteMenu)
148 OBJECT_ENTRY(CLSID_BrandBand, CBrandBand)
149 OBJECT_ENTRY(CLSID_CCommonBrowser, CCommonBrowser)
150 OBJECT_ENTRY(CLSID_GlobalFolderSettings, CGlobalFolderSettings)
151 OBJECT_ENTRY(CLSID_InternetToolbar, CInternetToolbar)
152 OBJECT_ENTRY(CLSID_CRegTreeOptions, CRegTreeOptions)
153 OBJECT_ENTRY(CLSID_TaskbarList, CTaskbarList)
154 OBJECT_ENTRY(CLSID_ExplorerBand, CExplorerBand)
155 OBJECT_ENTRY(CLSID_FileSearchBand, CSearchBar)
156 OBJECT_ENTRY(CLSID_ProgressDialog, CProgressDialog)
157 OBJECT_ENTRY(CLSID_ISFBand, CISFBand)
158 OBJECT_ENTRY(CLSID_FindFolder, CFindFolder)
160 
163 
164 /*************************************************************************
165  * BROWSEUI DllMain
166  */
168 {
169  TRACE("%p 0x%x %p\n", hInstance, dwReason, fImpLoad);
170 
172  {
173  gModule.Init(ObjectMap, hInstance, NULL);
175  }
176  else if (dwReason == DLL_PROCESS_DETACH)
177  {
178  gModule.Term();
179  }
180  return TRUE;
181 }
182 
183 /***********************************************************************
184  * DllCanUnloadNow (BROWSEUI.@)
185  */
187 {
188  return gModule.DllCanUnloadNow();
189 }
190 
191 /***********************************************************************
192  * DllGetClassObject (BROWSEUI.@)
193  */
195 {
196  return gModule.DllGetClassObject(rclsid, riid, ppv);
197 }
198 
199 /***********************************************************************
200  * DllRegisterServer (BROWSEUI.@)
201  */
203 {
205 }
206 
207 /***********************************************************************
208  * DllUnregisterServer (BROWSEUI.@)
209  */
211 {
213 }
214 
215 /***********************************************************************
216  * DllGetVersion (BROWSEUI.@)
217  */
219 {
220  if (info->cbSize != sizeof(DLLVERSIONINFO)) FIXME("support DLLVERSIONINFO2\n");
221 
222  /* this is what IE6 on Windows 98 reports */
223  info->dwMajorVersion = 6;
224  info->dwMinorVersion = 0;
225  info->dwBuildNumber = 2600;
226  info->dwPlatformID = DLLVER_PLATFORM_WINDOWS;
227 
228  return NOERROR;
229 }
return TRUE
Definition: browseui.cpp:180
#define STDAPI
Definition: basetyps.h:41
GLenum func
Definition: glext.h:6028
HRESULT(WINAPI * PMERGEDFOLDER_CREATEINSTANCE)(REFIID riid, void **ppv)
Definition: browseui.cpp:88
HRESULT DllCanUnloadNow()
Definition: atlbase.h:928
#define HRESULT
Definition: msvc.h:9
STDAPI DllCanUnloadNow()
Definition: browseui.cpp:186
STDAPI DllUnregisterServer()
Definition: browseui.cpp:210
HRESULT(WINAPI * PMENUBAND_CREATEINSTANCE)(REFIID riid, void **ppv)
Definition: browseui.cpp:87
#define REFIID
Definition: guiddef.h:118
HRESULT DllRegisterServer(BOOL bRegTypeLib=TRUE)
Definition: atlbase.h:940
HRESULT CBandProxy_CreateInstance(REFIID riid, void **ppv)
Definition: browseui.cpp:42
#define LoadLibrary
Definition: winbase.h:3679
#define NOERROR
Definition: winerror.h:2354
#define OBJECT_ENTRY(clsid, class)
Definition: atlcom.h:653
REFIID riid
Definition: precomp.h:44
DWORD LPVOID fImpLoad
Definition: browseui.cpp:168
HRESULT CAddressEditBox_CreateInstance(REFIID riid, void **ppv)
Definition: browseui.cpp:33
#define REFCLSID
Definition: guiddef.h:117
REFIID LPVOID * ppv
Definition: atlbase.h:39
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: browseui.cpp:194
DWORD dwReason
Definition: browseui.cpp:167
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
CBrowseUIModule gModule
Definition: browseui.cpp:161
#define IID_PPV_ARG(Itype, ppType)
void Term()
Definition: atlbase.h:820
HRESULT CExplorerBand_CreateInstance(REFIID riid, LPVOID *ppv)
Definition: browseui.cpp:69
HRESULT Init(_ATL_OBJMAP_ENTRY *p, HINSTANCE, const GUID *plibid)
Definition: atlbase.h:797
HINSTANCE hInstance
Definition: charmap.c:20
STDAPI DllGetVersion(DLLVERSIONINFO *info)
Definition: browseui.cpp:218
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:110
HRESULT CMenuBand_CreateInstance(REFIID iid, LPVOID *ppv)
Definition: browseui.cpp:111
HRESULT DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: atlbase.h:935
#define LoadLibraryW(x)
Definition: compat.h:404
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DllMain(IN HINSTANCE hinstDLL, IN DWORD dwReason, IN LPVOID lpvReserved)
Definition: kbsdll.c:83
#define DLL_PROCESS_DETACH
Definition: compat.h:119
HRESULT CBrandBand_CreateInstance(REFIID riid, void **ppv)
Definition: browseui.cpp:51
CAtlWinModule gWinModule
Definition: browseui.cpp:162
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define WINAPI
Definition: msvc.h:8
unsigned long DWORD
Definition: ntddk_ex.h:95
STDAPI DllRegisterServer()
Definition: browseui.cpp:202
HRESULT CAddressBand_CreateInstance(REFIID riid, void **ppv)
Definition: browseui.cpp:24
STDAPI_(BOOL) DllMain(HINSTANCE hInstance
static const WCHAR L[]
Definition: oid.c:1250
HRESULT CMergedFolder_CreateInstance(REFIID riid, void **ppv)
Definition: browseui.cpp:90
HRESULT CSearchBar_CreateInstance(REFIID riid, LPVOID *ppv)
Definition: browseui.cpp:60
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define GetModuleHandle
Definition: winbase.h:3644
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
#define BEGIN_OBJECT_MAP(x)
Definition: atlcom.h:649
#define GetProcAddress(x, y)
Definition: compat.h:410
HRESULT DllUnregisterServer(BOOL bUnRegTypeLib=TRUE)
Definition: atlbase.h:945
HRESULT CInternetToolbar_CreateInstance(REFIID riid, void **ppv)
Definition: browseui.cpp:78
#define END_OBJECT_MAP()
Definition: atlcom.h:651
#define DLLVER_PLATFORM_WINDOWS
Definition: shlwapi.h:1961