Commit a5923a6e authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IInternetHostSecurity::ProcessUrlAction implementation.

parent 7f11de86
...@@ -1772,6 +1772,9 @@ void HTMLDocumentNode_destructor(HTMLDOMNode *iface) ...@@ -1772,6 +1772,9 @@ void HTMLDocumentNode_destructor(HTMLDOMNode *iface)
{ {
HTMLDocumentNode *This = HTMLDOCNODE_NODE_THIS(iface); HTMLDocumentNode *This = HTMLDOCNODE_NODE_THIS(iface);
if(This->secmgr)
IInternetSecurityManager_Release(This->secmgr);
detach_selection(This); detach_selection(This);
detach_ranges(This); detach_ranges(This);
release_nodes(This); release_nodes(This);
...@@ -1805,6 +1808,7 @@ static dispex_static_data_t HTMLDocumentNode_dispex = { ...@@ -1805,6 +1808,7 @@ static dispex_static_data_t HTMLDocumentNode_dispex = {
HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_obj, HTMLWindow *window, HTMLDocumentNode **ret) HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_obj, HTMLWindow *window, HTMLDocumentNode **ret)
{ {
HTMLDocumentNode *doc; HTMLDocumentNode *doc;
HRESULT hres;
doc = heap_alloc_zero(sizeof(HTMLDocumentNode)); doc = heap_alloc_zero(sizeof(HTMLDocumentNode));
if(!doc) if(!doc)
...@@ -1829,6 +1833,12 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_ob ...@@ -1829,6 +1833,12 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_ob
HTMLDOMNode_Init(doc, &doc->node, (nsIDOMNode*)nsdoc); HTMLDOMNode_Init(doc, &doc->node, (nsIDOMNode*)nsdoc);
doc->node.vtbl = &HTMLDocumentNodeImplVtbl; doc->node.vtbl = &HTMLDocumentNodeImplVtbl;
hres = CoInternetCreateSecurityManager(NULL, &doc->secmgr, 0);
if(FAILED(hres)) {
htmldoc_release(&doc->basedoc);
return hres;
}
*ret = doc; *ret = doc;
return S_OK; return S_OK;
} }
......
...@@ -471,6 +471,8 @@ struct HTMLDocumentNode { ...@@ -471,6 +471,8 @@ struct HTMLDocumentNode {
HTMLDOMNode *nodes; HTMLDOMNode *nodes;
IInternetSecurityManager *secmgr;
struct list selection_list; struct list selection_list;
struct list range_list; struct list range_list;
}; };
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(mshtml); WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
#define HOSTSECMGR_THIS(iface) DEFINE_THIS(HTMLDocumentNode, IInternetHostSecurityManager, iface) #define HOSTSECMGR_THIS(iface) DEFINE_THIS(HTMLDocumentNode, IInternetHostSecurityManager, iface)
static HRESULT WINAPI InternetHostSecurityManager_QueryInterface(IInternetHostSecurityManager *iface, REFIID riid, void **ppv) static HRESULT WINAPI InternetHostSecurityManager_QueryInterface(IInternetHostSecurityManager *iface, REFIID riid, void **ppv)
...@@ -66,8 +68,14 @@ static HRESULT WINAPI InternetHostSecurityManager_ProcessUrlAction(IInternetHost ...@@ -66,8 +68,14 @@ static HRESULT WINAPI InternetHostSecurityManager_ProcessUrlAction(IInternetHost
BYTE *pPolicy, DWORD cbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwFlags, DWORD dwReserved) BYTE *pPolicy, DWORD cbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwFlags, DWORD dwReserved)
{ {
HTMLDocumentNode *This = HOSTSECMGR_THIS(iface); HTMLDocumentNode *This = HOSTSECMGR_THIS(iface);
FIXME("%p)->(%d %p %d %p %d %x %x)\n", This, dwAction, pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved); const WCHAR *url;
return E_NOTIMPL;
TRACE("%p)->(%d %p %d %p %d %x %x)\n", This, dwAction, pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved);
url = This->basedoc.doc_obj->url ? This->basedoc.doc_obj->url : about_blankW;
return IInternetSecurityManager_ProcessUrlAction(This->secmgr, url, dwAction, pPolicy, cbPolicy,
pContext, cbContext, dwFlags, dwReserved);
} }
static HRESULT WINAPI InternetHostSecurityManager_QueryCustomPolicy(IInternetHostSecurityManager *iface, REFGUID guidKey, static HRESULT WINAPI InternetHostSecurityManager_QueryCustomPolicy(IInternetHostSecurityManager *iface, REFGUID guidKey,
......
...@@ -117,6 +117,8 @@ DEFINE_EXPECT(script_testprop_i); ...@@ -117,6 +117,8 @@ DEFINE_EXPECT(script_testprop_i);
static const GUID CLSID_TestScript = static const GUID CLSID_TestScript =
{0x178fc163,0xf585,0x4e24,{0x9c,0x13,0x4b,0xb7,0xfa,0xf8,0x07,0x46}}; {0x178fc163,0xf585,0x4e24,{0x9c,0x13,0x4b,0xb7,0xfa,0xf8,0x07,0x46}};
static const GUID CLSID_TestActiveX =
{0x178fc163,0xf585,0x4e24,{0x9c,0x13,0x4b,0xb7,0xfa,0xf8,0x06,0x46}};
static IHTMLDocument2 *notif_doc; static IHTMLDocument2 *notif_doc;
static IDispatchEx *window_dispex; static IDispatchEx *window_dispex;
...@@ -575,6 +577,7 @@ static void test_security(void) ...@@ -575,6 +577,7 @@ static void test_security(void)
{ {
IInternetHostSecurityManager *sec_mgr; IInternetHostSecurityManager *sec_mgr;
IServiceProvider *sp; IServiceProvider *sp;
DWORD policy;
HRESULT hres; HRESULT hres;
hres = IActiveScriptSite_QueryInterface(site, &IID_IServiceProvider, (void**)&sp); hres = IActiveScriptSite_QueryInterface(site, &IID_IServiceProvider, (void**)&sp);
...@@ -585,6 +588,11 @@ static void test_security(void) ...@@ -585,6 +588,11 @@ static void test_security(void)
IServiceProvider_Release(sp); IServiceProvider_Release(sp);
ok(hres == S_OK, "QueryService failed: %08x\n", hres); ok(hres == S_OK, "QueryService failed: %08x\n", hres);
hres = IInternetHostSecurityManager_ProcessUrlAction(sec_mgr, URLACTION_ACTIVEX_RUN, (BYTE*)&policy, sizeof(policy),
(BYTE*)&CLSID_TestActiveX, sizeof(CLSID), 0, 0);
ok(hres == S_OK, "ProcessUrlAction failed: %08x\n", hres);
ok(policy == URLPOLICY_ALLOW, "policy = %x\n", policy);
IInternetHostSecurityManager_Release(sec_mgr); IInternetHostSecurityManager_Release(sec_mgr);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment