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