dsound: Don't specify period size for the IAudioClient.
[wine] / dlls / msxml3 / pi.c
1 /*
2  *    DOM processing instruction node implementation
3  *
4  * Copyright 2006 Huw Davies
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #define COBJMACROS
22
23 #include "config.h"
24
25 #include <stdarg.h>
26 #ifdef HAVE_LIBXML2
27 # include <libxml/parser.h>
28 # include <libxml/xmlerror.h>
29 #endif
30
31 #include "windef.h"
32 #include "winbase.h"
33 #include "winuser.h"
34 #include "ole2.h"
35 #include "msxml6.h"
36
37 #include "msxml_private.h"
38
39 #include "wine/debug.h"
40
41 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
42
43 #ifdef HAVE_LIBXML2
44
45 typedef struct _dom_pi
46 {
47     xmlnode node;
48     IXMLDOMProcessingInstruction IXMLDOMProcessingInstruction_iface;
49     LONG ref;
50 } dom_pi;
51
52 static const struct nodemap_funcs dom_pi_attr_map;
53
54 static inline dom_pi *impl_from_IXMLDOMProcessingInstruction( IXMLDOMProcessingInstruction *iface )
55 {
56     return CONTAINING_RECORD(iface, dom_pi, IXMLDOMProcessingInstruction_iface);
57 }
58
59 static HRESULT WINAPI dom_pi_QueryInterface(
60     IXMLDOMProcessingInstruction *iface,
61     REFIID riid,
62     void** ppvObject )
63 {
64     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
65     TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
66
67     if ( IsEqualGUID( riid, &IID_IXMLDOMProcessingInstruction ) ||
68          IsEqualGUID( riid, &IID_IXMLDOMNode ) ||
69          IsEqualGUID( riid, &IID_IDispatch ) ||
70          IsEqualGUID( riid, &IID_IUnknown ) )
71     {
72         *ppvObject = iface;
73     }
74     else if(node_query_interface(&This->node, riid, ppvObject))
75     {
76         return *ppvObject ? S_OK : E_NOINTERFACE;
77     }
78     else
79     {
80         TRACE("Unsupported interface %s\n", debugstr_guid(riid));
81         *ppvObject = NULL;
82         return E_NOINTERFACE;
83     }
84
85     IUnknown_AddRef((IUnknown*)*ppvObject);
86     return S_OK;
87 }
88
89 static ULONG WINAPI dom_pi_AddRef(
90     IXMLDOMProcessingInstruction *iface )
91 {
92     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
93     ULONG ref = InterlockedIncrement( &This->ref );
94     TRACE("(%p)->(%d)\n", This, ref);
95     return ref;
96 }
97
98 static ULONG WINAPI dom_pi_Release(
99     IXMLDOMProcessingInstruction *iface )
100 {
101     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
102     ULONG ref = InterlockedDecrement( &This->ref );
103
104     TRACE("(%p)->(%d)\n", This, ref);
105     if ( ref == 0 )
106     {
107         destroy_xmlnode(&This->node);
108         heap_free( This );
109     }
110
111     return ref;
112 }
113
114 static HRESULT WINAPI dom_pi_GetTypeInfoCount(
115     IXMLDOMProcessingInstruction *iface,
116     UINT* pctinfo )
117 {
118     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
119
120     TRACE("(%p)->(%p)\n", This, pctinfo);
121
122     *pctinfo = 1;
123
124     return S_OK;
125 }
126
127 static HRESULT WINAPI dom_pi_GetTypeInfo(
128     IXMLDOMProcessingInstruction *iface,
129     UINT iTInfo, LCID lcid,
130     ITypeInfo** ppTInfo )
131 {
132     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
133
134     TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
135
136     return get_typeinfo(IXMLDOMProcessingInstruction_tid, ppTInfo);
137 }
138
139 static HRESULT WINAPI dom_pi_GetIDsOfNames(
140     IXMLDOMProcessingInstruction *iface,
141     REFIID riid, LPOLESTR* rgszNames,
142     UINT cNames, LCID lcid, DISPID* rgDispId )
143 {
144     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
145     ITypeInfo *typeinfo;
146     HRESULT hr;
147
148     TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
149           lcid, rgDispId);
150
151     if(!rgszNames || cNames == 0 || !rgDispId)
152         return E_INVALIDARG;
153
154     hr = get_typeinfo(IXMLDOMProcessingInstruction_tid, &typeinfo);
155     if(SUCCEEDED(hr))
156     {
157         hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
158         ITypeInfo_Release(typeinfo);
159     }
160
161     return hr;
162 }
163
164 static HRESULT WINAPI dom_pi_Invoke(
165     IXMLDOMProcessingInstruction *iface,
166     DISPID dispIdMember, REFIID riid, LCID lcid,
167     WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult,
168     EXCEPINFO* pExcepInfo, UINT* puArgErr )
169 {
170     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
171     ITypeInfo *typeinfo;
172     HRESULT hr;
173
174     TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
175           lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
176
177     hr = get_typeinfo(IXMLDOMProcessingInstruction_tid, &typeinfo);
178     if(SUCCEEDED(hr))
179     {
180        hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMProcessingInstruction_iface, dispIdMember,
181                 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
182         ITypeInfo_Release(typeinfo);
183     }
184
185     return hr;
186 }
187
188 static HRESULT WINAPI dom_pi_get_nodeName(
189     IXMLDOMProcessingInstruction *iface,
190     BSTR* p )
191 {
192     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
193
194     TRACE("(%p)->(%p)\n", This, p);
195
196     return node_get_nodeName(&This->node, p);
197 }
198
199 static HRESULT WINAPI dom_pi_get_nodeValue(
200     IXMLDOMProcessingInstruction *iface,
201     VARIANT* value)
202 {
203     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
204
205     TRACE("(%p)->(%p)\n", This, value);
206
207     return node_get_content(&This->node, value);
208 }
209
210 static HRESULT WINAPI dom_pi_put_nodeValue(
211     IXMLDOMProcessingInstruction *iface,
212     VARIANT value)
213 {
214     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
215     BSTR sTarget;
216     HRESULT hr;
217
218     TRACE("(%p)->(%s)\n", This, debugstr_variant(&value));
219
220     /* Cannot set data to a PI node whose target is 'xml' */
221     hr = dom_pi_get_nodeName(iface, &sTarget);
222     if(hr == S_OK)
223     {
224         static const WCHAR xmlW[] = {'x','m','l',0};
225         if(lstrcmpW( sTarget, xmlW) == 0)
226         {
227             SysFreeString(sTarget);
228             return E_FAIL;
229         }
230
231         SysFreeString(sTarget);
232     }
233
234     return node_put_value(&This->node, &value);
235 }
236
237 static HRESULT WINAPI dom_pi_get_nodeType(
238     IXMLDOMProcessingInstruction *iface,
239     DOMNodeType* domNodeType )
240 {
241     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
242
243     TRACE("(%p)->(%p)\n", This, domNodeType);
244
245     *domNodeType = NODE_PROCESSING_INSTRUCTION;
246     return S_OK;
247 }
248
249 static HRESULT WINAPI dom_pi_get_parentNode(
250     IXMLDOMProcessingInstruction *iface,
251     IXMLDOMNode** parent )
252 {
253     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
254
255     TRACE("(%p)->(%p)\n", This, parent);
256
257     return node_get_parent(&This->node, parent);
258 }
259
260 static HRESULT WINAPI dom_pi_get_childNodes(
261     IXMLDOMProcessingInstruction *iface,
262     IXMLDOMNodeList** outList)
263 {
264     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
265
266     TRACE("(%p)->(%p)\n", This, outList);
267
268     return node_get_child_nodes(&This->node, outList);
269 }
270
271 static HRESULT WINAPI dom_pi_get_firstChild(
272     IXMLDOMProcessingInstruction *iface,
273     IXMLDOMNode** domNode)
274 {
275     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
276
277     TRACE("(%p)->(%p)\n", This, domNode);
278
279     return return_null_node(domNode);
280 }
281
282 static HRESULT WINAPI dom_pi_get_lastChild(
283     IXMLDOMProcessingInstruction *iface,
284     IXMLDOMNode** domNode)
285 {
286     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
287
288     TRACE("(%p)->(%p)\n", This, domNode);
289
290     return return_null_node(domNode);
291 }
292
293 static HRESULT WINAPI dom_pi_get_previousSibling(
294     IXMLDOMProcessingInstruction *iface,
295     IXMLDOMNode** domNode)
296 {
297     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
298
299     TRACE("(%p)->(%p)\n", This, domNode);
300
301     return node_get_previous_sibling(&This->node, domNode);
302 }
303
304 static HRESULT WINAPI dom_pi_get_nextSibling(
305     IXMLDOMProcessingInstruction *iface,
306     IXMLDOMNode** domNode)
307 {
308     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
309
310     TRACE("(%p)->(%p)\n", This, domNode);
311
312     return node_get_next_sibling(&This->node, domNode);
313 }
314
315 static HRESULT WINAPI dom_pi_get_attributes(
316     IXMLDOMProcessingInstruction *iface,
317     IXMLDOMNamedNodeMap** map)
318 {
319     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
320     static const WCHAR xmlW[] = {'x','m','l',0};
321     HRESULT hr;
322     BSTR name;
323
324     TRACE("(%p)->(%p)\n", This, map);
325
326     if (!map) return E_INVALIDARG;
327
328     *map = NULL;
329
330     hr = node_get_nodeName(&This->node, &name);
331     if (hr != S_OK) return hr;
332
333     if (!strcmpW(name, xmlW))
334     {
335         FIXME("created dummy map for <?xml ?>\n");
336         *map = create_nodemap(This->node.node, &dom_pi_attr_map);
337         SysFreeString(name);
338         return S_OK;
339     }
340
341     SysFreeString(name);
342
343     return S_FALSE;
344 }
345
346 static HRESULT WINAPI dom_pi_insertBefore(
347     IXMLDOMProcessingInstruction *iface,
348     IXMLDOMNode* newNode, VARIANT refChild,
349     IXMLDOMNode** outOldNode)
350 {
351     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
352
353     FIXME("(%p)->(%p %s %p) needs test\n", This, newNode, debugstr_variant(&refChild), outOldNode);
354
355     return node_insert_before(&This->node, newNode, &refChild, outOldNode);
356 }
357
358 static HRESULT WINAPI dom_pi_replaceChild(
359     IXMLDOMProcessingInstruction *iface,
360     IXMLDOMNode* newNode,
361     IXMLDOMNode* oldNode,
362     IXMLDOMNode** outOldNode)
363 {
364     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
365
366     FIXME("(%p)->(%p %p %p) needs test\n", This, newNode, oldNode, outOldNode);
367
368     return node_replace_child(&This->node, newNode, oldNode, outOldNode);
369 }
370
371 static HRESULT WINAPI dom_pi_removeChild(
372     IXMLDOMProcessingInstruction *iface,
373     IXMLDOMNode *child, IXMLDOMNode **oldChild)
374 {
375     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
376     TRACE("(%p)->(%p %p)\n", This, child, oldChild);
377     return node_remove_child(&This->node, child, oldChild);
378 }
379
380 static HRESULT WINAPI dom_pi_appendChild(
381     IXMLDOMProcessingInstruction *iface,
382     IXMLDOMNode *child, IXMLDOMNode **outChild)
383 {
384     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
385     TRACE("(%p)->(%p %p)\n", This, child, outChild);
386     return node_append_child(&This->node, child, outChild);
387 }
388
389 static HRESULT WINAPI dom_pi_hasChildNodes(
390     IXMLDOMProcessingInstruction *iface,
391     VARIANT_BOOL *ret)
392 {
393     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
394     TRACE("(%p)->(%p)\n", This, ret);
395     return node_has_childnodes(&This->node, ret);
396 }
397
398 static HRESULT WINAPI dom_pi_get_ownerDocument(
399     IXMLDOMProcessingInstruction *iface,
400     IXMLDOMDocument **doc)
401 {
402     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
403     TRACE("(%p)->(%p)\n", This, doc);
404     return node_get_owner_doc(&This->node, doc);
405 }
406
407 static HRESULT WINAPI dom_pi_cloneNode(
408     IXMLDOMProcessingInstruction *iface,
409     VARIANT_BOOL deep, IXMLDOMNode** outNode)
410 {
411     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
412     TRACE("(%p)->(%d %p)\n", This, deep, outNode);
413     return node_clone( &This->node, deep, outNode );
414 }
415
416 static HRESULT WINAPI dom_pi_get_nodeTypeString(
417     IXMLDOMProcessingInstruction *iface,
418     BSTR* p)
419 {
420     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
421     static const WCHAR processinginstructionW[] =
422         {'p','r','o','c','e','s','s','i','n','g','i','n','s','t','r','u','c','t','i','o','n',0};
423
424     TRACE("(%p)->(%p)\n", This, p);
425
426     return return_bstr(processinginstructionW, p);
427 }
428
429 static HRESULT WINAPI dom_pi_get_text(
430     IXMLDOMProcessingInstruction *iface,
431     BSTR* p)
432 {
433     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
434     TRACE("(%p)->(%p)\n", This, p);
435     return node_get_text(&This->node, p);
436 }
437
438 static HRESULT WINAPI dom_pi_put_text(
439     IXMLDOMProcessingInstruction *iface,
440     BSTR p)
441 {
442     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
443     TRACE("(%p)->(%s)\n", This, debugstr_w(p));
444     return node_put_text( &This->node, p );
445 }
446
447 static HRESULT WINAPI dom_pi_get_specified(
448     IXMLDOMProcessingInstruction *iface,
449     VARIANT_BOOL* isSpecified)
450 {
451     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
452     FIXME("(%p)->(%p) stub!\n", This, isSpecified);
453     *isSpecified = VARIANT_TRUE;
454     return S_OK;
455 }
456
457 static HRESULT WINAPI dom_pi_get_definition(
458     IXMLDOMProcessingInstruction *iface,
459     IXMLDOMNode** definitionNode)
460 {
461     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
462     FIXME("(%p)->(%p)\n", This, definitionNode);
463     return E_NOTIMPL;
464 }
465
466 static HRESULT WINAPI dom_pi_get_nodeTypedValue(
467     IXMLDOMProcessingInstruction *iface,
468     VARIANT* v)
469 {
470     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
471     TRACE("(%p)->(%p)\n", This, v);
472     return node_get_content(&This->node, v);
473 }
474
475 static HRESULT WINAPI dom_pi_put_nodeTypedValue(
476     IXMLDOMProcessingInstruction *iface,
477     VARIANT typedValue)
478 {
479     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
480     FIXME("(%p)->(%s)\n", This, debugstr_variant(&typedValue));
481     return E_NOTIMPL;
482 }
483
484 static HRESULT WINAPI dom_pi_get_dataType(
485     IXMLDOMProcessingInstruction *iface,
486     VARIANT* typename)
487 {
488     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
489     TRACE("(%p)->(%p)\n", This, typename);
490     return return_null_var( typename );
491 }
492
493 static HRESULT WINAPI dom_pi_put_dataType(
494     IXMLDOMProcessingInstruction *iface,
495     BSTR p)
496 {
497     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
498
499     FIXME("(%p)->(%s)\n", This, debugstr_w(p));
500
501     if(!p)
502         return E_INVALIDARG;
503
504     return E_FAIL;
505 }
506
507 static HRESULT WINAPI dom_pi_get_xml(
508     IXMLDOMProcessingInstruction *iface,
509     BSTR* p)
510 {
511     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
512
513     TRACE("(%p)->(%p)\n", This, p);
514
515     return node_get_xml(&This->node, FALSE, FALSE, p);
516 }
517
518 static HRESULT WINAPI dom_pi_transformNode(
519     IXMLDOMProcessingInstruction *iface,
520     IXMLDOMNode *node, BSTR *p)
521 {
522     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
523     TRACE("(%p)->(%p %p)\n", This, node, p);
524     return node_transform_node(&This->node, node, p);
525 }
526
527 static HRESULT WINAPI dom_pi_selectNodes(
528     IXMLDOMProcessingInstruction *iface,
529     BSTR p, IXMLDOMNodeList** outList)
530 {
531     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
532     TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outList);
533     return node_select_nodes(&This->node, p, outList);
534 }
535
536 static HRESULT WINAPI dom_pi_selectSingleNode(
537     IXMLDOMProcessingInstruction *iface,
538     BSTR p, IXMLDOMNode** outNode)
539 {
540     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
541     TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outNode);
542     return node_select_singlenode(&This->node, p, outNode);
543 }
544
545 static HRESULT WINAPI dom_pi_get_parsed(
546     IXMLDOMProcessingInstruction *iface,
547     VARIANT_BOOL* isParsed)
548 {
549     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
550     FIXME("(%p)->(%p) stub!\n", This, isParsed);
551     *isParsed = VARIANT_TRUE;
552     return S_OK;
553 }
554
555 static HRESULT WINAPI dom_pi_get_namespaceURI(
556     IXMLDOMProcessingInstruction *iface,
557     BSTR* p)
558 {
559     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
560     TRACE("(%p)->(%p)\n", This, p);
561     return node_get_namespaceURI(&This->node, p);
562 }
563
564 static HRESULT WINAPI dom_pi_get_prefix(
565     IXMLDOMProcessingInstruction *iface,
566     BSTR* prefix)
567 {
568     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
569     TRACE("(%p)->(%p)\n", This, prefix);
570     return return_null_bstr( prefix );
571 }
572
573 static HRESULT WINAPI dom_pi_get_baseName(
574     IXMLDOMProcessingInstruction *iface,
575     BSTR* name)
576 {
577     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
578     TRACE("(%p)->(%p)\n", This, name);
579     return node_get_base_name( &This->node, name );
580 }
581
582 static HRESULT WINAPI dom_pi_transformNodeToObject(
583     IXMLDOMProcessingInstruction *iface,
584     IXMLDOMNode* domNode, VARIANT var1)
585 {
586     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
587     FIXME("(%p)->(%p %s)\n", This, domNode, debugstr_variant(&var1));
588     return E_NOTIMPL;
589 }
590
591 static HRESULT WINAPI dom_pi_get_target(
592     IXMLDOMProcessingInstruction *iface,
593     BSTR *p)
594 {
595     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
596
597     TRACE("(%p)->(%p)\n", This, p);
598
599     /* target returns the same value as nodeName property */
600     return node_get_nodeName(&This->node, p);
601 }
602
603 static HRESULT WINAPI dom_pi_get_data(
604     IXMLDOMProcessingInstruction *iface,
605     BSTR *p)
606 {
607     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
608     HRESULT hr;
609     VARIANT ret;
610
611     TRACE("(%p)->(%p)\n", This, p);
612
613     if(!p)
614         return E_INVALIDARG;
615
616     hr = IXMLDOMProcessingInstruction_get_nodeValue( iface, &ret );
617     if(hr == S_OK)
618     {
619         *p = V_BSTR(&ret);
620     }
621
622     return hr;
623 }
624
625 static HRESULT WINAPI dom_pi_put_data(
626     IXMLDOMProcessingInstruction *iface,
627     BSTR data)
628 {
629     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
630     HRESULT hr;
631     VARIANT val;
632     BSTR sTarget;
633
634     TRACE("(%p)->(%s)\n", This, debugstr_w(data) );
635
636     /* Cannot set data to a PI node whose target is 'xml' */
637     hr = dom_pi_get_nodeName(iface, &sTarget);
638     if(hr == S_OK)
639     {
640         static const WCHAR xmlW[] = {'x','m','l',0};
641         if(lstrcmpW( sTarget, xmlW) == 0)
642         {
643             SysFreeString(sTarget);
644             return E_FAIL;
645         }
646
647         SysFreeString(sTarget);
648     }
649
650     V_VT(&val) = VT_BSTR;
651     V_BSTR(&val) = data;
652
653     return IXMLDOMProcessingInstruction_put_nodeValue( iface, val );
654 }
655
656 static const struct IXMLDOMProcessingInstructionVtbl dom_pi_vtbl =
657 {
658     dom_pi_QueryInterface,
659     dom_pi_AddRef,
660     dom_pi_Release,
661     dom_pi_GetTypeInfoCount,
662     dom_pi_GetTypeInfo,
663     dom_pi_GetIDsOfNames,
664     dom_pi_Invoke,
665     dom_pi_get_nodeName,
666     dom_pi_get_nodeValue,
667     dom_pi_put_nodeValue,
668     dom_pi_get_nodeType,
669     dom_pi_get_parentNode,
670     dom_pi_get_childNodes,
671     dom_pi_get_firstChild,
672     dom_pi_get_lastChild,
673     dom_pi_get_previousSibling,
674     dom_pi_get_nextSibling,
675     dom_pi_get_attributes,
676     dom_pi_insertBefore,
677     dom_pi_replaceChild,
678     dom_pi_removeChild,
679     dom_pi_appendChild,
680     dom_pi_hasChildNodes,
681     dom_pi_get_ownerDocument,
682     dom_pi_cloneNode,
683     dom_pi_get_nodeTypeString,
684     dom_pi_get_text,
685     dom_pi_put_text,
686     dom_pi_get_specified,
687     dom_pi_get_definition,
688     dom_pi_get_nodeTypedValue,
689     dom_pi_put_nodeTypedValue,
690     dom_pi_get_dataType,
691     dom_pi_put_dataType,
692     dom_pi_get_xml,
693     dom_pi_transformNode,
694     dom_pi_selectNodes,
695     dom_pi_selectSingleNode,
696     dom_pi_get_parsed,
697     dom_pi_get_namespaceURI,
698     dom_pi_get_prefix,
699     dom_pi_get_baseName,
700     dom_pi_transformNodeToObject,
701
702     dom_pi_get_target,
703     dom_pi_get_data,
704     dom_pi_put_data
705 };
706
707 static HRESULT dom_pi_get_qualified_item(const xmlNodePtr node, BSTR name, BSTR uri,
708     IXMLDOMNode **item)
709 {
710     FIXME("(%p)->(%s %s %p): stub\n", node, debugstr_w(name), debugstr_w(uri), item);
711     return E_NOTIMPL;
712 }
713
714 static HRESULT dom_pi_get_named_item(const xmlNodePtr node, BSTR name, IXMLDOMNode **item)
715 {
716     FIXME("(%p)->(%s %p): stub\n", node, debugstr_w(name), item );
717     return E_NOTIMPL;
718 }
719
720 static HRESULT dom_pi_set_named_item(xmlNodePtr node, IXMLDOMNode *newItem, IXMLDOMNode **namedItem)
721 {
722     FIXME("(%p)->(%p %p): stub\n", node, newItem, namedItem );
723     return E_NOTIMPL;
724 }
725
726 static HRESULT dom_pi_remove_qualified_item(xmlNodePtr node, BSTR name, BSTR uri, IXMLDOMNode **item)
727 {
728     FIXME("(%p)->(%s %s %p): stub\n", node, debugstr_w(name), debugstr_w(uri), item);
729     return E_NOTIMPL;
730 }
731
732 static HRESULT dom_pi_remove_named_item(xmlNodePtr node, BSTR name, IXMLDOMNode **item)
733 {
734     FIXME("(%p)->(%s %p): stub\n", node, debugstr_w(name), item);
735     return E_NOTIMPL;
736 }
737
738 static HRESULT dom_pi_get_item(const xmlNodePtr node, LONG index, IXMLDOMNode **item)
739 {
740     FIXME("(%p)->(%d %p): stub\n", node, index, item);
741     return E_NOTIMPL;
742 }
743
744 static HRESULT dom_pi_get_length(const xmlNodePtr node, LONG *length)
745 {
746     FIXME("(%p)->(%p): stub\n", node, length);
747
748     *length = 0;
749     return S_OK;
750 }
751
752 static HRESULT dom_pi_next_node(const xmlNodePtr node, LONG *iter, IXMLDOMNode **nextNode)
753 {
754     FIXME("(%p)->(%d %p): stub\n", node, *iter, nextNode);
755     return E_NOTIMPL;
756 }
757
758 static const struct nodemap_funcs dom_pi_attr_map = {
759     dom_pi_get_named_item,
760     dom_pi_set_named_item,
761     dom_pi_remove_named_item,
762     dom_pi_get_item,
763     dom_pi_get_length,
764     dom_pi_get_qualified_item,
765     dom_pi_remove_qualified_item,
766     dom_pi_next_node
767 };
768
769 static const tid_t dompi_iface_tids[] = {
770     IXMLDOMProcessingInstruction_tid,
771     0
772 };
773
774 static dispex_static_data_t dompi_dispex = {
775     NULL,
776     IXMLDOMProcessingInstruction_tid,
777     NULL,
778     dompi_iface_tids
779 };
780
781 IUnknown* create_pi( xmlNodePtr pi )
782 {
783     dom_pi *This;
784
785     This = heap_alloc( sizeof *This );
786     if ( !This )
787         return NULL;
788
789     This->IXMLDOMProcessingInstruction_iface.lpVtbl = &dom_pi_vtbl;
790     This->ref = 1;
791
792     init_xmlnode(&This->node, pi, (IXMLDOMNode*)&This->IXMLDOMProcessingInstruction_iface, &dompi_dispex);
793
794     return (IUnknown*)&This->IXMLDOMProcessingInstruction_iface;
795 }
796
797 #endif