mshtml: Added IInternetHostSecurity::ProcessUrlAction implementation.
This commit is contained in:
parent
7f11de8682
commit
a5923a6eea
|
@ -1772,6 +1772,9 @@ void HTMLDocumentNode_destructor(HTMLDOMNode *iface)
|
|||
{
|
||||
HTMLDocumentNode *This = HTMLDOCNODE_NODE_THIS(iface);
|
||||
|
||||
if(This->secmgr)
|
||||
IInternetSecurityManager_Release(This->secmgr);
|
||||
|
||||
detach_selection(This);
|
||||
detach_ranges(This);
|
||||
release_nodes(This);
|
||||
|
@ -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)
|
||||
{
|
||||
HTMLDocumentNode *doc;
|
||||
HRESULT hres;
|
||||
|
||||
doc = heap_alloc_zero(sizeof(HTMLDocumentNode));
|
||||
if(!doc)
|
||||
|
@ -1829,6 +1833,12 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_ob
|
|||
HTMLDOMNode_Init(doc, &doc->node, (nsIDOMNode*)nsdoc);
|
||||
doc->node.vtbl = &HTMLDocumentNodeImplVtbl;
|
||||
|
||||
hres = CoInternetCreateSecurityManager(NULL, &doc->secmgr, 0);
|
||||
if(FAILED(hres)) {
|
||||
htmldoc_release(&doc->basedoc);
|
||||
return hres;
|
||||
}
|
||||
|
||||
*ret = doc;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -471,6 +471,8 @@ struct HTMLDocumentNode {
|
|||
|
||||
HTMLDOMNode *nodes;
|
||||
|
||||
IInternetSecurityManager *secmgr;
|
||||
|
||||
struct list selection_list;
|
||||
struct list range_list;
|
||||
};
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
|
||||
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)
|
||||
|
||||
static HRESULT WINAPI InternetHostSecurityManager_QueryInterface(IInternetHostSecurityManager *iface, REFIID riid, void **ppv)
|
||||
|
@ -66,8 +68,14 @@ static HRESULT WINAPI InternetHostSecurityManager_ProcessUrlAction(IInternetHost
|
|||
BYTE *pPolicy, DWORD cbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwFlags, DWORD dwReserved)
|
||||
{
|
||||
HTMLDocumentNode *This = HOSTSECMGR_THIS(iface);
|
||||
FIXME("%p)->(%d %p %d %p %d %x %x)\n", This, dwAction, pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved);
|
||||
return E_NOTIMPL;
|
||||
const WCHAR *url;
|
||||
|
||||
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,
|
||||
|
|
|
@ -117,6 +117,8 @@ DEFINE_EXPECT(script_testprop_i);
|
|||
|
||||
static const GUID CLSID_TestScript =
|
||||
{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 IDispatchEx *window_dispex;
|
||||
|
@ -575,6 +577,7 @@ static void test_security(void)
|
|||
{
|
||||
IInternetHostSecurityManager *sec_mgr;
|
||||
IServiceProvider *sp;
|
||||
DWORD policy;
|
||||
HRESULT hres;
|
||||
|
||||
hres = IActiveScriptSite_QueryInterface(site, &IID_IServiceProvider, (void**)&sp);
|
||||
|
@ -585,6 +588,11 @@ static void test_security(void)
|
|||
IServiceProvider_Release(sp);
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue