2004-09-28 21:18:52 +02:00
|
|
|
/*
|
2004-11-30 22:14:21 +01:00
|
|
|
* Internet Security and Zone Manager
|
2004-09-28 21:18:52 +02:00
|
|
|
*
|
|
|
|
* Copyright (c) 2004 Huw D M Davies
|
2004-11-30 22:14:21 +01:00
|
|
|
* Copyright 2004 Jacek Caban
|
2004-09-28 21:18:52 +02: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
|
2004-09-28 21:18:52 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2007-12-13 20:26:51 +01:00
|
|
|
#include "urlmon_main.h"
|
2005-09-29 12:30:04 +02:00
|
|
|
#include "winreg.h"
|
2007-12-13 20:26:51 +01:00
|
|
|
|
2004-09-28 21:18:52 +02:00
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
|
|
|
|
|
2004-11-30 22:14:21 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* InternetSecurityManager implementation
|
|
|
|
*
|
|
|
|
*/
|
2005-09-07 11:23:18 +02:00
|
|
|
typedef struct {
|
|
|
|
const IInternetSecurityManagerVtbl* lpInternetSecurityManagerVtbl;
|
2004-09-28 21:18:52 +02:00
|
|
|
|
2005-09-07 11:23:18 +02:00
|
|
|
LONG ref;
|
2004-09-28 21:18:52 +02:00
|
|
|
|
2005-09-07 11:23:18 +02:00
|
|
|
IInternetSecurityMgrSite *mgrsite;
|
|
|
|
IInternetSecurityManager *custom_manager;
|
2004-09-28 21:18:52 +02:00
|
|
|
} SecManagerImpl;
|
|
|
|
|
2005-09-07 11:23:18 +02:00
|
|
|
#define SECMGR_THIS(iface) DEFINE_THIS(SecManagerImpl, InternetSecurityManager, iface)
|
|
|
|
|
2005-09-29 12:30:04 +02:00
|
|
|
static HRESULT map_url_to_zone(LPCWSTR url, DWORD *zone)
|
|
|
|
{
|
|
|
|
WCHAR schema[64];
|
|
|
|
DWORD res, size=0;
|
|
|
|
HKEY hkey;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
static const WCHAR wszZoneMapProtocolKey[] =
|
|
|
|
{'S','o','f','t','w','a','r','e','\\',
|
|
|
|
'M','i','c','r','o','s','o','f','t','\\',
|
|
|
|
'W','i','n','d','o','w','s','\\',
|
|
|
|
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
|
|
|
|
'I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s','\\',
|
|
|
|
'Z','o','n','e','M','a','p','\\',
|
|
|
|
'P','r','o','t','o','c','o','l','D','e','f','a','u','l','t','s',0};
|
|
|
|
static const WCHAR wszFile[] = {'f','i','l','e',0};
|
|
|
|
|
2007-02-06 20:48:19 +01:00
|
|
|
*zone = -1;
|
|
|
|
|
2005-09-29 12:30:04 +02:00
|
|
|
hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, schema, sizeof(schema)/sizeof(WCHAR), &size, 0);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
if(!*schema)
|
|
|
|
return 0x80041001;
|
|
|
|
|
|
|
|
/* file protocol is a special case */
|
|
|
|
if(!strcmpW(schema, wszFile)) {
|
|
|
|
WCHAR path[MAX_PATH];
|
|
|
|
|
|
|
|
hres = CoInternetParseUrl(url, PARSE_PATH_FROM_URL, 0, path,
|
|
|
|
sizeof(path)/sizeof(WCHAR), &size, 0);
|
|
|
|
|
|
|
|
if(SUCCEEDED(hres) && strchrW(path, '\\')) {
|
|
|
|
*zone = 0;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
WARN("domains are not yet implemented\n");
|
|
|
|
|
|
|
|
res = RegOpenKeyW(HKEY_CURRENT_USER, wszZoneMapProtocolKey, &hkey);
|
|
|
|
if(res != ERROR_SUCCESS) {
|
|
|
|
ERR("Could not open key %s\n", debugstr_w(wszZoneMapProtocolKey));
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
size = sizeof(DWORD);
|
|
|
|
res = RegQueryValueExW(hkey, schema, NULL, NULL, (PBYTE)zone, &size);
|
2006-07-17 21:22:27 +02:00
|
|
|
RegCloseKey(hkey);
|
2005-09-29 12:30:04 +02:00
|
|
|
if(res == ERROR_SUCCESS)
|
|
|
|
return S_OK;
|
|
|
|
|
|
|
|
res = RegOpenKeyW(HKEY_LOCAL_MACHINE, wszZoneMapProtocolKey, &hkey);
|
|
|
|
if(res != ERROR_SUCCESS) {
|
|
|
|
ERR("Could not open key %s\n", debugstr_w(wszZoneMapProtocolKey));
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
size = sizeof(DWORD);
|
|
|
|
res = RegQueryValueExW(hkey, schema, NULL, NULL, (PBYTE)zone, &size);
|
2006-07-17 21:22:27 +02:00
|
|
|
RegCloseKey(hkey);
|
2005-09-29 12:30:04 +02:00
|
|
|
if(res == ERROR_SUCCESS)
|
2005-12-26 13:27:25 +01:00
|
|
|
return S_OK;
|
2005-09-29 12:30:04 +02:00
|
|
|
|
|
|
|
*zone = 3;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2004-09-28 21:18:52 +02:00
|
|
|
static HRESULT WINAPI SecManagerImpl_QueryInterface(IInternetSecurityManager* iface,REFIID riid,void** ppvObject)
|
|
|
|
{
|
2005-09-07 11:23:18 +02:00
|
|
|
SecManagerImpl *This = SECMGR_THIS(iface);
|
2004-09-28 21:18:52 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppvObject);
|
|
|
|
|
|
|
|
/* Perform a sanity check on the parameters.*/
|
|
|
|
if ( (This==0) || (ppvObject==0) )
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
/* Initialize the return parameter */
|
|
|
|
*ppvObject = 0;
|
|
|
|
|
|
|
|
/* Compare the riid with the interface IDs implemented by this object.*/
|
|
|
|
if (IsEqualIID(&IID_IUnknown, riid) ||
|
|
|
|
IsEqualIID(&IID_IInternetSecurityManager, riid))
|
|
|
|
*ppvObject = iface;
|
|
|
|
|
|
|
|
/* Check that we obtained an interface.*/
|
2005-09-07 11:23:18 +02:00
|
|
|
if (!*ppvObject) {
|
|
|
|
WARN("not supported interface %s\n", debugstr_guid(riid));
|
2004-09-28 21:18:52 +02:00
|
|
|
return E_NOINTERFACE;
|
2005-09-07 11:23:18 +02:00
|
|
|
}
|
2004-09-28 21:18:52 +02:00
|
|
|
|
|
|
|
/* Query Interface always increases the reference count by one when it is successful */
|
2004-11-30 22:14:21 +01:00
|
|
|
IInternetSecurityManager_AddRef(iface);
|
2004-09-28 21:18:52 +02:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI SecManagerImpl_AddRef(IInternetSecurityManager* iface)
|
|
|
|
{
|
2005-09-07 11:23:18 +02:00
|
|
|
SecManagerImpl *This = SECMGR_THIS(iface);
|
2005-01-12 20:52:38 +01:00
|
|
|
ULONG refCount = InterlockedIncrement(&This->ref);
|
2004-09-28 21:18:52 +02:00
|
|
|
|
2006-10-05 23:49:11 +02:00
|
|
|
TRACE("(%p) ref=%u\n", This, refCount);
|
2004-09-28 21:18:52 +02:00
|
|
|
|
2005-01-12 20:52:38 +01:00
|
|
|
return refCount;
|
2004-09-28 21:18:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI SecManagerImpl_Release(IInternetSecurityManager* iface)
|
|
|
|
{
|
2005-09-07 11:23:18 +02:00
|
|
|
SecManagerImpl *This = SECMGR_THIS(iface);
|
2005-01-12 20:52:38 +01:00
|
|
|
ULONG refCount = InterlockedDecrement(&This->ref);
|
2004-09-28 21:18:52 +02:00
|
|
|
|
2006-10-05 23:49:11 +02:00
|
|
|
TRACE("(%p) ref=%u\n", This, refCount);
|
2004-09-28 21:18:52 +02:00
|
|
|
|
|
|
|
/* destroy the object if there's no more reference on it */
|
2005-01-12 20:52:38 +01:00
|
|
|
if (!refCount){
|
2005-09-07 11:23:18 +02:00
|
|
|
if(This->mgrsite)
|
|
|
|
IInternetSecurityMgrSite_Release(This->mgrsite);
|
|
|
|
if(This->custom_manager)
|
|
|
|
IInternetSecurityManager_Release(This->custom_manager);
|
|
|
|
|
2007-11-29 22:12:34 +01:00
|
|
|
heap_free(This);
|
2005-09-07 11:23:18 +02:00
|
|
|
|
2005-07-02 12:49:56 +02:00
|
|
|
URLMON_UnlockModule();
|
2004-09-28 21:18:52 +02:00
|
|
|
}
|
2005-02-03 20:38:37 +01:00
|
|
|
|
2005-01-12 20:52:38 +01:00
|
|
|
return refCount;
|
2004-09-28 21:18:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI SecManagerImpl_SetSecuritySite(IInternetSecurityManager *iface,
|
|
|
|
IInternetSecurityMgrSite *pSite)
|
|
|
|
{
|
2005-09-07 11:23:18 +02:00
|
|
|
SecManagerImpl *This = SECMGR_THIS(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pSite);
|
|
|
|
|
|
|
|
if(This->mgrsite)
|
|
|
|
IInternetSecurityMgrSite_Release(This->mgrsite);
|
|
|
|
|
|
|
|
if(This->custom_manager) {
|
|
|
|
IInternetSecurityManager_Release(This->custom_manager);
|
|
|
|
This->custom_manager = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
This->mgrsite = pSite;
|
|
|
|
|
|
|
|
if(pSite) {
|
|
|
|
IServiceProvider *servprov;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
IInternetSecurityMgrSite_AddRef(pSite);
|
|
|
|
|
|
|
|
hres = IInternetSecurityMgrSite_QueryInterface(pSite, &IID_IServiceProvider,
|
|
|
|
(void**)&servprov);
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
IServiceProvider_QueryService(servprov, &SID_SInternetSecurityManager,
|
|
|
|
&IID_IInternetSecurityManager, (void**)&This->custom_manager);
|
|
|
|
IServiceProvider_Release(servprov);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2004-09-28 21:18:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI SecManagerImpl_GetSecuritySite(IInternetSecurityManager *iface,
|
|
|
|
IInternetSecurityMgrSite **ppSite)
|
|
|
|
{
|
2005-09-07 11:23:18 +02:00
|
|
|
SecManagerImpl *This = SECMGR_THIS(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, ppSite);
|
|
|
|
|
|
|
|
if(!ppSite)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
if(This->mgrsite)
|
|
|
|
IInternetSecurityMgrSite_AddRef(This->mgrsite);
|
|
|
|
|
|
|
|
*ppSite = This->mgrsite;
|
|
|
|
return S_OK;
|
2004-09-28 21:18:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI SecManagerImpl_MapUrlToZone(IInternetSecurityManager *iface,
|
|
|
|
LPCWSTR pwszUrl, DWORD *pdwZone,
|
|
|
|
DWORD dwFlags)
|
|
|
|
{
|
2005-09-07 11:23:18 +02:00
|
|
|
SecManagerImpl *This = SECMGR_THIS(iface);
|
2005-09-29 12:30:04 +02:00
|
|
|
LPWSTR url;
|
|
|
|
DWORD size;
|
2005-09-07 11:23:18 +02:00
|
|
|
HRESULT hres;
|
|
|
|
|
2006-10-05 23:49:11 +02:00
|
|
|
TRACE("(%p)->(%s %p %08x)\n", iface, debugstr_w(pwszUrl), pdwZone, dwFlags);
|
2005-09-07 11:23:18 +02:00
|
|
|
|
|
|
|
if(This->custom_manager) {
|
|
|
|
hres = IInternetSecurityManager_MapUrlToZone(This->custom_manager,
|
|
|
|
pwszUrl, pdwZone, dwFlags);
|
|
|
|
if(hres != INET_E_DEFAULT_ACTION)
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
2007-10-07 17:50:02 +02:00
|
|
|
if(!pwszUrl) {
|
|
|
|
*pdwZone = -1;
|
2005-09-29 12:30:04 +02:00
|
|
|
return E_INVALIDARG;
|
2007-10-07 17:50:02 +02:00
|
|
|
}
|
2005-09-29 12:30:04 +02:00
|
|
|
|
|
|
|
if(dwFlags)
|
2006-10-05 23:49:11 +02:00
|
|
|
FIXME("not supported flags: %08x\n", dwFlags);
|
2005-09-29 12:30:04 +02:00
|
|
|
|
|
|
|
size = (strlenW(pwszUrl)+16) * sizeof(WCHAR);
|
2007-11-29 22:12:34 +01:00
|
|
|
url = heap_alloc(size);
|
2005-09-29 12:30:04 +02:00
|
|
|
|
|
|
|
hres = CoInternetParseUrl(pwszUrl, PARSE_SECURITY_URL, 0, url, size/sizeof(WCHAR), &size, 0);
|
|
|
|
if(FAILED(hres))
|
|
|
|
memcpy(url, pwszUrl, size);
|
|
|
|
|
|
|
|
hres = map_url_to_zone(url, pdwZone);
|
|
|
|
|
2007-11-29 22:12:34 +01:00
|
|
|
heap_free(url);
|
2005-09-29 12:30:04 +02:00
|
|
|
|
|
|
|
return hres;
|
2004-09-28 21:18:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI SecManagerImpl_GetSecurityId(IInternetSecurityManager *iface,
|
2005-12-26 13:27:25 +01:00
|
|
|
LPCWSTR pwszUrl, BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved)
|
2004-09-28 21:18:52 +02:00
|
|
|
{
|
2005-09-07 11:23:18 +02:00
|
|
|
SecManagerImpl *This = SECMGR_THIS(iface);
|
2005-12-26 13:27:25 +01:00
|
|
|
LPWSTR buf, ptr, ptr2;
|
|
|
|
DWORD size, zone, len;
|
2005-09-07 11:23:18 +02:00
|
|
|
HRESULT hres;
|
|
|
|
|
2005-12-26 13:27:25 +01:00
|
|
|
static const WCHAR wszFile[] = {'f','i','l','e',':'};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p %p %08lx)\n", iface, debugstr_w(pwszUrl), pbSecurityId,
|
|
|
|
pcbSecurityId, dwReserved);
|
2005-09-07 11:23:18 +02:00
|
|
|
|
|
|
|
if(This->custom_manager) {
|
|
|
|
hres = IInternetSecurityManager_GetSecurityId(This->custom_manager,
|
|
|
|
pwszUrl, pbSecurityId, pcbSecurityId, dwReserved);
|
|
|
|
if(hres != INET_E_DEFAULT_ACTION)
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
2005-12-26 13:27:25 +01:00
|
|
|
if(!pwszUrl || !pbSecurityId || !pcbSecurityId)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
if(dwReserved)
|
|
|
|
FIXME("dwReserved is not supported\n");
|
|
|
|
|
|
|
|
len = strlenW(pwszUrl)+1;
|
2007-11-29 22:12:34 +01:00
|
|
|
buf = heap_alloc((len+16)*sizeof(WCHAR));
|
2005-12-26 13:27:25 +01:00
|
|
|
|
|
|
|
hres = CoInternetParseUrl(pwszUrl, PARSE_SECURITY_URL, 0, buf, len, &size, 0);
|
|
|
|
if(FAILED(hres))
|
|
|
|
memcpy(buf, pwszUrl, len*sizeof(WCHAR));
|
|
|
|
|
|
|
|
hres = map_url_to_zone(buf, &zone);
|
|
|
|
if(FAILED(hres)) {
|
2007-11-29 22:12:34 +01:00
|
|
|
heap_free(buf);
|
2005-12-26 13:27:25 +01:00
|
|
|
return hres == 0x80041001 ? E_INVALIDARG : hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* file protocol is a special case */
|
|
|
|
if(strlenW(pwszUrl) >= sizeof(wszFile)/sizeof(WCHAR)
|
|
|
|
&& !memcmp(buf, wszFile, sizeof(wszFile))) {
|
|
|
|
|
|
|
|
static const BYTE secidFile[] = {'f','i','l','e',':'};
|
|
|
|
|
2007-11-29 22:12:34 +01:00
|
|
|
heap_free(buf);
|
2007-10-05 22:52:08 +02:00
|
|
|
|
2005-12-26 13:27:25 +01:00
|
|
|
if(*pcbSecurityId < sizeof(secidFile)+sizeof(zone))
|
|
|
|
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
|
|
|
|
|
|
|
|
memcpy(pbSecurityId, secidFile, sizeof(secidFile));
|
|
|
|
*(DWORD*)(pbSecurityId+sizeof(secidFile)) = zone;
|
|
|
|
|
|
|
|
*pcbSecurityId = sizeof(secidFile)+sizeof(zone);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
ptr = strchrW(buf, ':');
|
|
|
|
ptr2 = ++ptr;
|
|
|
|
while(*ptr2 == '/')
|
|
|
|
ptr2++;
|
|
|
|
if(ptr2 != ptr)
|
|
|
|
memmove(ptr, ptr2, (strlenW(ptr2)+1)*sizeof(WCHAR));
|
|
|
|
|
|
|
|
ptr = strchrW(ptr, '/');
|
|
|
|
if(ptr)
|
|
|
|
*ptr = 0;
|
|
|
|
|
|
|
|
len = WideCharToMultiByte(CP_ACP, 0, buf, -1, NULL, 0, NULL, NULL)-1;
|
|
|
|
|
2007-10-05 22:52:08 +02:00
|
|
|
if(len+sizeof(DWORD) > *pcbSecurityId) {
|
2007-11-29 22:12:34 +01:00
|
|
|
heap_free(buf);
|
2005-12-26 13:27:25 +01:00
|
|
|
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
|
2007-10-05 22:52:08 +02:00
|
|
|
}
|
2005-12-26 13:27:25 +01:00
|
|
|
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, buf, -1, (LPSTR)pbSecurityId, -1, NULL, NULL);
|
2007-11-29 22:12:34 +01:00
|
|
|
heap_free(buf);
|
2005-12-26 13:27:25 +01:00
|
|
|
|
|
|
|
*(DWORD*)(pbSecurityId+len) = zone;
|
|
|
|
|
|
|
|
*pcbSecurityId = len+sizeof(DWORD);
|
|
|
|
|
|
|
|
return S_OK;
|
2004-09-28 21:18:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI SecManagerImpl_ProcessUrlAction(IInternetSecurityManager *iface,
|
|
|
|
LPCWSTR pwszUrl, DWORD dwAction,
|
|
|
|
BYTE *pPolicy, DWORD cbPolicy,
|
|
|
|
BYTE *pContext, DWORD cbContext,
|
|
|
|
DWORD dwFlags, DWORD dwReserved)
|
|
|
|
{
|
2005-09-07 11:23:18 +02:00
|
|
|
SecManagerImpl *This = SECMGR_THIS(iface);
|
|
|
|
HRESULT hres;
|
|
|
|
|
2006-10-05 23:49:11 +02:00
|
|
|
TRACE("(%p)->(%s %08x %p %08x %p %08x %08x %08x)\n", iface, debugstr_w(pwszUrl), dwAction,
|
2004-09-28 21:18:52 +02:00
|
|
|
pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved);
|
2005-09-07 11:23:18 +02:00
|
|
|
|
|
|
|
if(This->custom_manager) {
|
|
|
|
hres = IInternetSecurityManager_ProcessUrlAction(This->custom_manager, pwszUrl, dwAction,
|
|
|
|
pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved);
|
|
|
|
if(hres != INET_E_DEFAULT_ACTION)
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
FIXME("Default action is not implemented\n");
|
2004-09-28 21:18:52 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI SecManagerImpl_QueryCustomPolicy(IInternetSecurityManager *iface,
|
|
|
|
LPCWSTR pwszUrl, REFGUID guidKey,
|
|
|
|
BYTE **ppPolicy, DWORD *pcbPolicy,
|
|
|
|
BYTE *pContext, DWORD cbContext,
|
|
|
|
DWORD dwReserved)
|
|
|
|
{
|
2005-09-07 11:23:18 +02:00
|
|
|
SecManagerImpl *This = SECMGR_THIS(iface);
|
|
|
|
HRESULT hres;
|
|
|
|
|
2006-10-05 23:49:11 +02:00
|
|
|
TRACE("(%p)->(%s %s %p %p %p %08x %08x )\n", iface, debugstr_w(pwszUrl), debugstr_guid(guidKey),
|
2004-09-28 21:18:52 +02:00
|
|
|
ppPolicy, pcbPolicy, pContext, cbContext, dwReserved);
|
2005-09-07 11:23:18 +02:00
|
|
|
|
|
|
|
if(This->custom_manager) {
|
|
|
|
hres = IInternetSecurityManager_QueryCustomPolicy(This->custom_manager, pwszUrl, guidKey,
|
|
|
|
ppPolicy, pcbPolicy, pContext, cbContext, dwReserved);
|
|
|
|
if(hres != INET_E_DEFAULT_ACTION)
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
FIXME("Default action is not implemented\n");
|
2004-09-28 21:18:52 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI SecManagerImpl_SetZoneMapping(IInternetSecurityManager *iface,
|
|
|
|
DWORD dwZone, LPCWSTR pwszPattern, DWORD dwFlags)
|
|
|
|
{
|
2005-09-07 11:23:18 +02:00
|
|
|
SecManagerImpl *This = SECMGR_THIS(iface);
|
|
|
|
HRESULT hres;
|
|
|
|
|
2006-10-05 23:49:11 +02:00
|
|
|
TRACE("(%p)->(%08x %s %08x)\n", iface, dwZone, debugstr_w(pwszPattern),dwFlags);
|
2005-09-07 11:23:18 +02:00
|
|
|
|
|
|
|
if(This->custom_manager) {
|
|
|
|
hres = IInternetSecurityManager_SetZoneMapping(This->custom_manager, dwZone,
|
|
|
|
pwszPattern, dwFlags);
|
|
|
|
if(hres != INET_E_DEFAULT_ACTION)
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
FIXME("Default action is not implemented\n");
|
2004-09-28 21:18:52 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI SecManagerImpl_GetZoneMappings(IInternetSecurityManager *iface,
|
2005-09-07 11:23:18 +02:00
|
|
|
DWORD dwZone, IEnumString **ppenumString, DWORD dwFlags)
|
2004-09-28 21:18:52 +02:00
|
|
|
{
|
2005-09-07 11:23:18 +02:00
|
|
|
SecManagerImpl *This = SECMGR_THIS(iface);
|
|
|
|
HRESULT hres;
|
|
|
|
|
2006-10-05 23:49:11 +02:00
|
|
|
TRACE("(%p)->(%08x %p %08x)\n", iface, dwZone, ppenumString,dwFlags);
|
2005-09-07 11:23:18 +02:00
|
|
|
|
|
|
|
if(This->custom_manager) {
|
|
|
|
hres = IInternetSecurityManager_GetZoneMappings(This->custom_manager, dwZone,
|
|
|
|
ppenumString, dwFlags);
|
|
|
|
if(hres != INET_E_DEFAULT_ACTION)
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
FIXME("Default action is not implemented\n");
|
2004-09-28 21:18:52 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2005-06-06 21:50:35 +02:00
|
|
|
static const IInternetSecurityManagerVtbl VT_SecManagerImpl =
|
2004-11-30 22:14:21 +01:00
|
|
|
{
|
|
|
|
SecManagerImpl_QueryInterface,
|
|
|
|
SecManagerImpl_AddRef,
|
|
|
|
SecManagerImpl_Release,
|
|
|
|
SecManagerImpl_SetSecuritySite,
|
|
|
|
SecManagerImpl_GetSecuritySite,
|
|
|
|
SecManagerImpl_MapUrlToZone,
|
|
|
|
SecManagerImpl_GetSecurityId,
|
|
|
|
SecManagerImpl_ProcessUrlAction,
|
|
|
|
SecManagerImpl_QueryCustomPolicy,
|
|
|
|
SecManagerImpl_SetZoneMapping,
|
|
|
|
SecManagerImpl_GetZoneMappings
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
|
|
|
|
{
|
|
|
|
SecManagerImpl *This;
|
|
|
|
|
|
|
|
TRACE("(%p,%p)\n",pUnkOuter,ppobj);
|
2007-11-29 22:12:34 +01:00
|
|
|
This = heap_alloc(sizeof(*This));
|
2004-11-30 22:14:21 +01:00
|
|
|
|
|
|
|
/* Initialize the virtual function table. */
|
2005-09-07 11:23:18 +02:00
|
|
|
This->lpInternetSecurityManagerVtbl = &VT_SecManagerImpl;
|
|
|
|
|
|
|
|
This->ref = 1;
|
|
|
|
This->mgrsite = NULL;
|
|
|
|
This->custom_manager = NULL;
|
2004-11-30 22:14:21 +01:00
|
|
|
|
|
|
|
*ppobj = This;
|
2005-07-02 12:49:56 +02:00
|
|
|
|
|
|
|
URLMON_LockModule();
|
|
|
|
|
2004-11-30 22:14:21 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* InternetZoneManager implementation
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
typedef struct {
|
2005-06-06 21:50:35 +02:00
|
|
|
const IInternetZoneManagerVtbl* lpVtbl;
|
2005-07-03 14:05:03 +02:00
|
|
|
LONG ref;
|
2004-11-30 22:14:21 +01:00
|
|
|
} ZoneMgrImpl;
|
|
|
|
|
2005-09-30 12:34:10 +02:00
|
|
|
static HRESULT open_zone_key(DWORD zone, HKEY *hkey, URLZONEREG zone_reg)
|
|
|
|
{
|
|
|
|
static const WCHAR wszZonesKey[] =
|
|
|
|
{'S','o','f','t','w','a','r','e','\\',
|
|
|
|
'M','i','c','r','o','s','o','f','t','\\',
|
|
|
|
'W','i','n','d','o','w','s','\\',
|
|
|
|
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
|
|
|
|
'I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s','\\',
|
|
|
|
'Z','o','n','e','s','\\',0};
|
|
|
|
static const WCHAR wszFormat[] = {'%','s','%','l','d',0};
|
|
|
|
|
|
|
|
WCHAR key_name[sizeof(wszZonesKey)/sizeof(WCHAR)+8];
|
|
|
|
HKEY parent_key;
|
|
|
|
DWORD res;
|
|
|
|
|
|
|
|
switch(zone_reg) {
|
|
|
|
case URLZONEREG_DEFAULT: /* FIXME: TEST */
|
|
|
|
case URLZONEREG_HKCU:
|
|
|
|
parent_key = HKEY_CURRENT_USER;
|
|
|
|
break;
|
|
|
|
case URLZONEREG_HKLM:
|
|
|
|
parent_key = HKEY_LOCAL_MACHINE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
WARN("Unknown URLZONEREG: %d\n", zone_reg);
|
|
|
|
return E_FAIL;
|
|
|
|
};
|
|
|
|
|
|
|
|
wsprintfW(key_name, wszFormat, wszZonesKey, zone);
|
|
|
|
|
|
|
|
res = RegOpenKeyW(parent_key, key_name, hkey);
|
|
|
|
|
|
|
|
if(res != ERROR_SUCCESS) {
|
|
|
|
WARN("RegOpenKey failed\n");
|
|
|
|
return E_INVALIDARG;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2004-11-30 22:14:21 +01:00
|
|
|
/********************************************************************
|
|
|
|
* IInternetZoneManager_QueryInterface
|
|
|
|
*/
|
|
|
|
static HRESULT WINAPI ZoneMgrImpl_QueryInterface(IInternetZoneManager* iface, REFIID riid, void** ppvObject)
|
|
|
|
{
|
|
|
|
ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppvObject);
|
|
|
|
|
|
|
|
if(!This || !ppvObject)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
if(!IsEqualIID(&IID_IUnknown, riid) && !IsEqualIID(&IID_IInternetZoneManager, riid)) {
|
|
|
|
FIXME("Unknown interface: %s\n", debugstr_guid(riid));
|
|
|
|
*ppvObject = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*ppvObject = iface;
|
|
|
|
IInternetZoneManager_AddRef(iface);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* IInternetZoneManager_AddRef
|
|
|
|
*/
|
|
|
|
static ULONG WINAPI ZoneMgrImpl_AddRef(IInternetZoneManager* iface)
|
|
|
|
{
|
|
|
|
ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
|
2005-01-12 20:52:38 +01:00
|
|
|
ULONG refCount = InterlockedIncrement(&This->ref);
|
2004-11-30 22:14:21 +01:00
|
|
|
|
2006-10-05 23:49:11 +02:00
|
|
|
TRACE("(%p)->(ref before=%u)\n",This, refCount - 1);
|
2004-11-30 22:14:21 +01:00
|
|
|
|
2005-01-12 20:52:38 +01:00
|
|
|
return refCount;
|
2004-11-30 22:14:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* IInternetZoneManager_Release
|
|
|
|
*/
|
|
|
|
static ULONG WINAPI ZoneMgrImpl_Release(IInternetZoneManager* iface)
|
|
|
|
{
|
|
|
|
ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
|
2005-01-12 20:52:38 +01:00
|
|
|
ULONG refCount = InterlockedDecrement(&This->ref);
|
2004-11-30 22:14:21 +01:00
|
|
|
|
2006-10-05 23:49:11 +02:00
|
|
|
TRACE("(%p)->(ref before=%u)\n",This, refCount + 1);
|
2004-11-30 22:14:21 +01:00
|
|
|
|
2005-07-02 12:49:56 +02:00
|
|
|
if(!refCount) {
|
2007-11-29 22:12:34 +01:00
|
|
|
heap_free(This);
|
2005-07-02 12:49:56 +02:00
|
|
|
URLMON_UnlockModule();
|
|
|
|
}
|
2005-02-03 20:38:37 +01:00
|
|
|
|
2005-01-12 20:52:38 +01:00
|
|
|
return refCount;
|
2004-11-30 22:14:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* IInternetZoneManager_GetZoneAttributes
|
|
|
|
*/
|
|
|
|
static HRESULT WINAPI ZoneMgrImpl_GetZoneAttributes(IInternetZoneManager* iface,
|
|
|
|
DWORD dwZone,
|
|
|
|
ZONEATTRIBUTES* pZoneAttributes)
|
|
|
|
{
|
2006-10-05 23:49:11 +02:00
|
|
|
FIXME("(%p)->(%d %p) stub\n", iface, dwZone, pZoneAttributes);
|
2004-11-30 22:14:21 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* IInternetZoneManager_SetZoneAttributes
|
|
|
|
*/
|
|
|
|
static HRESULT WINAPI ZoneMgrImpl_SetZoneAttributes(IInternetZoneManager* iface,
|
|
|
|
DWORD dwZone,
|
|
|
|
ZONEATTRIBUTES* pZoneAttributes)
|
|
|
|
{
|
2006-10-05 23:49:11 +02:00
|
|
|
FIXME("(%p)->(%08x %p) stub\n", iface, dwZone, pZoneAttributes);
|
2004-11-30 22:14:21 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* IInternetZoneManager_GetZoneCustomPolicy
|
|
|
|
*/
|
|
|
|
static HRESULT WINAPI ZoneMgrImpl_GetZoneCustomPolicy(IInternetZoneManager* iface,
|
|
|
|
DWORD dwZone,
|
|
|
|
REFGUID guidKey,
|
|
|
|
BYTE** ppPolicy,
|
|
|
|
DWORD* pcbPolicy,
|
|
|
|
URLZONEREG ulrZoneReg)
|
|
|
|
{
|
2006-10-05 23:49:11 +02:00
|
|
|
FIXME("(%p)->(%08x %s %p %p %08x) stub\n", iface, dwZone, debugstr_guid(guidKey),
|
2004-11-30 22:14:21 +01:00
|
|
|
ppPolicy, pcbPolicy, ulrZoneReg);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* IInternetZoneManager_SetZoneCustomPolicy
|
|
|
|
*/
|
|
|
|
static HRESULT WINAPI ZoneMgrImpl_SetZoneCustomPolicy(IInternetZoneManager* iface,
|
|
|
|
DWORD dwZone,
|
|
|
|
REFGUID guidKey,
|
|
|
|
BYTE* ppPolicy,
|
|
|
|
DWORD cbPolicy,
|
|
|
|
URLZONEREG ulrZoneReg)
|
|
|
|
{
|
2006-10-05 23:49:11 +02:00
|
|
|
FIXME("(%p)->(%08x %s %p %08x %08x) stub\n", iface, dwZone, debugstr_guid(guidKey),
|
2004-11-30 22:14:21 +01:00
|
|
|
ppPolicy, cbPolicy, ulrZoneReg);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* IInternetZoneManager_GetZoneActionPolicy
|
|
|
|
*/
|
|
|
|
static HRESULT WINAPI ZoneMgrImpl_GetZoneActionPolicy(IInternetZoneManager* iface,
|
2005-09-30 12:34:10 +02:00
|
|
|
DWORD dwZone, DWORD dwAction, BYTE* pPolicy, DWORD cbPolicy, URLZONEREG urlZoneReg)
|
2004-11-30 22:14:21 +01:00
|
|
|
{
|
2005-09-30 12:34:10 +02:00
|
|
|
WCHAR action[16];
|
|
|
|
HKEY hkey;
|
|
|
|
LONG res;
|
|
|
|
DWORD size = cbPolicy;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
static const WCHAR wszFormat[] = {'%','l','X',0};
|
|
|
|
|
2006-10-05 23:49:11 +02:00
|
|
|
TRACE("(%p)->(%d %08x %p %d %d)\n", iface, dwZone, dwAction, pPolicy,
|
2005-09-30 12:34:10 +02:00
|
|
|
cbPolicy, urlZoneReg);
|
|
|
|
|
|
|
|
if(!pPolicy)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
hres = open_zone_key(dwZone, &hkey, urlZoneReg);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
wsprintfW(action, wszFormat, dwAction);
|
|
|
|
|
|
|
|
res = RegQueryValueExW(hkey, action, NULL, NULL, pPolicy, &size);
|
|
|
|
if(res == ERROR_MORE_DATA) {
|
|
|
|
hres = E_INVALIDARG;
|
|
|
|
}else if(res == ERROR_FILE_NOT_FOUND) {
|
|
|
|
hres = E_FAIL;
|
|
|
|
}else if(res != ERROR_SUCCESS) {
|
2006-10-05 23:49:11 +02:00
|
|
|
ERR("RegQueryValue failed: %d\n", res);
|
2005-09-30 12:34:10 +02:00
|
|
|
hres = E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
RegCloseKey(hkey);
|
|
|
|
|
|
|
|
return hres;
|
2004-11-30 22:14:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* IInternetZoneManager_SetZoneActionPolicy
|
|
|
|
*/
|
|
|
|
static HRESULT WINAPI ZoneMgrImpl_SetZoneActionPolicy(IInternetZoneManager* iface,
|
|
|
|
DWORD dwZone,
|
|
|
|
DWORD dwAction,
|
|
|
|
BYTE* pPolicy,
|
|
|
|
DWORD cbPolicy,
|
|
|
|
URLZONEREG urlZoneReg)
|
|
|
|
{
|
2006-10-05 23:49:11 +02:00
|
|
|
FIXME("(%p)->(%08x %08x %p %08x %08x) stub\n", iface, dwZone, dwAction, pPolicy,
|
2004-11-30 22:14:21 +01:00
|
|
|
cbPolicy, urlZoneReg);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2005-05-24 14:30:35 +02:00
|
|
|
/********************************************************************
|
|
|
|
* IInternetZoneManager_PromptAction
|
|
|
|
*/
|
|
|
|
static HRESULT WINAPI ZoneMgrImpl_PromptAction(IInternetZoneManager* iface,
|
|
|
|
DWORD dwAction,
|
|
|
|
HWND hwndParent,
|
|
|
|
LPCWSTR pwszUrl,
|
|
|
|
LPCWSTR pwszText,
|
|
|
|
DWORD dwPromptFlags)
|
|
|
|
{
|
2006-10-05 23:49:11 +02:00
|
|
|
FIXME("%p %08x %p %s %s %08x\n", iface, dwAction, hwndParent,
|
2005-05-24 14:30:35 +02:00
|
|
|
debugstr_w(pwszUrl), debugstr_w(pwszText), dwPromptFlags );
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2004-11-30 22:14:21 +01:00
|
|
|
/********************************************************************
|
|
|
|
* IInternetZoneManager_LogAction
|
|
|
|
*/
|
|
|
|
static HRESULT WINAPI ZoneMgrImpl_LogAction(IInternetZoneManager* iface,
|
|
|
|
DWORD dwAction,
|
|
|
|
LPCWSTR pwszUrl,
|
|
|
|
LPCWSTR pwszText,
|
|
|
|
DWORD dwLogFlags)
|
|
|
|
{
|
2006-10-05 23:49:11 +02:00
|
|
|
FIXME("(%p)->(%08x %s %s %08x) stub\n", iface, dwAction, debugstr_w(pwszUrl),
|
2004-11-30 22:14:21 +01:00
|
|
|
debugstr_w(pwszText), dwLogFlags);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* IInternetZoneManager_CreateZoneEnumerator
|
|
|
|
*/
|
|
|
|
static HRESULT WINAPI ZoneMgrImpl_CreateZoneEnumerator(IInternetZoneManager* iface,
|
|
|
|
DWORD* pdwEnum,
|
|
|
|
DWORD* pdwCount,
|
|
|
|
DWORD dwFlags)
|
|
|
|
{
|
2006-10-05 23:49:11 +02:00
|
|
|
FIXME("(%p)->(%p %p %08x) stub\n", iface, pdwEnum, pdwCount, dwFlags);
|
2004-11-30 22:14:21 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* IInternetZoneManager_GetZoneAt
|
|
|
|
*/
|
|
|
|
static HRESULT WINAPI ZoneMgrImpl_GetZoneAt(IInternetZoneManager* iface,
|
|
|
|
DWORD dwEnum,
|
|
|
|
DWORD dwIndex,
|
|
|
|
DWORD* pdwZone)
|
|
|
|
{
|
2006-10-05 23:49:11 +02:00
|
|
|
FIXME("(%p)->(%08x %08x %p) stub\n", iface, dwEnum, dwIndex, pdwZone);
|
2004-11-30 22:14:21 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* IInternetZoneManager_DestroyZoneEnumerator
|
|
|
|
*/
|
|
|
|
static HRESULT WINAPI ZoneMgrImpl_DestroyZoneEnumerator(IInternetZoneManager* iface,
|
|
|
|
DWORD dwEnum)
|
|
|
|
{
|
2006-10-05 23:49:11 +02:00
|
|
|
FIXME("(%p)->(%08x) stub\n", iface, dwEnum);
|
2004-11-30 22:14:21 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* IInternetZoneManager_CopyTemplatePoliciesToZone
|
|
|
|
*/
|
|
|
|
static HRESULT WINAPI ZoneMgrImpl_CopyTemplatePoliciesToZone(IInternetZoneManager* iface,
|
|
|
|
DWORD dwTemplate,
|
|
|
|
DWORD dwZone,
|
|
|
|
DWORD dwReserved)
|
|
|
|
{
|
2006-10-05 23:49:11 +02:00
|
|
|
FIXME("(%p)->(%08x %08x %08x) stub\n", iface, dwTemplate, dwZone, dwReserved);
|
2004-11-30 22:14:21 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* IInternetZoneManager_Construct
|
|
|
|
*/
|
2005-06-06 21:50:35 +02:00
|
|
|
static const IInternetZoneManagerVtbl ZoneMgrImplVtbl = {
|
2004-11-30 22:14:21 +01:00
|
|
|
ZoneMgrImpl_QueryInterface,
|
|
|
|
ZoneMgrImpl_AddRef,
|
|
|
|
ZoneMgrImpl_Release,
|
|
|
|
ZoneMgrImpl_GetZoneAttributes,
|
|
|
|
ZoneMgrImpl_SetZoneAttributes,
|
|
|
|
ZoneMgrImpl_GetZoneCustomPolicy,
|
|
|
|
ZoneMgrImpl_SetZoneCustomPolicy,
|
|
|
|
ZoneMgrImpl_GetZoneActionPolicy,
|
|
|
|
ZoneMgrImpl_SetZoneActionPolicy,
|
2005-05-24 14:30:35 +02:00
|
|
|
ZoneMgrImpl_PromptAction,
|
2004-11-30 22:14:21 +01:00
|
|
|
ZoneMgrImpl_LogAction,
|
|
|
|
ZoneMgrImpl_CreateZoneEnumerator,
|
|
|
|
ZoneMgrImpl_GetZoneAt,
|
|
|
|
ZoneMgrImpl_DestroyZoneEnumerator,
|
|
|
|
ZoneMgrImpl_CopyTemplatePoliciesToZone,
|
|
|
|
};
|
2005-05-24 14:30:35 +02:00
|
|
|
|
2004-11-30 22:14:21 +01:00
|
|
|
HRESULT ZoneMgrImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
|
|
|
|
{
|
2007-11-29 22:12:34 +01:00
|
|
|
ZoneMgrImpl* ret = heap_alloc(sizeof(ZoneMgrImpl));
|
2004-11-30 22:14:21 +01:00
|
|
|
|
|
|
|
TRACE("(%p %p)\n", pUnkOuter, ppobj);
|
|
|
|
ret->lpVtbl = &ZoneMgrImplVtbl;
|
|
|
|
ret->ref = 1;
|
|
|
|
*ppobj = (IInternetZoneManager*)ret;
|
|
|
|
|
2005-07-02 12:49:56 +02:00
|
|
|
URLMON_LockModule();
|
|
|
|
|
2004-11-30 22:14:21 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2004-09-28 21:18:52 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* CoInternetCreateSecurityManager (URLMON.@)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoInternetCreateSecurityManager( IServiceProvider *pSP,
|
|
|
|
IInternetSecurityManager **ppSM, DWORD dwReserved )
|
|
|
|
{
|
2006-10-05 23:49:11 +02:00
|
|
|
TRACE("%p %p %d\n", pSP, ppSM, dwReserved );
|
2005-09-07 11:23:18 +02:00
|
|
|
|
|
|
|
if(pSP)
|
|
|
|
FIXME("pSP not supported\n");
|
|
|
|
|
2004-09-28 21:18:52 +02:00
|
|
|
return SecManagerImpl_Construct(NULL, (void**) ppSM);
|
|
|
|
}
|
2004-11-30 22:14:21 +01:00
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* CoInternetCreateZoneManager (URLMON.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CoInternetCreateZoneManager(IServiceProvider* pSP, IInternetZoneManager** ppZM, DWORD dwReserved)
|
|
|
|
{
|
2006-10-05 23:49:11 +02:00
|
|
|
TRACE("(%p %p %x)\n", pSP, ppZM, dwReserved);
|
2004-11-30 22:14:21 +01:00
|
|
|
return ZoneMgrImpl_Construct(NULL, (void**)ppZM);
|
|
|
|
}
|