Commit 11275cc7 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msscript: Added IActiveScriptSiteWindow stub.

parent f2a8b5d2
......@@ -57,6 +57,7 @@ struct ConnectionPoint {
typedef struct ScriptHost {
IActiveScriptSite IActiveScriptSite_iface;
IActiveScriptSiteWindow IActiveScriptSiteWindow_iface;
IServiceProvider IServiceProvider_iface;
LONG ref;
......@@ -222,6 +223,11 @@ static inline ScriptHost *impl_from_IActiveScriptSite(IActiveScriptSite *iface)
return CONTAINING_RECORD(iface, ScriptHost, IActiveScriptSite_iface);
}
static inline ScriptHost *impl_from_IActiveScriptSiteWindow(IActiveScriptSiteWindow *iface)
{
return CONTAINING_RECORD(iface, ScriptHost, IActiveScriptSiteWindow_iface);
}
static inline ScriptHost *impl_from_IServiceProvider(IServiceProvider *iface)
{
return CONTAINING_RECORD(iface, ScriptHost, IServiceProvider_iface);
......@@ -238,6 +244,9 @@ static HRESULT WINAPI ActiveScriptSite_QueryInterface(IActiveScriptSite *iface,
}else if(IsEqualGUID(&IID_IActiveScriptSite, riid)) {
TRACE("(%p)->(IID_IActiveScriptSite %p)\n", This, ppv);
*ppv = &This->IActiveScriptSite_iface;
}else if(IsEqualGUID(&IID_IActiveScriptSiteWindow, riid)) {
TRACE("(%p)->(IID_IActiveScriptSiteWindow %p)\n", This, ppv);
*ppv = &This->IActiveScriptSiteWindow_iface;
}else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv);
*ppv = &This->IServiceProvider_iface;
......@@ -379,6 +388,51 @@ static const IActiveScriptSiteVtbl ActiveScriptSiteVtbl = {
ActiveScriptSite_OnLeaveScript
};
/* IActiveScriptSiteWindow */
static HRESULT WINAPI ActiveScriptSiteWindow_QueryInterface(IActiveScriptSiteWindow *iface, REFIID riid, void **obj)
{
ScriptHost *This = impl_from_IActiveScriptSiteWindow(iface);
return IActiveScriptSite_QueryInterface(&This->IActiveScriptSite_iface, riid, obj);
}
static ULONG WINAPI ActiveScriptSiteWindow_AddRef(IActiveScriptSiteWindow *iface)
{
ScriptHost *This = impl_from_IActiveScriptSiteWindow(iface);
return IActiveScriptSite_AddRef(&This->IActiveScriptSite_iface);
}
static ULONG WINAPI ActiveScriptSiteWindow_Release(IActiveScriptSiteWindow *iface)
{
ScriptHost *This = impl_from_IActiveScriptSiteWindow(iface);
return IActiveScriptSite_Release(&This->IActiveScriptSite_iface);
}
static HRESULT WINAPI ActiveScriptSiteWindow_GetWindow(IActiveScriptSiteWindow *iface, HWND *hwnd)
{
ScriptHost *This = impl_from_IActiveScriptSiteWindow(iface);
FIXME("(%p, %p)\n", This, hwnd);
return E_NOTIMPL;
}
static HRESULT WINAPI ActiveScriptSiteWindow_EnableModeless(IActiveScriptSiteWindow *iface, BOOL enable)
{
ScriptHost *This = impl_from_IActiveScriptSiteWindow(iface);
FIXME("(%p, %d)\n", This, enable);
return E_NOTIMPL;
}
static const IActiveScriptSiteWindowVtbl ActiveScriptSiteWindowVtbl = {
ActiveScriptSiteWindow_QueryInterface,
ActiveScriptSiteWindow_AddRef,
ActiveScriptSiteWindow_Release,
ActiveScriptSiteWindow_GetWindow,
ActiveScriptSiteWindow_EnableModeless
};
/* IServiceProvider */
static HRESULT WINAPI ServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **obj)
{
......@@ -428,6 +482,7 @@ static HRESULT init_script_host(const CLSID *clsid, ScriptHost **ret)
return E_OUTOFMEMORY;
host->IActiveScriptSite_iface.lpVtbl = &ActiveScriptSiteVtbl;
host->IActiveScriptSiteWindow_iface.lpVtbl = &ActiveScriptSiteWindowVtbl;
host->IServiceProvider_iface.lpVtbl = &ServiceProviderVtbl;
host->ref = 1;
host->script = NULL;
......
......@@ -247,6 +247,7 @@ static ULONG WINAPI ActiveScript_Release(IActiveScript *iface)
static HRESULT WINAPI ActiveScript_SetScriptSite(IActiveScript *iface, IActiveScriptSite *pass)
{
IActiveScriptSiteInterruptPoll *poll;
IActiveScriptSiteWindow *window;
IActiveScriptSiteDebug *debug;
IServiceProvider *service;
ICanHandleException *canexpection;
......@@ -258,7 +259,7 @@ static HRESULT WINAPI ActiveScript_SetScriptSite(IActiveScript *iface, IActiveSc
ok(pass != NULL, "pass == NULL\n");
hres = IActiveScriptSite_QueryInterface(pass, &IID_IActiveScriptSiteInterruptPoll, (void**)&poll);
ok(hres == E_NOINTERFACE, "Could not get IActiveScriptSiteInterruptPoll interface: %08x\n", hres);
ok(hres == E_NOINTERFACE, "Got IActiveScriptSiteInterruptPoll interface: %08x\n", hres);
hres = IActiveScriptSite_GetLCID(pass, &lcid);
ok(hres == S_OK, "GetLCID failed: %08x\n", hres);
......@@ -267,15 +268,19 @@ static HRESULT WINAPI ActiveScript_SetScriptSite(IActiveScript *iface, IActiveSc
ok(hres == E_NOTIMPL, "OnStateChange failed: %08x\n", hres);
hres = IActiveScriptSite_QueryInterface(pass, &IID_IActiveScriptSiteDebug, (void**)&debug);
ok(hres == E_NOINTERFACE, "Could not get IActiveScriptSiteDebug interface: %08x\n", hres);
ok(hres == E_NOINTERFACE, "Got IActiveScriptSiteDebug interface: %08x\n", hres);
hres = IActiveScriptSite_QueryInterface(pass, &IID_ICanHandleException, (void**)&canexpection);
ok(hres == E_NOINTERFACE, "Could not get IID_ICanHandleException interface: %08x\n", hres);
ok(hres == E_NOINTERFACE, "Got IID_ICanHandleException interface: %08x\n", hres);
hres = IActiveScriptSite_QueryInterface(pass, &IID_IServiceProvider, (void**)&service);
ok(hres == S_OK, "Could not get IServiceProvider interface: %08x\n", hres);
IServiceProvider_Release(service);
hres = IActiveScriptSite_QueryInterface(pass, &IID_IActiveScriptSiteWindow, (void**)&window);
ok(hres == S_OK, "Could not get IActiveScriptSiteWindow interface: %08x\n", hres);
IActiveScriptSiteWindow_Release(window);
site = pass;
IActiveScriptSite_AddRef(site);
return S_OK;
......
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