Commit 62000c28 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Implement Exec for CGID_ScriptSite's CMDID_SCRIPTSITE_SECURITY_WINDOW.

parent a0624a7e
......@@ -730,9 +730,34 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID
{
ScriptHost *This = impl_from_IOleCommandTarget(iface);
FIXME("(%p)->(%s %ld %ld %s %p)\n", This, debugstr_guid(pguidCmdGroup), nCmdID, nCmdexecopt, wine_dbgstr_variant(pvaIn), pvaOut);
TRACE("(%p)->(%s %ld %ld %s %p)\n", This, debugstr_guid(pguidCmdGroup), nCmdID, nCmdexecopt, wine_dbgstr_variant(pvaIn), pvaOut);
return E_NOTIMPL;
if(!pguidCmdGroup) {
FIXME("Unsupported pguidCmdGroup %s\n", debugstr_guid(pguidCmdGroup));
return OLECMDERR_E_UNKNOWNGROUP;
}
if(IsEqualGUID(&CGID_ScriptSite, pguidCmdGroup)) {
switch(nCmdID) {
case CMDID_SCRIPTSITE_SECURITY_WINDOW:
if(!This->window || !This->window->base.outer_window) {
FIXME("No window\n");
return E_FAIL;
}
V_VT(pvaOut) = VT_DISPATCH;
V_DISPATCH(pvaOut) = (IDispatch*)&This->window->base.outer_window->base.IHTMLWindow2_iface;
IDispatch_AddRef(V_DISPATCH(pvaOut));
break;
default:
FIXME("Unsupported nCmdID %ld of CGID_ScriptSite group\n", nCmdID);
return OLECMDERR_E_NOTSUPPORTED;
}
return S_OK;
}
FIXME("Unsupported pguidCmdGroup %s\n", debugstr_guid(pguidCmdGroup));
return OLECMDERR_E_UNKNOWNGROUP;
}
static const IOleCommandTargetVtbl OleCommandTargetVtbl = {
......
......@@ -3079,11 +3079,12 @@ static void test_ui(void)
static void test_sp(void)
{
IServiceProvider *sp, *doc_sp, *doc_obj_sp, *window_sp;
IHTMLWindow2 *window, *cmdtarget_window;
IOleCommandTarget *cmdtarget;
IHTMLWindow2 *window;
IHTMLDocument2 *doc;
IUnknown *unk;
HRESULT hres;
VARIANT var;
hres = IDispatchEx_QueryInterface(window_dispex, &IID_IHTMLWindow2, (void**)&window);
ok(hres == S_OK, "QueryInterface(IHTMLWindow2) failed: %08lx\n", hres);
......@@ -3161,6 +3162,19 @@ static void test_sp(void)
IUnknown_Release(unk);
}
V_VT(&var) = VT_EMPTY;
hres = IOleCommandTarget_Exec(cmdtarget, &CGID_ScriptSite, CMDID_SCRIPTSITE_SECURITY_WINDOW, 0, NULL, &var);
ok(hres == S_OK, "Exec failed: %08lx\n", hres);
ok(V_VT(&var) == VT_DISPATCH, "V_VT(CMDID_SCRIPTSITE_SECURITY_WINDOW) = %d\n", V_VT(&var));
ok(V_DISPATCH(&var) != NULL, "V_DISPATCH(CMDID_SCRIPTSITE_SECURITY_WINDOW) = NULL\n");
hres = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IHTMLWindow2, (void**)&cmdtarget_window);
ok(hres == S_OK, "QueryInterface(IHTMLWindow2) failed: %08lx\n", hres);
ok(cmdtarget_window != NULL, "cmdtarget_window is NULL\n");
ok(window == cmdtarget_window, "window != cmdtarget_window\n");
IHTMLWindow2_Release(cmdtarget_window);
VariantClear(&var);
IOleCommandTarget_Release(cmdtarget);
IServiceProvider_Release(window_sp);
IServiceProvider_Release(doc_obj_sp);
......
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