2007-12-30 10:49:17 +00:00
|
|
|
/*
|
|
|
|
* XML Element implementation
|
|
|
|
*
|
|
|
|
* Copyright 2007 James Hawkins
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* 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
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2018-03-20 11:28:36 +00:00
|
|
|
#define COBJMACROS
|
2007-12-30 10:49:17 +00:00
|
|
|
|
2018-03-20 11:28:36 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
2007-12-30 10:49:17 +00:00
|
|
|
#ifdef HAVE_LIBXML2
|
2018-03-20 11:28:36 +00:00
|
|
|
# include <libxml/parser.h>
|
|
|
|
# include <libxml/xmlerror.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
#include "msxml6.h"
|
|
|
|
#include "ocidl.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include "msxml_private.h"
|
|
|
|
|
|
|
|
#ifdef HAVE_LIBXML2
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(msxml);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
2014-04-24 15:40:52 +00:00
|
|
|
static HRESULT XMLElementCollection_create( xmlNodePtr node, LPVOID *ppObj );
|
2009-01-04 10:48:19 +00:00
|
|
|
|
2007-12-30 10:49:17 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* IXMLElement
|
|
|
|
*/
|
|
|
|
typedef struct _xmlelem
|
|
|
|
{
|
2012-09-09 19:47:25 +00:00
|
|
|
IXMLElement IXMLElement_iface;
|
2007-12-30 10:49:17 +00:00
|
|
|
LONG ref;
|
|
|
|
xmlNodePtr node;
|
2010-02-06 21:34:28 +00:00
|
|
|
BOOL own;
|
2007-12-30 10:49:17 +00:00
|
|
|
} xmlelem;
|
|
|
|
|
|
|
|
static inline xmlelem *impl_from_IXMLElement(IXMLElement *iface)
|
|
|
|
{
|
2012-09-09 19:47:25 +00:00
|
|
|
return CONTAINING_RECORD(iface, xmlelem, IXMLElement_iface);
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_QueryInterface(IXMLElement *iface, REFIID riid, void** ppvObject)
|
|
|
|
{
|
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
if (IsEqualGUID(riid, &IID_IUnknown) ||
|
|
|
|
IsEqualGUID(riid, &IID_IDispatch) ||
|
2007-12-30 10:49:17 +00:00
|
|
|
IsEqualGUID(riid, &IID_IXMLElement))
|
|
|
|
{
|
|
|
|
*ppvObject = iface;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME("interface %s not implemented\n", debugstr_guid(riid));
|
2012-09-09 19:47:25 +00:00
|
|
|
*ppvObject = NULL;
|
2007-12-30 10:49:17 +00:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IXMLElement_AddRef(iface);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI xmlelem_AddRef(IXMLElement *iface)
|
|
|
|
{
|
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
TRACE("%p\n", This);
|
|
|
|
return InterlockedIncrement(&This->ref);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI xmlelem_Release(IXMLElement *iface)
|
|
|
|
{
|
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
TRACE("%p\n", This);
|
|
|
|
|
|
|
|
ref = InterlockedDecrement(&This->ref);
|
|
|
|
if (ref == 0)
|
|
|
|
{
|
2010-02-06 21:34:28 +00:00
|
|
|
if (This->own) xmlFreeNode(This->node);
|
|
|
|
heap_free(This);
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_GetTypeInfoCount(IXMLElement *iface, UINT* pctinfo)
|
|
|
|
{
|
2008-09-08 16:51:03 +00:00
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
|
|
|
|
*pctinfo = 1;
|
|
|
|
|
|
|
|
return S_OK;
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_GetTypeInfo(IXMLElement *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo** ppTInfo)
|
|
|
|
{
|
2008-09-08 16:51:03 +00:00
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
|
|
|
|
|
|
|
hr = get_typeinfo(IXMLElement_tid, ppTInfo);
|
|
|
|
|
|
|
|
return hr;
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_GetIDsOfNames(IXMLElement *iface, REFIID riid,
|
|
|
|
LPOLESTR* rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID* rgDispId)
|
|
|
|
{
|
2008-09-08 16:51:03 +00:00
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
ITypeInfo *typeinfo;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
|
|
|
lcid, rgDispId);
|
|
|
|
|
|
|
|
if(!rgszNames || cNames == 0 || !rgDispId)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
hr = get_typeinfo(IXMLElement_tid, &typeinfo);
|
|
|
|
if(SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
|
|
|
|
ITypeInfo_Release(typeinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
return hr;
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_Invoke(IXMLElement *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags,
|
|
|
|
DISPPARAMS* pDispParams, VARIANT* pVarResult,
|
|
|
|
EXCEPINFO* pExcepInfo, UINT* puArgErr)
|
|
|
|
{
|
2008-09-08 16:51:03 +00:00
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
ITypeInfo *typeinfo;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
|
|
|
|
hr = get_typeinfo(IXMLElement_tid, &typeinfo);
|
|
|
|
if(SUCCEEDED(hr))
|
|
|
|
{
|
2012-09-09 19:47:25 +00:00
|
|
|
hr = ITypeInfo_Invoke(typeinfo, &This->IXMLElement_iface, dispIdMember, wFlags, pDispParams,
|
2008-09-08 16:51:03 +00:00
|
|
|
pVarResult, pExcepInfo, puArgErr);
|
|
|
|
ITypeInfo_Release(typeinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
return hr;
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_get_tagName(IXMLElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
if (!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2014-04-24 15:40:52 +00:00
|
|
|
if (*This->node->name) {
|
|
|
|
*p = bstr_from_xmlChar(This->node->name);
|
|
|
|
CharUpperBuffW(*p, SysStringLen(*p));
|
|
|
|
}else {
|
|
|
|
*p = NULL;
|
|
|
|
}
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
TRACE("returning %s\n", debugstr_w(*p));
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_put_tagName(IXMLElement *iface, BSTR p)
|
|
|
|
{
|
2012-09-09 19:47:25 +00:00
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%s): stub\n", This, debugstr_w(p));
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
if (!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_get_parent(IXMLElement *iface, IXMLElement **parent)
|
|
|
|
{
|
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%p)\n", This, parent);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
if (!parent)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*parent = NULL;
|
|
|
|
|
|
|
|
if (!This->node->parent)
|
|
|
|
return S_FALSE;
|
|
|
|
|
2014-04-24 15:40:52 +00:00
|
|
|
return XMLElement_create(This->node->parent, (LPVOID *)parent, FALSE);
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_setAttribute(IXMLElement *iface, BSTR strPropertyName,
|
|
|
|
VARIANT PropertyValue)
|
|
|
|
{
|
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
xmlChar *name, *value;
|
|
|
|
xmlAttrPtr attr;
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%s %s)\n", This, debugstr_w(strPropertyName), debugstr_variant(&PropertyValue));
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
if (!strPropertyName || V_VT(&PropertyValue) != VT_BSTR)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
name = xmlchar_from_wchar(strPropertyName);
|
|
|
|
value = xmlchar_from_wchar(V_BSTR(&PropertyValue));
|
2007-12-30 10:49:17 +00:00
|
|
|
attr = xmlSetProp(This->node, name, value);
|
|
|
|
|
2010-02-06 21:34:28 +00:00
|
|
|
heap_free(name);
|
|
|
|
heap_free(value);
|
2007-12-30 10:49:17 +00:00
|
|
|
return (attr) ? S_OK : S_FALSE;
|
|
|
|
}
|
|
|
|
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
static HRESULT WINAPI xmlelem_getAttribute(IXMLElement *iface, BSTR name,
|
|
|
|
VARIANT *value)
|
2007-12-30 10:49:17 +00:00
|
|
|
{
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
static const WCHAR xmllangW[] = { 'x','m','l',':','l','a','n','g',0 };
|
2007-12-30 10:49:17 +00:00
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
xmlChar *val = NULL;
|
2007-12-30 10:49:17 +00:00
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%s, %p)\n", This, debugstr_w(name), value);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
if (!value)
|
2007-12-30 10:49:17 +00:00
|
|
|
return E_INVALIDARG;
|
|
|
|
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
VariantInit(value);
|
|
|
|
V_BSTR(value) = NULL;
|
2007-12-30 10:49:17 +00:00
|
|
|
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
if (!name)
|
2007-12-30 10:49:17 +00:00
|
|
|
return E_INVALIDARG;
|
|
|
|
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
/* case for xml:lang attribute */
|
|
|
|
if (!lstrcmpiW(name, xmllangW))
|
2007-12-30 10:49:17 +00:00
|
|
|
{
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
xmlNsPtr ns;
|
|
|
|
ns = xmlSearchNs(This->node->doc, This->node, (xmlChar*)"xml");
|
|
|
|
val = xmlGetNsProp(This->node, (xmlChar*)"lang", ns->href);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
xmlAttrPtr attr;
|
|
|
|
xmlChar *xml_name;
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
xml_name = xmlchar_from_wchar(name);
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
attr = This->node->properties;
|
|
|
|
while (attr)
|
2007-12-30 10:49:17 +00:00
|
|
|
{
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
BSTR attr_name;
|
|
|
|
|
|
|
|
attr_name = bstr_from_xmlChar(attr->name);
|
|
|
|
if (!lstrcmpiW(name, attr_name))
|
|
|
|
{
|
|
|
|
val = xmlNodeListGetString(attr->doc, attr->children, 1);
|
|
|
|
SysFreeString(attr_name);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
attr = attr->next;
|
|
|
|
SysFreeString(attr_name);
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
heap_free(xml_name);
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (val)
|
|
|
|
{
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
V_VT(value) = VT_BSTR;
|
|
|
|
V_BSTR(value) = bstr_from_xmlChar(val);
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
xmlFree(val);
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
TRACE("returning %s\n", debugstr_w(V_BSTR(value)));
|
2007-12-30 10:49:17 +00:00
|
|
|
return (val) ? S_OK : S_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_removeAttribute(IXMLElement *iface, BSTR strPropertyName)
|
|
|
|
{
|
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
xmlChar *name;
|
|
|
|
xmlAttrPtr attr;
|
|
|
|
int res;
|
|
|
|
HRESULT hr = S_FALSE;
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(strPropertyName));
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
if (!strPropertyName)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
name = xmlchar_from_wchar(strPropertyName);
|
2007-12-30 10:49:17 +00:00
|
|
|
attr = xmlHasProp(This->node, name);
|
|
|
|
if (!attr)
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
res = xmlRemoveProp(attr);
|
|
|
|
|
|
|
|
if (res == 0)
|
|
|
|
hr = S_OK;
|
|
|
|
|
|
|
|
done:
|
2010-02-06 21:34:28 +00:00
|
|
|
heap_free(name);
|
2007-12-30 10:49:17 +00:00
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_get_children(IXMLElement *iface, IXMLElementCollection **p)
|
|
|
|
{
|
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
if (!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2014-04-24 15:40:52 +00:00
|
|
|
return XMLElementCollection_create(This->node, (LPVOID *)p);
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
2009-04-28 19:57:36 +00:00
|
|
|
static LONG type_libxml_to_msxml(xmlElementType type)
|
2007-12-30 10:49:17 +00:00
|
|
|
{
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case XML_ELEMENT_NODE:
|
|
|
|
return XMLELEMTYPE_ELEMENT;
|
|
|
|
case XML_TEXT_NODE:
|
|
|
|
return XMLELEMTYPE_TEXT;
|
|
|
|
case XML_COMMENT_NODE:
|
|
|
|
return XMLELEMTYPE_COMMENT;
|
|
|
|
case XML_DOCUMENT_NODE:
|
|
|
|
return XMLELEMTYPE_DOCUMENT;
|
|
|
|
case XML_DTD_NODE:
|
|
|
|
return XMLELEMTYPE_DTD;
|
|
|
|
case XML_PI_NODE:
|
|
|
|
return XMLELEMTYPE_PI;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return XMLELEMTYPE_OTHER;
|
|
|
|
}
|
|
|
|
|
2009-04-28 19:57:36 +00:00
|
|
|
static HRESULT WINAPI xmlelem_get_type(IXMLElement *iface, LONG *p)
|
2007-12-30 10:49:17 +00:00
|
|
|
{
|
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
if (!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*p = type_libxml_to_msxml(This->node->type);
|
2009-04-28 19:57:36 +00:00
|
|
|
TRACE("returning %d\n", *p);
|
2007-12-30 10:49:17 +00:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_get_text(IXMLElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
xmlChar *content;
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
if (!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
content = xmlNodeGetContent(This->node);
|
|
|
|
*p = bstr_from_xmlChar(content);
|
|
|
|
TRACE("returning %s\n", debugstr_w(*p));
|
|
|
|
|
|
|
|
xmlFree(content);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_put_text(IXMLElement *iface, BSTR p)
|
|
|
|
{
|
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
xmlChar *content;
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(p));
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
/* FIXME: test which types can be used */
|
|
|
|
if (This->node->type == XML_ELEMENT_NODE)
|
|
|
|
return E_NOTIMPL;
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
content = xmlchar_from_wchar(p);
|
2007-12-30 10:49:17 +00:00
|
|
|
xmlNodeSetContent(This->node, content);
|
|
|
|
|
2010-02-06 21:34:28 +00:00
|
|
|
heap_free(content);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_addChild(IXMLElement *iface, IXMLElement *pChildElem,
|
2009-04-28 19:57:36 +00:00
|
|
|
LONG lIndex, LONG lreserved)
|
2007-12-30 10:49:17 +00:00
|
|
|
{
|
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
xmlelem *childElem = impl_from_IXMLElement(pChildElem);
|
|
|
|
xmlNodePtr child;
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%p %d %d)\n", This, pChildElem, lIndex, lreserved);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
if (lIndex == 0)
|
|
|
|
child = xmlAddChild(This->node, childElem->node);
|
|
|
|
else
|
|
|
|
child = xmlAddNextSibling(This->node, childElem->node->last);
|
|
|
|
|
2010-02-06 21:34:28 +00:00
|
|
|
/* parent is responsible for child data */
|
|
|
|
if (child) childElem->own = FALSE;
|
|
|
|
|
2007-12-30 10:49:17 +00:00
|
|
|
return (child) ? S_OK : S_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_removeChild(IXMLElement *iface, IXMLElement *pChildElem)
|
|
|
|
{
|
2010-02-06 21:34:28 +00:00
|
|
|
xmlelem *This = impl_from_IXMLElement(iface);
|
|
|
|
xmlelem *childElem = impl_from_IXMLElement(pChildElem);
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%p)\n", This, childElem);
|
2010-02-06 21:34:28 +00:00
|
|
|
|
|
|
|
if (!pChildElem)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
/* only supported for This is childElem parent case */
|
|
|
|
if (This->node != childElem->node->parent)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
xmlUnlinkNode(childElem->node);
|
|
|
|
/* standalone element now */
|
|
|
|
childElem->own = TRUE;
|
|
|
|
|
|
|
|
return S_OK;
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const struct IXMLElementVtbl xmlelem_vtbl =
|
|
|
|
{
|
|
|
|
xmlelem_QueryInterface,
|
|
|
|
xmlelem_AddRef,
|
|
|
|
xmlelem_Release,
|
|
|
|
xmlelem_GetTypeInfoCount,
|
|
|
|
xmlelem_GetTypeInfo,
|
|
|
|
xmlelem_GetIDsOfNames,
|
|
|
|
xmlelem_Invoke,
|
|
|
|
xmlelem_get_tagName,
|
|
|
|
xmlelem_put_tagName,
|
|
|
|
xmlelem_get_parent,
|
|
|
|
xmlelem_setAttribute,
|
|
|
|
xmlelem_getAttribute,
|
|
|
|
xmlelem_removeAttribute,
|
|
|
|
xmlelem_get_children,
|
|
|
|
xmlelem_get_type,
|
|
|
|
xmlelem_get_text,
|
|
|
|
xmlelem_put_text,
|
|
|
|
xmlelem_addChild,
|
|
|
|
xmlelem_removeChild
|
|
|
|
};
|
|
|
|
|
2014-04-24 15:40:52 +00:00
|
|
|
HRESULT XMLElement_create(xmlNodePtr node, LPVOID *ppObj, BOOL own)
|
2007-12-30 10:49:17 +00:00
|
|
|
{
|
|
|
|
xmlelem *elem;
|
|
|
|
|
2014-04-24 15:40:52 +00:00
|
|
|
TRACE("(%p)\n", ppObj);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
if (!ppObj)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*ppObj = NULL;
|
|
|
|
|
2010-02-06 21:34:28 +00:00
|
|
|
elem = heap_alloc(sizeof (*elem));
|
2007-12-30 10:49:17 +00:00
|
|
|
if(!elem)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
elem->IXMLElement_iface.lpVtbl = &xmlelem_vtbl;
|
2007-12-30 10:49:17 +00:00
|
|
|
elem->ref = 1;
|
|
|
|
elem->node = node;
|
2010-02-06 21:34:28 +00:00
|
|
|
elem->own = own;
|
2007-12-30 10:49:17 +00:00
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
*ppObj = &elem->IXMLElement_iface;
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
TRACE("returning iface %p\n", *ppObj);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* IXMLElementCollection
|
|
|
|
*/
|
|
|
|
typedef struct _xmlelem_collection
|
|
|
|
{
|
2012-09-09 19:47:25 +00:00
|
|
|
IXMLElementCollection IXMLElementCollection_iface;
|
|
|
|
IEnumVARIANT IEnumVARIANT_iface;
|
2007-12-30 10:49:17 +00:00
|
|
|
LONG ref;
|
|
|
|
LONG length;
|
|
|
|
xmlNodePtr node;
|
|
|
|
|
|
|
|
/* IEnumVARIANT members */
|
|
|
|
xmlNodePtr current;
|
|
|
|
} xmlelem_collection;
|
|
|
|
|
2010-02-06 21:34:28 +00:00
|
|
|
static inline LONG xmlelem_collection_updatelength(xmlelem_collection *collection)
|
|
|
|
{
|
|
|
|
xmlNodePtr ptr = collection->node->children;
|
|
|
|
|
|
|
|
collection->length = 0;
|
|
|
|
while (ptr)
|
|
|
|
{
|
|
|
|
collection->length++;
|
|
|
|
ptr = ptr->next;
|
|
|
|
}
|
|
|
|
return collection->length;
|
|
|
|
}
|
|
|
|
|
2007-12-30 10:49:17 +00:00
|
|
|
static inline xmlelem_collection *impl_from_IXMLElementCollection(IXMLElementCollection *iface)
|
|
|
|
{
|
2012-09-09 19:47:25 +00:00
|
|
|
return CONTAINING_RECORD(iface, xmlelem_collection, IXMLElementCollection_iface);
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline xmlelem_collection *impl_from_IEnumVARIANT(IEnumVARIANT *iface)
|
|
|
|
{
|
2012-09-09 19:47:25 +00:00
|
|
|
return CONTAINING_RECORD(iface, xmlelem_collection, IEnumVARIANT_iface);
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_collection_QueryInterface(IXMLElementCollection *iface, REFIID riid, void** ppvObject)
|
|
|
|
{
|
|
|
|
xmlelem_collection *This = impl_from_IXMLElementCollection(iface);
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
if (IsEqualGUID(riid, &IID_IUnknown) ||
|
|
|
|
IsEqualGUID(riid, &IID_IXMLElementCollection))
|
|
|
|
{
|
|
|
|
*ppvObject = iface;
|
|
|
|
}
|
|
|
|
else if (IsEqualGUID(riid, &IID_IEnumVARIANT))
|
|
|
|
{
|
2012-09-09 19:47:25 +00:00
|
|
|
*ppvObject = &This->IEnumVARIANT_iface;
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME("interface %s not implemented\n", debugstr_guid(riid));
|
2014-04-24 15:40:52 +00:00
|
|
|
*ppvObject = NULL;
|
2007-12-30 10:49:17 +00:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IXMLElementCollection_AddRef(iface);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI xmlelem_collection_AddRef(IXMLElementCollection *iface)
|
|
|
|
{
|
|
|
|
xmlelem_collection *This = impl_from_IXMLElementCollection(iface);
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)\n", This);
|
2007-12-30 10:49:17 +00:00
|
|
|
return InterlockedIncrement(&This->ref);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI xmlelem_collection_Release(IXMLElementCollection *iface)
|
|
|
|
{
|
|
|
|
xmlelem_collection *This = impl_from_IXMLElementCollection(iface);
|
|
|
|
LONG ref;
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)\n", This);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
ref = InterlockedDecrement(&This->ref);
|
|
|
|
if (ref == 0)
|
|
|
|
{
|
2010-02-06 21:34:28 +00:00
|
|
|
heap_free(This);
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_collection_GetTypeInfoCount(IXMLElementCollection *iface, UINT* pctinfo)
|
|
|
|
{
|
|
|
|
FIXME("\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_collection_GetTypeInfo(IXMLElementCollection *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo** ppTInfo)
|
|
|
|
{
|
|
|
|
FIXME("\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_collection_GetIDsOfNames(IXMLElementCollection *iface, REFIID riid,
|
|
|
|
LPOLESTR* rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID* rgDispId)
|
|
|
|
{
|
|
|
|
FIXME("\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_collection_Invoke(IXMLElementCollection *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags,
|
|
|
|
DISPPARAMS* pDispParams, VARIANT* pVarResult,
|
|
|
|
EXCEPINFO* pExcepInfo, UINT* puArgErr)
|
|
|
|
{
|
|
|
|
FIXME("\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-04-28 19:57:36 +00:00
|
|
|
static HRESULT WINAPI xmlelem_collection_put_length(IXMLElementCollection *iface, LONG v)
|
2007-12-30 10:49:17 +00:00
|
|
|
{
|
2012-09-09 19:47:25 +00:00
|
|
|
xmlelem_collection *This = impl_from_IXMLElementCollection(iface);
|
|
|
|
TRACE("(%p)->(%d)\n", This, v);
|
2007-12-30 10:49:17 +00:00
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2009-04-28 19:57:36 +00:00
|
|
|
static HRESULT WINAPI xmlelem_collection_get_length(IXMLElementCollection *iface, LONG *p)
|
2007-12-30 10:49:17 +00:00
|
|
|
{
|
|
|
|
xmlelem_collection *This = impl_from_IXMLElementCollection(iface);
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
if (!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2010-02-06 21:34:28 +00:00
|
|
|
*p = xmlelem_collection_updatelength(This);
|
2007-12-30 10:49:17 +00:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_collection_get__newEnum(IXMLElementCollection *iface, IUnknown **ppUnk)
|
|
|
|
{
|
|
|
|
xmlelem_collection *This = impl_from_IXMLElementCollection(iface);
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%p)\n", This, ppUnk);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
if (!ppUnk)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2014-04-24 15:40:52 +00:00
|
|
|
IXMLElementCollection_AddRef(iface);
|
|
|
|
*ppUnk = (IUnknown *)&This->IEnumVARIANT_iface;
|
2007-12-30 10:49:17 +00:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_collection_item(IXMLElementCollection *iface, VARIANT var1,
|
|
|
|
VARIANT var2, IDispatch **ppDisp)
|
|
|
|
{
|
|
|
|
xmlelem_collection *This = impl_from_IXMLElementCollection(iface);
|
2010-02-06 21:34:28 +00:00
|
|
|
xmlNodePtr ptr = This->node->children;
|
2007-12-30 10:49:17 +00:00
|
|
|
int index, i;
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%s %s %p)\n", This, debugstr_variant(&var1), debugstr_variant(&var2), ppDisp);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
if (!ppDisp)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*ppDisp = NULL;
|
|
|
|
|
|
|
|
index = V_I4(&var1);
|
|
|
|
if (index < 0)
|
|
|
|
return E_INVALIDARG;
|
2010-02-06 21:34:28 +00:00
|
|
|
|
|
|
|
xmlelem_collection_updatelength(This);
|
2007-12-30 10:49:17 +00:00
|
|
|
if (index >= This->length)
|
|
|
|
return E_FAIL;
|
|
|
|
|
|
|
|
for (i = 0; i < index; i++)
|
|
|
|
ptr = ptr->next;
|
|
|
|
|
2014-04-24 15:40:52 +00:00
|
|
|
return XMLElement_create(ptr, (LPVOID *)ppDisp, FALSE);
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const struct IXMLElementCollectionVtbl xmlelem_collection_vtbl =
|
|
|
|
{
|
|
|
|
xmlelem_collection_QueryInterface,
|
|
|
|
xmlelem_collection_AddRef,
|
|
|
|
xmlelem_collection_Release,
|
|
|
|
xmlelem_collection_GetTypeInfoCount,
|
|
|
|
xmlelem_collection_GetTypeInfo,
|
|
|
|
xmlelem_collection_GetIDsOfNames,
|
|
|
|
xmlelem_collection_Invoke,
|
|
|
|
xmlelem_collection_put_length,
|
|
|
|
xmlelem_collection_get_length,
|
|
|
|
xmlelem_collection_get__newEnum,
|
|
|
|
xmlelem_collection_item
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* xmlelem_collection implementation of IEnumVARIANT.
|
|
|
|
*/
|
|
|
|
static HRESULT WINAPI xmlelem_collection_IEnumVARIANT_QueryInterface(
|
|
|
|
IEnumVARIANT *iface, REFIID riid, LPVOID *ppvObj)
|
|
|
|
{
|
|
|
|
xmlelem_collection *this = impl_from_IEnumVARIANT(iface);
|
2014-04-24 15:40:52 +00:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", this, debugstr_guid(riid), ppvObj);
|
|
|
|
|
|
|
|
if (IsEqualGUID(riid, &IID_IUnknown) ||
|
|
|
|
IsEqualGUID(riid, &IID_IEnumVARIANT))
|
|
|
|
{
|
|
|
|
*ppvObj = iface;
|
|
|
|
IEnumVARIANT_AddRef(iface);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
FIXME("interface %s not implemented\n", debugstr_guid(riid));
|
|
|
|
*ppvObj = NULL;
|
|
|
|
return E_NOINTERFACE;
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI xmlelem_collection_IEnumVARIANT_AddRef(
|
|
|
|
IEnumVARIANT *iface)
|
|
|
|
{
|
|
|
|
xmlelem_collection *this = impl_from_IEnumVARIANT(iface);
|
2014-04-24 15:40:52 +00:00
|
|
|
return IXMLElementCollection_AddRef(&this->IXMLElementCollection_iface);
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI xmlelem_collection_IEnumVARIANT_Release(
|
|
|
|
IEnumVARIANT *iface)
|
|
|
|
{
|
|
|
|
xmlelem_collection *this = impl_from_IEnumVARIANT(iface);
|
2014-04-24 15:40:52 +00:00
|
|
|
return IXMLElementCollection_Release(&this->IXMLElementCollection_iface);
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_collection_IEnumVARIANT_Next(
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
IEnumVARIANT *iface, ULONG celt, VARIANT *rgVar, ULONG *fetched)
|
2007-12-30 10:49:17 +00:00
|
|
|
{
|
|
|
|
xmlelem_collection *This = impl_from_IEnumVARIANT(iface);
|
|
|
|
xmlNodePtr ptr = This->current;
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)->(%d %p %p)\n", This, celt, rgVar, fetched);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
if (!rgVar)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
/* FIXME: handle celt */
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
if (fetched)
|
|
|
|
*fetched = 1;
|
2007-12-30 10:49:17 +00:00
|
|
|
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
if (This->current)
|
|
|
|
This->current = This->current->next;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
V_VT(rgVar) = VT_EMPTY;
|
|
|
|
if (fetched) *fetched = 0;
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
V_VT(rgVar) = VT_DISPATCH;
|
2014-04-24 15:40:52 +00:00
|
|
|
return XMLElement_create(ptr, (LPVOID *)&V_DISPATCH(rgVar), FALSE);
|
2007-12-30 10:49:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_collection_IEnumVARIANT_Skip(
|
|
|
|
IEnumVARIANT *iface, ULONG celt)
|
|
|
|
{
|
2012-09-09 19:47:25 +00:00
|
|
|
xmlelem_collection *This = impl_from_IEnumVARIANT(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, celt);
|
2007-12-30 10:49:17 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_collection_IEnumVARIANT_Reset(
|
|
|
|
IEnumVARIANT *iface)
|
|
|
|
{
|
|
|
|
xmlelem_collection *This = impl_from_IEnumVARIANT(iface);
|
2012-09-09 19:47:25 +00:00
|
|
|
TRACE("(%p)\n", This);
|
2010-02-06 21:34:28 +00:00
|
|
|
This->current = This->node->children;
|
2007-12-30 10:49:17 +00:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI xmlelem_collection_IEnumVARIANT_Clone(
|
|
|
|
IEnumVARIANT *iface, IEnumVARIANT **ppEnum)
|
|
|
|
{
|
2012-09-09 19:47:25 +00:00
|
|
|
xmlelem_collection *This = impl_from_IEnumVARIANT(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, ppEnum);
|
2007-12-30 10:49:17 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct IEnumVARIANTVtbl xmlelem_collection_IEnumVARIANTvtbl =
|
|
|
|
{
|
|
|
|
xmlelem_collection_IEnumVARIANT_QueryInterface,
|
|
|
|
xmlelem_collection_IEnumVARIANT_AddRef,
|
|
|
|
xmlelem_collection_IEnumVARIANT_Release,
|
|
|
|
xmlelem_collection_IEnumVARIANT_Next,
|
|
|
|
xmlelem_collection_IEnumVARIANT_Skip,
|
|
|
|
xmlelem_collection_IEnumVARIANT_Reset,
|
|
|
|
xmlelem_collection_IEnumVARIANT_Clone
|
|
|
|
};
|
|
|
|
|
2014-04-24 15:40:52 +00:00
|
|
|
static HRESULT XMLElementCollection_create(xmlNodePtr node, LPVOID *ppObj)
|
2007-12-30 10:49:17 +00:00
|
|
|
{
|
|
|
|
xmlelem_collection *collection;
|
|
|
|
|
2014-04-24 15:40:52 +00:00
|
|
|
TRACE("(%p)\n", ppObj);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
*ppObj = NULL;
|
|
|
|
|
2010-02-06 21:34:28 +00:00
|
|
|
if (!node->children)
|
2007-12-30 10:49:17 +00:00
|
|
|
return S_FALSE;
|
|
|
|
|
2010-02-06 21:34:28 +00:00
|
|
|
collection = heap_alloc(sizeof (*collection));
|
2007-12-30 10:49:17 +00:00
|
|
|
if(!collection)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
collection->IXMLElementCollection_iface.lpVtbl = &xmlelem_collection_vtbl;
|
|
|
|
collection->IEnumVARIANT_iface.lpVtbl = &xmlelem_collection_IEnumVARIANTvtbl;
|
2007-12-30 10:49:17 +00:00
|
|
|
collection->ref = 1;
|
|
|
|
collection->length = 0;
|
|
|
|
collection->node = node;
|
2010-02-06 21:34:28 +00:00
|
|
|
collection->current = node->children;
|
|
|
|
xmlelem_collection_updatelength(collection);
|
2007-12-30 10:49:17 +00:00
|
|
|
|
2012-09-09 19:47:25 +00:00
|
|
|
*ppObj = &collection->IXMLElementCollection_iface;
|
2007-12-30 10:49:17 +00:00
|
|
|
|
|
|
|
TRACE("returning iface %p\n", *ppObj);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|