2005-08-19 17:18:05 +02:00
|
|
|
/*
|
|
|
|
* Node list implementation
|
|
|
|
*
|
|
|
|
* Copyright 2005 Mike McCormack
|
|
|
|
*
|
2005-11-08 13:46:43 +01:00
|
|
|
* This library is free software; you can redistribute it and/or
|
2005-08-19 17:18:05 +02:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
2005-11-08 13:46:43 +01:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
2005-08-19 17:18:05 +02:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-08-19 17:18:05 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
2021-10-20 11:39:06 +02:00
|
|
|
#include <libxml/parser.h>
|
|
|
|
#include <libxml/xmlerror.h>
|
2011-02-24 13:11:53 +01:00
|
|
|
|
2005-08-19 17:18:05 +02:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
2010-08-29 23:31:49 +02:00
|
|
|
#include "msxml6.h"
|
2011-11-19 18:55:30 +01:00
|
|
|
#include "msxml2did.h"
|
2005-08-19 17:18:05 +02:00
|
|
|
|
|
|
|
#include "msxml_private.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
2007-05-11 17:03:13 +02:00
|
|
|
/* This file implements the object returned by childNodes property. Note that this is
|
2012-06-30 14:16:33 +02:00
|
|
|
* not the IXMLDOMNodeList returned by XPath queries - it's implemented in selection.c.
|
2007-05-11 17:03:13 +02:00
|
|
|
* They are different because the list returned by childNodes:
|
|
|
|
* - is "live" - changes to the XML tree are automatically reflected in the list
|
|
|
|
* - doesn't supports IXMLDOMSelection
|
|
|
|
* - note that an attribute node have a text child in DOM but not in the XPath data model
|
|
|
|
* thus the child is inaccessible by an XPath query
|
|
|
|
*/
|
|
|
|
|
2015-02-21 14:58:41 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(msxml);
|
|
|
|
|
2012-06-30 23:12:12 +02:00
|
|
|
typedef struct
|
2005-08-19 17:18:05 +02:00
|
|
|
{
|
2011-11-19 18:55:30 +01:00
|
|
|
DispatchEx dispex;
|
2010-12-16 01:04:15 +01:00
|
|
|
IXMLDOMNodeList IXMLDOMNodeList_iface;
|
2005-08-19 17:18:05 +02:00
|
|
|
LONG ref;
|
2007-05-11 17:03:13 +02:00
|
|
|
xmlNodePtr parent;
|
2005-08-19 17:18:05 +02:00
|
|
|
xmlNodePtr current;
|
2012-06-30 23:12:12 +02:00
|
|
|
IEnumVARIANT *enumvariant;
|
2005-08-19 17:18:05 +02:00
|
|
|
} xmlnodelist;
|
|
|
|
|
2012-07-01 17:26:55 +02:00
|
|
|
static HRESULT nodelist_get_item(IUnknown *iface, LONG index, VARIANT *item)
|
2012-06-30 23:12:12 +02:00
|
|
|
{
|
2012-07-01 17:26:55 +02:00
|
|
|
V_VT(item) = VT_DISPATCH;
|
|
|
|
return IXMLDOMNodeList_get_item((IXMLDOMNodeList*)iface, index, (IXMLDOMNode**)&V_DISPATCH(item));
|
2012-06-30 23:12:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static const struct enumvariant_funcs nodelist_enumvariant = {
|
|
|
|
nodelist_get_item,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2005-08-19 17:18:05 +02:00
|
|
|
static inline xmlnodelist *impl_from_IXMLDOMNodeList( IXMLDOMNodeList *iface )
|
|
|
|
{
|
2010-12-16 01:04:15 +01:00
|
|
|
return CONTAINING_RECORD(iface, xmlnodelist, IXMLDOMNodeList_iface);
|
2005-08-19 17:18:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlnodelist_QueryInterface(
|
|
|
|
IXMLDOMNodeList *iface,
|
|
|
|
REFIID riid,
|
|
|
|
void** ppvObject )
|
|
|
|
{
|
2011-11-19 18:55:30 +01:00
|
|
|
xmlnodelist *This = impl_from_IXMLDOMNodeList( iface );
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
|
2005-08-19 17:18:05 +02:00
|
|
|
|
|
|
|
if ( IsEqualGUID( riid, &IID_IUnknown ) ||
|
|
|
|
IsEqualGUID( riid, &IID_IDispatch ) ||
|
|
|
|
IsEqualGUID( riid, &IID_IXMLDOMNodeList ) )
|
|
|
|
{
|
|
|
|
*ppvObject = iface;
|
|
|
|
}
|
2012-06-30 23:12:12 +02:00
|
|
|
else if (IsEqualGUID( riid, &IID_IEnumVARIANT ))
|
|
|
|
{
|
|
|
|
if (!This->enumvariant)
|
|
|
|
{
|
|
|
|
HRESULT hr = create_enumvariant((IUnknown*)iface, FALSE, &nodelist_enumvariant, &This->enumvariant);
|
|
|
|
if (FAILED(hr)) return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
return IEnumVARIANT_QueryInterface(This->enumvariant, &IID_IEnumVARIANT, ppvObject);
|
|
|
|
}
|
2011-11-19 18:55:30 +01:00
|
|
|
else if (dispex_query_interface(&This->dispex, riid, ppvObject))
|
|
|
|
{
|
|
|
|
return *ppvObject ? S_OK : E_NOINTERFACE;
|
|
|
|
}
|
2005-08-19 17:18:05 +02:00
|
|
|
else
|
2006-01-27 19:22:56 +01:00
|
|
|
{
|
2011-03-13 14:40:26 +01:00
|
|
|
TRACE("interface %s not implemented\n", debugstr_guid(riid));
|
2006-06-12 02:34:17 +02:00
|
|
|
*ppvObject = NULL;
|
2005-08-19 17:18:05 +02:00
|
|
|
return E_NOINTERFACE;
|
2006-01-27 19:22:56 +01:00
|
|
|
}
|
2005-08-19 17:18:05 +02:00
|
|
|
|
|
|
|
IXMLDOMNodeList_AddRef( iface );
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI xmlnodelist_AddRef(
|
|
|
|
IXMLDOMNodeList *iface )
|
|
|
|
{
|
|
|
|
xmlnodelist *This = impl_from_IXMLDOMNodeList( iface );
|
2011-03-05 19:32:31 +01:00
|
|
|
ULONG ref = InterlockedIncrement( &This->ref );
|
|
|
|
TRACE("(%p)->(%d)\n", This, ref);
|
|
|
|
return ref;
|
2005-08-19 17:18:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI xmlnodelist_Release(
|
|
|
|
IXMLDOMNodeList *iface )
|
|
|
|
{
|
|
|
|
xmlnodelist *This = impl_from_IXMLDOMNodeList( iface );
|
2011-03-05 19:32:31 +01:00
|
|
|
ULONG ref = InterlockedDecrement( &This->ref );
|
2005-08-19 17:18:05 +02:00
|
|
|
|
2011-03-05 19:32:31 +01:00
|
|
|
TRACE("(%p)->(%d)\n", This, ref);
|
2005-08-19 17:18:05 +02:00
|
|
|
if ( ref == 0 )
|
|
|
|
{
|
2007-05-11 17:03:13 +02:00
|
|
|
xmldoc_release( This->parent->doc );
|
2012-06-30 23:12:12 +02:00
|
|
|
if (This->enumvariant) IEnumVARIANT_Release(This->enumvariant);
|
2010-02-03 20:47:53 +01:00
|
|
|
heap_free( This );
|
2005-08-19 17:18:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlnodelist_GetTypeInfoCount(
|
|
|
|
IXMLDOMNodeList *iface,
|
|
|
|
UINT* pctinfo )
|
|
|
|
{
|
2008-02-21 10:24:32 +01:00
|
|
|
xmlnodelist *This = impl_from_IXMLDOMNodeList( iface );
|
2011-11-19 18:55:30 +01:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
|
2005-08-19 17:18:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlnodelist_GetTypeInfo(
|
|
|
|
IXMLDOMNodeList *iface,
|
|
|
|
UINT iTInfo,
|
|
|
|
LCID lcid,
|
|
|
|
ITypeInfo** ppTInfo )
|
|
|
|
{
|
2008-02-21 10:24:32 +01:00
|
|
|
xmlnodelist *This = impl_from_IXMLDOMNodeList( iface );
|
2011-11-19 18:55:30 +01:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface,
|
|
|
|
iTInfo, lcid, ppTInfo);
|
2005-08-19 17:18:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlnodelist_GetIDsOfNames(
|
|
|
|
IXMLDOMNodeList *iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPOLESTR* rgszNames,
|
|
|
|
UINT cNames,
|
|
|
|
LCID lcid,
|
|
|
|
DISPID* rgDispId )
|
|
|
|
{
|
2008-02-21 10:24:32 +01:00
|
|
|
xmlnodelist *This = impl_from_IXMLDOMNodeList( iface );
|
2011-11-19 18:55:30 +01:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface,
|
|
|
|
riid, rgszNames, cNames, lcid, rgDispId);
|
2005-08-19 17:18:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlnodelist_Invoke(
|
|
|
|
IXMLDOMNodeList *iface,
|
|
|
|
DISPID dispIdMember,
|
|
|
|
REFIID riid,
|
|
|
|
LCID lcid,
|
|
|
|
WORD wFlags,
|
|
|
|
DISPPARAMS* pDispParams,
|
|
|
|
VARIANT* pVarResult,
|
|
|
|
EXCEPINFO* pExcepInfo,
|
|
|
|
UINT* puArgErr )
|
|
|
|
{
|
2008-02-21 10:24:32 +01:00
|
|
|
xmlnodelist *This = impl_from_IXMLDOMNodeList( iface );
|
2011-11-19 18:55:30 +01:00
|
|
|
return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface,
|
|
|
|
dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2005-08-19 17:18:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlnodelist_get_item(
|
|
|
|
IXMLDOMNodeList* iface,
|
2009-03-09 23:28:16 +01:00
|
|
|
LONG index,
|
2005-08-19 17:18:05 +02:00
|
|
|
IXMLDOMNode** listItem)
|
|
|
|
{
|
2005-11-03 13:04:52 +01:00
|
|
|
xmlnodelist *This = impl_from_IXMLDOMNodeList( iface );
|
2007-05-11 17:03:13 +02:00
|
|
|
xmlNodePtr curr;
|
2009-03-09 23:28:53 +01:00
|
|
|
LONG nodeIndex = 0;
|
2005-11-03 13:04:52 +01:00
|
|
|
|
2010-02-17 07:40:40 +01:00
|
|
|
TRACE("(%p)->(%d %p)\n", This, index, listItem);
|
2008-07-02 08:16:05 +02:00
|
|
|
|
|
|
|
if(!listItem)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2005-11-03 13:04:52 +01:00
|
|
|
*listItem = NULL;
|
|
|
|
|
|
|
|
if (index < 0)
|
|
|
|
return S_FALSE;
|
|
|
|
|
2007-05-11 17:03:13 +02:00
|
|
|
curr = This->parent->children;
|
2005-11-05 11:42:45 +01:00
|
|
|
while(curr)
|
|
|
|
{
|
|
|
|
if(nodeIndex++ == index) break;
|
2007-05-11 17:03:13 +02:00
|
|
|
curr = curr->next;
|
2005-11-03 13:04:52 +01:00
|
|
|
}
|
2005-11-05 11:42:45 +01:00
|
|
|
if(!curr) return S_FALSE;
|
|
|
|
|
2005-11-03 13:04:52 +01:00
|
|
|
*listItem = create_node( curr );
|
|
|
|
|
|
|
|
return S_OK;
|
2005-08-19 17:18:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlnodelist_get_length(
|
|
|
|
IXMLDOMNodeList* iface,
|
2009-03-09 23:28:16 +01:00
|
|
|
LONG* listLength)
|
2005-08-19 17:18:05 +02:00
|
|
|
{
|
2005-11-03 13:04:52 +01:00
|
|
|
|
2007-05-11 17:03:13 +02:00
|
|
|
xmlNodePtr curr;
|
2009-03-09 23:28:53 +01:00
|
|
|
LONG nodeCount = 0;
|
2005-11-03 13:04:52 +01:00
|
|
|
|
|
|
|
xmlnodelist *This = impl_from_IXMLDOMNodeList( iface );
|
|
|
|
|
2010-02-17 07:40:40 +01:00
|
|
|
TRACE("(%p)->(%p)\n", This, listLength);
|
2005-11-03 13:04:52 +01:00
|
|
|
|
2008-07-02 08:16:05 +02:00
|
|
|
if(!listLength)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2007-05-11 17:03:13 +02:00
|
|
|
curr = This->parent->children;
|
2006-10-22 21:48:42 +02:00
|
|
|
while (curr)
|
2005-11-05 11:42:45 +01:00
|
|
|
{
|
2005-11-03 13:04:52 +01:00
|
|
|
nodeCount++;
|
2007-05-11 17:03:13 +02:00
|
|
|
curr = curr->next;
|
2005-11-03 13:04:52 +01:00
|
|
|
}
|
2005-11-05 11:42:45 +01:00
|
|
|
|
|
|
|
*listLength = nodeCount;
|
2005-11-03 13:04:52 +01:00
|
|
|
return S_OK;
|
2005-08-19 17:18:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlnodelist_nextNode(
|
|
|
|
IXMLDOMNodeList* iface,
|
|
|
|
IXMLDOMNode** nextItem)
|
|
|
|
{
|
|
|
|
xmlnodelist *This = impl_from_IXMLDOMNodeList( iface );
|
|
|
|
|
2010-02-17 07:40:40 +01:00
|
|
|
TRACE("(%p)->(%p)\n", This, nextItem );
|
2005-08-19 17:18:05 +02:00
|
|
|
|
2008-07-02 08:16:05 +02:00
|
|
|
if(!nextItem)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2006-06-12 02:34:17 +02:00
|
|
|
*nextItem = NULL;
|
|
|
|
|
2005-08-19 17:18:05 +02:00
|
|
|
if (!This->current)
|
|
|
|
return S_FALSE;
|
|
|
|
|
|
|
|
*nextItem = create_node( This->current );
|
2007-05-11 17:03:13 +02:00
|
|
|
This->current = This->current->next;
|
2005-08-19 17:18:05 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlnodelist_reset(
|
|
|
|
IXMLDOMNodeList* iface)
|
|
|
|
{
|
2005-09-03 11:39:38 +02:00
|
|
|
xmlnodelist *This = impl_from_IXMLDOMNodeList( iface );
|
|
|
|
|
|
|
|
TRACE("%p\n", This);
|
2007-05-11 17:03:13 +02:00
|
|
|
This->current = This->parent->children;
|
2005-09-03 11:39:38 +02:00
|
|
|
return S_OK;
|
2005-08-19 17:18:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlnodelist__newEnum(
|
|
|
|
IXMLDOMNodeList* iface,
|
2012-06-30 23:12:12 +02:00
|
|
|
IUnknown** enumv)
|
2005-08-19 17:18:05 +02:00
|
|
|
{
|
2010-02-17 07:40:40 +01:00
|
|
|
xmlnodelist *This = impl_from_IXMLDOMNodeList( iface );
|
2012-06-30 23:12:12 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, enumv);
|
|
|
|
return create_enumvariant((IUnknown*)iface, TRUE, &nodelist_enumvariant, (IEnumVARIANT**)enumv);
|
2005-08-19 17:18:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static const struct IXMLDOMNodeListVtbl xmlnodelist_vtbl =
|
|
|
|
{
|
|
|
|
xmlnodelist_QueryInterface,
|
|
|
|
xmlnodelist_AddRef,
|
|
|
|
xmlnodelist_Release,
|
|
|
|
xmlnodelist_GetTypeInfoCount,
|
|
|
|
xmlnodelist_GetTypeInfo,
|
|
|
|
xmlnodelist_GetIDsOfNames,
|
|
|
|
xmlnodelist_Invoke,
|
|
|
|
xmlnodelist_get_item,
|
|
|
|
xmlnodelist_get_length,
|
|
|
|
xmlnodelist_nextNode,
|
|
|
|
xmlnodelist_reset,
|
|
|
|
xmlnodelist__newEnum,
|
|
|
|
};
|
|
|
|
|
2011-11-19 18:55:30 +01:00
|
|
|
static HRESULT xmlnodelist_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
|
|
|
|
{
|
|
|
|
WCHAR *ptr;
|
|
|
|
int idx = 0;
|
|
|
|
|
2020-11-27 14:31:40 +01:00
|
|
|
for(ptr = name; *ptr >= '0' && *ptr <= '9'; ptr++)
|
2011-11-19 18:55:30 +01:00
|
|
|
idx = idx*10 + (*ptr-'0');
|
|
|
|
if(*ptr)
|
|
|
|
return DISP_E_UNKNOWNNAME;
|
|
|
|
|
|
|
|
*dispid = DISPID_DOM_COLLECTION_BASE + idx;
|
|
|
|
TRACE("ret %x\n", *dispid);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT xmlnodelist_invoke(IUnknown *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params,
|
|
|
|
VARIANT *res, EXCEPINFO *ei)
|
|
|
|
{
|
|
|
|
xmlnodelist *This = impl_from_IXMLDOMNodeList( (IXMLDOMNodeList*)iface );
|
|
|
|
|
|
|
|
TRACE("(%p)->(%x %x %x %p %p %p)\n", This, id, lcid, flags, params, res, ei);
|
|
|
|
|
2012-12-17 07:16:41 +01:00
|
|
|
if (id >= DISPID_DOM_COLLECTION_BASE && id <= DISPID_DOM_COLLECTION_MAX)
|
2011-11-19 18:55:30 +01:00
|
|
|
{
|
2012-12-17 07:16:41 +01:00
|
|
|
switch(flags)
|
2011-11-19 18:55:30 +01:00
|
|
|
{
|
2012-12-17 07:16:41 +01:00
|
|
|
case DISPATCH_PROPERTYGET:
|
|
|
|
{
|
|
|
|
IXMLDOMNode *disp = NULL;
|
|
|
|
|
|
|
|
V_VT(res) = VT_DISPATCH;
|
|
|
|
IXMLDOMNodeList_get_item(&This->IXMLDOMNodeList_iface, id - DISPID_DOM_COLLECTION_BASE, &disp);
|
|
|
|
V_DISPATCH(res) = (IDispatch*)disp;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
FIXME("unimplemented flags %x\n", flags);
|
|
|
|
break;
|
|
|
|
}
|
2011-11-19 18:55:30 +01:00
|
|
|
}
|
2012-12-17 07:16:41 +01:00
|
|
|
}
|
|
|
|
else if (id == DISPID_VALUE)
|
|
|
|
{
|
|
|
|
switch(flags)
|
2011-11-19 18:55:30 +01:00
|
|
|
{
|
2012-12-17 07:16:41 +01:00
|
|
|
case DISPATCH_METHOD|DISPATCH_PROPERTYGET:
|
|
|
|
case DISPATCH_PROPERTYGET:
|
|
|
|
case DISPATCH_METHOD:
|
|
|
|
{
|
|
|
|
IXMLDOMNode *item;
|
|
|
|
VARIANT index;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
if (params->cArgs - params->cNamedArgs != 1) return DISP_E_BADPARAMCOUNT;
|
|
|
|
|
|
|
|
VariantInit(&index);
|
|
|
|
hr = VariantChangeType(&index, params->rgvarg, 0, VT_I4);
|
|
|
|
if(FAILED(hr))
|
|
|
|
{
|
|
|
|
FIXME("failed to convert arg, %s\n", debugstr_variant(params->rgvarg));
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
IXMLDOMNodeList_get_item(&This->IXMLDOMNodeList_iface, V_I4(&index), &item);
|
|
|
|
V_VT(res) = VT_DISPATCH;
|
|
|
|
V_DISPATCH(res) = (IDispatch*)item;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
FIXME("DISPID_VALUE: unimplemented flags %x\n", flags);
|
|
|
|
break;
|
|
|
|
}
|
2011-11-19 18:55:30 +01:00
|
|
|
}
|
|
|
|
}
|
2012-12-17 07:16:41 +01:00
|
|
|
else
|
|
|
|
return DISP_E_UNKNOWNNAME;
|
2011-11-19 18:55:30 +01:00
|
|
|
|
|
|
|
TRACE("ret %p\n", V_DISPATCH(res));
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const dispex_static_data_vtbl_t xmlnodelist_dispex_vtbl = {
|
|
|
|
xmlnodelist_get_dispid,
|
|
|
|
xmlnodelist_invoke
|
|
|
|
};
|
|
|
|
|
|
|
|
static const tid_t xmlnodelist_iface_tids[] = {
|
|
|
|
IXMLDOMNodeList_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
static dispex_static_data_t xmlnodelist_dispex = {
|
|
|
|
&xmlnodelist_dispex_vtbl,
|
|
|
|
IXMLDOMNodeList_tid,
|
|
|
|
NULL,
|
|
|
|
xmlnodelist_iface_tids
|
|
|
|
};
|
|
|
|
|
2007-05-11 17:03:13 +02:00
|
|
|
IXMLDOMNodeList* create_children_nodelist( xmlNodePtr node )
|
2005-08-19 17:18:05 +02:00
|
|
|
{
|
2011-11-19 18:55:30 +01:00
|
|
|
xmlnodelist *This;
|
2005-08-19 17:18:05 +02:00
|
|
|
|
2011-11-19 18:55:30 +01:00
|
|
|
This = heap_alloc( sizeof *This );
|
|
|
|
if ( !This )
|
2005-08-19 17:18:05 +02:00
|
|
|
return NULL;
|
|
|
|
|
2011-11-19 18:55:30 +01:00
|
|
|
This->IXMLDOMNodeList_iface.lpVtbl = &xmlnodelist_vtbl;
|
|
|
|
This->ref = 1;
|
|
|
|
This->parent = node;
|
|
|
|
This->current = node->children;
|
2012-06-30 23:12:12 +02:00
|
|
|
This->enumvariant = NULL;
|
2007-05-11 17:03:13 +02:00
|
|
|
xmldoc_add_ref( node->doc );
|
2005-11-18 16:05:26 +01:00
|
|
|
|
2011-11-19 18:55:30 +01:00
|
|
|
init_dispex(&This->dispex, (IUnknown*)&This->IXMLDOMNodeList_iface, &xmlnodelist_dispex);
|
|
|
|
|
|
|
|
return &This->IXMLDOMNodeList_iface;
|
2005-08-19 17:18:05 +02:00
|
|
|
}
|