2001-01-11 23:32:44 +01:00
|
|
|
/*
|
2002-05-05 21:40:57 +02:00
|
|
|
* SHDOCVW - Internet Explorer Web Control
|
2001-01-11 23:32:44 +01:00
|
|
|
*
|
2002-03-10 00:29:33 +01:00
|
|
|
* Copyright 2001 John R. Sheets (for CodeWeavers)
|
2004-11-02 00:22:14 +01:00
|
|
|
* Copyright 2004 Mike McCormack (for CodeWeavers)
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2001-01-11 23:32:44 +01:00
|
|
|
*/
|
|
|
|
|
2004-02-13 21:57:34 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2004-02-13 21:57:34 +01:00
|
|
|
#include <stdio.h>
|
2004-10-07 05:06:48 +02:00
|
|
|
|
2006-02-08 12:36:25 +01:00
|
|
|
#include "wine/unicode.h"
|
|
|
|
#include "wine/debug.h"
|
2001-01-11 23:32:44 +01:00
|
|
|
|
|
|
|
#include "shdocvw.h"
|
2004-02-13 21:57:34 +01:00
|
|
|
|
2006-02-08 12:36:25 +01:00
|
|
|
#include "winreg.h"
|
|
|
|
#include "shlwapi.h"
|
2001-01-11 23:32:44 +01:00
|
|
|
|
2004-02-13 21:57:34 +01:00
|
|
|
#include "initguid.h"
|
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
2001-01-11 23:32:44 +01:00
|
|
|
|
2005-01-27 11:43:53 +01:00
|
|
|
LONG SHDOCVW_refCount = 0;
|
|
|
|
|
2003-10-02 06:31:06 +02:00
|
|
|
HINSTANCE shdocvw_hinstance = 0;
|
2004-02-13 21:57:34 +01:00
|
|
|
static HMODULE SHDOCVW_hshell32 = 0;
|
2006-07-31 13:27:22 +02:00
|
|
|
static ITypeInfo *wb_typeinfo = NULL;
|
|
|
|
|
|
|
|
HRESULT get_typeinfo(ITypeInfo **typeinfo)
|
|
|
|
{
|
|
|
|
ITypeLib *typelib;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
if(wb_typeinfo) {
|
|
|
|
*typeinfo = wb_typeinfo;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = LoadRegTypeLib(&LIBID_SHDocVw, 1, 1, LOCALE_SYSTEM_DEFAULT, &typelib);
|
|
|
|
if(FAILED(hres)) {
|
2006-10-05 23:49:39 +02:00
|
|
|
ERR("LoadRegTypeLib failed: %08x\n", hres);
|
2006-07-31 13:27:22 +02:00
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = ITypeLib_GetTypeInfoOfGuid(typelib, &IID_IWebBrowser2, &wb_typeinfo);
|
|
|
|
ITypeLib_Release(typelib);
|
|
|
|
|
|
|
|
*typeinfo = wb_typeinfo;
|
|
|
|
return hres;
|
|
|
|
}
|
2003-10-02 06:31:06 +02:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SHDOCVW DllMain
|
|
|
|
*/
|
|
|
|
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID fImpLoad)
|
|
|
|
{
|
2006-10-05 23:49:39 +02:00
|
|
|
TRACE("%p 0x%x %p\n", hinst, fdwReason, fImpLoad);
|
2006-04-07 10:52:00 +02:00
|
|
|
switch (fdwReason)
|
|
|
|
{
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
shdocvw_hinstance = hinst;
|
|
|
|
register_iewindow_class();
|
|
|
|
break;
|
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
if (SHDOCVW_hshell32) FreeLibrary(SHDOCVW_hshell32);
|
|
|
|
unregister_iewindow_class();
|
2006-07-31 13:27:22 +02:00
|
|
|
if(wb_typeinfo)
|
|
|
|
ITypeInfo_Release(wb_typeinfo);
|
2006-04-07 10:52:00 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return TRUE;
|
2003-10-02 06:31:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2002-05-22 03:55:18 +02:00
|
|
|
* DllCanUnloadNow (SHDOCVW.@)
|
|
|
|
*/
|
2005-05-17 16:41:37 +02:00
|
|
|
HRESULT WINAPI DllCanUnloadNow(void)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2006-06-30 23:40:54 +02:00
|
|
|
return SHDOCVW_refCount ? S_FALSE : S_OK;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2002-05-22 03:55:18 +02:00
|
|
|
* DllGetVersion (SHDOCVW.@)
|
2001-01-11 23:32:44 +01:00
|
|
|
*/
|
2005-05-17 16:41:37 +02:00
|
|
|
HRESULT WINAPI DllGetVersion(DLLVERSIONINFO *info)
|
2001-01-11 23:32:44 +01:00
|
|
|
{
|
2004-02-21 05:01:22 +01:00
|
|
|
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;
|
2001-01-11 23:32:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2002-05-22 03:55:18 +02:00
|
|
|
* DllInstall (SHDOCVW.@)
|
2001-01-11 23:32:44 +01:00
|
|
|
*/
|
2005-05-17 16:41:37 +02:00
|
|
|
HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
|
2001-01-11 23:32:44 +01:00
|
|
|
{
|
2002-05-05 21:40:57 +02:00
|
|
|
FIXME("(%s, %s): stub!\n", bInstall ? "TRUE":"FALSE", debugstr_w(cmdline));
|
2001-01-11 23:32:44 +01:00
|
|
|
|
2002-05-05 21:40:57 +02:00
|
|
|
return S_OK;
|
2001-01-11 23:32:44 +01:00
|
|
|
}
|
|
|
|
|
2003-10-02 06:31:06 +02:00
|
|
|
/*************************************************************************
|
|
|
|
* SHDOCVW_LoadShell32
|
|
|
|
*
|
|
|
|
* makes sure the handle to shell32 is valid
|
|
|
|
*/
|
2007-01-29 19:12:56 +01:00
|
|
|
static BOOL SHDOCVW_LoadShell32(void)
|
2003-10-02 06:31:06 +02:00
|
|
|
{
|
|
|
|
if (SHDOCVW_hshell32)
|
|
|
|
return TRUE;
|
|
|
|
return ((SHDOCVW_hshell32 = LoadLibraryA("shell32.dll")) != NULL);
|
|
|
|
}
|
|
|
|
|
2003-05-13 06:44:39 +02:00
|
|
|
/***********************************************************************
|
2003-09-11 03:04:24 +02:00
|
|
|
* @ (SHDOCVW.110)
|
2003-05-13 06:44:39 +02:00
|
|
|
*
|
|
|
|
* Called by Win98 explorer.exe main binary, definitely has 0
|
|
|
|
* parameters.
|
|
|
|
*/
|
2003-09-11 03:04:24 +02:00
|
|
|
DWORD WINAPI WinList_Init(void)
|
2003-05-13 06:44:39 +02:00
|
|
|
{
|
|
|
|
FIXME("(), stub!\n");
|
|
|
|
return 0x0deadfeed;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2003-09-11 03:04:24 +02:00
|
|
|
* @ (SHDOCVW.118)
|
2003-05-13 06:44:39 +02:00
|
|
|
*
|
|
|
|
* Called by Win98 explorer.exe main binary, definitely has only one
|
|
|
|
* parameter.
|
|
|
|
*/
|
2003-10-02 06:31:06 +02:00
|
|
|
static BOOL (WINAPI *pShellDDEInit)(BOOL start) = NULL;
|
|
|
|
|
|
|
|
BOOL WINAPI ShellDDEInit(BOOL start)
|
2003-05-13 06:44:39 +02:00
|
|
|
{
|
2003-10-02 06:31:06 +02:00
|
|
|
TRACE("(%d)\n", start);
|
|
|
|
|
|
|
|
if (!pShellDDEInit)
|
|
|
|
{
|
|
|
|
if (!SHDOCVW_LoadShell32())
|
|
|
|
return FALSE;
|
2007-05-24 16:41:17 +02:00
|
|
|
pShellDDEInit = (void *)GetProcAddress(SHDOCVW_hshell32, (LPCSTR)188);
|
2003-10-02 06:31:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (pShellDDEInit)
|
|
|
|
return pShellDDEInit(start);
|
|
|
|
else
|
|
|
|
return FALSE;
|
2003-05-13 06:44:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2003-09-11 03:04:24 +02:00
|
|
|
* @ (SHDOCVW.125)
|
2003-05-13 06:44:39 +02:00
|
|
|
*
|
|
|
|
* Called by Win98 explorer.exe main binary, definitely has 0
|
|
|
|
* parameters.
|
|
|
|
*/
|
2003-09-11 03:04:24 +02:00
|
|
|
DWORD WINAPI RunInstallUninstallStubs(void)
|
2003-05-13 06:44:39 +02:00
|
|
|
{
|
|
|
|
FIXME("(), stub!\n");
|
|
|
|
return 0x0deadbee;
|
|
|
|
}
|
2004-11-19 18:55:28 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* SetQueryNetSessionCount (SHDOCVW.@)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI SetQueryNetSessionCount(DWORD arg)
|
|
|
|
{
|
2006-10-05 23:49:39 +02:00
|
|
|
FIXME("(%u), stub!\n", arg);
|
2004-11-19 18:55:28 +01:00
|
|
|
return 0;
|
|
|
|
}
|
2006-02-08 12:36:03 +01:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* OpenURL (SHDOCVW.@)
|
|
|
|
*/
|
|
|
|
void WINAPI OpenURL(HWND hWnd, HINSTANCE hInst, LPCSTR lpcstrUrl, int nShowCmd)
|
|
|
|
{
|
|
|
|
FIXME("%p %p %s %d\n", hWnd, hInst, debugstr_a(lpcstrUrl), nShowCmd);
|
|
|
|
}
|
2006-02-15 13:37:18 +01:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* Some forwards (by ordinal) to SHLWAPI
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void* fetch_shlwapi_ordinal(unsigned ord)
|
|
|
|
{
|
|
|
|
static const WCHAR shlwapiW[] = {'s','h','l','w','a','p','i','.','d','l','l','\0'};
|
|
|
|
static HANDLE h;
|
|
|
|
|
|
|
|
if (!h && !(h = GetModuleHandleW(shlwapiW))) return NULL;
|
|
|
|
return (void*)GetProcAddress(h, (const char*)ord);
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* WhichPlatformFORWARD (SHDOCVW.@)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI WhichPlatformFORWARD(void)
|
|
|
|
{
|
|
|
|
static DWORD (*WINAPI p)(void);
|
|
|
|
|
|
|
|
if (p || (p = fetch_shlwapi_ordinal(276))) return p();
|
|
|
|
return 1; /* not integrated, see shlwapi.WhichPlatform */
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* StopWatchModeFORWARD (SHDOCVW.@)
|
|
|
|
*/
|
|
|
|
void WINAPI StopWatchModeFORWARD(void)
|
|
|
|
{
|
|
|
|
static void (*WINAPI p)(void);
|
|
|
|
|
|
|
|
if (p || (p = fetch_shlwapi_ordinal(241))) p();
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* StopWatchFlushFORWARD (SHDOCVW.@)
|
|
|
|
*/
|
|
|
|
void WINAPI StopWatchFlushFORWARD(void)
|
|
|
|
{
|
|
|
|
static void (*WINAPI p)(void);
|
|
|
|
|
|
|
|
if (p || (p = fetch_shlwapi_ordinal(242))) p();
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* StopWatchWFORWARD (SHDOCVW.@)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI StopWatchWFORWARD(DWORD dwClass, LPCWSTR lpszStr, DWORD dwUnknown,
|
|
|
|
DWORD dwMode, DWORD dwTimeStamp)
|
|
|
|
{
|
|
|
|
static DWORD (*WINAPI p)(DWORD, LPCWSTR, DWORD, DWORD, DWORD);
|
|
|
|
|
|
|
|
if (p || (p = fetch_shlwapi_ordinal(243)))
|
|
|
|
return p(dwClass, lpszStr, dwUnknown, dwMode, dwTimeStamp);
|
|
|
|
return ERROR_CALL_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* StopWatchAFORWARD (SHDOCVW.@)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI StopWatchAFORWARD(DWORD dwClass, LPCSTR lpszStr, DWORD dwUnknown,
|
|
|
|
DWORD dwMode, DWORD dwTimeStamp)
|
|
|
|
{
|
|
|
|
static DWORD (*WINAPI p)(DWORD, LPCSTR, DWORD, DWORD, DWORD);
|
|
|
|
|
|
|
|
if (p || (p = fetch_shlwapi_ordinal(244)))
|
|
|
|
return p(dwClass, lpszStr, dwUnknown, dwMode, dwTimeStamp);
|
|
|
|
return ERROR_CALL_NOT_IMPLEMENTED;
|
|
|
|
}
|