Commit ceb89792 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msxml3: Added custom queryresult DISPIDs implementation.

parent eca8577d
...@@ -302,12 +302,51 @@ static const struct IXMLDOMNodeListVtbl queryresult_vtbl = ...@@ -302,12 +302,51 @@ static const struct IXMLDOMNodeListVtbl queryresult_vtbl =
queryresult__newEnum, queryresult__newEnum,
}; };
static HRESULT queryresult_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
{
queryresult *This = impl_from_IXMLDOMNodeList( (IXMLDOMNodeList*)iface );
WCHAR *ptr;
DWORD idx=0;
for(ptr = name; *ptr && isdigitW(*ptr); ptr++)
idx = idx*10 + (*ptr-'0');
if(*ptr)
return DISP_E_UNKNOWNNAME;
if(idx >= xmlXPathNodeSetGetLength(This->result->nodesetval))
return DISP_E_UNKNOWNNAME;
*dispid = MSXML_DISPID_CUSTOM_MIN + idx;
TRACE("ret %x\n", *dispid);
return S_OK;
}
static HRESULT queryresult_invoke(IUnknown *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params,
VARIANT *res, EXCEPINFO *ei)
{
queryresult *This = impl_from_IXMLDOMNodeList( (IXMLDOMNodeList*)iface );
if(flags != DISPATCH_PROPERTYGET) {
FIXME("flags %x\n", flags);
return E_NOTIMPL;
}
V_VT(res) = VT_DISPATCH;
V_DISPATCH(res) = (IDispatch*)create_node(This->result->nodesetval->nodeTab[This->resultPos]);
return S_OK;
}
static const dispex_static_data_vtbl_t queryresult_dispex_vtbl = {
queryresult_get_dispid,
queryresult_invoke
};
static const tid_t queryresult_iface_tids[] = { static const tid_t queryresult_iface_tids[] = {
IXMLDOMNodeList_tid, IXMLDOMNodeList_tid,
0 0
}; };
static dispex_static_data_t queryresult_dispex = { static dispex_static_data_t queryresult_dispex = {
NULL, &queryresult_dispex_vtbl,
IXMLDOMNodeList_tid, IXMLDOMNodeList_tid,
NULL, NULL,
queryresult_iface_tids queryresult_iface_tids
......
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