quartz: Fix checking for duration.
[wine/wine64.git] / dlls / msxml3 / text.c
blob52163a2c604dc87a2811a562e08e8dd0ef7c9095
1 /*
2 * DOM text node implementation
4 * Copyright 2006 Huw Davies
5 * Copyright 2007-2008 Alistair Leslie-Hughes
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #define COBJMACROS
24 #include "config.h"
26 #include <stdarg.h>
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winuser.h"
30 #include "ole2.h"
31 #include "msxml2.h"
33 #include "msxml_private.h"
35 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
39 #ifdef HAVE_LIBXML2
41 typedef struct _domtext
43 const struct IXMLDOMTextVtbl *lpVtbl;
44 LONG ref;
45 IUnknown *element_unk;
46 IXMLDOMElement *element;
47 } domtext;
49 static inline domtext *impl_from_IXMLDOMText( IXMLDOMText *iface )
51 return (domtext *)((char*)iface - FIELD_OFFSET(domtext, lpVtbl));
54 static HRESULT WINAPI domtext_QueryInterface(
55 IXMLDOMText *iface,
56 REFIID riid,
57 void** ppvObject )
59 domtext *This = impl_from_IXMLDOMText( iface );
60 TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
62 if ( IsEqualGUID( riid, &IID_IXMLDOMText ) ||
63 IsEqualGUID( riid, &IID_IXMLDOMCharacterData) ||
64 IsEqualGUID( riid, &IID_IDispatch ) ||
65 IsEqualGUID( riid, &IID_IUnknown ) )
67 *ppvObject = iface;
69 else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) ||
70 IsEqualGUID( riid, &IID_IXMLDOMElement ) )
72 return IUnknown_QueryInterface(This->element_unk, riid, ppvObject);
74 else
76 FIXME("Unsupported interface %s\n", debugstr_guid(riid));
77 return E_NOINTERFACE;
80 IXMLDOMText_AddRef( iface );
82 return S_OK;
85 static ULONG WINAPI domtext_AddRef(
86 IXMLDOMText *iface )
88 domtext *This = impl_from_IXMLDOMText( iface );
89 return InterlockedIncrement( &This->ref );
92 static ULONG WINAPI domtext_Release(
93 IXMLDOMText *iface )
95 domtext *This = impl_from_IXMLDOMText( iface );
96 ULONG ref;
98 ref = InterlockedDecrement( &This->ref );
99 if ( ref == 0 )
101 IUnknown_Release( This->element_unk );
102 HeapFree( GetProcessHeap(), 0, This );
105 return ref;
108 static HRESULT WINAPI domtext_GetTypeInfoCount(
109 IXMLDOMText *iface,
110 UINT* pctinfo )
112 domtext *This = impl_from_IXMLDOMText( iface );
114 TRACE("(%p)->(%p)\n", This, pctinfo);
116 *pctinfo = 1;
118 return S_OK;
121 static HRESULT WINAPI domtext_GetTypeInfo(
122 IXMLDOMText *iface,
123 UINT iTInfo, LCID lcid,
124 ITypeInfo** ppTInfo )
126 domtext *This = impl_from_IXMLDOMText( iface );
127 HRESULT hr;
129 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
131 hr = get_typeinfo(IXMLDOMText_tid, ppTInfo);
133 return hr;
136 static HRESULT WINAPI domtext_GetIDsOfNames(
137 IXMLDOMText *iface,
138 REFIID riid, LPOLESTR* rgszNames,
139 UINT cNames, LCID lcid, DISPID* rgDispId )
141 domtext *This = impl_from_IXMLDOMText( iface );
142 ITypeInfo *typeinfo;
143 HRESULT hr;
145 TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
146 lcid, rgDispId);
148 if(!rgszNames || cNames == 0 || !rgDispId)
149 return E_INVALIDARG;
151 hr = get_typeinfo(IXMLDOMText_tid, &typeinfo);
152 if(SUCCEEDED(hr))
154 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
155 ITypeInfo_Release(typeinfo);
158 return hr;
161 static HRESULT WINAPI domtext_Invoke(
162 IXMLDOMText *iface,
163 DISPID dispIdMember, REFIID riid, LCID lcid,
164 WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult,
165 EXCEPINFO* pExcepInfo, UINT* puArgErr )
167 domtext *This = impl_from_IXMLDOMText( iface );
168 ITypeInfo *typeinfo;
169 HRESULT hr;
171 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
172 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
174 hr = get_typeinfo(IXMLDOMText_tid, &typeinfo);
175 if(SUCCEEDED(hr))
177 hr = ITypeInfo_Invoke(typeinfo, &(This->lpVtbl), dispIdMember, wFlags, pDispParams,
178 pVarResult, pExcepInfo, puArgErr);
179 ITypeInfo_Release(typeinfo);
182 return hr;
185 static HRESULT WINAPI domtext_get_nodeName(
186 IXMLDOMText *iface,
187 BSTR* p )
189 domtext *This = impl_from_IXMLDOMText( iface );
190 return IXMLDOMNode_get_nodeName( This->element, p );
193 static HRESULT WINAPI domtext_get_nodeValue(
194 IXMLDOMText *iface,
195 VARIANT* var1 )
197 domtext *This = impl_from_IXMLDOMText( iface );
198 return IXMLDOMNode_get_nodeValue( This->element, var1 );
201 static HRESULT WINAPI domtext_put_nodeValue(
202 IXMLDOMText *iface,
203 VARIANT var1 )
205 domtext *This = impl_from_IXMLDOMText( iface );
206 return IXMLDOMNode_put_nodeValue( This->element, var1 );
209 static HRESULT WINAPI domtext_get_nodeType(
210 IXMLDOMText *iface,
211 DOMNodeType* domNodeType )
213 domtext *This = impl_from_IXMLDOMText( iface );
214 return IXMLDOMNode_get_nodeType( This->element, domNodeType );
217 static HRESULT WINAPI domtext_get_parentNode(
218 IXMLDOMText *iface,
219 IXMLDOMNode** parent )
221 domtext *This = impl_from_IXMLDOMText( iface );
222 return IXMLDOMNode_get_parentNode( This->element, parent );
225 static HRESULT WINAPI domtext_get_childNodes(
226 IXMLDOMText *iface,
227 IXMLDOMNodeList** outList)
229 domtext *This = impl_from_IXMLDOMText( iface );
230 return IXMLDOMNode_get_childNodes( This->element, outList );
233 static HRESULT WINAPI domtext_get_firstChild(
234 IXMLDOMText *iface,
235 IXMLDOMNode** domNode)
237 domtext *This = impl_from_IXMLDOMText( iface );
238 return IXMLDOMNode_get_firstChild( This->element, domNode );
241 static HRESULT WINAPI domtext_get_lastChild(
242 IXMLDOMText *iface,
243 IXMLDOMNode** domNode)
245 domtext *This = impl_from_IXMLDOMText( iface );
246 return IXMLDOMNode_get_lastChild( This->element, domNode );
249 static HRESULT WINAPI domtext_get_previousSibling(
250 IXMLDOMText *iface,
251 IXMLDOMNode** domNode)
253 domtext *This = impl_from_IXMLDOMText( iface );
254 return IXMLDOMNode_get_previousSibling( This->element, domNode );
257 static HRESULT WINAPI domtext_get_nextSibling(
258 IXMLDOMText *iface,
259 IXMLDOMNode** domNode)
261 domtext *This = impl_from_IXMLDOMText( iface );
262 return IXMLDOMNode_get_nextSibling( This->element, domNode );
265 static HRESULT WINAPI domtext_get_attributes(
266 IXMLDOMText *iface,
267 IXMLDOMNamedNodeMap** attributeMap)
269 domtext *This = impl_from_IXMLDOMText( iface );
270 return IXMLDOMNode_get_attributes( This->element, attributeMap );
273 static HRESULT WINAPI domtext_insertBefore(
274 IXMLDOMText *iface,
275 IXMLDOMNode* newNode, VARIANT var1,
276 IXMLDOMNode** outOldNode)
278 domtext *This = impl_from_IXMLDOMText( iface );
279 return IXMLDOMNode_insertBefore( This->element, newNode, var1, outOldNode );
282 static HRESULT WINAPI domtext_replaceChild(
283 IXMLDOMText *iface,
284 IXMLDOMNode* newNode,
285 IXMLDOMNode* oldNode,
286 IXMLDOMNode** outOldNode)
288 domtext *This = impl_from_IXMLDOMText( iface );
289 return IXMLDOMNode_replaceChild( This->element, newNode, oldNode, outOldNode );
292 static HRESULT WINAPI domtext_removeChild(
293 IXMLDOMText *iface,
294 IXMLDOMNode* domNode, IXMLDOMNode** oldNode)
296 domtext *This = impl_from_IXMLDOMText( iface );
297 return IXMLDOMNode_removeChild( This->element, domNode, oldNode );
300 static HRESULT WINAPI domtext_appendChild(
301 IXMLDOMText *iface,
302 IXMLDOMNode* newNode, IXMLDOMNode** outNewNode)
304 domtext *This = impl_from_IXMLDOMText( iface );
305 return IXMLDOMNode_appendChild( This->element, newNode, outNewNode );
308 static HRESULT WINAPI domtext_hasChildNodes(
309 IXMLDOMText *iface,
310 VARIANT_BOOL* pbool)
312 domtext *This = impl_from_IXMLDOMText( iface );
313 return IXMLDOMNode_hasChildNodes( This->element, pbool );
316 static HRESULT WINAPI domtext_get_ownerDocument(
317 IXMLDOMText *iface,
318 IXMLDOMDocument** domDocument)
320 domtext *This = impl_from_IXMLDOMText( iface );
321 return IXMLDOMNode_get_ownerDocument( This->element, domDocument );
324 static HRESULT WINAPI domtext_cloneNode(
325 IXMLDOMText *iface,
326 VARIANT_BOOL pbool, IXMLDOMNode** outNode)
328 domtext *This = impl_from_IXMLDOMText( iface );
329 return IXMLDOMNode_cloneNode( This->element, pbool, outNode );
332 static HRESULT WINAPI domtext_get_nodeTypeString(
333 IXMLDOMText *iface,
334 BSTR* p)
336 domtext *This = impl_from_IXMLDOMText( iface );
337 return IXMLDOMNode_get_nodeTypeString( This->element, p );
340 static HRESULT WINAPI domtext_get_text(
341 IXMLDOMText *iface,
342 BSTR* p)
344 domtext *This = impl_from_IXMLDOMText( iface );
345 return IXMLDOMNode_get_text( This->element, p );
348 static HRESULT WINAPI domtext_put_text(
349 IXMLDOMText *iface,
350 BSTR p)
352 domtext *This = impl_from_IXMLDOMText( iface );
353 return IXMLDOMNode_put_text( This->element, p );
356 static HRESULT WINAPI domtext_get_specified(
357 IXMLDOMText *iface,
358 VARIANT_BOOL* pbool)
360 domtext *This = impl_from_IXMLDOMText( iface );
361 return IXMLDOMNode_get_specified( This->element, pbool );
364 static HRESULT WINAPI domtext_get_definition(
365 IXMLDOMText *iface,
366 IXMLDOMNode** domNode)
368 domtext *This = impl_from_IXMLDOMText( iface );
369 return IXMLDOMNode_get_definition( This->element, domNode );
372 static HRESULT WINAPI domtext_get_nodeTypedValue(
373 IXMLDOMText *iface,
374 VARIANT* var1)
376 domtext *This = impl_from_IXMLDOMText( iface );
377 return IXMLDOMNode_get_nodeTypedValue( This->element, var1 );
380 static HRESULT WINAPI domtext_put_nodeTypedValue(
381 IXMLDOMText *iface,
382 VARIANT var1)
384 domtext *This = impl_from_IXMLDOMText( iface );
385 return IXMLDOMNode_put_nodeTypedValue( This->element, var1 );
388 static HRESULT WINAPI domtext_get_dataType(
389 IXMLDOMText *iface,
390 VARIANT* var1)
392 domtext *This = impl_from_IXMLDOMText( iface );
393 return IXMLDOMNode_get_dataType( This->element, var1 );
396 static HRESULT WINAPI domtext_put_dataType(
397 IXMLDOMText *iface,
398 BSTR p)
400 domtext *This = impl_from_IXMLDOMText( iface );
401 return IXMLDOMNode_put_dataType( This->element, p );
404 static HRESULT WINAPI domtext_get_xml(
405 IXMLDOMText *iface,
406 BSTR* p)
408 domtext *This = impl_from_IXMLDOMText( iface );
409 return IXMLDOMNode_get_xml( This->element, p );
412 static HRESULT WINAPI domtext_transformNode(
413 IXMLDOMText *iface,
414 IXMLDOMNode* domNode, BSTR* p)
416 domtext *This = impl_from_IXMLDOMText( iface );
417 return IXMLDOMNode_transformNode( This->element, domNode, p );
420 static HRESULT WINAPI domtext_selectNodes(
421 IXMLDOMText *iface,
422 BSTR p, IXMLDOMNodeList** outList)
424 domtext *This = impl_from_IXMLDOMText( iface );
425 return IXMLDOMNode_selectNodes( This->element, p, outList );
428 static HRESULT WINAPI domtext_selectSingleNode(
429 IXMLDOMText *iface,
430 BSTR p, IXMLDOMNode** outNode)
432 domtext *This = impl_from_IXMLDOMText( iface );
433 return IXMLDOMNode_selectSingleNode( This->element, p, outNode );
436 static HRESULT WINAPI domtext_get_parsed(
437 IXMLDOMText *iface,
438 VARIANT_BOOL* pbool)
440 domtext *This = impl_from_IXMLDOMText( iface );
441 return IXMLDOMNode_get_parsed( This->element, pbool );
444 static HRESULT WINAPI domtext_get_namespaceURI(
445 IXMLDOMText *iface,
446 BSTR* p)
448 domtext *This = impl_from_IXMLDOMText( iface );
449 return IXMLDOMNode_get_namespaceURI( This->element, p );
452 static HRESULT WINAPI domtext_get_prefix(
453 IXMLDOMText *iface,
454 BSTR* p)
456 domtext *This = impl_from_IXMLDOMText( iface );
457 return IXMLDOMNode_get_prefix( This->element, p );
460 static HRESULT WINAPI domtext_get_baseName(
461 IXMLDOMText *iface,
462 BSTR* p)
464 domtext *This = impl_from_IXMLDOMText( iface );
465 return IXMLDOMNode_get_baseName( This->element, p );
468 static HRESULT WINAPI domtext_transformNodeToObject(
469 IXMLDOMText *iface,
470 IXMLDOMNode* domNode, VARIANT var1)
472 domtext *This = impl_from_IXMLDOMText( iface );
473 return IXMLDOMNode_transformNodeToObject( This->element, domNode, var1 );
476 static HRESULT WINAPI domtext_get_data(
477 IXMLDOMText *iface,
478 BSTR *p)
480 domtext *This = impl_from_IXMLDOMText( iface );
481 HRESULT hr = E_FAIL;
482 VARIANT vRet;
484 if(!p)
485 return E_INVALIDARG;
487 hr = IXMLDOMNode_get_nodeValue( This->element, &vRet );
488 if(hr == S_OK)
490 *p = V_BSTR(&vRet);
493 return hr;
496 static HRESULT WINAPI domtext_put_data(
497 IXMLDOMText *iface,
498 BSTR data)
500 domtext *This = impl_from_IXMLDOMText( iface );
501 HRESULT hr = E_FAIL;
502 VARIANT val;
504 TRACE("%p %s\n", This, debugstr_w(data) );
506 V_VT(&val) = VT_BSTR;
507 V_BSTR(&val) = data;
509 hr = IXMLDOMNode_put_nodeValue( This->element, val );
511 return hr;
514 static HRESULT WINAPI domtext_get_length(
515 IXMLDOMText *iface,
516 long *len)
518 domtext *This = impl_from_IXMLDOMText( iface );
519 xmlnode *pDOMNode = impl_from_IXMLDOMNode( (IXMLDOMNode*)This->element );
520 xmlChar *pContent;
521 long nLength = 0;
523 TRACE("%p\n", iface);
525 if(!len)
526 return E_INVALIDARG;
528 pContent = xmlNodeGetContent(pDOMNode->node);
529 if(pContent)
531 nLength = xmlStrlen(pContent);
532 xmlFree(pContent);
535 *len = nLength;
537 return S_OK;
540 static HRESULT WINAPI domtext_substringData(
541 IXMLDOMText *iface,
542 long offset, long count, BSTR *p)
544 domtext *This = impl_from_IXMLDOMText( iface );
545 xmlnode *pDOMNode = impl_from_IXMLDOMNode( (IXMLDOMNode*)This->element );
546 xmlChar *pContent;
547 long nLength = 0;
548 HRESULT hr = S_FALSE;
550 TRACE("%p\n", iface);
552 if(!p)
553 return E_INVALIDARG;
555 *p = NULL;
556 if(offset < 0 || count < 0)
557 return E_INVALIDARG;
559 if(count == 0)
560 return hr;
562 pContent = xmlNodeGetContent(pDOMNode->node);
563 if(pContent)
565 nLength = xmlStrlen(pContent);
567 if( offset < nLength)
569 BSTR sContent = bstr_from_xmlChar(pContent);
570 if(offset + count > nLength)
571 *p = SysAllocString(&sContent[offset]);
572 else
573 *p = SysAllocStringLen(&sContent[offset], count);
575 SysFreeString(sContent);
576 hr = S_OK;
579 xmlFree(pContent);
582 return hr;
585 static HRESULT WINAPI domtext_appendData(
586 IXMLDOMText *iface,
587 BSTR p)
589 domtext *This = impl_from_IXMLDOMText( iface );
590 xmlnode *pDOMNode = impl_from_IXMLDOMNode( (IXMLDOMNode*)This->element );
591 xmlChar *pContent;
592 HRESULT hr = S_FALSE;
594 TRACE("%p\n", iface);
596 /* Nothing to do if NULL or an Empty string passed in. */
597 if(p == NULL || SysStringLen(p) == 0)
598 return S_OK;
600 pContent = xmlChar_from_wchar( (WCHAR*)p );
601 if(pContent)
603 if(xmlTextConcat(pDOMNode->node, pContent, SysStringLen(p) ) == 0)
604 hr = S_OK;
605 else
607 hr = E_FAIL;
608 xmlFree(pContent);
611 else
612 hr = E_FAIL;
614 return hr;
617 static HRESULT WINAPI domtext_insertData(
618 IXMLDOMText *iface,
619 long offset, BSTR p)
621 domtext *This = impl_from_IXMLDOMText( iface );
622 xmlnode *pDOMNode = impl_from_IXMLDOMNode( (IXMLDOMNode*)This->element );
623 xmlChar *pXmlContent;
624 BSTR sNewString;
625 HRESULT hr = S_FALSE;
626 long nLength = 0, nLengthP = 0;
627 xmlChar *str = NULL;
629 TRACE("%p\n", This);
631 /* If have a NULL or empty string, don't do anything. */
632 if(SysStringLen(p) == 0)
633 return S_OK;
635 if(offset < 0)
637 return E_INVALIDARG;
640 pXmlContent = xmlNodeGetContent(pDOMNode->node);
641 if(pXmlContent)
643 BSTR sContent = bstr_from_xmlChar( pXmlContent );
644 nLength = SysStringLen(sContent);
645 nLengthP = SysStringLen(p);
647 if(nLength < offset)
649 SysFreeString(sContent);
650 xmlFree(pXmlContent);
652 return E_INVALIDARG;
655 sNewString = SysAllocStringLen(NULL, nLength + nLengthP + 1);
656 if(sNewString)
658 if(offset > 0)
659 memcpy(sNewString, sContent, offset * sizeof(WCHAR));
661 memcpy(&sNewString[offset], p, nLengthP * sizeof(WCHAR));
663 if(offset+nLengthP < nLength)
664 memcpy(&sNewString[offset+nLengthP], &sContent[offset], (nLength-offset) * sizeof(WCHAR));
666 sNewString[nLengthP + nLength] = 0;
668 str = xmlChar_from_wchar((WCHAR*)sNewString);
669 if(str)
671 xmlNodeSetContent(pDOMNode->node, str);
672 hr = S_OK;
675 SysFreeString(sNewString);
678 SysFreeString(sContent);
680 xmlFree(pXmlContent);
683 return hr;
686 static HRESULT WINAPI domtext_deleteData(
687 IXMLDOMText *iface,
688 long offset, long count)
690 FIXME("\n");
691 return E_NOTIMPL;
694 static HRESULT WINAPI domtext_replaceData(
695 IXMLDOMText *iface,
696 long offset, long count, BSTR p)
698 FIXME("\n");
699 return E_NOTIMPL;
702 static HRESULT WINAPI domtext_splitText(
703 IXMLDOMText *iface,
704 long offset, IXMLDOMText **txtNode)
706 FIXME("\n");
707 return E_NOTIMPL;
711 static const struct IXMLDOMTextVtbl domtext_vtbl =
713 domtext_QueryInterface,
714 domtext_AddRef,
715 domtext_Release,
716 domtext_GetTypeInfoCount,
717 domtext_GetTypeInfo,
718 domtext_GetIDsOfNames,
719 domtext_Invoke,
720 domtext_get_nodeName,
721 domtext_get_nodeValue,
722 domtext_put_nodeValue,
723 domtext_get_nodeType,
724 domtext_get_parentNode,
725 domtext_get_childNodes,
726 domtext_get_firstChild,
727 domtext_get_lastChild,
728 domtext_get_previousSibling,
729 domtext_get_nextSibling,
730 domtext_get_attributes,
731 domtext_insertBefore,
732 domtext_replaceChild,
733 domtext_removeChild,
734 domtext_appendChild,
735 domtext_hasChildNodes,
736 domtext_get_ownerDocument,
737 domtext_cloneNode,
738 domtext_get_nodeTypeString,
739 domtext_get_text,
740 domtext_put_text,
741 domtext_get_specified,
742 domtext_get_definition,
743 domtext_get_nodeTypedValue,
744 domtext_put_nodeTypedValue,
745 domtext_get_dataType,
746 domtext_put_dataType,
747 domtext_get_xml,
748 domtext_transformNode,
749 domtext_selectNodes,
750 domtext_selectSingleNode,
751 domtext_get_parsed,
752 domtext_get_namespaceURI,
753 domtext_get_prefix,
754 domtext_get_baseName,
755 domtext_transformNodeToObject,
756 domtext_get_data,
757 domtext_put_data,
758 domtext_get_length,
759 domtext_substringData,
760 domtext_appendData,
761 domtext_insertData,
762 domtext_deleteData,
763 domtext_replaceData,
764 domtext_splitText
767 IUnknown* create_text( xmlNodePtr text )
769 domtext *This;
770 HRESULT hr;
772 This = HeapAlloc( GetProcessHeap(), 0, sizeof *This );
773 if ( !This )
774 return NULL;
776 This->lpVtbl = &domtext_vtbl;
777 This->ref = 1;
779 This->element_unk = create_element( text, (IUnknown*)&This->lpVtbl );
780 if(!This->element_unk)
782 HeapFree(GetProcessHeap(), 0, This);
783 return NULL;
786 hr = IUnknown_QueryInterface(This->element_unk, &IID_IXMLDOMNode, (LPVOID*)&This->element);
787 if(FAILED(hr))
789 IUnknown_Release(This->element_unk);
790 HeapFree( GetProcessHeap(), 0, This );
791 return NULL;
793 /* The ref on This->element is actually looped back into this object, so release it */
794 IXMLDOMNode_Release(This->element);
796 return (IUnknown*) &This->lpVtbl;
799 #endif