[CMAKE]
[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 <windows.h>
22 #include <shlobj.h>
23 #include <shlobj_undoc.h>
24 #include <shlguid.h>
25 #include <shlguid_undoc.h>
26 #include <shlwapi.h>
27 #include <tchar.h>
28 #include <atlbase.h>
29 #include <atlcom.h>
30 #include <atlwin.h>
31 #include <wine/debug.h>
32 #include "resource.h"
33 #include "aclmulti.h"
34 #include "addressband.h"
35 #include "addresseditbox.h"
36 #include "bandproxy.h"
37 #include "bandsite.h"
38 #include "bandsitemenu.h"
39 #include "brandband.h"
40 #include "internettoolbar.h"
41
42 WINE_DEFAULT_DEBUG_CHANNEL(browseui);
43
44 class CBrowseUIModule : public CComModule
45 {
46 public:
47 };
48
49
50 BEGIN_OBJECT_MAP(ObjectMap)
51 OBJECT_ENTRY(CLSID_ACLMulti, CACLMulti)
52 OBJECT_ENTRY(CLSID_SH_AddressBand, CAddressBand)
53 OBJECT_ENTRY(CLSID_AddressEditBox, CAddressEditBox)
54 OBJECT_ENTRY(CLSID_BandProxy, CBandProxy)
55 OBJECT_ENTRY(CLSID_RebarBandSite, CBandSite)
56 OBJECT_ENTRY(CLSID_BandSiteMenu, CBandSiteMenu)
57 OBJECT_ENTRY(CLSID_BrandBand, CBrandBand)
58 OBJECT_ENTRY(CLSID_InternetToolbar, CInternetToolbar)
59 END_OBJECT_MAP()
60
61 CBrowseUIModule gModule;
62 CAtlWinModule gWinModule;
63
64 void *operator new (size_t, void *buf)
65 {
66 return buf;
67 }
68
69 /*************************************************************************
70 * BROWSEUI DllMain
71 */
72 STDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID fImpLoad)
73 {
74 TRACE("%p 0x%x %p\n", hInstance, dwReason, fImpLoad);
75
76 /* HACK - the global constructors don't run, so I placement new them here */
77 new (&gModule) CBrowseUIModule;
78 new (&gWinModule) CAtlWinModule;
79 new (&_AtlBaseModule) CAtlBaseModule;
80 new (&_AtlComModule) CAtlComModule;
81
82 if (dwReason == DLL_PROCESS_ATTACH)
83 {
84 gModule.Init(ObjectMap, hInstance, NULL);
85 DisableThreadLibraryCalls (hInstance);
86 }
87 else if (dwReason == DLL_PROCESS_DETACH)
88 {
89 gModule.Term();
90 }
91 return TRUE;
92 }
93
94 /***********************************************************************
95 * DllCanUnloadNow (BROWSEUI.@)
96 */
97 STDAPI DllCanUnloadNow()
98 {
99 return gModule.DllCanUnloadNow();
100 }
101
102 /***********************************************************************
103 * DllGetClassObject (BROWSEUI.@)
104 */
105 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
106 {
107 return gModule.DllGetClassObject(rclsid, riid, ppv);
108 }
109
110 /***********************************************************************
111 * DllRegisterServer (BROWSEUI.@)
112 */
113 STDAPI DllRegisterServer()
114 {
115 return gModule.DllRegisterServer(FALSE);
116 }
117
118 /***********************************************************************
119 * DllUnregisterServer (BROWSEUI.@)
120 */
121 STDAPI DllUnregisterServer()
122 {
123 return gModule.DllUnregisterServer(FALSE);
124 }
125
126 /***********************************************************************
127 * DllGetVersion (BROWSEUI.@)
128 */
129 HRESULT WINAPI DllGetVersion(DLLVERSIONINFO *info)
130 {
131 if (info->cbSize != sizeof(DLLVERSIONINFO)) FIXME("support DLLVERSIONINFO2\n");
132
133 /* this is what IE6 on Windows 98 reports */
134 info->dwMajorVersion = 6;
135 info->dwMinorVersion = 0;
136 info->dwBuildNumber = 2600;
137 info->dwPlatformID = DLLVER_PLATFORM_WINDOWS;
138
139 return NOERROR;
140 }