2 * Internet Security and Zone Manager
4 * Copyright (c) 2004 Huw D M Davies
5 * Copyright 2004 Jacek Caban
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #include "urlmon_main.h"
28 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(urlmon
);
32 static const WCHAR fileW
[] = {'f','i','l','e',0};
34 static HRESULT
get_zone_from_reg(LPCWSTR schema
, DWORD
*zone
)
39 static const WCHAR wszZoneMapProtocolKey
[] =
40 {'S','o','f','t','w','a','r','e','\\',
41 'M','i','c','r','o','s','o','f','t','\\',
42 'W','i','n','d','o','w','s','\\',
43 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
44 'I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s','\\',
45 'Z','o','n','e','M','a','p','\\',
46 'P','r','o','t','o','c','o','l','D','e','f','a','u','l','t','s',0};
48 res
= RegOpenKeyW(HKEY_CURRENT_USER
, wszZoneMapProtocolKey
, &hkey
);
49 if(res
!= ERROR_SUCCESS
) {
50 ERR("Could not open key %s\n", debugstr_w(wszZoneMapProtocolKey
));
55 res
= RegQueryValueExW(hkey
, schema
, NULL
, NULL
, (PBYTE
)zone
, &size
);
57 if(res
== ERROR_SUCCESS
)
60 res
= RegOpenKeyW(HKEY_LOCAL_MACHINE
, wszZoneMapProtocolKey
, &hkey
);
61 if(res
!= ERROR_SUCCESS
) {
62 ERR("Could not open key %s\n", debugstr_w(wszZoneMapProtocolKey
));
67 res
= RegQueryValueExW(hkey
, schema
, NULL
, NULL
, (PBYTE
)zone
, &size
);
69 if(res
== ERROR_SUCCESS
)
76 static HRESULT
map_url_to_zone(LPCWSTR url
, DWORD
*zone
, LPWSTR
*ret_url
)
83 secur_url
= heap_alloc(INTERNET_MAX_URL_LENGTH
*sizeof(WCHAR
));
86 hres
= CoInternetParseUrl(url
, PARSE_SECURITY_URL
, 0, secur_url
, INTERNET_MAX_URL_LENGTH
, &size
, 0);
88 strcpyW(secur_url
, url
);
90 hres
= CoInternetParseUrl(secur_url
, PARSE_SCHEMA
, 0, schema
, sizeof(schema
)/sizeof(WCHAR
), &size
, 0);
91 if(FAILED(hres
) || !*schema
) {
96 /* file protocol is a special case */
97 if(!strcmpW(schema
, fileW
)) {
98 WCHAR path
[MAX_PATH
], root
[20];
101 hres
= CoInternetParseUrl(secur_url
, PARSE_PATH_FROM_URL
, 0, path
,
102 sizeof(path
)/sizeof(WCHAR
), &size
, 0);
104 if(SUCCEEDED(hres
) && (ptr
= strchrW(path
, '\\')) && ptr
-path
< sizeof(root
)/sizeof(WCHAR
)) {
107 memcpy(root
, path
, (ptr
-path
)*sizeof(WCHAR
));
110 type
= GetDriveTypeW(root
);
114 case DRIVE_NO_ROOT_DIR
:
116 case DRIVE_REMOVABLE
:
128 FIXME("unsupported drive type %d\n", type
);
134 WARN("domains are not yet implemented\n");
135 hres
= get_zone_from_reg(schema
, zone
);
138 if(FAILED(hres
) || !ret_url
)
139 heap_free(secur_url
);
141 *ret_url
= secur_url
;
146 static HRESULT
open_zone_key(HKEY parent_key
, DWORD zone
, HKEY
*hkey
)
148 static const WCHAR wszZonesKey
[] =
149 {'S','o','f','t','w','a','r','e','\\',
150 'M','i','c','r','o','s','o','f','t','\\',
151 'W','i','n','d','o','w','s','\\',
152 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
153 'I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s','\\',
154 'Z','o','n','e','s','\\',0};
155 static const WCHAR wszFormat
[] = {'%','s','%','l','d',0};
157 WCHAR key_name
[sizeof(wszZonesKey
)/sizeof(WCHAR
)+8];
160 wsprintfW(key_name
, wszFormat
, wszZonesKey
, zone
);
162 res
= RegOpenKeyW(parent_key
, key_name
, hkey
);
164 if(res
!= ERROR_SUCCESS
) {
165 WARN("RegOpenKey failed\n");
172 static HRESULT
get_action_policy(DWORD zone
, DWORD action
, BYTE
*policy
, DWORD size
, URLZONEREG zone_reg
)
180 case URLACTION_SCRIPT_OVERRIDE_SAFETY
:
181 *(DWORD
*)policy
= URLPOLICY_DISALLOW
;
186 case URLZONEREG_DEFAULT
:
187 case URLZONEREG_HKCU
:
188 parent_key
= HKEY_CURRENT_USER
;
190 case URLZONEREG_HKLM
:
191 parent_key
= HKEY_LOCAL_MACHINE
;
194 WARN("Unknown URLZONEREG: %d\n", zone_reg
);
198 hres
= open_zone_key(parent_key
, zone
, &hkey
);
199 if(SUCCEEDED(hres
)) {
200 WCHAR action_str
[16];
203 static const WCHAR formatW
[] = {'%','X',0};
205 wsprintfW(action_str
, formatW
, action
);
207 res
= RegQueryValueExW(hkey
, action_str
, NULL
, NULL
, policy
, &len
);
208 if(res
== ERROR_MORE_DATA
) {
210 }else if(res
== ERROR_FILE_NOT_FOUND
) {
212 }else if(res
!= ERROR_SUCCESS
) {
213 ERR("RegQueryValue failed: %d\n", res
);
220 if(FAILED(hres
) && zone_reg
== URLZONEREG_DEFAULT
)
221 return get_action_policy(zone
, action
, policy
, size
, URLZONEREG_HKLM
);
226 /***********************************************************************
227 * InternetSecurityManager implementation
231 const IInternetSecurityManagerVtbl
* lpInternetSecurityManagerVtbl
;
235 IInternetSecurityMgrSite
*mgrsite
;
236 IInternetSecurityManager
*custom_manager
;
239 #define SECMGR_THIS(iface) DEFINE_THIS(SecManagerImpl, InternetSecurityManager, iface)
241 static HRESULT WINAPI
SecManagerImpl_QueryInterface(IInternetSecurityManager
* iface
,REFIID riid
,void** ppvObject
)
243 SecManagerImpl
*This
= SECMGR_THIS(iface
);
245 TRACE("(%p)->(%s,%p)\n",This
,debugstr_guid(riid
),ppvObject
);
247 /* Perform a sanity check on the parameters.*/
248 if ( (This
==0) || (ppvObject
==0) )
251 /* Initialize the return parameter */
254 /* Compare the riid with the interface IDs implemented by this object.*/
255 if (IsEqualIID(&IID_IUnknown
, riid
) ||
256 IsEqualIID(&IID_IInternetSecurityManager
, riid
))
259 /* Check that we obtained an interface.*/
261 WARN("not supported interface %s\n", debugstr_guid(riid
));
262 return E_NOINTERFACE
;
265 /* Query Interface always increases the reference count by one when it is successful */
266 IInternetSecurityManager_AddRef(iface
);
271 static ULONG WINAPI
SecManagerImpl_AddRef(IInternetSecurityManager
* iface
)
273 SecManagerImpl
*This
= SECMGR_THIS(iface
);
274 ULONG refCount
= InterlockedIncrement(&This
->ref
);
276 TRACE("(%p) ref=%u\n", This
, refCount
);
281 static ULONG WINAPI
SecManagerImpl_Release(IInternetSecurityManager
* iface
)
283 SecManagerImpl
*This
= SECMGR_THIS(iface
);
284 ULONG refCount
= InterlockedDecrement(&This
->ref
);
286 TRACE("(%p) ref=%u\n", This
, refCount
);
288 /* destroy the object if there's no more reference on it */
291 IInternetSecurityMgrSite_Release(This
->mgrsite
);
292 if(This
->custom_manager
)
293 IInternetSecurityManager_Release(This
->custom_manager
);
297 URLMON_UnlockModule();
303 static HRESULT WINAPI
SecManagerImpl_SetSecuritySite(IInternetSecurityManager
*iface
,
304 IInternetSecurityMgrSite
*pSite
)
306 SecManagerImpl
*This
= SECMGR_THIS(iface
);
308 TRACE("(%p)->(%p)\n", This
, pSite
);
311 IInternetSecurityMgrSite_Release(This
->mgrsite
);
313 if(This
->custom_manager
) {
314 IInternetSecurityManager_Release(This
->custom_manager
);
315 This
->custom_manager
= NULL
;
318 This
->mgrsite
= pSite
;
321 IServiceProvider
*servprov
;
324 IInternetSecurityMgrSite_AddRef(pSite
);
326 hres
= IInternetSecurityMgrSite_QueryInterface(pSite
, &IID_IServiceProvider
,
328 if(SUCCEEDED(hres
)) {
329 IServiceProvider_QueryService(servprov
, &SID_SInternetSecurityManager
,
330 &IID_IInternetSecurityManager
, (void**)&This
->custom_manager
);
331 IServiceProvider_Release(servprov
);
338 static HRESULT WINAPI
SecManagerImpl_GetSecuritySite(IInternetSecurityManager
*iface
,
339 IInternetSecurityMgrSite
**ppSite
)
341 SecManagerImpl
*This
= SECMGR_THIS(iface
);
343 TRACE("(%p)->(%p)\n", This
, ppSite
);
349 IInternetSecurityMgrSite_AddRef(This
->mgrsite
);
351 *ppSite
= This
->mgrsite
;
355 static HRESULT WINAPI
SecManagerImpl_MapUrlToZone(IInternetSecurityManager
*iface
,
356 LPCWSTR pwszUrl
, DWORD
*pdwZone
,
359 SecManagerImpl
*This
= SECMGR_THIS(iface
);
362 TRACE("(%p)->(%s %p %08x)\n", iface
, debugstr_w(pwszUrl
), pdwZone
, dwFlags
);
364 if(This
->custom_manager
) {
365 hres
= IInternetSecurityManager_MapUrlToZone(This
->custom_manager
,
366 pwszUrl
, pdwZone
, dwFlags
);
367 if(hres
!= INET_E_DEFAULT_ACTION
)
377 FIXME("not supported flags: %08x\n", dwFlags
);
379 return map_url_to_zone(pwszUrl
, pdwZone
, NULL
);
382 static HRESULT WINAPI
SecManagerImpl_GetSecurityId(IInternetSecurityManager
*iface
,
383 LPCWSTR pwszUrl
, BYTE
*pbSecurityId
, DWORD
*pcbSecurityId
, DWORD_PTR dwReserved
)
385 SecManagerImpl
*This
= SECMGR_THIS(iface
);
386 LPWSTR url
, ptr
, ptr2
;
390 static const WCHAR wszFile
[] = {'f','i','l','e',':'};
392 TRACE("(%p)->(%s %p %p %08lx)\n", iface
, debugstr_w(pwszUrl
), pbSecurityId
,
393 pcbSecurityId
, dwReserved
);
395 if(This
->custom_manager
) {
396 hres
= IInternetSecurityManager_GetSecurityId(This
->custom_manager
,
397 pwszUrl
, pbSecurityId
, pcbSecurityId
, dwReserved
);
398 if(hres
!= INET_E_DEFAULT_ACTION
)
402 if(!pwszUrl
|| !pbSecurityId
|| !pcbSecurityId
)
406 FIXME("dwReserved is not supported\n");
408 hres
= map_url_to_zone(pwszUrl
, &zone
, &url
);
410 return hres
== 0x80041001 ? E_INVALIDARG
: hres
;
412 /* file protocol is a special case */
413 if(strlenW(url
) >= sizeof(wszFile
)/sizeof(WCHAR
)
414 && !memcmp(url
, wszFile
, sizeof(wszFile
)) && strchrW(url
, '\\')) {
416 static const BYTE secidFile
[] = {'f','i','l','e',':'};
420 if(*pcbSecurityId
< sizeof(secidFile
)+sizeof(zone
))
421 return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER
);
423 memcpy(pbSecurityId
, secidFile
, sizeof(secidFile
));
424 *(DWORD
*)(pbSecurityId
+sizeof(secidFile
)) = zone
;
426 *pcbSecurityId
= sizeof(secidFile
)+sizeof(zone
);
430 ptr
= strchrW(url
, ':');
435 memmove(ptr
, ptr2
, (strlenW(ptr2
)+1)*sizeof(WCHAR
));
437 ptr
= strchrW(ptr
, '/');
441 len
= WideCharToMultiByte(CP_ACP
, 0, url
, -1, NULL
, 0, NULL
, NULL
)-1;
443 if(len
+sizeof(DWORD
) > *pcbSecurityId
) {
445 return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER
);
448 WideCharToMultiByte(CP_ACP
, 0, url
, -1, (LPSTR
)pbSecurityId
, len
, NULL
, NULL
);
451 *(DWORD
*)(pbSecurityId
+len
) = zone
;
453 *pcbSecurityId
= len
+sizeof(DWORD
);
459 static HRESULT WINAPI
SecManagerImpl_ProcessUrlAction(IInternetSecurityManager
*iface
,
460 LPCWSTR pwszUrl
, DWORD dwAction
,
461 BYTE
*pPolicy
, DWORD cbPolicy
,
462 BYTE
*pContext
, DWORD cbContext
,
463 DWORD dwFlags
, DWORD dwReserved
)
465 SecManagerImpl
*This
= SECMGR_THIS(iface
);
469 TRACE("(%p)->(%s %08x %p %08x %p %08x %08x %08x)\n", iface
, debugstr_w(pwszUrl
), dwAction
,
470 pPolicy
, cbPolicy
, pContext
, cbContext
, dwFlags
, dwReserved
);
472 if(This
->custom_manager
) {
473 hres
= IInternetSecurityManager_ProcessUrlAction(This
->custom_manager
, pwszUrl
, dwAction
,
474 pPolicy
, cbPolicy
, pContext
, cbContext
, dwFlags
, dwReserved
);
475 if(hres
!= INET_E_DEFAULT_ACTION
)
479 if(pContext
|| cbContext
|| dwFlags
|| dwReserved
)
480 FIXME("Unsupported arguments\n");
485 hres
= map_url_to_zone(pwszUrl
, &zone
, NULL
);
489 hres
= get_action_policy(zone
, dwAction
, (BYTE
*)&policy
, sizeof(policy
), URLZONEREG_DEFAULT
);
493 TRACE("policy %x\n", policy
);
495 switch(GetUrlPolicyPermissions(policy
)) {
496 case URLPOLICY_ALLOW
:
497 case URLPOLICY_CHANNEL_SOFTDIST_PRECACHE
:
499 case URLPOLICY_DISALLOW
:
501 case URLPOLICY_QUERY
:
502 FIXME("URLPOLICY_QUERY not implemented\n");
505 FIXME("Not implemented policy %x\n", policy
);
512 static HRESULT WINAPI
SecManagerImpl_QueryCustomPolicy(IInternetSecurityManager
*iface
,
513 LPCWSTR pwszUrl
, REFGUID guidKey
,
514 BYTE
**ppPolicy
, DWORD
*pcbPolicy
,
515 BYTE
*pContext
, DWORD cbContext
,
518 SecManagerImpl
*This
= SECMGR_THIS(iface
);
521 TRACE("(%p)->(%s %s %p %p %p %08x %08x )\n", iface
, debugstr_w(pwszUrl
), debugstr_guid(guidKey
),
522 ppPolicy
, pcbPolicy
, pContext
, cbContext
, dwReserved
);
524 if(This
->custom_manager
) {
525 hres
= IInternetSecurityManager_QueryCustomPolicy(This
->custom_manager
, pwszUrl
, guidKey
,
526 ppPolicy
, pcbPolicy
, pContext
, cbContext
, dwReserved
);
527 if(hres
!= INET_E_DEFAULT_ACTION
)
531 FIXME("Default action is not implemented\n");
535 static HRESULT WINAPI
SecManagerImpl_SetZoneMapping(IInternetSecurityManager
*iface
,
536 DWORD dwZone
, LPCWSTR pwszPattern
, DWORD dwFlags
)
538 SecManagerImpl
*This
= SECMGR_THIS(iface
);
541 TRACE("(%p)->(%08x %s %08x)\n", iface
, dwZone
, debugstr_w(pwszPattern
),dwFlags
);
543 if(This
->custom_manager
) {
544 hres
= IInternetSecurityManager_SetZoneMapping(This
->custom_manager
, dwZone
,
545 pwszPattern
, dwFlags
);
546 if(hres
!= INET_E_DEFAULT_ACTION
)
550 FIXME("Default action is not implemented\n");
554 static HRESULT WINAPI
SecManagerImpl_GetZoneMappings(IInternetSecurityManager
*iface
,
555 DWORD dwZone
, IEnumString
**ppenumString
, DWORD dwFlags
)
557 SecManagerImpl
*This
= SECMGR_THIS(iface
);
560 TRACE("(%p)->(%08x %p %08x)\n", iface
, dwZone
, ppenumString
,dwFlags
);
562 if(This
->custom_manager
) {
563 hres
= IInternetSecurityManager_GetZoneMappings(This
->custom_manager
, dwZone
,
564 ppenumString
, dwFlags
);
565 if(hres
!= INET_E_DEFAULT_ACTION
)
569 FIXME("Default action is not implemented\n");
573 static const IInternetSecurityManagerVtbl VT_SecManagerImpl
=
575 SecManagerImpl_QueryInterface
,
576 SecManagerImpl_AddRef
,
577 SecManagerImpl_Release
,
578 SecManagerImpl_SetSecuritySite
,
579 SecManagerImpl_GetSecuritySite
,
580 SecManagerImpl_MapUrlToZone
,
581 SecManagerImpl_GetSecurityId
,
582 SecManagerImpl_ProcessUrlAction
,
583 SecManagerImpl_QueryCustomPolicy
,
584 SecManagerImpl_SetZoneMapping
,
585 SecManagerImpl_GetZoneMappings
588 HRESULT
SecManagerImpl_Construct(IUnknown
*pUnkOuter
, LPVOID
*ppobj
)
590 SecManagerImpl
*This
;
592 TRACE("(%p,%p)\n",pUnkOuter
,ppobj
);
593 This
= heap_alloc(sizeof(*This
));
595 /* Initialize the virtual function table. */
596 This
->lpInternetSecurityManagerVtbl
= &VT_SecManagerImpl
;
599 This
->mgrsite
= NULL
;
600 This
->custom_manager
= NULL
;
609 /***********************************************************************
610 * InternetZoneManager implementation
614 const IInternetZoneManagerVtbl
* lpVtbl
;
618 /********************************************************************
619 * IInternetZoneManager_QueryInterface
621 static HRESULT WINAPI
ZoneMgrImpl_QueryInterface(IInternetZoneManager
* iface
, REFIID riid
, void** ppvObject
)
623 ZoneMgrImpl
* This
= (ZoneMgrImpl
*)iface
;
625 TRACE("(%p)->(%s,%p)\n", This
, debugstr_guid(riid
), ppvObject
);
627 if(!This
|| !ppvObject
)
630 if(!IsEqualIID(&IID_IUnknown
, riid
) && !IsEqualIID(&IID_IInternetZoneManager
, riid
)) {
631 FIXME("Unknown interface: %s\n", debugstr_guid(riid
));
633 return E_NOINTERFACE
;
637 IInternetZoneManager_AddRef(iface
);
642 /********************************************************************
643 * IInternetZoneManager_AddRef
645 static ULONG WINAPI
ZoneMgrImpl_AddRef(IInternetZoneManager
* iface
)
647 ZoneMgrImpl
* This
= (ZoneMgrImpl
*)iface
;
648 ULONG refCount
= InterlockedIncrement(&This
->ref
);
650 TRACE("(%p)->(ref before=%u)\n",This
, refCount
- 1);
655 /********************************************************************
656 * IInternetZoneManager_Release
658 static ULONG WINAPI
ZoneMgrImpl_Release(IInternetZoneManager
* iface
)
660 ZoneMgrImpl
* This
= (ZoneMgrImpl
*)iface
;
661 ULONG refCount
= InterlockedDecrement(&This
->ref
);
663 TRACE("(%p)->(ref before=%u)\n",This
, refCount
+ 1);
667 URLMON_UnlockModule();
673 /********************************************************************
674 * IInternetZoneManager_GetZoneAttributes
676 static HRESULT WINAPI
ZoneMgrImpl_GetZoneAttributes(IInternetZoneManager
* iface
,
678 ZONEATTRIBUTES
* pZoneAttributes
)
680 FIXME("(%p)->(%d %p) stub\n", iface
, dwZone
, pZoneAttributes
);
684 /********************************************************************
685 * IInternetZoneManager_SetZoneAttributes
687 static HRESULT WINAPI
ZoneMgrImpl_SetZoneAttributes(IInternetZoneManager
* iface
,
689 ZONEATTRIBUTES
* pZoneAttributes
)
691 FIXME("(%p)->(%08x %p) stub\n", iface
, dwZone
, pZoneAttributes
);
695 /********************************************************************
696 * IInternetZoneManager_GetZoneCustomPolicy
698 static HRESULT WINAPI
ZoneMgrImpl_GetZoneCustomPolicy(IInternetZoneManager
* iface
,
703 URLZONEREG ulrZoneReg
)
705 FIXME("(%p)->(%08x %s %p %p %08x) stub\n", iface
, dwZone
, debugstr_guid(guidKey
),
706 ppPolicy
, pcbPolicy
, ulrZoneReg
);
710 /********************************************************************
711 * IInternetZoneManager_SetZoneCustomPolicy
713 static HRESULT WINAPI
ZoneMgrImpl_SetZoneCustomPolicy(IInternetZoneManager
* iface
,
718 URLZONEREG ulrZoneReg
)
720 FIXME("(%p)->(%08x %s %p %08x %08x) stub\n", iface
, dwZone
, debugstr_guid(guidKey
),
721 ppPolicy
, cbPolicy
, ulrZoneReg
);
725 /********************************************************************
726 * IInternetZoneManager_GetZoneActionPolicy
728 static HRESULT WINAPI
ZoneMgrImpl_GetZoneActionPolicy(IInternetZoneManager
* iface
,
729 DWORD dwZone
, DWORD dwAction
, BYTE
* pPolicy
, DWORD cbPolicy
, URLZONEREG urlZoneReg
)
731 TRACE("(%p)->(%d %08x %p %d %d)\n", iface
, dwZone
, dwAction
, pPolicy
,
732 cbPolicy
, urlZoneReg
);
737 return get_action_policy(dwZone
, dwAction
, pPolicy
, cbPolicy
, urlZoneReg
);
740 /********************************************************************
741 * IInternetZoneManager_SetZoneActionPolicy
743 static HRESULT WINAPI
ZoneMgrImpl_SetZoneActionPolicy(IInternetZoneManager
* iface
,
748 URLZONEREG urlZoneReg
)
750 FIXME("(%p)->(%08x %08x %p %08x %08x) stub\n", iface
, dwZone
, dwAction
, pPolicy
,
751 cbPolicy
, urlZoneReg
);
755 /********************************************************************
756 * IInternetZoneManager_PromptAction
758 static HRESULT WINAPI
ZoneMgrImpl_PromptAction(IInternetZoneManager
* iface
,
765 FIXME("%p %08x %p %s %s %08x\n", iface
, dwAction
, hwndParent
,
766 debugstr_w(pwszUrl
), debugstr_w(pwszText
), dwPromptFlags
);
770 /********************************************************************
771 * IInternetZoneManager_LogAction
773 static HRESULT WINAPI
ZoneMgrImpl_LogAction(IInternetZoneManager
* iface
,
779 FIXME("(%p)->(%08x %s %s %08x) stub\n", iface
, dwAction
, debugstr_w(pwszUrl
),
780 debugstr_w(pwszText
), dwLogFlags
);
784 /********************************************************************
785 * IInternetZoneManager_CreateZoneEnumerator
787 static HRESULT WINAPI
ZoneMgrImpl_CreateZoneEnumerator(IInternetZoneManager
* iface
,
792 FIXME("(%p)->(%p %p %08x) stub\n", iface
, pdwEnum
, pdwCount
, dwFlags
);
796 /********************************************************************
797 * IInternetZoneManager_GetZoneAt
799 static HRESULT WINAPI
ZoneMgrImpl_GetZoneAt(IInternetZoneManager
* iface
,
804 FIXME("(%p)->(%08x %08x %p) stub\n", iface
, dwEnum
, dwIndex
, pdwZone
);
808 /********************************************************************
809 * IInternetZoneManager_DestroyZoneEnumerator
811 static HRESULT WINAPI
ZoneMgrImpl_DestroyZoneEnumerator(IInternetZoneManager
* iface
,
814 FIXME("(%p)->(%08x) stub\n", iface
, dwEnum
);
818 /********************************************************************
819 * IInternetZoneManager_CopyTemplatePoliciesToZone
821 static HRESULT WINAPI
ZoneMgrImpl_CopyTemplatePoliciesToZone(IInternetZoneManager
* iface
,
826 FIXME("(%p)->(%08x %08x %08x) stub\n", iface
, dwTemplate
, dwZone
, dwReserved
);
830 /********************************************************************
831 * IInternetZoneManager_Construct
833 static const IInternetZoneManagerVtbl ZoneMgrImplVtbl
= {
834 ZoneMgrImpl_QueryInterface
,
837 ZoneMgrImpl_GetZoneAttributes
,
838 ZoneMgrImpl_SetZoneAttributes
,
839 ZoneMgrImpl_GetZoneCustomPolicy
,
840 ZoneMgrImpl_SetZoneCustomPolicy
,
841 ZoneMgrImpl_GetZoneActionPolicy
,
842 ZoneMgrImpl_SetZoneActionPolicy
,
843 ZoneMgrImpl_PromptAction
,
844 ZoneMgrImpl_LogAction
,
845 ZoneMgrImpl_CreateZoneEnumerator
,
846 ZoneMgrImpl_GetZoneAt
,
847 ZoneMgrImpl_DestroyZoneEnumerator
,
848 ZoneMgrImpl_CopyTemplatePoliciesToZone
,
851 HRESULT
ZoneMgrImpl_Construct(IUnknown
*pUnkOuter
, LPVOID
*ppobj
)
853 ZoneMgrImpl
* ret
= heap_alloc(sizeof(ZoneMgrImpl
));
855 TRACE("(%p %p)\n", pUnkOuter
, ppobj
);
856 ret
->lpVtbl
= &ZoneMgrImplVtbl
;
858 *ppobj
= (IInternetZoneManager
*)ret
;
865 /***********************************************************************
866 * CoInternetCreateSecurityManager (URLMON.@)
869 HRESULT WINAPI
CoInternetCreateSecurityManager( IServiceProvider
*pSP
,
870 IInternetSecurityManager
**ppSM
, DWORD dwReserved
)
872 TRACE("%p %p %d\n", pSP
, ppSM
, dwReserved
);
875 FIXME("pSP not supported\n");
877 return SecManagerImpl_Construct(NULL
, (void**) ppSM
);
880 /********************************************************************
881 * CoInternetCreateZoneManager (URLMON.@)
883 HRESULT WINAPI
CoInternetCreateZoneManager(IServiceProvider
* pSP
, IInternetZoneManager
** ppZM
, DWORD dwReserved
)
885 TRACE("(%p %p %x)\n", pSP
, ppZM
, dwReserved
);
886 return ZoneMgrImpl_Construct(NULL
, (void**)ppZM
);