winex11.drv: Add an optimized path for BitBlt(SRCINVERT).
[wine/multimedia.git] / dlls / urlmon / sec_mgr.c
blob0b56ba4e7004c74f0443e0d07e5e64c867669d55
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include <stdio.h>
24 #include "urlmon_main.h"
25 #include "winreg.h"
27 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
31 /***********************************************************************
32 * InternetSecurityManager implementation
35 typedef struct {
36 const IInternetSecurityManagerVtbl* lpInternetSecurityManagerVtbl;
38 LONG ref;
40 IInternetSecurityMgrSite *mgrsite;
41 IInternetSecurityManager *custom_manager;
42 } SecManagerImpl;
44 #define SECMGR_THIS(iface) DEFINE_THIS(SecManagerImpl, InternetSecurityManager, iface)
46 static HRESULT map_url_to_zone(LPCWSTR url, DWORD *zone)
48 WCHAR schema[64];
49 DWORD res, size=0;
50 HKEY hkey;
51 HRESULT hres;
53 static const WCHAR wszZoneMapProtocolKey[] =
54 {'S','o','f','t','w','a','r','e','\\',
55 'M','i','c','r','o','s','o','f','t','\\',
56 'W','i','n','d','o','w','s','\\',
57 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
58 'I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s','\\',
59 'Z','o','n','e','M','a','p','\\',
60 'P','r','o','t','o','c','o','l','D','e','f','a','u','l','t','s',0};
61 static const WCHAR wszFile[] = {'f','i','l','e',0};
63 *zone = -1;
65 hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, schema, sizeof(schema)/sizeof(WCHAR), &size, 0);
66 if(FAILED(hres))
67 return hres;
68 if(!*schema)
69 return 0x80041001;
71 /* file protocol is a special case */
72 if(!strcmpW(schema, wszFile)) {
73 WCHAR path[MAX_PATH];
75 hres = CoInternetParseUrl(url, PARSE_PATH_FROM_URL, 0, path,
76 sizeof(path)/sizeof(WCHAR), &size, 0);
78 if(SUCCEEDED(hres) && strchrW(path, '\\')) {
79 *zone = 0;
80 return S_OK;
84 WARN("domains are not yet implemented\n");
86 res = RegOpenKeyW(HKEY_CURRENT_USER, wszZoneMapProtocolKey, &hkey);
87 if(res != ERROR_SUCCESS) {
88 ERR("Could not open key %s\n", debugstr_w(wszZoneMapProtocolKey));
89 return E_UNEXPECTED;
92 size = sizeof(DWORD);
93 res = RegQueryValueExW(hkey, schema, NULL, NULL, (PBYTE)zone, &size);
94 RegCloseKey(hkey);
95 if(res == ERROR_SUCCESS)
96 return S_OK;
98 res = RegOpenKeyW(HKEY_LOCAL_MACHINE, wszZoneMapProtocolKey, &hkey);
99 if(res != ERROR_SUCCESS) {
100 ERR("Could not open key %s\n", debugstr_w(wszZoneMapProtocolKey));
101 return E_UNEXPECTED;
104 size = sizeof(DWORD);
105 res = RegQueryValueExW(hkey, schema, NULL, NULL, (PBYTE)zone, &size);
106 RegCloseKey(hkey);
107 if(res == ERROR_SUCCESS)
108 return S_OK;
110 *zone = 3;
111 return S_OK;
114 static HRESULT WINAPI SecManagerImpl_QueryInterface(IInternetSecurityManager* iface,REFIID riid,void** ppvObject)
116 SecManagerImpl *This = SECMGR_THIS(iface);
118 TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppvObject);
120 /* Perform a sanity check on the parameters.*/
121 if ( (This==0) || (ppvObject==0) )
122 return E_INVALIDARG;
124 /* Initialize the return parameter */
125 *ppvObject = 0;
127 /* Compare the riid with the interface IDs implemented by this object.*/
128 if (IsEqualIID(&IID_IUnknown, riid) ||
129 IsEqualIID(&IID_IInternetSecurityManager, riid))
130 *ppvObject = iface;
132 /* Check that we obtained an interface.*/
133 if (!*ppvObject) {
134 WARN("not supported interface %s\n", debugstr_guid(riid));
135 return E_NOINTERFACE;
138 /* Query Interface always increases the reference count by one when it is successful */
139 IInternetSecurityManager_AddRef(iface);
141 return S_OK;
144 static ULONG WINAPI SecManagerImpl_AddRef(IInternetSecurityManager* iface)
146 SecManagerImpl *This = SECMGR_THIS(iface);
147 ULONG refCount = InterlockedIncrement(&This->ref);
149 TRACE("(%p) ref=%u\n", This, refCount);
151 return refCount;
154 static ULONG WINAPI SecManagerImpl_Release(IInternetSecurityManager* iface)
156 SecManagerImpl *This = SECMGR_THIS(iface);
157 ULONG refCount = InterlockedDecrement(&This->ref);
159 TRACE("(%p) ref=%u\n", This, refCount);
161 /* destroy the object if there's no more reference on it */
162 if (!refCount){
163 if(This->mgrsite)
164 IInternetSecurityMgrSite_Release(This->mgrsite);
165 if(This->custom_manager)
166 IInternetSecurityManager_Release(This->custom_manager);
168 heap_free(This);
170 URLMON_UnlockModule();
173 return refCount;
176 static HRESULT WINAPI SecManagerImpl_SetSecuritySite(IInternetSecurityManager *iface,
177 IInternetSecurityMgrSite *pSite)
179 SecManagerImpl *This = SECMGR_THIS(iface);
181 TRACE("(%p)->(%p)\n", This, pSite);
183 if(This->mgrsite)
184 IInternetSecurityMgrSite_Release(This->mgrsite);
186 if(This->custom_manager) {
187 IInternetSecurityManager_Release(This->custom_manager);
188 This->custom_manager = NULL;
191 This->mgrsite = pSite;
193 if(pSite) {
194 IServiceProvider *servprov;
195 HRESULT hres;
197 IInternetSecurityMgrSite_AddRef(pSite);
199 hres = IInternetSecurityMgrSite_QueryInterface(pSite, &IID_IServiceProvider,
200 (void**)&servprov);
201 if(SUCCEEDED(hres)) {
202 IServiceProvider_QueryService(servprov, &SID_SInternetSecurityManager,
203 &IID_IInternetSecurityManager, (void**)&This->custom_manager);
204 IServiceProvider_Release(servprov);
208 return S_OK;
211 static HRESULT WINAPI SecManagerImpl_GetSecuritySite(IInternetSecurityManager *iface,
212 IInternetSecurityMgrSite **ppSite)
214 SecManagerImpl *This = SECMGR_THIS(iface);
216 TRACE("(%p)->(%p)\n", This, ppSite);
218 if(!ppSite)
219 return E_INVALIDARG;
221 if(This->mgrsite)
222 IInternetSecurityMgrSite_AddRef(This->mgrsite);
224 *ppSite = This->mgrsite;
225 return S_OK;
228 static HRESULT WINAPI SecManagerImpl_MapUrlToZone(IInternetSecurityManager *iface,
229 LPCWSTR pwszUrl, DWORD *pdwZone,
230 DWORD dwFlags)
232 SecManagerImpl *This = SECMGR_THIS(iface);
233 LPWSTR url;
234 DWORD size;
235 HRESULT hres;
237 TRACE("(%p)->(%s %p %08x)\n", iface, debugstr_w(pwszUrl), pdwZone, dwFlags);
239 if(This->custom_manager) {
240 hres = IInternetSecurityManager_MapUrlToZone(This->custom_manager,
241 pwszUrl, pdwZone, dwFlags);
242 if(hres != INET_E_DEFAULT_ACTION)
243 return hres;
246 if(!pwszUrl) {
247 *pdwZone = -1;
248 return E_INVALIDARG;
251 if(dwFlags)
252 FIXME("not supported flags: %08x\n", dwFlags);
254 size = (strlenW(pwszUrl)+16) * sizeof(WCHAR);
255 url = heap_alloc(size);
257 hres = CoInternetParseUrl(pwszUrl, PARSE_SECURITY_URL, 0, url, size/sizeof(WCHAR), &size, 0);
258 if(FAILED(hres))
259 memcpy(url, pwszUrl, size);
261 hres = map_url_to_zone(url, pdwZone);
263 heap_free(url);
265 return hres;
268 static HRESULT WINAPI SecManagerImpl_GetSecurityId(IInternetSecurityManager *iface,
269 LPCWSTR pwszUrl, BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved)
271 SecManagerImpl *This = SECMGR_THIS(iface);
272 LPWSTR buf, ptr, ptr2;
273 DWORD size, zone, len;
274 HRESULT hres;
276 static const WCHAR wszFile[] = {'f','i','l','e',':'};
278 TRACE("(%p)->(%s %p %p %08lx)\n", iface, debugstr_w(pwszUrl), pbSecurityId,
279 pcbSecurityId, 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 if(!pwszUrl || !pbSecurityId || !pcbSecurityId)
289 return E_INVALIDARG;
291 if(dwReserved)
292 FIXME("dwReserved is not supported\n");
294 len = strlenW(pwszUrl)+1;
295 buf = heap_alloc((len+16)*sizeof(WCHAR));
297 hres = CoInternetParseUrl(pwszUrl, PARSE_SECURITY_URL, 0, buf, len, &size, 0);
298 if(FAILED(hres))
299 memcpy(buf, pwszUrl, len*sizeof(WCHAR));
301 hres = map_url_to_zone(buf, &zone);
302 if(FAILED(hres)) {
303 heap_free(buf);
304 return hres == 0x80041001 ? E_INVALIDARG : hres;
307 /* file protocol is a special case */
308 if(strlenW(pwszUrl) >= sizeof(wszFile)/sizeof(WCHAR)
309 && !memcmp(buf, wszFile, sizeof(wszFile))) {
311 static const BYTE secidFile[] = {'f','i','l','e',':'};
313 heap_free(buf);
315 if(*pcbSecurityId < sizeof(secidFile)+sizeof(zone))
316 return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
318 memcpy(pbSecurityId, secidFile, sizeof(secidFile));
319 *(DWORD*)(pbSecurityId+sizeof(secidFile)) = zone;
321 *pcbSecurityId = sizeof(secidFile)+sizeof(zone);
322 return S_OK;
325 ptr = strchrW(buf, ':');
326 ptr2 = ++ptr;
327 while(*ptr2 == '/')
328 ptr2++;
329 if(ptr2 != ptr)
330 memmove(ptr, ptr2, (strlenW(ptr2)+1)*sizeof(WCHAR));
332 ptr = strchrW(ptr, '/');
333 if(ptr)
334 *ptr = 0;
336 len = WideCharToMultiByte(CP_ACP, 0, buf, -1, NULL, 0, NULL, NULL)-1;
338 if(len+sizeof(DWORD) > *pcbSecurityId) {
339 heap_free(buf);
340 return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
343 WideCharToMultiByte(CP_ACP, 0, buf, -1, (LPSTR)pbSecurityId, -1, NULL, NULL);
344 heap_free(buf);
346 *(DWORD*)(pbSecurityId+len) = zone;
348 *pcbSecurityId = len+sizeof(DWORD);
350 return S_OK;
354 static HRESULT WINAPI SecManagerImpl_ProcessUrlAction(IInternetSecurityManager *iface,
355 LPCWSTR pwszUrl, DWORD dwAction,
356 BYTE *pPolicy, DWORD cbPolicy,
357 BYTE *pContext, DWORD cbContext,
358 DWORD dwFlags, DWORD dwReserved)
360 SecManagerImpl *This = SECMGR_THIS(iface);
361 HRESULT hres;
363 TRACE("(%p)->(%s %08x %p %08x %p %08x %08x %08x)\n", iface, debugstr_w(pwszUrl), dwAction,
364 pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved);
366 if(This->custom_manager) {
367 hres = IInternetSecurityManager_ProcessUrlAction(This->custom_manager, pwszUrl, dwAction,
368 pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved);
369 if(hres != INET_E_DEFAULT_ACTION)
370 return hres;
373 FIXME("Default action is not implemented\n");
374 return E_NOTIMPL;
378 static HRESULT WINAPI SecManagerImpl_QueryCustomPolicy(IInternetSecurityManager *iface,
379 LPCWSTR pwszUrl, REFGUID guidKey,
380 BYTE **ppPolicy, DWORD *pcbPolicy,
381 BYTE *pContext, DWORD cbContext,
382 DWORD dwReserved)
384 SecManagerImpl *This = SECMGR_THIS(iface);
385 HRESULT hres;
387 TRACE("(%p)->(%s %s %p %p %p %08x %08x )\n", iface, debugstr_w(pwszUrl), debugstr_guid(guidKey),
388 ppPolicy, pcbPolicy, pContext, cbContext, dwReserved);
390 if(This->custom_manager) {
391 hres = IInternetSecurityManager_QueryCustomPolicy(This->custom_manager, pwszUrl, guidKey,
392 ppPolicy, pcbPolicy, pContext, cbContext, dwReserved);
393 if(hres != INET_E_DEFAULT_ACTION)
394 return hres;
397 FIXME("Default action is not implemented\n");
398 return E_NOTIMPL;
401 static HRESULT WINAPI SecManagerImpl_SetZoneMapping(IInternetSecurityManager *iface,
402 DWORD dwZone, LPCWSTR pwszPattern, DWORD dwFlags)
404 SecManagerImpl *This = SECMGR_THIS(iface);
405 HRESULT hres;
407 TRACE("(%p)->(%08x %s %08x)\n", iface, dwZone, debugstr_w(pwszPattern),dwFlags);
409 if(This->custom_manager) {
410 hres = IInternetSecurityManager_SetZoneMapping(This->custom_manager, dwZone,
411 pwszPattern, dwFlags);
412 if(hres != INET_E_DEFAULT_ACTION)
413 return hres;
416 FIXME("Default action is not implemented\n");
417 return E_NOTIMPL;
420 static HRESULT WINAPI SecManagerImpl_GetZoneMappings(IInternetSecurityManager *iface,
421 DWORD dwZone, IEnumString **ppenumString, DWORD dwFlags)
423 SecManagerImpl *This = SECMGR_THIS(iface);
424 HRESULT hres;
426 TRACE("(%p)->(%08x %p %08x)\n", iface, dwZone, ppenumString,dwFlags);
428 if(This->custom_manager) {
429 hres = IInternetSecurityManager_GetZoneMappings(This->custom_manager, dwZone,
430 ppenumString, dwFlags);
431 if(hres != INET_E_DEFAULT_ACTION)
432 return hres;
435 FIXME("Default action is not implemented\n");
436 return E_NOTIMPL;
439 static const IInternetSecurityManagerVtbl VT_SecManagerImpl =
441 SecManagerImpl_QueryInterface,
442 SecManagerImpl_AddRef,
443 SecManagerImpl_Release,
444 SecManagerImpl_SetSecuritySite,
445 SecManagerImpl_GetSecuritySite,
446 SecManagerImpl_MapUrlToZone,
447 SecManagerImpl_GetSecurityId,
448 SecManagerImpl_ProcessUrlAction,
449 SecManagerImpl_QueryCustomPolicy,
450 SecManagerImpl_SetZoneMapping,
451 SecManagerImpl_GetZoneMappings
454 HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
456 SecManagerImpl *This;
458 TRACE("(%p,%p)\n",pUnkOuter,ppobj);
459 This = heap_alloc(sizeof(*This));
461 /* Initialize the virtual function table. */
462 This->lpInternetSecurityManagerVtbl = &VT_SecManagerImpl;
464 This->ref = 1;
465 This->mgrsite = NULL;
466 This->custom_manager = NULL;
468 *ppobj = This;
470 URLMON_LockModule();
472 return S_OK;
475 /***********************************************************************
476 * InternetZoneManager implementation
479 typedef struct {
480 const IInternetZoneManagerVtbl* lpVtbl;
481 LONG ref;
482 } ZoneMgrImpl;
484 static HRESULT open_zone_key(DWORD zone, HKEY *hkey, URLZONEREG zone_reg)
486 static const WCHAR wszZonesKey[] =
487 {'S','o','f','t','w','a','r','e','\\',
488 'M','i','c','r','o','s','o','f','t','\\',
489 'W','i','n','d','o','w','s','\\',
490 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
491 'I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s','\\',
492 'Z','o','n','e','s','\\',0};
493 static const WCHAR wszFormat[] = {'%','s','%','l','d',0};
495 WCHAR key_name[sizeof(wszZonesKey)/sizeof(WCHAR)+8];
496 HKEY parent_key;
497 DWORD res;
499 switch(zone_reg) {
500 case URLZONEREG_DEFAULT: /* FIXME: TEST */
501 case URLZONEREG_HKCU:
502 parent_key = HKEY_CURRENT_USER;
503 break;
504 case URLZONEREG_HKLM:
505 parent_key = HKEY_LOCAL_MACHINE;
506 break;
507 default:
508 WARN("Unknown URLZONEREG: %d\n", zone_reg);
509 return E_FAIL;
512 wsprintfW(key_name, wszFormat, wszZonesKey, zone);
514 res = RegOpenKeyW(parent_key, key_name, hkey);
516 if(res != ERROR_SUCCESS) {
517 WARN("RegOpenKey failed\n");
518 return E_INVALIDARG;
521 return S_OK;
524 /********************************************************************
525 * IInternetZoneManager_QueryInterface
527 static HRESULT WINAPI ZoneMgrImpl_QueryInterface(IInternetZoneManager* iface, REFIID riid, void** ppvObject)
529 ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
531 TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppvObject);
533 if(!This || !ppvObject)
534 return E_INVALIDARG;
536 if(!IsEqualIID(&IID_IUnknown, riid) && !IsEqualIID(&IID_IInternetZoneManager, riid)) {
537 FIXME("Unknown interface: %s\n", debugstr_guid(riid));
538 *ppvObject = NULL;
539 return E_NOINTERFACE;
542 *ppvObject = iface;
543 IInternetZoneManager_AddRef(iface);
545 return S_OK;
548 /********************************************************************
549 * IInternetZoneManager_AddRef
551 static ULONG WINAPI ZoneMgrImpl_AddRef(IInternetZoneManager* iface)
553 ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
554 ULONG refCount = InterlockedIncrement(&This->ref);
556 TRACE("(%p)->(ref before=%u)\n",This, refCount - 1);
558 return refCount;
561 /********************************************************************
562 * IInternetZoneManager_Release
564 static ULONG WINAPI ZoneMgrImpl_Release(IInternetZoneManager* iface)
566 ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
567 ULONG refCount = InterlockedDecrement(&This->ref);
569 TRACE("(%p)->(ref before=%u)\n",This, refCount + 1);
571 if(!refCount) {
572 heap_free(This);
573 URLMON_UnlockModule();
576 return refCount;
579 /********************************************************************
580 * IInternetZoneManager_GetZoneAttributes
582 static HRESULT WINAPI ZoneMgrImpl_GetZoneAttributes(IInternetZoneManager* iface,
583 DWORD dwZone,
584 ZONEATTRIBUTES* pZoneAttributes)
586 FIXME("(%p)->(%d %p) stub\n", iface, dwZone, pZoneAttributes);
587 return E_NOTIMPL;
590 /********************************************************************
591 * IInternetZoneManager_SetZoneAttributes
593 static HRESULT WINAPI ZoneMgrImpl_SetZoneAttributes(IInternetZoneManager* iface,
594 DWORD dwZone,
595 ZONEATTRIBUTES* pZoneAttributes)
597 FIXME("(%p)->(%08x %p) stub\n", iface, dwZone, pZoneAttributes);
598 return E_NOTIMPL;
601 /********************************************************************
602 * IInternetZoneManager_GetZoneCustomPolicy
604 static HRESULT WINAPI ZoneMgrImpl_GetZoneCustomPolicy(IInternetZoneManager* iface,
605 DWORD dwZone,
606 REFGUID guidKey,
607 BYTE** ppPolicy,
608 DWORD* pcbPolicy,
609 URLZONEREG ulrZoneReg)
611 FIXME("(%p)->(%08x %s %p %p %08x) stub\n", iface, dwZone, debugstr_guid(guidKey),
612 ppPolicy, pcbPolicy, ulrZoneReg);
613 return E_NOTIMPL;
616 /********************************************************************
617 * IInternetZoneManager_SetZoneCustomPolicy
619 static HRESULT WINAPI ZoneMgrImpl_SetZoneCustomPolicy(IInternetZoneManager* iface,
620 DWORD dwZone,
621 REFGUID guidKey,
622 BYTE* ppPolicy,
623 DWORD cbPolicy,
624 URLZONEREG ulrZoneReg)
626 FIXME("(%p)->(%08x %s %p %08x %08x) stub\n", iface, dwZone, debugstr_guid(guidKey),
627 ppPolicy, cbPolicy, ulrZoneReg);
628 return E_NOTIMPL;
631 /********************************************************************
632 * IInternetZoneManager_GetZoneActionPolicy
634 static HRESULT WINAPI ZoneMgrImpl_GetZoneActionPolicy(IInternetZoneManager* iface,
635 DWORD dwZone, DWORD dwAction, BYTE* pPolicy, DWORD cbPolicy, URLZONEREG urlZoneReg)
637 WCHAR action[16];
638 HKEY hkey;
639 LONG res;
640 DWORD size = cbPolicy;
641 HRESULT hres;
643 static const WCHAR wszFormat[] = {'%','l','X',0};
645 TRACE("(%p)->(%d %08x %p %d %d)\n", iface, dwZone, dwAction, pPolicy,
646 cbPolicy, urlZoneReg);
648 if(!pPolicy)
649 return E_INVALIDARG;
651 hres = open_zone_key(dwZone, &hkey, urlZoneReg);
652 if(FAILED(hres))
653 return hres;
655 wsprintfW(action, wszFormat, dwAction);
657 res = RegQueryValueExW(hkey, action, NULL, NULL, pPolicy, &size);
658 if(res == ERROR_MORE_DATA) {
659 hres = E_INVALIDARG;
660 }else if(res == ERROR_FILE_NOT_FOUND) {
661 hres = E_FAIL;
662 }else if(res != ERROR_SUCCESS) {
663 ERR("RegQueryValue failed: %d\n", res);
664 hres = E_UNEXPECTED;
667 RegCloseKey(hkey);
669 return hres;
672 /********************************************************************
673 * IInternetZoneManager_SetZoneActionPolicy
675 static HRESULT WINAPI ZoneMgrImpl_SetZoneActionPolicy(IInternetZoneManager* iface,
676 DWORD dwZone,
677 DWORD dwAction,
678 BYTE* pPolicy,
679 DWORD cbPolicy,
680 URLZONEREG urlZoneReg)
682 FIXME("(%p)->(%08x %08x %p %08x %08x) stub\n", iface, dwZone, dwAction, pPolicy,
683 cbPolicy, urlZoneReg);
684 return E_NOTIMPL;
687 /********************************************************************
688 * IInternetZoneManager_PromptAction
690 static HRESULT WINAPI ZoneMgrImpl_PromptAction(IInternetZoneManager* iface,
691 DWORD dwAction,
692 HWND hwndParent,
693 LPCWSTR pwszUrl,
694 LPCWSTR pwszText,
695 DWORD dwPromptFlags)
697 FIXME("%p %08x %p %s %s %08x\n", iface, dwAction, hwndParent,
698 debugstr_w(pwszUrl), debugstr_w(pwszText), dwPromptFlags );
699 return E_NOTIMPL;
702 /********************************************************************
703 * IInternetZoneManager_LogAction
705 static HRESULT WINAPI ZoneMgrImpl_LogAction(IInternetZoneManager* iface,
706 DWORD dwAction,
707 LPCWSTR pwszUrl,
708 LPCWSTR pwszText,
709 DWORD dwLogFlags)
711 FIXME("(%p)->(%08x %s %s %08x) stub\n", iface, dwAction, debugstr_w(pwszUrl),
712 debugstr_w(pwszText), dwLogFlags);
713 return E_NOTIMPL;
716 /********************************************************************
717 * IInternetZoneManager_CreateZoneEnumerator
719 static HRESULT WINAPI ZoneMgrImpl_CreateZoneEnumerator(IInternetZoneManager* iface,
720 DWORD* pdwEnum,
721 DWORD* pdwCount,
722 DWORD dwFlags)
724 FIXME("(%p)->(%p %p %08x) stub\n", iface, pdwEnum, pdwCount, dwFlags);
725 return E_NOTIMPL;
728 /********************************************************************
729 * IInternetZoneManager_GetZoneAt
731 static HRESULT WINAPI ZoneMgrImpl_GetZoneAt(IInternetZoneManager* iface,
732 DWORD dwEnum,
733 DWORD dwIndex,
734 DWORD* pdwZone)
736 FIXME("(%p)->(%08x %08x %p) stub\n", iface, dwEnum, dwIndex, pdwZone);
737 return E_NOTIMPL;
740 /********************************************************************
741 * IInternetZoneManager_DestroyZoneEnumerator
743 static HRESULT WINAPI ZoneMgrImpl_DestroyZoneEnumerator(IInternetZoneManager* iface,
744 DWORD dwEnum)
746 FIXME("(%p)->(%08x) stub\n", iface, dwEnum);
747 return E_NOTIMPL;
750 /********************************************************************
751 * IInternetZoneManager_CopyTemplatePoliciesToZone
753 static HRESULT WINAPI ZoneMgrImpl_CopyTemplatePoliciesToZone(IInternetZoneManager* iface,
754 DWORD dwTemplate,
755 DWORD dwZone,
756 DWORD dwReserved)
758 FIXME("(%p)->(%08x %08x %08x) stub\n", iface, dwTemplate, dwZone, dwReserved);
759 return E_NOTIMPL;
762 /********************************************************************
763 * IInternetZoneManager_Construct
765 static const IInternetZoneManagerVtbl ZoneMgrImplVtbl = {
766 ZoneMgrImpl_QueryInterface,
767 ZoneMgrImpl_AddRef,
768 ZoneMgrImpl_Release,
769 ZoneMgrImpl_GetZoneAttributes,
770 ZoneMgrImpl_SetZoneAttributes,
771 ZoneMgrImpl_GetZoneCustomPolicy,
772 ZoneMgrImpl_SetZoneCustomPolicy,
773 ZoneMgrImpl_GetZoneActionPolicy,
774 ZoneMgrImpl_SetZoneActionPolicy,
775 ZoneMgrImpl_PromptAction,
776 ZoneMgrImpl_LogAction,
777 ZoneMgrImpl_CreateZoneEnumerator,
778 ZoneMgrImpl_GetZoneAt,
779 ZoneMgrImpl_DestroyZoneEnumerator,
780 ZoneMgrImpl_CopyTemplatePoliciesToZone,
783 HRESULT ZoneMgrImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
785 ZoneMgrImpl* ret = heap_alloc(sizeof(ZoneMgrImpl));
787 TRACE("(%p %p)\n", pUnkOuter, ppobj);
788 ret->lpVtbl = &ZoneMgrImplVtbl;
789 ret->ref = 1;
790 *ppobj = (IInternetZoneManager*)ret;
792 URLMON_LockModule();
794 return S_OK;
797 /***********************************************************************
798 * CoInternetCreateSecurityManager (URLMON.@)
801 HRESULT WINAPI CoInternetCreateSecurityManager( IServiceProvider *pSP,
802 IInternetSecurityManager **ppSM, DWORD dwReserved )
804 TRACE("%p %p %d\n", pSP, ppSM, dwReserved );
806 if(pSP)
807 FIXME("pSP not supported\n");
809 return SecManagerImpl_Construct(NULL, (void**) ppSM);
812 /********************************************************************
813 * CoInternetCreateZoneManager (URLMON.@)
815 HRESULT WINAPI CoInternetCreateZoneManager(IServiceProvider* pSP, IInternetZoneManager** ppZM, DWORD dwReserved)
817 TRACE("(%p %p %x)\n", pSP, ppZM, dwReserved);
818 return ZoneMgrImpl_Construct(NULL, (void**)ppZM);