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