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)
|
2008-10-23 23:05:01 +02:00
|
|
|
* Copyright 2008 Detlef Riekenberg
|
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"
|
2008-10-23 23:05:01 +02:00
|
|
|
#include "wininet.h"
|
2011-07-31 13:24:41 +02:00
|
|
|
#include "isguids.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;
|
|
|
|
|
2004-02-13 21:57:34 +01:00
|
|
|
static HMODULE SHDOCVW_hshell32 = 0;
|
2011-07-23 18:40:54 +02:00
|
|
|
static HINSTANCE ieframe_instance;
|
|
|
|
|
2011-09-18 19:36:45 +02:00
|
|
|
static HINSTANCE get_ieframe_instance(void)
|
2011-07-23 18:40:54 +02:00
|
|
|
{
|
|
|
|
static const WCHAR ieframe_dllW[] = {'i','e','f','r','a','m','e','.','d','l','l',0};
|
|
|
|
|
|
|
|
if(!ieframe_instance)
|
|
|
|
ieframe_instance = LoadLibraryW(ieframe_dllW);
|
|
|
|
|
|
|
|
return ieframe_instance;
|
|
|
|
}
|
|
|
|
|
2011-07-31 13:24:41 +02:00
|
|
|
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)
|
|
|
|
{
|
2015-07-09 15:57:11 +02:00
|
|
|
TRACE("(%s %s %p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
|
2011-07-31 13:24:41 +02:00
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
2011-10-20 16:46:59 +02:00
|
|
|
DWORD (WINAPI *pIEWinMain)(const WCHAR*,int);
|
|
|
|
WCHAR *cmdline;
|
|
|
|
DWORD ret, len;
|
2011-07-31 13:24:41 +02:00
|
|
|
|
|
|
|
TRACE("%s %d\n", debugstr_a(szCommandLine), nShowWindow);
|
|
|
|
|
|
|
|
pIEWinMain = (void*)GetProcAddress(get_ieframe_instance(), MAKEINTRESOURCEA(101));
|
|
|
|
if(!pIEWinMain)
|
|
|
|
ExitProcess(1);
|
|
|
|
|
2011-10-20 16:46:59 +02:00
|
|
|
len = MultiByteToWideChar(CP_ACP, 0, szCommandLine, -1, NULL, 0);
|
|
|
|
cmdline = heap_alloc(len*sizeof(WCHAR));
|
|
|
|
if(!cmdline)
|
|
|
|
ExitProcess(1);
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, szCommandLine, -1, cmdline, len);
|
|
|
|
|
|
|
|
ret = pIEWinMain(cmdline, nShowWindow);
|
|
|
|
|
|
|
|
heap_free(cmdline);
|
|
|
|
return ret;
|
2011-07-31 13:24:41 +02:00
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
{
|
2015-07-09 15:57:11 +02:00
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
DisableThreadLibraryCalls(hinst);
|
2006-04-07 10:52:00 +02:00
|
|
|
break;
|
|
|
|
case DLL_PROCESS_DETACH:
|
2013-05-17 12:25:09 +02:00
|
|
|
if (fImpLoad) break;
|
2006-04-07 10:52:00 +02:00
|
|
|
if (SHDOCVW_hshell32) FreeLibrary(SHDOCVW_hshell32);
|
2013-05-17 12:25:09 +02:00
|
|
|
if (ieframe_instance) FreeLibrary(ieframe_instance);
|
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
|
|
|
|
2011-06-11 20:12:26 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* @ (SHDOCVW.130)
|
|
|
|
*
|
|
|
|
* Called by Emerge Desktop (alternative Windows Shell).
|
|
|
|
*/
|
2015-10-30 10:47:37 +01:00
|
|
|
DWORD WINAPI RunInstallUninstallStubs2(int arg)
|
2011-06-11 20:12:26 +02:00
|
|
|
{
|
2015-10-30 10:47:37 +01:00
|
|
|
FIXME("(%d), stub!\n", arg);
|
2011-06-11 20:12:26 +02:00
|
|
|
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
|
|
|
|
2006-02-15 13:37:18 +01:00
|
|
|
/**********************************************************************
|
|
|
|
* Some forwards (by ordinal) to SHLWAPI
|
|
|
|
*/
|
|
|
|
|
2009-01-08 17:27:49 +01:00
|
|
|
static void* fetch_shlwapi_ordinal(UINT_PTR ord)
|
2006-02-15 13:37:18 +01:00
|
|
|
{
|
|
|
|
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)
|
|
|
|
{
|
2008-02-19 12:37:21 +01:00
|
|
|
static DWORD (WINAPI *p)(void);
|
2006-02-15 13:37:18 +01:00
|
|
|
|
|
|
|
if (p || (p = fetch_shlwapi_ordinal(276))) return p();
|
|
|
|
return 1; /* not integrated, see shlwapi.WhichPlatform */
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* StopWatchModeFORWARD (SHDOCVW.@)
|
|
|
|
*/
|
|
|
|
void WINAPI StopWatchModeFORWARD(void)
|
|
|
|
{
|
2008-02-19 12:37:21 +01:00
|
|
|
static void (WINAPI *p)(void);
|
2006-02-15 13:37:18 +01:00
|
|
|
|
|
|
|
if (p || (p = fetch_shlwapi_ordinal(241))) p();
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* StopWatchFlushFORWARD (SHDOCVW.@)
|
|
|
|
*/
|
|
|
|
void WINAPI StopWatchFlushFORWARD(void)
|
|
|
|
{
|
2008-02-19 12:37:21 +01:00
|
|
|
static void (WINAPI *p)(void);
|
2006-02-15 13:37:18 +01:00
|
|
|
|
|
|
|
if (p || (p = fetch_shlwapi_ordinal(242))) p();
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
2014-12-20 16:56:51 +01:00
|
|
|
* StopWatchAFORWARD (SHDOCVW.@)
|
2006-02-15 13:37:18 +01:00
|
|
|
*/
|
2014-12-20 16:56:51 +01:00
|
|
|
DWORD WINAPI StopWatchAFORWARD(DWORD dwClass, LPCSTR lpszStr, DWORD dwUnknown,
|
2006-02-15 13:37:18 +01:00
|
|
|
DWORD dwMode, DWORD dwTimeStamp)
|
|
|
|
{
|
2014-12-20 16:56:51 +01:00
|
|
|
static DWORD (WINAPI *p)(DWORD, LPCSTR, DWORD, DWORD, DWORD);
|
2006-02-15 13:37:18 +01:00
|
|
|
|
|
|
|
if (p || (p = fetch_shlwapi_ordinal(243)))
|
|
|
|
return p(dwClass, lpszStr, dwUnknown, dwMode, dwTimeStamp);
|
|
|
|
return ERROR_CALL_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
2014-12-20 16:56:51 +01:00
|
|
|
* StopWatchWFORWARD (SHDOCVW.@)
|
2006-02-15 13:37:18 +01:00
|
|
|
*/
|
2014-12-20 16:56:51 +01:00
|
|
|
DWORD WINAPI StopWatchWFORWARD(DWORD dwClass, LPCWSTR lpszStr, DWORD dwUnknown,
|
2006-02-15 13:37:18 +01:00
|
|
|
DWORD dwMode, DWORD dwTimeStamp)
|
|
|
|
{
|
2014-12-20 16:56:51 +01:00
|
|
|
static DWORD (WINAPI *p)(DWORD, LPCWSTR, DWORD, DWORD, DWORD);
|
2006-02-15 13:37:18 +01:00
|
|
|
|
|
|
|
if (p || (p = fetch_shlwapi_ordinal(244)))
|
|
|
|
return p(dwClass, lpszStr, dwUnknown, dwMode, dwTimeStamp);
|
|
|
|
return ERROR_CALL_NOT_IMPLEMENTED;
|
|
|
|
}
|
2008-10-23 23:05:01 +02:00
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* URLSubRegQueryA (SHDOCVW.151)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI URLSubRegQueryA(LPCSTR regpath, LPCSTR name, DWORD type,
|
|
|
|
LPSTR out, DWORD outlen, DWORD unknown)
|
|
|
|
{
|
|
|
|
CHAR buffer[INTERNET_MAX_URL_LENGTH];
|
|
|
|
DWORD len;
|
|
|
|
LONG res;
|
|
|
|
|
|
|
|
TRACE("(%s, %s, %d, %p, %d, %d)\n", debugstr_a(regpath), debugstr_a(name),
|
|
|
|
type, out, outlen, unknown);
|
|
|
|
|
|
|
|
if (!out) return S_OK;
|
|
|
|
|
|
|
|
len = sizeof(buffer);
|
|
|
|
res = SHRegGetUSValueA(regpath, name, NULL, buffer, &len, FALSE, NULL, 0);
|
|
|
|
if (!res) {
|
|
|
|
lstrcpynA(out, buffer, outlen);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
2008-12-23 11:42:07 +01:00
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* ParseURLFromOutsideSourceW (SHDOCVW.170)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI ParseURLFromOutsideSourceW(LPCWSTR url, LPWSTR out, LPDWORD plen, LPDWORD unknown)
|
|
|
|
{
|
|
|
|
WCHAR buffer_in[INTERNET_MAX_URL_LENGTH];
|
|
|
|
WCHAR buffer_out[INTERNET_MAX_URL_LENGTH];
|
|
|
|
LPCWSTR ptr = url;
|
|
|
|
HRESULT hr;
|
|
|
|
DWORD needed;
|
|
|
|
DWORD len;
|
|
|
|
DWORD res = 0;
|
|
|
|
|
|
|
|
|
|
|
|
TRACE("(%s, %p, %p, %p) len: %d, unknown: 0x%x\n", debugstr_w(url), out, plen, unknown,
|
|
|
|
plen ? *plen : 0, unknown ? *unknown : 0);
|
|
|
|
|
|
|
|
if (!PathIsURLW(ptr)) {
|
2018-08-08 11:30:15 +02:00
|
|
|
len = ARRAY_SIZE(buffer_in);
|
2008-12-23 11:42:07 +01:00
|
|
|
buffer_in[0] = 0;
|
2011-05-14 23:18:10 +02:00
|
|
|
hr = UrlApplySchemeW(ptr, buffer_in, &len, URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT);
|
2008-12-23 11:42:07 +01:00
|
|
|
TRACE("got 0x%x with %s\n", hr, debugstr_w(buffer_in));
|
|
|
|
if (hr == S_OK) {
|
|
|
|
/* we parsed the url to buffer_in */
|
|
|
|
ptr = buffer_in;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME("call search hook for %s\n", debugstr_w(ptr));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-08 11:30:15 +02:00
|
|
|
len = ARRAY_SIZE(buffer_out);
|
2008-12-23 11:42:07 +01:00
|
|
|
buffer_out[0] = '\0';
|
|
|
|
hr = UrlCanonicalizeW(ptr, buffer_out, &len, URL_ESCAPE_SPACES_ONLY);
|
|
|
|
needed = lstrlenW(buffer_out)+1;
|
|
|
|
TRACE("got 0x%x with %s (need %d)\n", hr, debugstr_w(buffer_out), needed);
|
|
|
|
|
|
|
|
if (*plen >= needed) {
|
|
|
|
if (out != NULL) {
|
|
|
|
lstrcpyW(out, buffer_out);
|
|
|
|
res++;
|
|
|
|
}
|
|
|
|
needed--;
|
|
|
|
}
|
|
|
|
|
|
|
|
*plen = needed;
|
|
|
|
|
|
|
|
TRACE("=> %d\n", res);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* ParseURLFromOutsideSourceA (SHDOCVW.169)
|
|
|
|
*
|
|
|
|
* See ParseURLFromOutsideSourceW
|
|
|
|
*/
|
|
|
|
DWORD WINAPI ParseURLFromOutsideSourceA(LPCSTR url, LPSTR out, LPDWORD plen, LPDWORD unknown)
|
|
|
|
{
|
|
|
|
WCHAR buffer[INTERNET_MAX_URL_LENGTH];
|
|
|
|
LPWSTR urlW = NULL;
|
|
|
|
DWORD needed;
|
|
|
|
DWORD res;
|
|
|
|
DWORD len;
|
|
|
|
|
|
|
|
TRACE("(%s, %p, %p, %p) len: %d, unknown: 0x%x\n", debugstr_a(url), out, plen, unknown,
|
|
|
|
plen ? *plen : 0, unknown ? *unknown : 0);
|
|
|
|
|
|
|
|
if (url) {
|
|
|
|
len = MultiByteToWideChar(CP_ACP, 0, url, -1, NULL, 0);
|
|
|
|
urlW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, url, -1, urlW, len);
|
|
|
|
}
|
|
|
|
|
2018-08-08 11:30:15 +02:00
|
|
|
len = ARRAY_SIZE(buffer);
|
2013-04-26 01:03:47 +02:00
|
|
|
ParseURLFromOutsideSourceW(urlW, buffer, &len, unknown);
|
2008-12-23 11:42:07 +01:00
|
|
|
HeapFree(GetProcessHeap(), 0, urlW);
|
|
|
|
|
|
|
|
needed = WideCharToMultiByte(CP_ACP, 0, buffer, -1, NULL, 0, NULL, NULL);
|
|
|
|
|
|
|
|
res = 0;
|
|
|
|
if (*plen >= needed) {
|
|
|
|
if (out != NULL) {
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, buffer, -1, out, *plen, NULL, NULL);
|
|
|
|
res = needed;
|
|
|
|
}
|
|
|
|
needed--;
|
|
|
|
}
|
|
|
|
|
|
|
|
*plen = needed;
|
|
|
|
|
|
|
|
TRACE("=> %d\n", res);
|
|
|
|
return res;
|
|
|
|
}
|
2009-01-22 21:59:08 +01:00
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* IEParseDisplayNameWithBCW (SHDOCVW.218)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI IEParseDisplayNameWithBCW(DWORD codepage, LPCWSTR lpszDisplayName, LPBC pbc, LPITEMIDLIST *ppidl)
|
|
|
|
{
|
|
|
|
/* Guessing at parameter 3 based on IShellFolder's ParseDisplayName */
|
|
|
|
FIXME("stub: 0x%x %s %p %p\n",codepage,debugstr_w(lpszDisplayName),pbc,ppidl);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
2009-08-07 11:48:09 +02:00
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* SHRestricted2W (SHDOCVW.159)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI SHRestricted2W(DWORD res, LPCWSTR url, DWORD reserved)
|
|
|
|
{
|
|
|
|
FIXME("(%d %s %d) stub\n", res, debugstr_w(url), reserved);
|
|
|
|
return 0;
|
|
|
|
}
|
2010-04-18 15:31:05 +02:00
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* SHRestricted2A (SHDOCVW.158)
|
|
|
|
*
|
|
|
|
* See SHRestricted2W
|
|
|
|
*/
|
|
|
|
DWORD WINAPI SHRestricted2A(DWORD restriction, LPCSTR url, DWORD reserved)
|
|
|
|
{
|
|
|
|
LPWSTR urlW = NULL;
|
|
|
|
DWORD res;
|
|
|
|
|
|
|
|
TRACE("(%d, %s, %d)\n", restriction, debugstr_a(url), reserved);
|
|
|
|
if (url) {
|
|
|
|
DWORD len = MultiByteToWideChar(CP_ACP, 0, url, -1, NULL, 0);
|
|
|
|
urlW = heap_alloc(len * sizeof(WCHAR));
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, url, -1, urlW, len);
|
|
|
|
}
|
|
|
|
res = SHRestricted2W(restriction, urlW, reserved);
|
|
|
|
heap_free(urlW);
|
|
|
|
return res;
|
|
|
|
}
|
2010-10-24 15:31:09 +02:00
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* ImportPrivacySettings (SHDOCVW.@)
|
|
|
|
*
|
|
|
|
* Import global and/or per site privacy preferences from an xml file
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* filename [I] XML file to use
|
|
|
|
* pGlobalPrefs [IO] PTR to a usage flag for the global privacy preferences
|
|
|
|
* pPerSitePrefs [IO] PTR to a usage flag for the per site privacy preferences
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: TRUE (the privacy preferences where updated)
|
|
|
|
* Failure: FALSE (the privacy preferences are unchanged)
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* Set the flag to TRUE, when the related privacy preferences in the xml file
|
|
|
|
* should be used (parsed and overwrite the current settings).
|
|
|
|
* On return, the flag is TRUE, when the related privacy settings where used
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
BOOL WINAPI ImportPrivacySettings(LPCWSTR filename, BOOL *pGlobalPrefs, BOOL * pPerSitePrefs)
|
|
|
|
{
|
|
|
|
FIXME("(%s, %p->%d, %p->%d): stub\n", debugstr_w(filename),
|
|
|
|
pGlobalPrefs, pGlobalPrefs ? *pGlobalPrefs : 0,
|
|
|
|
pPerSitePrefs, pPerSitePrefs ? *pPerSitePrefs : 0);
|
|
|
|
|
|
|
|
if (pGlobalPrefs) *pGlobalPrefs = FALSE;
|
|
|
|
if (pPerSitePrefs) *pPerSitePrefs = FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2014-06-26 11:35:30 +02:00
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* ResetProfileSharing (SHDOCVW.164)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI ResetProfileSharing(HWND hwnd)
|
|
|
|
{
|
|
|
|
FIXME("(%p) stub\n", hwnd);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
2014-06-27 11:40:20 +02:00
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* InstallReg_RunDLL (SHDOCVW.@)
|
|
|
|
*/
|
|
|
|
void WINAPI InstallReg_RunDLL(HWND hwnd, HINSTANCE handle, LPCSTR cmdline, INT show)
|
|
|
|
{
|
|
|
|
FIXME("(%p %p %s %x)\n", hwnd, handle, debugstr_a(cmdline), show);
|
|
|
|
}
|
2015-02-05 04:11:46 +01:00
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* DoFileDownload (SHDOCVW.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI DoFileDownload(LPWSTR filename)
|
|
|
|
{
|
|
|
|
FIXME("(%s) stub\n", debugstr_w(filename));
|
|
|
|
return FALSE;
|
|
|
|
}
|
2018-01-14 21:53:06 +01:00
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* DoOrganizeFavDlgW (SHDOCVW.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI DoOrganizeFavDlgW(HWND hwnd, LPCWSTR initDir)
|
|
|
|
{
|
|
|
|
FIXME("(%p %s) stub\n", hwnd, debugstr_w(initDir));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* DoOrganizeFavDlg (SHDOCVW.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI DoOrganizeFavDlg(HWND hwnd, LPCSTR initDir)
|
|
|
|
{
|
|
|
|
LPWSTR initDirW = NULL;
|
|
|
|
BOOL res;
|
|
|
|
|
|
|
|
TRACE("(%p %s)\n", hwnd, debugstr_a(initDir));
|
|
|
|
|
|
|
|
if (initDir) {
|
|
|
|
DWORD len = MultiByteToWideChar(CP_ACP, 0, initDir, -1, NULL, 0);
|
|
|
|
initDirW = heap_alloc(len * sizeof(WCHAR));
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, initDir, -1, initDirW, len);
|
|
|
|
}
|
|
|
|
res = DoOrganizeFavDlgW(hwnd, initDirW);
|
|
|
|
heap_free(initDirW);
|
|
|
|
return res;
|
|
|
|
}
|