msxml3: Suppress IID_IRunnableObject FIXME since its not supported.
[wine.git] / dlls / msxml3 / pi.c
blob3f997e2280bc90973d6a08e1677cc162b0ce2f7e
1 /*
2 * DOM processing instruction node implementation
4 * Copyright 2006 Huw Davies
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.
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.
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
21 #define COBJMACROS
23 #include "config.h"
25 #include <stdarg.h>
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "ole2.h"
30 #include "msxml2.h"
32 #include "msxml_private.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
38 #ifdef HAVE_LIBXML2
40 typedef struct _dom_pi
42 const struct IXMLDOMProcessingInstructionVtbl *lpVtbl;
43 LONG ref;
44 IUnknown *node_unk;
45 IXMLDOMNode *node;
46 } dom_pi;
48 static inline dom_pi *impl_from_IXMLDOMProcessingInstruction( IXMLDOMProcessingInstruction *iface )
50 return (dom_pi *)((char*)iface - FIELD_OFFSET(dom_pi, lpVtbl));
53 static HRESULT WINAPI dom_pi_QueryInterface(
54 IXMLDOMProcessingInstruction *iface,
55 REFIID riid,
56 void** ppvObject )
58 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
59 TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
61 if ( IsEqualGUID( riid, &IID_IXMLDOMProcessingInstruction ) ||
62 IsEqualGUID( riid, &IID_IUnknown ) )
64 *ppvObject = iface;
66 else if ( IsEqualGUID( riid, &IID_IDispatch ) ||
67 IsEqualGUID( riid, &IID_IXMLDOMNode ) )
69 return IUnknown_QueryInterface(This->node_unk, riid, ppvObject);
71 else
73 FIXME("Unsupported inteferace %s\n", debugstr_guid(riid));
74 return E_NOINTERFACE;
77 IXMLDOMProcessingInstruction_AddRef( iface );
79 return S_OK;
82 static ULONG WINAPI dom_pi_AddRef(
83 IXMLDOMProcessingInstruction *iface )
85 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
86 return InterlockedIncrement( &This->ref );
89 static ULONG WINAPI dom_pi_Release(
90 IXMLDOMProcessingInstruction *iface )
92 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
93 ULONG ref;
95 ref = InterlockedDecrement( &This->ref );
96 if ( ref == 0 )
98 IUnknown_Release( This->node_unk );
99 HeapFree( GetProcessHeap(), 0, This );
102 return ref;
105 static HRESULT WINAPI dom_pi_GetTypeInfoCount(
106 IXMLDOMProcessingInstruction *iface,
107 UINT* pctinfo )
109 FIXME("\n");
110 return E_NOTIMPL;
113 static HRESULT WINAPI dom_pi_GetTypeInfo(
114 IXMLDOMProcessingInstruction *iface,
115 UINT iTInfo, LCID lcid,
116 ITypeInfo** ppTInfo )
118 FIXME("\n");
119 return E_NOTIMPL;
122 static HRESULT WINAPI dom_pi_GetIDsOfNames(
123 IXMLDOMProcessingInstruction *iface,
124 REFIID riid, LPOLESTR* rgszNames,
125 UINT cNames, LCID lcid, DISPID* rgDispId )
127 FIXME("\n");
128 return E_NOTIMPL;
131 static HRESULT WINAPI dom_pi_Invoke(
132 IXMLDOMProcessingInstruction *iface,
133 DISPID dispIdMember, REFIID riid, LCID lcid,
134 WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult,
135 EXCEPINFO* pExcepInfo, UINT* puArgErr )
137 FIXME("\n");
138 return E_NOTIMPL;
141 static HRESULT WINAPI dom_pi_get_nodeName(
142 IXMLDOMProcessingInstruction *iface,
143 BSTR* p )
145 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
146 return IXMLDOMNode_get_nodeName( This->node, p );
149 static HRESULT WINAPI dom_pi_get_nodeValue(
150 IXMLDOMProcessingInstruction *iface,
151 VARIANT* var1 )
153 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
154 return IXMLDOMNode_get_nodeValue( This->node, var1 );
157 static HRESULT WINAPI dom_pi_put_nodeValue(
158 IXMLDOMProcessingInstruction *iface,
159 VARIANT var1 )
161 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
162 return IXMLDOMNode_put_nodeValue( This->node, var1 );
165 static HRESULT WINAPI dom_pi_get_nodeType(
166 IXMLDOMProcessingInstruction *iface,
167 DOMNodeType* domNodeType )
169 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
170 return IXMLDOMNode_get_nodeType( This->node, domNodeType );
173 static HRESULT WINAPI dom_pi_get_parentNode(
174 IXMLDOMProcessingInstruction *iface,
175 IXMLDOMNode** parent )
177 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
178 return IXMLDOMNode_get_parentNode( This->node, parent );
181 static HRESULT WINAPI dom_pi_get_childNodes(
182 IXMLDOMProcessingInstruction *iface,
183 IXMLDOMNodeList** outList)
185 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
186 return IXMLDOMNode_get_childNodes( This->node, outList );
189 static HRESULT WINAPI dom_pi_get_firstChild(
190 IXMLDOMProcessingInstruction *iface,
191 IXMLDOMNode** domNode)
193 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
194 return IXMLDOMNode_get_firstChild( This->node, domNode );
197 static HRESULT WINAPI dom_pi_get_lastChild(
198 IXMLDOMProcessingInstruction *iface,
199 IXMLDOMNode** domNode)
201 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
202 return IXMLDOMNode_get_lastChild( This->node, domNode );
205 static HRESULT WINAPI dom_pi_get_previousSibling(
206 IXMLDOMProcessingInstruction *iface,
207 IXMLDOMNode** domNode)
209 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
210 return IXMLDOMNode_get_previousSibling( This->node, domNode );
213 static HRESULT WINAPI dom_pi_get_nextSibling(
214 IXMLDOMProcessingInstruction *iface,
215 IXMLDOMNode** domNode)
217 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
218 return IXMLDOMNode_get_nextSibling( This->node, domNode );
221 static HRESULT WINAPI dom_pi_get_attributes(
222 IXMLDOMProcessingInstruction *iface,
223 IXMLDOMNamedNodeMap** attributeMap)
225 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
226 return IXMLDOMNode_get_attributes( This->node, attributeMap );
229 static HRESULT WINAPI dom_pi_insertBefore(
230 IXMLDOMProcessingInstruction *iface,
231 IXMLDOMNode* newNode, VARIANT var1,
232 IXMLDOMNode** outOldNode)
234 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
235 return IXMLDOMNode_insertBefore( This->node, newNode, var1, outOldNode );
238 static HRESULT WINAPI dom_pi_replaceChild(
239 IXMLDOMProcessingInstruction *iface,
240 IXMLDOMNode* newNode,
241 IXMLDOMNode* oldNode,
242 IXMLDOMNode** outOldNode)
244 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
245 return IXMLDOMNode_replaceChild( This->node, newNode, oldNode, outOldNode );
248 static HRESULT WINAPI dom_pi_removeChild(
249 IXMLDOMProcessingInstruction *iface,
250 IXMLDOMNode* domNode, IXMLDOMNode** oldNode)
252 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
253 return IXMLDOMNode_removeChild( This->node, domNode, oldNode );
256 static HRESULT WINAPI dom_pi_appendChild(
257 IXMLDOMProcessingInstruction *iface,
258 IXMLDOMNode* newNode, IXMLDOMNode** outNewNode)
260 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
261 return IXMLDOMNode_appendChild( This->node, newNode, outNewNode );
264 static HRESULT WINAPI dom_pi_hasChildNodes(
265 IXMLDOMProcessingInstruction *iface,
266 VARIANT_BOOL* pbool)
268 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
269 return IXMLDOMNode_hasChildNodes( This->node, pbool );
272 static HRESULT WINAPI dom_pi_get_ownerDocument(
273 IXMLDOMProcessingInstruction *iface,
274 IXMLDOMDocument** domDocument)
276 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
277 return IXMLDOMNode_get_ownerDocument( This->node, domDocument );
280 static HRESULT WINAPI dom_pi_cloneNode(
281 IXMLDOMProcessingInstruction *iface,
282 VARIANT_BOOL pbool, IXMLDOMNode** outNode)
284 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
285 return IXMLDOMNode_cloneNode( This->node, pbool, outNode );
288 static HRESULT WINAPI dom_pi_get_nodeTypeString(
289 IXMLDOMProcessingInstruction *iface,
290 BSTR* p)
292 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
293 return IXMLDOMNode_get_nodeTypeString( This->node, p );
296 static HRESULT WINAPI dom_pi_get_text(
297 IXMLDOMProcessingInstruction *iface,
298 BSTR* p)
300 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
301 return IXMLDOMNode_get_text( This->node, p );
304 static HRESULT WINAPI dom_pi_put_text(
305 IXMLDOMProcessingInstruction *iface,
306 BSTR p)
308 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
309 return IXMLDOMNode_put_text( This->node, p );
312 static HRESULT WINAPI dom_pi_get_specified(
313 IXMLDOMProcessingInstruction *iface,
314 VARIANT_BOOL* pbool)
316 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
317 return IXMLDOMNode_get_specified( This->node, pbool );
320 static HRESULT WINAPI dom_pi_get_definition(
321 IXMLDOMProcessingInstruction *iface,
322 IXMLDOMNode** domNode)
324 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
325 return IXMLDOMNode_get_definition( This->node, domNode );
328 static HRESULT WINAPI dom_pi_get_nodeTypedValue(
329 IXMLDOMProcessingInstruction *iface,
330 VARIANT* var1)
332 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
333 return IXMLDOMNode_get_nodeTypedValue( This->node, var1 );
336 static HRESULT WINAPI dom_pi_put_nodeTypedValue(
337 IXMLDOMProcessingInstruction *iface,
338 VARIANT var1)
340 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
341 return IXMLDOMNode_put_nodeTypedValue( This->node, var1 );
344 static HRESULT WINAPI dom_pi_get_dataType(
345 IXMLDOMProcessingInstruction *iface,
346 VARIANT* var1)
348 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
349 return IXMLDOMNode_get_dataType( This->node, var1 );
352 static HRESULT WINAPI dom_pi_put_dataType(
353 IXMLDOMProcessingInstruction *iface,
354 BSTR p)
356 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
357 return IXMLDOMNode_put_dataType( This->node, p );
360 static HRESULT WINAPI dom_pi_get_xml(
361 IXMLDOMProcessingInstruction *iface,
362 BSTR* p)
364 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
365 return IXMLDOMNode_get_xml( This->node, p );
368 static HRESULT WINAPI dom_pi_transformNode(
369 IXMLDOMProcessingInstruction *iface,
370 IXMLDOMNode* domNode, BSTR* p)
372 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
373 return IXMLDOMNode_transformNode( This->node, domNode, p );
376 static HRESULT WINAPI dom_pi_selectNodes(
377 IXMLDOMProcessingInstruction *iface,
378 BSTR p, IXMLDOMNodeList** outList)
380 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
381 return IXMLDOMNode_selectNodes( This->node, p, outList );
384 static HRESULT WINAPI dom_pi_selectSingleNode(
385 IXMLDOMProcessingInstruction *iface,
386 BSTR p, IXMLDOMNode** outNode)
388 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
389 return IXMLDOMNode_selectSingleNode( This->node, p, outNode );
392 static HRESULT WINAPI dom_pi_get_parsed(
393 IXMLDOMProcessingInstruction *iface,
394 VARIANT_BOOL* pbool)
396 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
397 return IXMLDOMNode_get_parsed( This->node, pbool );
400 static HRESULT WINAPI dom_pi_get_namespaceURI(
401 IXMLDOMProcessingInstruction *iface,
402 BSTR* p)
404 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
405 return IXMLDOMNode_get_namespaceURI( This->node, p );
408 static HRESULT WINAPI dom_pi_get_prefix(
409 IXMLDOMProcessingInstruction *iface,
410 BSTR* p)
412 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
413 return IXMLDOMNode_get_prefix( This->node, p );
416 static HRESULT WINAPI dom_pi_get_baseName(
417 IXMLDOMProcessingInstruction *iface,
418 BSTR* p)
420 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
421 return IXMLDOMNode_get_baseName( This->node, p );
424 static HRESULT WINAPI dom_pi_transformNodeToObject(
425 IXMLDOMProcessingInstruction *iface,
426 IXMLDOMNode* domNode, VARIANT var1)
428 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
429 return IXMLDOMNode_transformNodeToObject( This->node, domNode, var1 );
432 static HRESULT WINAPI dom_pi_get_target(
433 IXMLDOMProcessingInstruction *iface,
434 BSTR *p)
436 FIXME("\n");
437 return E_NOTIMPL;
440 static HRESULT WINAPI dom_pi_get_data(
441 IXMLDOMProcessingInstruction *iface,
442 BSTR *p)
444 FIXME("\n");
445 return E_NOTIMPL;
448 static HRESULT WINAPI dom_pi_put_data(
449 IXMLDOMProcessingInstruction *iface,
450 BSTR data)
452 FIXME("\n");
453 return E_NOTIMPL;
456 static const struct IXMLDOMProcessingInstructionVtbl dom_pi_vtbl =
458 dom_pi_QueryInterface,
459 dom_pi_AddRef,
460 dom_pi_Release,
461 dom_pi_GetTypeInfoCount,
462 dom_pi_GetTypeInfo,
463 dom_pi_GetIDsOfNames,
464 dom_pi_Invoke,
465 dom_pi_get_nodeName,
466 dom_pi_get_nodeValue,
467 dom_pi_put_nodeValue,
468 dom_pi_get_nodeType,
469 dom_pi_get_parentNode,
470 dom_pi_get_childNodes,
471 dom_pi_get_firstChild,
472 dom_pi_get_lastChild,
473 dom_pi_get_previousSibling,
474 dom_pi_get_nextSibling,
475 dom_pi_get_attributes,
476 dom_pi_insertBefore,
477 dom_pi_replaceChild,
478 dom_pi_removeChild,
479 dom_pi_appendChild,
480 dom_pi_hasChildNodes,
481 dom_pi_get_ownerDocument,
482 dom_pi_cloneNode,
483 dom_pi_get_nodeTypeString,
484 dom_pi_get_text,
485 dom_pi_put_text,
486 dom_pi_get_specified,
487 dom_pi_get_definition,
488 dom_pi_get_nodeTypedValue,
489 dom_pi_put_nodeTypedValue,
490 dom_pi_get_dataType,
491 dom_pi_put_dataType,
492 dom_pi_get_xml,
493 dom_pi_transformNode,
494 dom_pi_selectNodes,
495 dom_pi_selectSingleNode,
496 dom_pi_get_parsed,
497 dom_pi_get_namespaceURI,
498 dom_pi_get_prefix,
499 dom_pi_get_baseName,
500 dom_pi_transformNodeToObject,
502 dom_pi_get_target,
503 dom_pi_get_data,
504 dom_pi_put_data
507 IUnknown* create_pi( xmlNodePtr pi )
509 dom_pi *This;
510 HRESULT hr;
512 This = HeapAlloc( GetProcessHeap(), 0, sizeof *This );
513 if ( !This )
514 return NULL;
516 This->lpVtbl = &dom_pi_vtbl;
517 This->ref = 1;
519 This->node_unk = create_basic_node( pi, (IUnknown*)&This->lpVtbl );
520 if(!This->node_unk)
522 HeapFree(GetProcessHeap(), 0, This);
523 return NULL;
526 hr = IUnknown_QueryInterface(This->node_unk, &IID_IXMLDOMNode, (LPVOID*)&This->node);
527 if(FAILED(hr))
529 IUnknown_Release(This->node_unk);
530 HeapFree( GetProcessHeap(), 0, This );
531 return NULL;
533 /* The ref on This->node is actually looped back into this object, so release it */
534 IXMLDOMNode_Release(This->node);
536 return (IUnknown*) &This->lpVtbl;
539 #endif