jscript: Query created ActiveXObject for IObjectWithSite interface.
This commit is contained in:
parent
0713fde4fe
commit
4462fb356d
|
@ -59,6 +59,7 @@ static IInternetHostSecurityManager *get_sec_mgr(script_ctx_t *ctx)
|
|||
static IUnknown *create_activex_object(script_ctx_t *ctx, const WCHAR *progid)
|
||||
{
|
||||
IInternetHostSecurityManager *secmgr;
|
||||
IObjectWithSite *obj_site;
|
||||
struct CONFIRMSAFETY cs;
|
||||
IClassFactoryEx *cfex;
|
||||
IClassFactory *cf;
|
||||
|
@ -114,6 +115,12 @@ static IUnknown *create_activex_object(script_ctx_t *ctx, const WCHAR *progid)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
hres = IUnknown_QueryInterface(obj, &IID_IObjectWithSite, (void**)&obj_site);
|
||||
if(SUCCEEDED(hres)) {
|
||||
FIXME("Set object site\n");
|
||||
IObjectWithSite_Release(obj_site);
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,6 +66,7 @@ DEFINE_EXPECT(QueryCustomPolicy);
|
|||
DEFINE_EXPECT(reportSuccess);
|
||||
DEFINE_EXPECT(Host_QS_SecMgr);
|
||||
DEFINE_EXPECT(Caller_QS_SecMgr);
|
||||
DEFINE_EXPECT(QI_IObjectWithSite);
|
||||
|
||||
static const WCHAR testW[] = {'t','e','s','t',0};
|
||||
|
||||
|
@ -132,6 +133,9 @@ static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid,
|
|||
if(FAILED(QI_IDispatch_hres))
|
||||
return QI_IDispatch_hres;
|
||||
*ppv = iface;
|
||||
}else if(IsEqualGUID(&IID_IObjectWithSite, riid)) {
|
||||
CHECK_EXPECT(QI_IObjectWithSite);
|
||||
return E_NOINTERFACE;
|
||||
}else {
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
@ -747,12 +751,14 @@ static void test_ActiveXObject(void)
|
|||
SET_EXPECT(ProcessUrlAction);
|
||||
SET_EXPECT(CreateInstance);
|
||||
SET_EXPECT(QueryCustomPolicy);
|
||||
SET_EXPECT(QI_IObjectWithSite);
|
||||
SET_EXPECT(reportSuccess);
|
||||
parse_script_a(parser, "(new ActiveXObject('Wine.Test')).reportSuccess();");
|
||||
CHECK_CALLED(Host_QS_SecMgr);
|
||||
CHECK_CALLED(ProcessUrlAction);
|
||||
CHECK_CALLED(CreateInstance);
|
||||
CHECK_CALLED(QueryCustomPolicy);
|
||||
CHECK_CALLED(QI_IObjectWithSite);
|
||||
CHECK_CALLED(reportSuccess);
|
||||
|
||||
proc = parse_procedure_a(parser, "(new ActiveXObject('Wine.Test')).reportSuccess();");
|
||||
|
@ -760,21 +766,25 @@ static void test_ActiveXObject(void)
|
|||
SET_EXPECT(ProcessUrlAction);
|
||||
SET_EXPECT(CreateInstance);
|
||||
SET_EXPECT(QueryCustomPolicy);
|
||||
SET_EXPECT(QI_IObjectWithSite);
|
||||
SET_EXPECT(reportSuccess);
|
||||
call_procedure(proc, NULL);
|
||||
CHECK_CALLED(ProcessUrlAction);
|
||||
CHECK_CALLED(CreateInstance);
|
||||
CHECK_CALLED(QueryCustomPolicy);
|
||||
CHECK_CALLED(QI_IObjectWithSite);
|
||||
CHECK_CALLED(reportSuccess);
|
||||
|
||||
SET_EXPECT(ProcessUrlAction);
|
||||
SET_EXPECT(CreateInstance);
|
||||
SET_EXPECT(QueryCustomPolicy);
|
||||
SET_EXPECT(QI_IObjectWithSite);
|
||||
SET_EXPECT(reportSuccess);
|
||||
call_procedure(proc, &caller_sp);
|
||||
CHECK_CALLED(ProcessUrlAction);
|
||||
CHECK_CALLED(CreateInstance);
|
||||
CHECK_CALLED(QueryCustomPolicy);
|
||||
CHECK_CALLED(QI_IObjectWithSite);
|
||||
CHECK_CALLED(reportSuccess);
|
||||
|
||||
IDispatchEx_Release(proc);
|
||||
|
@ -787,12 +797,14 @@ static void test_ActiveXObject(void)
|
|||
SET_EXPECT(ProcessUrlAction);
|
||||
SET_EXPECT(CreateInstance);
|
||||
SET_EXPECT(QueryCustomPolicy);
|
||||
SET_EXPECT(QI_IObjectWithSite);
|
||||
SET_EXPECT(reportSuccess);
|
||||
call_procedure(proc, &caller_sp);
|
||||
CHECK_CALLED(Host_QS_SecMgr);
|
||||
CHECK_CALLED(ProcessUrlAction);
|
||||
CHECK_CALLED(CreateInstance);
|
||||
CHECK_CALLED(QueryCustomPolicy);
|
||||
CHECK_CALLED(QI_IObjectWithSite);
|
||||
CHECK_CALLED(reportSuccess);
|
||||
|
||||
parse_script_a(parser, "testException(function() { new ActiveXObject('Wine.TestABC'); }, 'Error', -2146827859);");
|
||||
|
@ -866,12 +878,14 @@ static void test_ActiveXObject(void)
|
|||
SET_EXPECT(ProcessUrlAction);
|
||||
SET_EXPECT(CreateInstance);
|
||||
SET_EXPECT(QueryCustomPolicy);
|
||||
SET_EXPECT(QI_IObjectWithSite);
|
||||
SET_EXPECT(reportSuccess);
|
||||
parse_script_a(parser, "(new ActiveXObject('Wine.Test')).reportSuccess();");
|
||||
CHECK_CALLED(Host_QS_SecMgr);
|
||||
CHECK_CALLED(ProcessUrlAction);
|
||||
CHECK_CALLED(CreateInstance);
|
||||
CHECK_CALLED(QueryCustomPolicy);
|
||||
CHECK_CALLED(QI_IObjectWithSite);
|
||||
CHECK_CALLED(reportSuccess);
|
||||
|
||||
IUnknown_Release(parser);
|
||||
|
|
Loading…
Reference in New Issue