Commit d7aee26d authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Make propputref methods invocable with DISPATCH_PROPERTYPUT.

parent 8d5b1dd5
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "winnls.h" #include "winnls.h"
#include "ole2.h" #include "ole2.h"
#include "msxml6.h" #include "msxml6.h"
#include "msxml6did.h"
#include "wininet.h" #include "wininet.h"
#include "urlmon.h" #include "urlmon.h"
#include "winreg.h" #include "winreg.h"
...@@ -519,6 +520,30 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW ...@@ -519,6 +520,30 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW
return DISP_E_UNKNOWNNAME; return DISP_E_UNKNOWNNAME;
} }
static BOOL is_propputref_id(DISPID id)
{
switch (id)
{
case DISPID_DOM_DOCUMENT_DOCUMENTELEMENT:
case DISPID_XMLDOM_DOCUMENT2_SCHEMAS:
case DISPID_XMLDOM_SELECTION_CONTEXT:
case DISPID_XMLDOM_TEMPLATE_STYLESHEET:
case DISPID_SAX_CONTENTHANDLER_DOCUMENTLOCATOR:
case DISPID_SAX_XMLFILTER_PARENT:
case DISPID_SAX_XMLREADER_ENTITYRESOLVER:
case DISPID_SAX_XMLREADER_CONTENTHANDLER:
case DISPID_SAX_XMLREADER_DTDHANDLER:
case DISPID_SAX_XMLREADER_ERRORHANDLER:
case DISPID_MXXML_FILTER_ENTITYRESOLVER:
case DISPID_MXXML_FILTER_CONTENTHANDLER:
case DISPID_MXXML_FILTER_DTDHANDLER:
case DISPID_MXXML_FILTER_ERRORHANDLER:
return TRUE;
default:
return FALSE;
}
}
static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
{ {
...@@ -601,6 +626,8 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc ...@@ -601,6 +626,8 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
return E_FAIL; return E_FAIL;
} }
if (is_propputref_id(id) && wFlags == DISPATCH_PROPERTYPUT)
wFlags = DISPATCH_PROPERTYPUTREF;
hres = ITypeInfo_Invoke(ti, unk, id, wFlags, pdp, pvarRes, pei, &argerr); hres = ITypeInfo_Invoke(ti, unk, id, wFlags, pdp, pvarRes, pei, &argerr);
ITypeInfo_Release(ti); ITypeInfo_Release(ti);
......
...@@ -4432,11 +4432,14 @@ static void test_obj_dispex(IUnknown *obj) ...@@ -4432,11 +4432,14 @@ static void test_obj_dispex(IUnknown *obj)
IDispatchEx_Release(dispex); IDispatchEx_Release(dispex);
} }
static void test_dispex(void) static void test_saxreader_dispex(void)
{ {
IVBSAXXMLReader *vbreader; IVBSAXXMLReader *vbreader;
ISAXXMLReader *reader; ISAXXMLReader *reader;
DISPPARAMS dispparams;
DISPID dispid;
IUnknown *unk; IUnknown *unk;
VARIANT arg;
HRESULT hr; HRESULT hr;
hr = CoCreateInstance(&CLSID_SAXXMLReader, NULL, CLSCTX_INPROC_SERVER, hr = CoCreateInstance(&CLSID_SAXXMLReader, NULL, CLSCTX_INPROC_SERVER,
...@@ -4454,6 +4457,39 @@ static void test_dispex(void) ...@@ -4454,6 +4457,39 @@ static void test_dispex(void)
EXPECT_HR(hr, S_OK); EXPECT_HR(hr, S_OK);
test_obj_dispex(unk); test_obj_dispex(unk);
IUnknown_Release(unk); IUnknown_Release(unk);
dispid = DISPID_PROPERTYPUT;
dispparams.cArgs = 1;
dispparams.cNamedArgs = 1;
dispparams.rgdispidNamedArgs = &dispid;
dispparams.rgvarg = &arg;
V_VT(&arg) = VT_DISPATCH;
V_DISPATCH(&arg) = NULL;
/* propputref is callable as PROPERTYPUT and PROPERTYPUTREF */
hr = IVBSAXXMLReader_Invoke(vbreader,
DISPID_SAX_XMLREADER_CONTENTHANDLER,
&IID_NULL,
0,
DISPATCH_PROPERTYPUT,
&dispparams,
NULL,
NULL,
NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IVBSAXXMLReader_Invoke(vbreader,
DISPID_SAX_XMLREADER_CONTENTHANDLER,
&IID_NULL,
0,
DISPATCH_PROPERTYPUTREF,
&dispparams,
NULL,
NULL,
NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
IVBSAXXMLReader_Release(vbreader); IVBSAXXMLReader_Release(vbreader);
ISAXXMLReader_Release(reader); ISAXXMLReader_Release(reader);
...@@ -5518,7 +5554,7 @@ START_TEST(saxreader) ...@@ -5518,7 +5554,7 @@ START_TEST(saxreader)
test_saxreader_properties(); test_saxreader_properties();
test_saxreader_features(); test_saxreader_features();
test_saxreader_encoding(); test_saxreader_encoding();
test_dispex(); test_saxreader_dispex();
/* MXXMLWriter tests */ /* MXXMLWriter tests */
get_class_support_data(mxwriter_support_data, &IID_IMXWriter); get_class_support_data(mxwriter_support_data, &IID_IMXWriter);
......
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