Release 20050930.
[wine/gsoc-2012-control.git] / dlls / urlmon / sec_mgr.c
blob576e82a618280371a1c26b2d33306eec575f507e
1 /*
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include <stdarg.h>
23 #include <stdio.h>
25 #define COBJMACROS
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winuser.h"
30 #include "winreg.h"
31 #include "wine/debug.h"
32 #include "ole2.h"
33 #include "wine/unicode.h"
34 #include "urlmon.h"
35 #include "urlmon_main.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
39 /***********************************************************************
40 * InternetSecurityManager implementation
43 typedef struct {
44 const IInternetSecurityManagerVtbl* lpInternetSecurityManagerVtbl;
46 LONG ref;
48 IInternetSecurityMgrSite *mgrsite;
49 IInternetSecurityManager *custom_manager;
50 } SecManagerImpl;
52 #define SECMGR_THIS(iface) DEFINE_THIS(SecManagerImpl, InternetSecurityManager, iface)
54 static HRESULT map_url_to_zone(LPCWSTR url, DWORD *zone)
56 WCHAR schema[64];
57 DWORD res, size=0;
58 HKEY hkey;
59 HRESULT hres;
61 static const WCHAR wszZoneMapProtocolKey[] =
62 {'S','o','f','t','w','a','r','e','\\',
63 'M','i','c','r','o','s','o','f','t','\\',
64 'W','i','n','d','o','w','s','\\',
65 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
66 'I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s','\\',
67 'Z','o','n','e','M','a','p','\\',
68 'P','r','o','t','o','c','o','l','D','e','f','a','u','l','t','s',0};
69 static const WCHAR wszFile[] = {'f','i','l','e',0};
71 hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, schema, sizeof(schema)/sizeof(WCHAR), &size, 0);
72 if(FAILED(hres))
73 return hres;
74 if(!*schema)
75 return 0x80041001;
77 /* file protocol is a special case */
78 if(!strcmpW(schema, wszFile)) {
79 WCHAR path[MAX_PATH];
81 hres = CoInternetParseUrl(url, PARSE_PATH_FROM_URL, 0, path,
82 sizeof(path)/sizeof(WCHAR), &size, 0);
84 if(SUCCEEDED(hres) && strchrW(path, '\\')) {
85 *zone = 0;
86 return S_OK;
90 WARN("domains are not yet implemented\n");
92 res = RegOpenKeyW(HKEY_CURRENT_USER, wszZoneMapProtocolKey, &hkey);
93 if(res != ERROR_SUCCESS) {
94 ERR("Could not open key %s\n", debugstr_w(wszZoneMapProtocolKey));
95 return E_UNEXPECTED;
98 size = sizeof(DWORD);
99 res = RegQueryValueExW(hkey, schema, NULL, NULL, (PBYTE)zone, &size);
100 if(res == ERROR_SUCCESS)
101 return S_OK;
103 res = RegOpenKeyW(HKEY_LOCAL_MACHINE, wszZoneMapProtocolKey, &hkey);
104 if(res != ERROR_SUCCESS) {
105 ERR("Could not open key %s\n", debugstr_w(wszZoneMapProtocolKey));
106 return E_UNEXPECTED;
109 size = sizeof(DWORD);
110 res = RegQueryValueExW(hkey, schema, NULL, NULL, (PBYTE)zone, &size);
111 if(res == ERROR_SUCCESS)
112 return S_OK;
114 *zone = 3;
115 return S_OK;
118 static HRESULT WINAPI SecManagerImpl_QueryInterface(IInternetSecurityManager* iface,REFIID riid,void** ppvObject)
120 SecManagerImpl *This = SECMGR_THIS(iface);
122 TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppvObject);
124 /* Perform a sanity check on the parameters.*/
125 if ( (This==0) || (ppvObject==0) )
126 return E_INVALIDARG;
128 /* Initialize the return parameter */
129 *ppvObject = 0;
131 /* Compare the riid with the interface IDs implemented by this object.*/
132 if (IsEqualIID(&IID_IUnknown, riid) ||
133 IsEqualIID(&IID_IInternetSecurityManager, riid))
134 *ppvObject = iface;
136 /* Check that we obtained an interface.*/
137 if (!*ppvObject) {
138 WARN("not supported interface %s\n", debugstr_guid(riid));
139 return E_NOINTERFACE;
142 /* Query Interface always increases the reference count by one when it is successful */
143 IInternetSecurityManager_AddRef(iface);
145 return S_OK;
148 static ULONG WINAPI SecManagerImpl_AddRef(IInternetSecurityManager* iface)
150 SecManagerImpl *This = SECMGR_THIS(iface);
151 ULONG refCount = InterlockedIncrement(&This->ref);
153 TRACE("(%p) ref=%lu\n", This, refCount);
155 return refCount;
158 static ULONG WINAPI SecManagerImpl_Release(IInternetSecurityManager* iface)
160 SecManagerImpl *This = SECMGR_THIS(iface);
161 ULONG refCount = InterlockedDecrement(&This->ref);
163 TRACE("(%p) ref=%lu\n", This, refCount);
165 /* destroy the object if there's no more reference on it */
166 if (!refCount){
167 if(This->mgrsite)
168 IInternetSecurityMgrSite_Release(This->mgrsite);
169 if(This->custom_manager)
170 IInternetSecurityManager_Release(This->custom_manager);
172 HeapFree(GetProcessHeap(),0,This);
174 URLMON_UnlockModule();
177 return refCount;
180 static HRESULT WINAPI SecManagerImpl_SetSecuritySite(IInternetSecurityManager *iface,
181 IInternetSecurityMgrSite *pSite)
183 SecManagerImpl *This = SECMGR_THIS(iface);
185 TRACE("(%p)->(%p)\n", This, pSite);
187 if(This->mgrsite)
188 IInternetSecurityMgrSite_Release(This->mgrsite);
190 if(This->custom_manager) {
191 IInternetSecurityManager_Release(This->custom_manager);
192 This->custom_manager = NULL;
195 This->mgrsite = pSite;
197 if(pSite) {
198 IServiceProvider *servprov;
199 HRESULT hres;
201 IInternetSecurityMgrSite_AddRef(pSite);
203 hres = IInternetSecurityMgrSite_QueryInterface(pSite, &IID_IServiceProvider,
204 (void**)&servprov);
205 if(SUCCEEDED(hres)) {
206 IServiceProvider_QueryService(servprov, &SID_SInternetSecurityManager,
207 &IID_IInternetSecurityManager, (void**)&This->custom_manager);
208 IServiceProvider_Release(servprov);
212 return S_OK;
215 static HRESULT WINAPI SecManagerImpl_GetSecuritySite(IInternetSecurityManager *iface,
216 IInternetSecurityMgrSite **ppSite)
218 SecManagerImpl *This = SECMGR_THIS(iface);
220 TRACE("(%p)->(%p)\n", This, ppSite);
222 if(!ppSite)
223 return E_INVALIDARG;
225 if(This->mgrsite)
226 IInternetSecurityMgrSite_AddRef(This->mgrsite);
228 *ppSite = This->mgrsite;
229 return S_OK;
232 static HRESULT WINAPI SecManagerImpl_MapUrlToZone(IInternetSecurityManager *iface,
233 LPCWSTR pwszUrl, DWORD *pdwZone,
234 DWORD dwFlags)
236 SecManagerImpl *This = SECMGR_THIS(iface);
237 LPWSTR url;
238 DWORD size;
239 HRESULT hres;
241 TRACE("(%p)->(%s %p %08lx)\n", iface, debugstr_w(pwszUrl), pdwZone, dwFlags);
243 if(This->custom_manager) {
244 hres = IInternetSecurityManager_MapUrlToZone(This->custom_manager,
245 pwszUrl, pdwZone, dwFlags);
246 if(hres != INET_E_DEFAULT_ACTION)
247 return hres;
250 if(!pwszUrl)
251 return E_INVALIDARG;
253 if(dwFlags)
254 FIXME("not supported flags: %08lx\n", dwFlags);
256 size = (strlenW(pwszUrl)+16) * sizeof(WCHAR);
257 url = HeapAlloc(GetProcessHeap(), 0, size);
259 hres = CoInternetParseUrl(pwszUrl, PARSE_SECURITY_URL, 0, url, size/sizeof(WCHAR), &size, 0);
260 if(FAILED(hres))
261 memcpy(url, pwszUrl, size);
263 hres = map_url_to_zone(url, pdwZone);
265 HeapFree(GetProcessHeap(), 0, url);
267 return hres;
270 static HRESULT WINAPI SecManagerImpl_GetSecurityId(IInternetSecurityManager *iface,
271 LPCWSTR pwszUrl,
272 BYTE *pbSecurityId, DWORD *pcbSecurityId,
273 DWORD_PTR dwReserved)
275 SecManagerImpl *This = SECMGR_THIS(iface);
276 HRESULT hres;
278 TRACE("(%p)->(%s %p %p %08lx)\n", iface, debugstr_w(pwszUrl), pbSecurityId, pcbSecurityId,
279 dwReserved);
281 if(This->custom_manager) {
282 hres = IInternetSecurityManager_GetSecurityId(This->custom_manager,
283 pwszUrl, pbSecurityId, pcbSecurityId, dwReserved);
284 if(hres != INET_E_DEFAULT_ACTION)
285 return hres;
288 FIXME("Default action is not implemented\n");
289 return E_NOTIMPL;
293 static HRESULT WINAPI SecManagerImpl_ProcessUrlAction(IInternetSecurityManager *iface,
294 LPCWSTR pwszUrl, DWORD dwAction,
295 BYTE *pPolicy, DWORD cbPolicy,
296 BYTE *pContext, DWORD cbContext,
297 DWORD dwFlags, DWORD dwReserved)
299 SecManagerImpl *This = SECMGR_THIS(iface);
300 HRESULT hres;
302 TRACE("(%p)->(%s %08lx %p %08lx %p %08lx %08lx %08lx)\n", iface, debugstr_w(pwszUrl), dwAction,
303 pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved);
305 if(This->custom_manager) {
306 hres = IInternetSecurityManager_ProcessUrlAction(This->custom_manager, pwszUrl, dwAction,
307 pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved);
308 if(hres != INET_E_DEFAULT_ACTION)
309 return hres;
312 FIXME("Default action is not implemented\n");
313 return E_NOTIMPL;
317 static HRESULT WINAPI SecManagerImpl_QueryCustomPolicy(IInternetSecurityManager *iface,
318 LPCWSTR pwszUrl, REFGUID guidKey,
319 BYTE **ppPolicy, DWORD *pcbPolicy,
320 BYTE *pContext, DWORD cbContext,
321 DWORD dwReserved)
323 SecManagerImpl *This = SECMGR_THIS(iface);
324 HRESULT hres;
326 TRACE("(%p)->(%s %s %p %p %p %08lx %08lx )\n", iface, debugstr_w(pwszUrl), debugstr_guid(guidKey),
327 ppPolicy, pcbPolicy, pContext, cbContext, dwReserved);
329 if(This->custom_manager) {
330 hres = IInternetSecurityManager_QueryCustomPolicy(This->custom_manager, pwszUrl, guidKey,
331 ppPolicy, pcbPolicy, pContext, cbContext, dwReserved);
332 if(hres != INET_E_DEFAULT_ACTION)
333 return hres;
336 FIXME("Default action is not implemented\n");
337 return E_NOTIMPL;
340 static HRESULT WINAPI SecManagerImpl_SetZoneMapping(IInternetSecurityManager *iface,
341 DWORD dwZone, LPCWSTR pwszPattern, DWORD dwFlags)
343 SecManagerImpl *This = SECMGR_THIS(iface);
344 HRESULT hres;
346 TRACE("(%p)->(%08lx %s %08lx)\n", iface, dwZone, debugstr_w(pwszPattern),dwFlags);
348 if(This->custom_manager) {
349 hres = IInternetSecurityManager_SetZoneMapping(This->custom_manager, dwZone,
350 pwszPattern, dwFlags);
351 if(hres != INET_E_DEFAULT_ACTION)
352 return hres;
355 FIXME("Default action is not implemented\n");
356 return E_NOTIMPL;
359 static HRESULT WINAPI SecManagerImpl_GetZoneMappings(IInternetSecurityManager *iface,
360 DWORD dwZone, IEnumString **ppenumString, DWORD dwFlags)
362 SecManagerImpl *This = SECMGR_THIS(iface);
363 HRESULT hres;
365 TRACE("(%p)->(%08lx %p %08lx)\n", iface, dwZone, ppenumString,dwFlags);
367 if(This->custom_manager) {
368 hres = IInternetSecurityManager_GetZoneMappings(This->custom_manager, dwZone,
369 ppenumString, dwFlags);
370 if(hres != INET_E_DEFAULT_ACTION)
371 return hres;
374 FIXME("Default action is not implemented\n");
375 return E_NOTIMPL;
378 static const IInternetSecurityManagerVtbl VT_SecManagerImpl =
380 SecManagerImpl_QueryInterface,
381 SecManagerImpl_AddRef,
382 SecManagerImpl_Release,
383 SecManagerImpl_SetSecuritySite,
384 SecManagerImpl_GetSecuritySite,
385 SecManagerImpl_MapUrlToZone,
386 SecManagerImpl_GetSecurityId,
387 SecManagerImpl_ProcessUrlAction,
388 SecManagerImpl_QueryCustomPolicy,
389 SecManagerImpl_SetZoneMapping,
390 SecManagerImpl_GetZoneMappings
393 HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
395 SecManagerImpl *This;
397 TRACE("(%p,%p)\n",pUnkOuter,ppobj);
398 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
400 /* Initialize the virtual function table. */
401 This->lpInternetSecurityManagerVtbl = &VT_SecManagerImpl;
403 This->ref = 1;
404 This->mgrsite = NULL;
405 This->custom_manager = NULL;
407 *ppobj = This;
409 URLMON_LockModule();
411 return S_OK;
414 /***********************************************************************
415 * InternetZoneManager implementation
418 typedef struct {
419 const IInternetZoneManagerVtbl* lpVtbl;
420 LONG ref;
421 } ZoneMgrImpl;
423 static HRESULT open_zone_key(DWORD zone, HKEY *hkey, URLZONEREG zone_reg)
425 static const WCHAR wszZonesKey[] =
426 {'S','o','f','t','w','a','r','e','\\',
427 'M','i','c','r','o','s','o','f','t','\\',
428 'W','i','n','d','o','w','s','\\',
429 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
430 'I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s','\\',
431 'Z','o','n','e','s','\\',0};
432 static const WCHAR wszFormat[] = {'%','s','%','l','d',0};
434 WCHAR key_name[sizeof(wszZonesKey)/sizeof(WCHAR)+8];
435 HKEY parent_key;
436 DWORD res;
438 switch(zone_reg) {
439 case URLZONEREG_DEFAULT: /* FIXME: TEST */
440 case URLZONEREG_HKCU:
441 parent_key = HKEY_CURRENT_USER;
442 break;
443 case URLZONEREG_HKLM:
444 parent_key = HKEY_LOCAL_MACHINE;
445 break;
446 default:
447 WARN("Unknown URLZONEREG: %d\n", zone_reg);
448 return E_FAIL;
451 wsprintfW(key_name, wszFormat, wszZonesKey, zone);
453 res = RegOpenKeyW(parent_key, key_name, hkey);
455 if(res != ERROR_SUCCESS) {
456 WARN("RegOpenKey failed\n");
457 return E_INVALIDARG;
460 return S_OK;
463 /********************************************************************
464 * IInternetZoneManager_QueryInterface
466 static HRESULT WINAPI ZoneMgrImpl_QueryInterface(IInternetZoneManager* iface, REFIID riid, void** ppvObject)
468 ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
470 TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppvObject);
472 if(!This || !ppvObject)
473 return E_INVALIDARG;
475 if(!IsEqualIID(&IID_IUnknown, riid) && !IsEqualIID(&IID_IInternetZoneManager, riid)) {
476 FIXME("Unknown interface: %s\n", debugstr_guid(riid));
477 *ppvObject = NULL;
478 return E_NOINTERFACE;
481 *ppvObject = iface;
482 IInternetZoneManager_AddRef(iface);
484 return S_OK;
487 /********************************************************************
488 * IInternetZoneManager_AddRef
490 static ULONG WINAPI ZoneMgrImpl_AddRef(IInternetZoneManager* iface)
492 ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
493 ULONG refCount = InterlockedIncrement(&This->ref);
495 TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
497 return refCount;
500 /********************************************************************
501 * IInternetZoneManager_Release
503 static ULONG WINAPI ZoneMgrImpl_Release(IInternetZoneManager* iface)
505 ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
506 ULONG refCount = InterlockedDecrement(&This->ref);
508 TRACE("(%p)->(ref before=%lu)\n",This, refCount + 1);
510 if(!refCount) {
511 HeapFree(GetProcessHeap(), 0, This);
512 URLMON_UnlockModule();
515 return refCount;
518 /********************************************************************
519 * IInternetZoneManager_GetZoneAttributes
521 static HRESULT WINAPI ZoneMgrImpl_GetZoneAttributes(IInternetZoneManager* iface,
522 DWORD dwZone,
523 ZONEATTRIBUTES* pZoneAttributes)
525 FIXME("(%p)->(%ld %p) stub\n", iface, dwZone, pZoneAttributes);
526 return E_NOTIMPL;
529 /********************************************************************
530 * IInternetZoneManager_SetZoneAttributes
532 static HRESULT WINAPI ZoneMgrImpl_SetZoneAttributes(IInternetZoneManager* iface,
533 DWORD dwZone,
534 ZONEATTRIBUTES* pZoneAttributes)
536 FIXME("(%p)->(%08lx %p) stub\n", iface, dwZone, pZoneAttributes);
537 return E_NOTIMPL;
540 /********************************************************************
541 * IInternetZoneManager_GetZoneCustomPolicy
543 static HRESULT WINAPI ZoneMgrImpl_GetZoneCustomPolicy(IInternetZoneManager* iface,
544 DWORD dwZone,
545 REFGUID guidKey,
546 BYTE** ppPolicy,
547 DWORD* pcbPolicy,
548 URLZONEREG ulrZoneReg)
550 FIXME("(%p)->(%08lx %s %p %p %08x) stub\n", iface, dwZone, debugstr_guid(guidKey),
551 ppPolicy, pcbPolicy, ulrZoneReg);
552 return E_NOTIMPL;
555 /********************************************************************
556 * IInternetZoneManager_SetZoneCustomPolicy
558 static HRESULT WINAPI ZoneMgrImpl_SetZoneCustomPolicy(IInternetZoneManager* iface,
559 DWORD dwZone,
560 REFGUID guidKey,
561 BYTE* ppPolicy,
562 DWORD cbPolicy,
563 URLZONEREG ulrZoneReg)
565 FIXME("(%p)->(%08lx %s %p %08lx %08x) stub\n", iface, dwZone, debugstr_guid(guidKey),
566 ppPolicy, cbPolicy, ulrZoneReg);
567 return E_NOTIMPL;
570 /********************************************************************
571 * IInternetZoneManager_GetZoneActionPolicy
573 static HRESULT WINAPI ZoneMgrImpl_GetZoneActionPolicy(IInternetZoneManager* iface,
574 DWORD dwZone, DWORD dwAction, BYTE* pPolicy, DWORD cbPolicy, URLZONEREG urlZoneReg)
576 WCHAR action[16];
577 HKEY hkey;
578 LONG res;
579 DWORD size = cbPolicy;
580 HRESULT hres;
582 static const WCHAR wszFormat[] = {'%','l','X',0};
584 TRACE("(%p)->(%ld %08lx %p %ld %d)\n", iface, dwZone, dwAction, pPolicy,
585 cbPolicy, urlZoneReg);
587 if(!pPolicy)
588 return E_INVALIDARG;
590 hres = open_zone_key(dwZone, &hkey, urlZoneReg);
591 if(FAILED(hres))
592 return hres;
594 wsprintfW(action, wszFormat, dwAction);
596 res = RegQueryValueExW(hkey, action, NULL, NULL, pPolicy, &size);
597 if(res == ERROR_MORE_DATA) {
598 hres = E_INVALIDARG;
599 }else if(res == ERROR_FILE_NOT_FOUND) {
600 hres = E_FAIL;
601 }else if(res != ERROR_SUCCESS) {
602 ERR("RegQueryValue failed: %ld\n", res);
603 hres = E_UNEXPECTED;
606 RegCloseKey(hkey);
608 return hres;
611 /********************************************************************
612 * IInternetZoneManager_SetZoneActionPolicy
614 static HRESULT WINAPI ZoneMgrImpl_SetZoneActionPolicy(IInternetZoneManager* iface,
615 DWORD dwZone,
616 DWORD dwAction,
617 BYTE* pPolicy,
618 DWORD cbPolicy,
619 URLZONEREG urlZoneReg)
621 FIXME("(%p)->(%08lx %08lx %p %08lx %08x) stub\n", iface, dwZone, dwAction, pPolicy,
622 cbPolicy, urlZoneReg);
623 return E_NOTIMPL;
626 /********************************************************************
627 * IInternetZoneManager_PromptAction
629 static HRESULT WINAPI ZoneMgrImpl_PromptAction(IInternetZoneManager* iface,
630 DWORD dwAction,
631 HWND hwndParent,
632 LPCWSTR pwszUrl,
633 LPCWSTR pwszText,
634 DWORD dwPromptFlags)
636 FIXME("%p %08lx %p %s %s %08lx\n", iface, dwAction, hwndParent,
637 debugstr_w(pwszUrl), debugstr_w(pwszText), dwPromptFlags );
638 return E_NOTIMPL;
641 /********************************************************************
642 * IInternetZoneManager_LogAction
644 static HRESULT WINAPI ZoneMgrImpl_LogAction(IInternetZoneManager* iface,
645 DWORD dwAction,
646 LPCWSTR pwszUrl,
647 LPCWSTR pwszText,
648 DWORD dwLogFlags)
650 FIXME("(%p)->(%08lx %s %s %08lx) stub\n", iface, dwAction, debugstr_w(pwszUrl),
651 debugstr_w(pwszText), dwLogFlags);
652 return E_NOTIMPL;
655 /********************************************************************
656 * IInternetZoneManager_CreateZoneEnumerator
658 static HRESULT WINAPI ZoneMgrImpl_CreateZoneEnumerator(IInternetZoneManager* iface,
659 DWORD* pdwEnum,
660 DWORD* pdwCount,
661 DWORD dwFlags)
663 FIXME("(%p)->(%p %p %08lx) stub\n", iface, pdwEnum, pdwCount, dwFlags);
664 return E_NOTIMPL;
667 /********************************************************************
668 * IInternetZoneManager_GetZoneAt
670 static HRESULT WINAPI ZoneMgrImpl_GetZoneAt(IInternetZoneManager* iface,
671 DWORD dwEnum,
672 DWORD dwIndex,
673 DWORD* pdwZone)
675 FIXME("(%p)->(%08lx %08lx %p) stub\n", iface, dwEnum, dwIndex, pdwZone);
676 return E_NOTIMPL;
679 /********************************************************************
680 * IInternetZoneManager_DestroyZoneEnumerator
682 static HRESULT WINAPI ZoneMgrImpl_DestroyZoneEnumerator(IInternetZoneManager* iface,
683 DWORD dwEnum)
685 FIXME("(%p)->(%08lx) stub\n", iface, dwEnum);
686 return E_NOTIMPL;
689 /********************************************************************
690 * IInternetZoneManager_CopyTemplatePoliciesToZone
692 static HRESULT WINAPI ZoneMgrImpl_CopyTemplatePoliciesToZone(IInternetZoneManager* iface,
693 DWORD dwTemplate,
694 DWORD dwZone,
695 DWORD dwReserved)
697 FIXME("(%p)->(%08lx %08lx %08lx) stub\n", iface, dwTemplate, dwZone, dwReserved);
698 return E_NOTIMPL;
701 /********************************************************************
702 * IInternetZoneManager_Construct
704 static const IInternetZoneManagerVtbl ZoneMgrImplVtbl = {
705 ZoneMgrImpl_QueryInterface,
706 ZoneMgrImpl_AddRef,
707 ZoneMgrImpl_Release,
708 ZoneMgrImpl_GetZoneAttributes,
709 ZoneMgrImpl_SetZoneAttributes,
710 ZoneMgrImpl_GetZoneCustomPolicy,
711 ZoneMgrImpl_SetZoneCustomPolicy,
712 ZoneMgrImpl_GetZoneActionPolicy,
713 ZoneMgrImpl_SetZoneActionPolicy,
714 ZoneMgrImpl_PromptAction,
715 ZoneMgrImpl_LogAction,
716 ZoneMgrImpl_CreateZoneEnumerator,
717 ZoneMgrImpl_GetZoneAt,
718 ZoneMgrImpl_DestroyZoneEnumerator,
719 ZoneMgrImpl_CopyTemplatePoliciesToZone,
722 HRESULT ZoneMgrImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
724 ZoneMgrImpl* ret = HeapAlloc(GetProcessHeap(), 0, sizeof(ZoneMgrImpl));
726 TRACE("(%p %p)\n", pUnkOuter, ppobj);
727 ret->lpVtbl = &ZoneMgrImplVtbl;
728 ret->ref = 1;
729 *ppobj = (IInternetZoneManager*)ret;
731 URLMON_LockModule();
733 return S_OK;
736 /***********************************************************************
737 * CoInternetCreateSecurityManager (URLMON.@)
740 HRESULT WINAPI CoInternetCreateSecurityManager( IServiceProvider *pSP,
741 IInternetSecurityManager **ppSM, DWORD dwReserved )
743 TRACE("%p %p %ld\n", pSP, ppSM, dwReserved );
745 if(pSP)
746 FIXME("pSP not supported\n");
748 return SecManagerImpl_Construct(NULL, (void**) ppSM);
751 /********************************************************************
752 * CoInternetCreateZoneManager (URLMON.@)
754 HRESULT WINAPI CoInternetCreateZoneManager(IServiceProvider* pSP, IInternetZoneManager** ppZM, DWORD dwReserved)
756 TRACE("(%p %p %lx)\n", pSP, ppZM, dwReserved);
757 return ZoneMgrImpl_Construct(NULL, (void**)ppZM);