[USB-BRINGUP-TRUNK]
[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_InternetToolbar, CInternetToolbar)
40 END_OBJECT_MAP()
41
42 CBrowseUIModule gModule;
43 CAtlWinModule gWinModule;
44
45 void *operator new (size_t, void *buf)
46 {
47 return buf;
48 }
49
50 /*************************************************************************
51 * BROWSEUI DllMain
52 */
53 STDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID fImpLoad)
54 {
55 TRACE("%p 0x%x %p\n", hInstance, dwReason, fImpLoad);
56
57 /* HACK - the global constructors don't run, so I placement new them here */
58 new (&gModule) CBrowseUIModule;
59 new (&gWinModule) CAtlWinModule;
60 new (&_AtlBaseModule) CAtlBaseModule;
61 new (&_AtlComModule) CAtlComModule;
62
63 if (dwReason == DLL_PROCESS_ATTACH)
64 {
65 gModule.Init(ObjectMap, hInstance, NULL);
66 DisableThreadLibraryCalls (hInstance);
67 }
68 else if (dwReason == DLL_PROCESS_DETACH)
69 {
70 gModule.Term();
71 }
72 return TRUE;
73 }
74
75 /***********************************************************************
76 * DllCanUnloadNow (BROWSEUI.@)
77 */
78 STDAPI DllCanUnloadNow()
79 {
80 return gModule.DllCanUnloadNow();
81 }
82
83 /***********************************************************************
84 * DllGetClassObject (BROWSEUI.@)
85 */
86 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
87 {
88 return gModule.DllGetClassObject(rclsid, riid, ppv);
89 }
90
91 /***********************************************************************
92 * DllRegisterServer (BROWSEUI.@)
93 */
94 STDAPI DllRegisterServer()
95 {
96 return gModule.DllRegisterServer(FALSE);
97 }
98
99 /***********************************************************************
100 * DllUnregisterServer (BROWSEUI.@)
101 */
102 STDAPI DllUnregisterServer()
103 {
104 return gModule.DllUnregisterServer(FALSE);
105 }
106
107 /***********************************************************************
108 * DllGetVersion (BROWSEUI.@)
109 */
110 HRESULT WINAPI DllGetVersion(DLLVERSIONINFO *info)
111 {
112 if (info->cbSize != sizeof(DLLVERSIONINFO)) FIXME("support DLLVERSIONINFO2\n");
113
114 /* this is what IE6 on Windows 98 reports */
115 info->dwMajorVersion = 6;
116 info->dwMinorVersion = 0;
117 info->dwBuildNumber = 2600;
118 info->dwPlatformID = DLLVER_PLATFORM_WINDOWS;
119
120 return NOERROR;
121 }