2 * Copyright 2009 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
31 #include "wine/debug.h"
33 #include "mshtml_private.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
37 static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
39 #define HOSTSECMGR_THIS(iface) DEFINE_THIS(HTMLDocumentNode, IInternetHostSecurityManager, iface)
41 static HRESULT WINAPI InternetHostSecurityManager_QueryInterface(IInternetHostSecurityManager *iface, REFIID riid, void **ppv)
43 HTMLDocumentNode *This = HOSTSECMGR_THIS(iface);
44 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->node), riid, ppv);
47 static ULONG WINAPI InternetHostSecurityManager_AddRef(IInternetHostSecurityManager *iface)
49 HTMLDocumentNode *This = HOSTSECMGR_THIS(iface);
50 return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->node));
53 static ULONG WINAPI InternetHostSecurityManager_Release(IInternetHostSecurityManager *iface)
55 HTMLDocumentNode *This = HOSTSECMGR_THIS(iface);
56 return IHTMLDOMNode_Release(HTMLDOMNODE(&This->node));
59 static HRESULT WINAPI InternetHostSecurityManager_GetSecurityId(IInternetHostSecurityManager *iface, BYTE *pbSecurityId,
60 DWORD *pcbSecurityId, DWORD_PTR dwReserved)
62 HTMLDocumentNode *This = HOSTSECMGR_THIS(iface);
63 FIXME("(%p)->(%p %p %lx)\n", This, pbSecurityId, pcbSecurityId, dwReserved);
67 static HRESULT WINAPI InternetHostSecurityManager_ProcessUrlAction(IInternetHostSecurityManager *iface, DWORD dwAction,
68 BYTE *pPolicy, DWORD cbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwFlags, DWORD dwReserved)
70 HTMLDocumentNode *This = HOSTSECMGR_THIS(iface);
73 TRACE("%p)->(%d %p %d %p %d %x %x)\n", This, dwAction, pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved);
75 url = This->basedoc.doc_obj->url ? This->basedoc.doc_obj->url : about_blankW;
77 return IInternetSecurityManager_ProcessUrlAction(This->secmgr, url, dwAction, pPolicy, cbPolicy,
78 pContext, cbContext, dwFlags, dwReserved);
81 static HRESULT WINAPI InternetHostSecurityManager_QueryCustomPolicy(IInternetHostSecurityManager *iface, REFGUID guidKey,
82 BYTE **ppPolicy, DWORD *pcbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwReserved)
84 HTMLDocumentNode *This = HOSTSECMGR_THIS(iface);
85 FIXME("(%p)->(%s %p %p %p %d %x)\n", This, debugstr_guid(guidKey), ppPolicy, pcbPolicy, pContext, cbContext, dwReserved);
89 #undef HOSTSECMGR_THIS
91 static const IInternetHostSecurityManagerVtbl InternetHostSecurityManagerVtbl = {
92 InternetHostSecurityManager_QueryInterface,
93 InternetHostSecurityManager_AddRef,
94 InternetHostSecurityManager_Release,
95 InternetHostSecurityManager_GetSecurityId,
96 InternetHostSecurityManager_ProcessUrlAction,
97 InternetHostSecurityManager_QueryCustomPolicy
100 void HTMLDocumentNode_SecMgr_Init(HTMLDocumentNode *This)
102 This->lpIInternetHostSecurityManagerVtbl = &InternetHostSecurityManagerVtbl;