Synchronize with trunk revision 59636 (just before Alex's CreateProcess revamp).
[reactos.git] / dll / win32 / browseui / browseui.cpp
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 WINE_DEFAULT_DEBUG_CHANNEL(browseui);
24
25 class CBrowseUIModule : public CComModule
26 {
27 public:
28 };
29
30
31 BEGIN_OBJECT_MAP(ObjectMap)
32 OBJECT_ENTRY(CLSID_ACLMulti, CACLMulti)
33 OBJECT_ENTRY(CLSID_SH_AddressBand, CAddressBand)
34 OBJECT_ENTRY(CLSID_AddressEditBox, CAddressEditBox)
35 OBJECT_ENTRY(CLSID_BandProxy, CBandProxy)
36 OBJECT_ENTRY(CLSID_RebarBandSite, CBandSite)
37 OBJECT_ENTRY(CLSID_BandSiteMenu, CBandSiteMenu)
38 OBJECT_ENTRY(CLSID_BrandBand, CBrandBand)
39 OBJECT_ENTRY(CLSID_CCommonBrowser, CCommonBrowser)
40 OBJECT_ENTRY(CLSID_GlobalFolderSettings, CGlobalFolderSettings)
41 OBJECT_ENTRY(CLSID_InternetToolbar, CInternetToolbar)
42 OBJECT_ENTRY(CLSID_CRegTreeOptions, CRegTreeOptions)
43 END_OBJECT_MAP()
44
45 CBrowseUIModule gModule;
46 CAtlWinModule gWinModule;
47
48 void *operator new (size_t, void *buf)
49 {
50 return buf;
51 }
52
53 /*************************************************************************
54 * BROWSEUI DllMain
55 */
56 STDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID fImpLoad)
57 {
58 TRACE("%p 0x%x %p\n", hInstance, dwReason, fImpLoad);
59
60 if (dwReason == DLL_PROCESS_ATTACH)
61 {
62 /* HACK - the global constructors don't run, so I placement new them here */
63 new (&gModule) CBrowseUIModule;
64 new (&gWinModule) CAtlWinModule;
65 new (&_AtlBaseModule) CAtlBaseModule;
66 new (&_AtlComModule) CAtlComModule;
67
68 gModule.Init(ObjectMap, hInstance, NULL);
69 DisableThreadLibraryCalls (hInstance);
70 }
71 else if (dwReason == DLL_PROCESS_DETACH)
72 {
73 gModule.Term();
74 }
75 return TRUE;
76 }
77
78 /***********************************************************************
79 * DllCanUnloadNow (BROWSEUI.@)
80 */
81 STDAPI DllCanUnloadNow()
82 {
83 return gModule.DllCanUnloadNow();
84 }
85
86 /***********************************************************************
87 * DllGetClassObject (BROWSEUI.@)
88 */
89 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
90 {
91 return gModule.DllGetClassObject(rclsid, riid, ppv);
92 }
93
94 /***********************************************************************
95 * DllRegisterServer (BROWSEUI.@)
96 */
97 STDAPI DllRegisterServer()
98 {
99 return gModule.DllRegisterServer(FALSE);
100 }
101
102 /***********************************************************************
103 * DllUnregisterServer (BROWSEUI.@)
104 */
105 STDAPI DllUnregisterServer()
106 {
107 return gModule.DllUnregisterServer(FALSE);
108 }
109
110 /***********************************************************************
111 * DllGetVersion (BROWSEUI.@)
112 */
113 STDAPI DllGetVersion(DLLVERSIONINFO *info)
114 {
115 if (info->cbSize != sizeof(DLLVERSIONINFO)) FIXME("support DLLVERSIONINFO2\n");
116
117 /* this is what IE6 on Windows 98 reports */
118 info->dwMajorVersion = 6;
119 info->dwMinorVersion = 0;
120 info->dwBuildNumber = 2600;
121 info->dwPlatformID = DLLVER_PLATFORM_WINDOWS;
122
123 return NOERROR;
124 }