HRESULT __RPC_STUB ICatInformation_IsClassOfCategories_Stub( ICatInformation *This, REFCLSID rclsid, ULONG cImplemented, CATID rgcatidImpl[], ULONG cRequired, CATID rgcatidReq[] ) { TRACE("(%p)\n", This); return ICatInformation_IsClassOfCategories( This, rclsid, cImplemented, rgcatidImpl, cRequired, rgcatidReq ); }
static HRESULT confirm_safety_load(HTMLDocumentNode *This, struct CONFIRMSAFETY *cs, DWORD *ret) { IObjectSafety *obj_safety; HRESULT hres; hres = IUnknown_QueryInterface(cs->pUnk, &IID_IObjectSafety, (void**)&obj_safety); if(SUCCEEDED(hres)) { hres = IObjectSafety_SetInterfaceSafetyOptions(obj_safety, &IID_IDispatch, INTERFACESAFE_FOR_UNTRUSTED_DATA, INTERFACESAFE_FOR_UNTRUSTED_DATA); IObjectSafety_Release(obj_safety); *ret = SUCCEEDED(hres) ? URLPOLICY_ALLOW : URLPOLICY_DISALLOW; }else { CATID init_catid = CATID_SafeForInitializing; hres = ICatInformation_IsClassOfCategories(This->catmgr, &cs->clsid, 1, &init_catid, 0, NULL); assert(SUCCEEDED(hres)); *ret = hres == S_OK ? URLPOLICY_ALLOW : URLPOLICY_DISALLOW; } return S_OK; }
static HRESULT confirm_safety(HTMLDocumentNode *This, const WCHAR *url, struct CONFIRMSAFETY *cs, DWORD *ret) { DWORD policy, enabled_opts, supported_opts; IObjectSafety *obj_safety; HRESULT hres; TRACE("%s %p %s\n", debugstr_w(url), cs->pUnk, debugstr_guid(&cs->clsid)); /* FIXME: Check URLACTION_ACTIVEX_OVERRIDE_SCRIPT_SAFETY */ hres = IInternetSecurityManager_ProcessUrlAction(This->basedoc.window->secmgr, url, URLACTION_SCRIPT_SAFE_ACTIVEX, (BYTE*)&policy, sizeof(policy), NULL, 0, 0, 0); if(FAILED(hres) || policy != URLPOLICY_ALLOW) { *ret = URLPOLICY_DISALLOW; return S_OK; } hres = IUnknown_QueryInterface(cs->pUnk, &IID_IObjectSafety, (void**)&obj_safety); if(SUCCEEDED(hres)) { hres = IObjectSafety_GetInterfaceSafetyOptions(obj_safety, &IID_IDispatchEx, &supported_opts, &enabled_opts); if(FAILED(hres)) supported_opts = 0; enabled_opts = INTERFACESAFE_FOR_UNTRUSTED_CALLER; if(supported_opts & INTERFACE_USES_SECURITY_MANAGER) enabled_opts |= INTERFACE_USES_SECURITY_MANAGER; hres = IObjectSafety_SetInterfaceSafetyOptions(obj_safety, &IID_IDispatchEx, enabled_opts, enabled_opts); if(FAILED(hres)) { enabled_opts &= ~INTERFACE_USES_SECURITY_MANAGER; hres = IObjectSafety_SetInterfaceSafetyOptions(obj_safety, &IID_IDispatch, enabled_opts, enabled_opts); } IObjectSafety_Release(obj_safety); if(FAILED(hres)) { *ret = URLPOLICY_DISALLOW; return S_OK; } }else { CATID scripting_catid = CATID_SafeForScripting; if(!This->catmgr) { hres = CoCreateInstance(&CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ICatInformation, (void**)&This->catmgr); if(FAILED(hres)) return hres; } hres = ICatInformation_IsClassOfCategories(This->catmgr, &cs->clsid, 1, &scripting_catid, 0, NULL); if(FAILED(hres)) return hres; if(hres != S_OK) { *ret = URLPOLICY_DISALLOW; return S_OK; } } if(cs->dwFlags & CONFIRMSAFETYACTION_LOADOBJECT) return confirm_safety_load(This, cs, ret); *ret = URLPOLICY_ALLOW; return S_OK; }