Commit c21c8525 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msscript: Implement IScriptControl get/set AllowUI.

parent f46235ce
......@@ -89,6 +89,7 @@ struct ScriptControl {
IOleClientSite *site;
SIZEL extent;
LONG timeout;
VARIANT_BOOL allow_ui;
/* connection points */
ConnectionPoint *cp_list;
......@@ -816,15 +817,22 @@ static HRESULT WINAPI ScriptControl_put_Timeout(IScriptControl *iface, LONG time
static HRESULT WINAPI ScriptControl_get_AllowUI(IScriptControl *iface, VARIANT_BOOL *p)
{
ScriptControl *This = impl_from_IScriptControl(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
if(!p)
return E_POINTER;
*p = This->allow_ui;
return S_OK;
}
static HRESULT WINAPI ScriptControl_put_AllowUI(IScriptControl *iface, VARIANT_BOOL allow_ui)
{
ScriptControl *This = impl_from_IScriptControl(iface);
FIXME("(%p)->(%x)\n", This, allow_ui);
return E_NOTIMPL;
TRACE("(%p)->(%x)\n", This, allow_ui);
This->allow_ui = allow_ui;
return S_OK;
}
static HRESULT WINAPI ScriptControl_get_UseSafeSubset(IScriptControl *iface, VARIANT_BOOL *p)
......@@ -1882,6 +1890,7 @@ static HRESULT WINAPI ScriptControl_CreateInstance(IClassFactory *iface, IUnknow
script_control->timeout = 10000;
script_control->view_sink_flags = 0;
script_control->view_sink = NULL;
script_control->allow_ui = VARIANT_TRUE;
ConnectionPoint_Init(&script_control->cp_scsource, script_control, &DIID_DScriptControlSource);
ConnectionPoint_Init(&script_control->cp_propnotif, script_control, &IID_IPropertyNotifySink);
......
......@@ -1227,6 +1227,33 @@ static void test_AddObject(void)
SysFreeString(objname);
}
static void test_AllowUI(void)
{
IScriptControl *sc;
VARIANT_BOOL allow;
HRESULT hr;
hr = CoCreateInstance(&CLSID_ScriptControl, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IScriptControl, (void**)&sc);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IScriptControl_get_AllowUI(sc, NULL);
ok(hr == E_POINTER, "got 0x%08x\n", hr);
hr = IScriptControl_get_AllowUI(sc, &allow);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(allow == VARIANT_TRUE, "got %d\n", allow);
hr = IScriptControl_put_AllowUI(sc, VARIANT_FALSE);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IScriptControl_get_AllowUI(sc, &allow);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(allow == VARIANT_FALSE, "got %d\n", allow);
IScriptControl_Release(sc);
}
START_TEST(msscript)
{
IUnknown *unk;
......@@ -1253,6 +1280,7 @@ START_TEST(msscript)
test_timeout();
test_Reset();
test_AddObject();
test_AllowUI();
CoUninitialize();
}
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