static HRESULT WINAPI xmlelem_collection_QueryInterface(IXMLElementCollection *iface, REFIID riid, void** ppvObject) { xmlelem_collection *This = impl_from_IXMLElementCollection(iface); TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IXMLElementCollection)) { *ppvObject = iface; } else if (IsEqualGUID(riid, &IID_IEnumVARIANT)) { *ppvObject = (IEnumVARIANT *)&(This->lpvtblIEnumVARIANT); } else { FIXME("interface %s not implemented\n", debugstr_guid(riid)); return E_NOINTERFACE; } IXMLElementCollection_AddRef(iface); return S_OK; }
static HRESULT WINAPI xmlelem_collection_item(IXMLElementCollection *iface, VARIANT var1, VARIANT var2, IDispatch **ppDisp) { xmlelem_collection *This = impl_from_IXMLElementCollection(iface); xmlNodePtr ptr = This->node; int index, i; TRACE("(%p, %p)\n", iface, ppDisp); if (!ppDisp) return E_INVALIDARG; *ppDisp = NULL; index = V_I4(&var1); if (index < 0) return E_INVALIDARG; if (index >= This->length) return E_FAIL; for (i = 0; i < index; i++) ptr = ptr->next; return XMLElement_create((IUnknown *)iface, ptr, (LPVOID *)ppDisp); }
static HRESULT WINAPI xmlelem_collection_item(IXMLElementCollection *iface, VARIANT var1, VARIANT var2, IDispatch **ppDisp) { xmlelem_collection *This = impl_from_IXMLElementCollection(iface); xmlNodePtr ptr = This->node->children; int index, i; TRACE("(%p)->(%s %s %p)\n", This, debugstr_variant(&var1), debugstr_variant(&var2), ppDisp); if (!ppDisp) return E_INVALIDARG; *ppDisp = NULL; index = V_I4(&var1); if (index < 0) return E_INVALIDARG; xmlelem_collection_updatelength(This); if (index >= This->length) return E_FAIL; for (i = 0; i < index; i++) ptr = ptr->next; return XMLElement_create(ptr, (LPVOID *)ppDisp, FALSE); }
static HRESULT WINAPI xmlelem_collection_get_length(IXMLElementCollection *iface, long *p) { xmlelem_collection *This = impl_from_IXMLElementCollection(iface); TRACE("(%p, %p)\n", iface, p); if (!p) return E_INVALIDARG; *p = This->length; return S_OK; }
static HRESULT WINAPI xmlelem_collection_get_length(IXMLElementCollection *iface, LONG *p) { xmlelem_collection *This = impl_from_IXMLElementCollection(iface); TRACE("(%p)->(%p)\n", This, p); if (!p) return E_INVALIDARG; *p = xmlelem_collection_updatelength(This); return S_OK; }
static HRESULT WINAPI xmlelem_collection_get__newEnum(IXMLElementCollection *iface, IUnknown **ppUnk) { xmlelem_collection *This = impl_from_IXMLElementCollection(iface); TRACE("(%p, %p)\n", iface, ppUnk); if (!ppUnk) return E_INVALIDARG; *ppUnk = (IUnknown *)This; IUnknown_AddRef(*ppUnk); return S_OK; }
static HRESULT WINAPI xmlelem_collection_get__newEnum(IXMLElementCollection *iface, IUnknown **ppUnk) { xmlelem_collection *This = impl_from_IXMLElementCollection(iface); TRACE("(%p)->(%p)\n", This, ppUnk); if (!ppUnk) return E_INVALIDARG; IXMLElementCollection_AddRef(iface); *ppUnk = (IUnknown *)&This->IEnumVARIANT_iface; return S_OK; }
static ULONG WINAPI xmlelem_collection_Release(IXMLElementCollection *iface) { xmlelem_collection *This = impl_from_IXMLElementCollection(iface); LONG ref; TRACE("%p\n", This); ref = InterlockedDecrement(&This->ref); if (ref == 0) { HeapFree(GetProcessHeap(), 0, This); } return ref; }
static ULONG WINAPI xmlelem_collection_Release(IXMLElementCollection *iface) { xmlelem_collection *This = impl_from_IXMLElementCollection(iface); LONG ref; TRACE("(%p)\n", This); ref = InterlockedDecrement(&This->ref); if (ref == 0) { heap_free(This); } return ref; }
static ULONG WINAPI xmlelem_collection_AddRef(IXMLElementCollection *iface) { xmlelem_collection *This = impl_from_IXMLElementCollection(iface); TRACE("%p\n", This); return InterlockedIncrement(&This->ref); }
static HRESULT WINAPI xmlelem_collection_put_length(IXMLElementCollection *iface, LONG v) { xmlelem_collection *This = impl_from_IXMLElementCollection(iface); TRACE("(%p)->(%d)\n", This, v); return E_FAIL; }