reactos/dll/win32/browseui/browseui.cpp
Amine Khaldi c424146e2c Create a branch for cmake bringup.
svn path=/branches/cmake-bringup/; revision=48236
2010-07-24 18:52:44 +00:00

140 lines
3.8 KiB
C++

/*
* ReactOS Explorer
*
* Copyright 2009 Andrew Hill <ash77 at domain reactos.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <windows.h>
#include <shlobj.h>
#include <shlobj_undoc.h>
#include <shlguid.h>
#include <shlguid_undoc.h>
#include <shlwapi.h>
#include <tchar.h>
#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <wine/debug.h>
#include "resource.h"
#include "aclmulti.h"
#include "addressband.h"
#include "addresseditbox.h"
#include "bandproxy.h"
#include "bandsite.h"
#include "bandsitemenu.h"
#include "brandband.h"
#include "internettoolbar.h"
WINE_DEFAULT_DEBUG_CHANNEL(browseui);
class CBrowseUIModule : public CComModule
{
public:
};
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_ACLMulti, CACLMulti)
OBJECT_ENTRY(CLSID_SH_AddressBand, CAddressBand)
OBJECT_ENTRY(CLSID_AddressEditBox, CAddressEditBox)
OBJECT_ENTRY(CLSID_BandProxy, CBandProxy)
OBJECT_ENTRY(CLSID_RebarBandSite, CBandSite)
OBJECT_ENTRY(CLSID_BandSiteMenu, CBandSiteMenu)
OBJECT_ENTRY(CLSID_BrandBand, CBrandBand)
OBJECT_ENTRY(CLSID_InternetToolbar, CInternetToolbar)
END_OBJECT_MAP()
CBrowseUIModule gModule;
CAtlWinModule gWinModule;
void *operator new (size_t, void *buf)
{
return buf;
}
/*************************************************************************
* BROWSEUI DllMain
*/
STDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID fImpLoad)
{
TRACE("%p 0x%x %p\n", hInstance, dwReason, fImpLoad);
/* HACK - the global constructors don't run, so I placement new them here */
new (&gModule) CBrowseUIModule;
new (&gWinModule) CAtlWinModule;
new (&_AtlBaseModule) CAtlBaseModule;
new (&_AtlComModule) CAtlComModule;
if (dwReason == DLL_PROCESS_ATTACH)
{
gModule.Init(ObjectMap, hInstance, NULL);
DisableThreadLibraryCalls (hInstance);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
gModule.Term();
}
return TRUE;
}
/***********************************************************************
* DllCanUnloadNow (BROWSEUI.@)
*/
STDAPI DllCanUnloadNow()
{
return gModule.DllCanUnloadNow();
}
/***********************************************************************
* DllGetClassObject (BROWSEUI.@)
*/
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
return gModule.DllGetClassObject(rclsid, riid, ppv);
}
/***********************************************************************
* DllRegisterServer (BROWSEUI.@)
*/
STDAPI DllRegisterServer()
{
return gModule.DllRegisterServer(FALSE);
}
/***********************************************************************
* DllUnregisterServer (BROWSEUI.@)
*/
STDAPI DllUnregisterServer()
{
return gModule.DllUnregisterServer(FALSE);
}
/***********************************************************************
* DllGetVersion (BROWSEUI.@)
*/
HRESULT WINAPI DllGetVersion(DLLVERSIONINFO *info)
{
if (info->cbSize != sizeof(DLLVERSIONINFO)) FIXME("support DLLVERSIONINFO2\n");
/* this is what IE6 on Windows 98 reports */
info->dwMajorVersion = 6;
info->dwMinorVersion = 0;
info->dwBuildNumber = 2600;
info->dwPlatformID = DLLVER_PLATFORM_WINDOWS;
return NOERROR;
}