Commit 598e4405 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

shdocvw: Moved remaining code out of factory.c.

parent 908d8333
......@@ -5,7 +5,6 @@ IMPORTS = uuid shlwapi
DELAYIMPORTS = version ole32 oleaut32 ieframe
C_SRCS = \
factory.c \
shdocvw_main.c \
shlinstobj.c
......
/*
* Implementation of class factory for IE Web Browser
*
* Copyright 2001 John R. Sheets (for CodeWeavers)
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <string.h>
#include <stdio.h>
#include "shdocvw.h"
#include "winreg.h"
#include "isguids.h"
#include "winver.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
/**********************************************************************
* Implement the WebBrowser class factory
*/
static HRESULT get_ieframe_object(REFCLSID rclsid, REFIID riid, void **ppv)
{
HINSTANCE ieframe_instance;
static HRESULT (WINAPI *ieframe_DllGetClassObject)(REFCLSID,REFIID,void**);
if(!ieframe_DllGetClassObject) {
ieframe_instance = get_ieframe_instance();
if(!ieframe_instance)
return CLASS_E_CLASSNOTAVAILABLE;
ieframe_DllGetClassObject = (void*)GetProcAddress(ieframe_instance, "DllGetClassObject");
if(!ieframe_DllGetClassObject)
return CLASS_E_CLASSNOTAVAILABLE;
}
return ieframe_DllGetClassObject(rclsid, riid, ppv);
}
/*************************************************************************
* DllGetClassObject (SHDOCVW.@)
*/
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
{
TRACE("\n");
if(IsEqualGUID(&CLSID_WebBrowser, rclsid)
|| IsEqualGUID(&CLSID_WebBrowser_V1, rclsid)
|| IsEqualGUID(&CLSID_InternetShortcut, rclsid)
|| IsEqualGUID(&CLSID_CUrlHistory, rclsid)
|| IsEqualGUID(&CLSID_TaskbarList, rclsid))
return get_ieframe_object(rclsid, riid, ppv);
/* As a last resort, figure if the CLSID belongs to a 'Shell Instance Object' */
return SHDOCVW_GetShellInstanceObjectClassObject(rclsid, riid, ppv);
}
/***********************************************************************
* DllRegisterServer (shdocvw.@)
*/
HRESULT WINAPI DllRegisterServer(void)
{
TRACE("\n");
return S_OK;
}
/***********************************************************************
* DllUnregisterServer (shdocvw.@)
*/
HRESULT WINAPI DllUnregisterServer(void)
{
TRACE("\n");
return S_OK;
}
/******************************************************************
* IEWinMain (SHDOCVW.101)
*
* Only returns on error.
*/
DWORD WINAPI IEWinMain(LPSTR szCommandLine, int nShowWindow)
{
DWORD (WINAPI *pIEWinMain)(LPSTR,int);
TRACE("%s %d\n", debugstr_a(szCommandLine), nShowWindow);
pIEWinMain = (void*)GetProcAddress(get_ieframe_instance(), MAKEINTRESOURCEA(101));
if(!pIEWinMain)
ExitProcess(1);
return pIEWinMain(szCommandLine, nShowWindow);
}
......@@ -33,6 +33,7 @@
#include "winreg.h"
#include "shlwapi.h"
#include "wininet.h"
#include "isguids.h"
#include "initguid.h"
......@@ -54,6 +55,79 @@ HINSTANCE get_ieframe_instance(void)
return ieframe_instance;
}
static HRESULT get_ieframe_object(REFCLSID rclsid, REFIID riid, void **ppv)
{
HINSTANCE ieframe_instance;
static HRESULT (WINAPI *ieframe_DllGetClassObject)(REFCLSID,REFIID,void**);
if(!ieframe_DllGetClassObject) {
ieframe_instance = get_ieframe_instance();
if(!ieframe_instance)
return CLASS_E_CLASSNOTAVAILABLE;
ieframe_DllGetClassObject = (void*)GetProcAddress(ieframe_instance, "DllGetClassObject");
if(!ieframe_DllGetClassObject)
return CLASS_E_CLASSNOTAVAILABLE;
}
return ieframe_DllGetClassObject(rclsid, riid, ppv);
}
/*************************************************************************
* DllGetClassObject (SHDOCVW.@)
*/
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
{
TRACE("\n");
if(IsEqualGUID(&CLSID_WebBrowser, rclsid)
|| IsEqualGUID(&CLSID_WebBrowser_V1, rclsid)
|| IsEqualGUID(&CLSID_InternetShortcut, rclsid)
|| IsEqualGUID(&CLSID_CUrlHistory, rclsid)
|| IsEqualGUID(&CLSID_TaskbarList, rclsid))
return get_ieframe_object(rclsid, riid, ppv);
/* As a last resort, figure if the CLSID belongs to a 'Shell Instance Object' */
return SHDOCVW_GetShellInstanceObjectClassObject(rclsid, riid, ppv);
}
/***********************************************************************
* DllRegisterServer (shdocvw.@)
*/
HRESULT WINAPI DllRegisterServer(void)
{
TRACE("\n");
return S_OK;
}
/***********************************************************************
* DllUnregisterServer (shdocvw.@)
*/
HRESULT WINAPI DllUnregisterServer(void)
{
TRACE("\n");
return S_OK;
}
/******************************************************************
* IEWinMain (SHDOCVW.101)
*
* Only returns on error.
*/
DWORD WINAPI IEWinMain(LPSTR szCommandLine, int nShowWindow)
{
DWORD (WINAPI *pIEWinMain)(LPSTR,int);
TRACE("%s %d\n", debugstr_a(szCommandLine), nShowWindow);
pIEWinMain = (void*)GetProcAddress(get_ieframe_instance(), MAKEINTRESOURCEA(101));
if(!pIEWinMain)
ExitProcess(1);
return pIEWinMain(szCommandLine, nShowWindow);
}
/*************************************************************************
* SHDOCVW DllMain
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment