ReactOS 0.4.16-dev-2207-geb15453
stylesheet.c File Reference
#include <stdarg.h>
#include <libxml/parser.h>
#include <libxml/xmlerror.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "msxml6.h"
#include "msxml_private.h"
#include "initguid.h"
#include "asptlb.h"
#include "wine/debug.h"
Include dependency graph for stylesheet.c:

Go to the source code of this file.

Classes

struct  xsltemplate
 
struct  xslprocessor
 

Macros

#define COBJMACROS
 

Enumerations

enum  output_type { PROCESSOR_OUTPUT_NOT_SET , PROCESSOR_OUTPUT_STREAM , PROCESSOR_OUTPUT_PERSISTSTREAM , PROCESSOR_OUTPUT_RESPONSE }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msxml)
 
static HRESULT XSLProcessor_create (xsltemplate *, IXSLProcessor **)
 
static xsltemplateimpl_from_IXSLTemplate (IXSLTemplate *iface)
 
static xslprocessorimpl_from_IXSLProcessor (IXSLProcessor *iface)
 
static void xslprocessor_par_free (struct xslprocessor_params *params, struct xslprocessor_par *par)
 
static void xsltemplate_set_node (xsltemplate *This, IXMLDOMNode *node)
 
static HRESULT WINAPI xsltemplate_QueryInterface (IXSLTemplate *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI xsltemplate_AddRef (IXSLTemplate *iface)
 
static ULONG WINAPI xsltemplate_Release (IXSLTemplate *iface)
 
static HRESULT WINAPI xsltemplate_GetTypeInfoCount (IXSLTemplate *iface, UINT *pctinfo)
 
static HRESULT WINAPI xsltemplate_GetTypeInfo (IXSLTemplate *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI xsltemplate_GetIDsOfNames (IXSLTemplate *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI xsltemplate_Invoke (IXSLTemplate *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI xsltemplate_putref_stylesheet (IXSLTemplate *iface, IXMLDOMNode *node)
 
static HRESULT WINAPI xsltemplate_get_stylesheet (IXSLTemplate *iface, IXMLDOMNode **node)
 
static HRESULT WINAPI xsltemplate_createProcessor (IXSLTemplate *iface, IXSLProcessor **processor)
 
HRESULT XSLTemplate_create (void **ppObj)
 
static HRESULT WINAPI xslprocessor_QueryInterface (IXSLProcessor *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI xslprocessor_AddRef (IXSLProcessor *iface)
 
static ULONG WINAPI xslprocessor_Release (IXSLProcessor *iface)
 
static HRESULT WINAPI xslprocessor_GetTypeInfoCount (IXSLProcessor *iface, UINT *pctinfo)
 
static HRESULT WINAPI xslprocessor_GetTypeInfo (IXSLProcessor *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI xslprocessor_GetIDsOfNames (IXSLProcessor *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI xslprocessor_Invoke (IXSLProcessor *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI xslprocessor_put_input (IXSLProcessor *iface, VARIANT input)
 
static HRESULT WINAPI xslprocessor_get_input (IXSLProcessor *iface, VARIANT *input)
 
static HRESULT WINAPI xslprocessor_get_ownerTemplate (IXSLProcessor *iface, IXSLTemplate **template)
 
static HRESULT WINAPI xslprocessor_setStartMode (IXSLProcessor *iface, BSTR p, BSTR uri)
 
static HRESULT WINAPI xslprocessor_get_startMode (IXSLProcessor *iface, BSTR *p)
 
static HRESULT WINAPI xslprocessor_get_startModeURI (IXSLProcessor *iface, BSTR *uri)
 
static HRESULT WINAPI xslprocessor_put_output (IXSLProcessor *iface, VARIANT var)
 
static HRESULT WINAPI xslprocessor_get_output (IXSLProcessor *iface, VARIANT *output)
 
static HRESULT WINAPI xslprocessor_transform (IXSLProcessor *iface, VARIANT_BOOL *ret)
 
static HRESULT WINAPI xslprocessor_reset (IXSLProcessor *iface)
 
static HRESULT WINAPI xslprocessor_get_readyState (IXSLProcessor *iface, LONG *state)
 
static HRESULT xslprocessor_set_parvalue (const VARIANT *var, struct xslprocessor_par *par)
 
static HRESULT WINAPI xslprocessor_addParameter (IXSLProcessor *iface, BSTR p, VARIANT var, BSTR uri)
 
static HRESULT WINAPI xslprocessor_addObject (IXSLProcessor *iface, IDispatch *obj, BSTR uri)
 
static HRESULT WINAPI xslprocessor_get_stylesheet (IXSLProcessor *iface, IXMLDOMNode **node)
 

Variables

static const struct IXSLTemplateVtbl XSLTemplateVtbl
 
static const tid_t xsltemplate_iface_tids []
 
static dispex_static_data_t xsltemplate_dispex
 
static const struct IXSLProcessorVtbl XSLProcessorVtbl
 
static const tid_t xslprocessor_iface_tids []
 
static dispex_static_data_t xslprocessor_dispex
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file stylesheet.c.

Enumeration Type Documentation

◆ output_type

Enumerator
PROCESSOR_OUTPUT_NOT_SET 
PROCESSOR_OUTPUT_STREAM 
PROCESSOR_OUTPUT_PERSISTSTREAM 
PROCESSOR_OUTPUT_RESPONSE 

Definition at line 51 of file stylesheet.c.

52{
54 PROCESSOR_OUTPUT_STREAM, /* IStream or ISequentialStream */
55 PROCESSOR_OUTPUT_PERSISTSTREAM, /* IPersistStream or IPersistStreamInit */
56 PROCESSOR_OUTPUT_RESPONSE, /* IResponse */
57};
@ PROCESSOR_OUTPUT_NOT_SET
Definition: stylesheet.c:53
@ PROCESSOR_OUTPUT_RESPONSE
Definition: stylesheet.c:56
@ PROCESSOR_OUTPUT_PERSISTSTREAM
Definition: stylesheet.c:55
@ PROCESSOR_OUTPUT_STREAM
Definition: stylesheet.c:54

Function Documentation

◆ impl_from_IXSLProcessor()

◆ impl_from_IXSLTemplate()

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msxml  )

◆ xslprocessor_addObject()

static HRESULT WINAPI xslprocessor_addObject ( IXSLProcessor iface,
IDispatch obj,
BSTR  uri 
)
static

Definition at line 749 of file stylesheet.c.

753{
755
756 FIXME("(%p)->(%p %s): stub\n", This, obj, debugstr_w(uri));
757 return E_NOTIMPL;
758}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99
#define debugstr_w
Definition: kernel32.h:32
const char * uri
Definition: sec_mgr.c:1588
static xslprocessor * impl_from_IXSLProcessor(IXSLProcessor *iface)
Definition: stylesheet.c:88

◆ xslprocessor_addParameter()

static HRESULT WINAPI xslprocessor_addParameter ( IXSLProcessor iface,
BSTR  p,
VARIANT  var,
BSTR  uri 
)
static

Definition at line 688 of file stylesheet.c.

693{
695 struct xslprocessor_par *cur, *par = NULL;
696 HRESULT hr;
697
698 TRACE("(%p)->(%s %s %s)\n", This, debugstr_w(p), debugstr_variant(&var),
699 debugstr_w(uri));
700
701 if (uri && *uri)
702 FIXME("namespace uri is not supported\n");
703
704 /* search for existing parameter first */
705 LIST_FOR_EACH_ENTRY(cur, &This->params.list, struct xslprocessor_par, entry)
706 {
707 if (!wcscmp(cur->name, p))
708 {
709 par = cur;
710 break;
711 }
712 }
713
714 /* override with new value or add new parameter */
715 if (par)
716 {
717 if (V_VT(&var) == VT_NULL || V_VT(&var) == VT_EMPTY)
718 {
719 /* remove parameter */
720 xslprocessor_par_free(&This->params, par);
721 return S_OK;
722 }
723 SysFreeString(par->value);
724 par->value = NULL;
725 }
726 else
727 {
728 /* new parameter */
729 par = malloc(sizeof(struct xslprocessor_par));
730 if (!par) return E_OUTOFMEMORY;
731
732 par->name = SysAllocString(p);
733 if (!par->name)
734 {
735 free(par);
736 return E_OUTOFMEMORY;
737 }
738 list_add_tail(&This->params.list, &par->entry);
739 This->params.count++;
740 }
741
743 if (FAILED(hr))
744 xslprocessor_par_free(&This->params, par);
745
746 return hr;
747}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
@ VT_NULL
Definition: compat.h:2296
@ VT_EMPTY
Definition: compat.h:2295
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1972
FxCollectionEntry * cur
GLfloat GLfloat p
Definition: glext.h:8902
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
uint32_t entry
Definition: isohybrid.c:63
const char * var
Definition: shader.c:5666
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define V_VT(A)
Definition: oleauto.h:211
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
struct list entry
Definition: msxml_private.h:86
static HRESULT xslprocessor_set_parvalue(const VARIANT *var, struct xslprocessor_par *par)
Definition: stylesheet.c:668
static void xslprocessor_par_free(struct xslprocessor_params *params, struct xslprocessor_par *par)
Definition: stylesheet.c:93

◆ xslprocessor_AddRef()

static ULONG WINAPI xslprocessor_AddRef ( IXSLProcessor iface)
static

Definition at line 316 of file stylesheet.c.

317{
320 TRACE("%p, refcount %lu.\n", iface, ref);
321 return ref;
322}
#define InterlockedIncrement
Definition: armddk.h:53
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ XSLProcessor_create()

HRESULT XSLProcessor_create ( xsltemplate template,
IXSLProcessor **  ppObj 
)
static

Definition at line 807 of file stylesheet.c.

808{
810
811 TRACE("(%p)\n", ppObj);
812
813 This = malloc(sizeof(*This));
814 if(!This)
815 return E_OUTOFMEMORY;
816
817 This->IXSLProcessor_iface.lpVtbl = &XSLProcessorVtbl;
818 This->ref = 1;
819 This->input = NULL;
820 This->output.unk = NULL;
821 This->output_type = PROCESSOR_OUTPUT_NOT_SET;
822 This->outstr = NULL;
823 list_init(&This->params.list);
824 This->params.count = 0;
825 This->stylesheet = template;
826 IXSLTemplate_AddRef(&template->IXSLTemplate_iface);
827 init_dispex(&This->dispex, (IUnknown*)&This->IXSLProcessor_iface, &xslprocessor_dispex);
828
829 *ppObj = &This->IXSLProcessor_iface;
830
831 TRACE("returning iface %p\n", *ppObj);
832
833 return S_OK;
834}
static void list_init(struct list_entry *head)
Definition: list.h:51
const UINT template
Definition: action.c:7511
HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype)
Definition: dispex.c:919
static dispex_static_data_t xslprocessor_dispex
Definition: stylesheet.c:800
static const struct IXSLProcessorVtbl XSLProcessorVtbl
Definition: stylesheet.c:770

Referenced by xsltemplate_createProcessor().

◆ xslprocessor_get_input()

static HRESULT WINAPI xslprocessor_get_input ( IXSLProcessor iface,
VARIANT input 
)
static

Definition at line 424 of file stylesheet.c.

425{
427
428 FIXME("(%p)->(%p): stub\n", This, input);
429 return E_NOTIMPL;
430}
GLenum GLenum GLenum input
Definition: glext.h:9031

◆ xslprocessor_get_output()

static HRESULT WINAPI xslprocessor_get_output ( IXSLProcessor iface,
VARIANT output 
)
static

Definition at line 531 of file stylesheet.c.

534{
536
537 TRACE("(%p)->(%p)\n", This, output);
538
539 if (!output) return E_INVALIDARG;
540
541 if (This->output.unk)
542 {
543 V_VT(output) = VT_UNKNOWN;
544 V_UNKNOWN(output) = This->output.unk;
545 IUnknown_AddRef(This->output.unk);
546 }
547 else if (This->outstr)
548 {
549 V_VT(output) = VT_BSTR;
550 V_BSTR(output) = SysAllocString(This->outstr);
551 }
552 else
553 V_VT(output) = VT_EMPTY;
554
555 return S_OK;
556}
#define E_INVALIDARG
Definition: ddrawi.h:101
@ VT_BSTR
Definition: compat.h:2303
@ VT_UNKNOWN
Definition: compat.h:2308
#define V_UNKNOWN(A)
Definition: oleauto.h:281
#define V_BSTR(A)
Definition: oleauto.h:226

◆ xslprocessor_get_ownerTemplate()

static HRESULT WINAPI xslprocessor_get_ownerTemplate ( IXSLProcessor iface,
IXSLTemplate **  template 
)
static

Definition at line 432 of file stylesheet.c.

435{
437
438 FIXME("(%p)->(%p): stub\n", This, template);
439 return E_NOTIMPL;
440}

◆ xslprocessor_get_readyState()

static HRESULT WINAPI xslprocessor_get_readyState ( IXSLProcessor iface,
LONG state 
)
static

Definition at line 658 of file stylesheet.c.

661{
663
664 FIXME("(%p)->(%p): stub\n", This, state);
665 return E_NOTIMPL;
666}
static int state
Definition: maze.c:121

◆ xslprocessor_get_startMode()

static HRESULT WINAPI xslprocessor_get_startMode ( IXSLProcessor iface,
BSTR p 
)
static

Definition at line 453 of file stylesheet.c.

456{
458
459 FIXME("(%p)->(%p): stub\n", This, p);
460 return E_NOTIMPL;
461}

◆ xslprocessor_get_startModeURI()

static HRESULT WINAPI xslprocessor_get_startModeURI ( IXSLProcessor iface,
BSTR uri 
)
static

Definition at line 463 of file stylesheet.c.

466{
468
469 FIXME("(%p)->(%p): stub\n", This, uri);
470 return E_NOTIMPL;
471}

◆ xslprocessor_get_stylesheet()

static HRESULT WINAPI xslprocessor_get_stylesheet ( IXSLProcessor iface,
IXMLDOMNode **  node 
)
static

Definition at line 760 of file stylesheet.c.

763{
765
766 FIXME("(%p)->(%p): stub\n", This, node);
767 return E_NOTIMPL;
768}
Definition: dlist.c:348

◆ xslprocessor_GetIDsOfNames()

static HRESULT WINAPI xslprocessor_GetIDsOfNames ( IXSLProcessor iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 365 of file stylesheet.c.

369{
371 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface,
372 riid, rgszNames, cNames, lcid, rgDispId);
373}
LCID lcid
Definition: locale.c:5656
REFIID riid
Definition: atlbase.h:39

◆ xslprocessor_GetTypeInfo()

static HRESULT WINAPI xslprocessor_GetTypeInfo ( IXSLProcessor iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 355 of file stylesheet.c.

359{
361 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface,
362 iTInfo, lcid, ppTInfo);
363}

◆ xslprocessor_GetTypeInfoCount()

static HRESULT WINAPI xslprocessor_GetTypeInfoCount ( IXSLProcessor iface,
UINT pctinfo 
)
static

Definition at line 349 of file stylesheet.c.

350{
352 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
353}

◆ xslprocessor_Invoke()

static HRESULT WINAPI xslprocessor_Invoke ( IXSLProcessor iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 375 of file stylesheet.c.

380{
382 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface,
383 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
384}
WINBASEAPI _In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon_undoc.h:337

◆ xslprocessor_par_free()

static void xslprocessor_par_free ( struct xslprocessor_params params,
struct xslprocessor_par par 
)
static

Definition at line 93 of file stylesheet.c.

94{
95 params->count--;
96 list_remove(&par->entry);
97 SysFreeString(par->name);
98 SysFreeString(par->value);
99 free(par);
100}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
GLenum const GLfloat * params
Definition: glext.h:5645

Referenced by xslprocessor_addParameter(), and xslprocessor_Release().

◆ xslprocessor_put_input()

static HRESULT WINAPI xslprocessor_put_input ( IXSLProcessor iface,
VARIANT  input 
)
static

Definition at line 386 of file stylesheet.c.

387{
389 IXMLDOMNode *input_node;
390 HRESULT hr;
391
392 TRACE("(%p)->(%s)\n", This, debugstr_variant(&input));
393
394 /* try IXMLDOMNode directly first */
395 if (V_VT(&input) == VT_UNKNOWN)
396 hr = IUnknown_QueryInterface(V_UNKNOWN(&input), &IID_IXMLDOMNode, (void**)&input_node);
397 else if (V_VT(&input) == VT_DISPATCH)
398 hr = IDispatch_QueryInterface(V_DISPATCH(&input), &IID_IXMLDOMNode, (void**)&input_node);
399 else
400 {
401 IXMLDOMDocument *doc;
402
403 hr = dom_document_create(MSXML_DEFAULT, (void **)&doc);
404 if (hr == S_OK)
405 {
407
408 hr = IXMLDOMDocument_load(doc, input, &b);
409 if (hr == S_OK)
410 hr = IXMLDOMDocument_QueryInterface(doc, &IID_IXMLDOMNode, (void**)&input_node);
411 IXMLDOMDocument_Release(doc);
412 }
413 }
414
415 if (hr == S_OK)
416 {
417 if (This->input) IXMLDOMNode_Release(This->input);
418 This->input = input_node;
419 }
420
421 return hr;
422}
short VARIANT_BOOL
Definition: compat.h:2290
@ VT_DISPATCH
Definition: compat.h:2304
HRESULT dom_document_create(MSXML_VERSION version, void **ppObj)
Definition: domdoc.c:3788
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define b
Definition: ke_i.h:79
@ MSXML_DEFAULT
Definition: msxml_dispex.h:28
#define V_DISPATCH(A)
Definition: oleauto.h:239

◆ xslprocessor_put_output()

static HRESULT WINAPI xslprocessor_put_output ( IXSLProcessor iface,
VARIANT  var 
)
static

Definition at line 473 of file stylesheet.c.

476{
479 IUnknown *output = NULL;
480 HRESULT hr = S_OK;
481
482 TRACE("(%p)->(%s)\n", This, debugstr_variant(&var));
483
484 switch (V_VT(&var))
485 {
486 case VT_EMPTY:
487 break;
488 case VT_UNKNOWN:
489 case VT_DISPATCH:
490 if (!V_UNKNOWN(&var))
491 break;
492
494 hr = IUnknown_QueryInterface(V_UNKNOWN(&var), &IID_IStream, (void **)&output);
495 if (FAILED(hr))
496 hr = IUnknown_QueryInterface(V_UNKNOWN(&var), &IID_ISequentialStream, (void **)&output);
497 if (FAILED(hr))
498 {
500 hr = IUnknown_QueryInterface(V_UNKNOWN(&var), &IID_IResponse, (void **)&output);
501 }
502 if (FAILED(hr))
503 {
505 hr = IUnknown_QueryInterface(V_UNKNOWN(&var), &IID_IPersistStream, (void **)&output);
506 }
507 if (FAILED(hr))
508 hr = IUnknown_QueryInterface(V_UNKNOWN(&var), &IID_IPersistStreamInit, (void **)&output);
509 if (FAILED(hr))
510 {
512 WARN("failed to get output interface, hr %#lx.\n", hr);
513 }
514 break;
515 default:
516 FIXME("output type %d not handled\n", V_VT(&var));
517 hr = E_FAIL;
518 }
519
520 if (hr == S_OK)
521 {
522 if (This->output.unk)
523 IUnknown_Release(This->output.unk);
524 This->output.unk = output;
525 This->output_type = output_type;
526 }
527
528 return hr;
529}
#define WARN(fmt,...)
Definition: precomp.h:61
#define E_FAIL
Definition: ddrawi.h:102
const GUID IID_IPersistStreamInit
const GUID IID_IPersistStream
Definition: proxy.cpp:13
output_type
Definition: stylesheet.c:52

◆ xslprocessor_QueryInterface()

static HRESULT WINAPI xslprocessor_QueryInterface ( IXSLProcessor iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 287 of file stylesheet.c.

291{
293 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
294
295 if ( IsEqualGUID( riid, &IID_IXSLProcessor ) ||
298 {
299 *ppvObject = iface;
300 }
301 else if (dispex_query_interface(&This->dispex, riid, ppvObject))
302 {
303 return *ppvObject ? S_OK : E_NOINTERFACE;
304 }
305 else
306 {
307 FIXME("Unsupported interface %s\n", debugstr_guid(riid));
308 *ppvObject = NULL;
309 return E_NOINTERFACE;
310 }
311
312 IUnknown_AddRef((IUnknown*)*ppvObject);
313 return S_OK;
314}
const GUID IID_IUnknown
#define debugstr_guid
Definition: kernel32.h:35
BOOL dispex_query_interface(DispatchEx *This, REFIID riid, void **ppv)
Definition: dispex.c:1656
const GUID IID_IDispatch
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ xslprocessor_Release()

static ULONG WINAPI xslprocessor_Release ( IXSLProcessor iface)
static

Definition at line 324 of file stylesheet.c.

325{
328
329 TRACE("%p, refcount %lu.\n", iface, ref);
330 if ( ref == 0 )
331 {
332 struct xslprocessor_par *par, *par2;
333
334 if (This->input) IXMLDOMNode_Release(This->input);
335 if (This->output.unk)
336 IUnknown_Release(This->output.unk);
337 SysFreeString(This->outstr);
338
339 LIST_FOR_EACH_ENTRY_SAFE(par, par2, &This->params.list, struct xslprocessor_par, entry)
340 xslprocessor_par_free(&This->params, par);
341
342 IXSLTemplate_Release(&This->stylesheet->IXSLTemplate_iface);
343 free(This);
344 }
345
346 return ref;
347}
#define InterlockedDecrement
Definition: armddk.h:52
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204

◆ xslprocessor_reset()

static HRESULT WINAPI xslprocessor_reset ( IXSLProcessor iface)
static

Definition at line 650 of file stylesheet.c.

651{
653
654 FIXME("(%p): stub\n", This);
655 return E_NOTIMPL;
656}

◆ xslprocessor_set_parvalue()

static HRESULT xslprocessor_set_parvalue ( const VARIANT var,
struct xslprocessor_par par 
)
static

Definition at line 668 of file stylesheet.c.

669{
670 HRESULT hr = S_OK;
671
672 switch (V_VT(var))
673 {
674 case VT_BSTR:
675 {
677 if (!par->value) hr = E_OUTOFMEMORY;
678 break;
679 }
680 default:
681 FIXME("value type %d not handled\n", V_VT(var));
682 hr = E_NOTIMPL;
683 }
684
685 return hr;
686}

Referenced by xslprocessor_addParameter().

◆ xslprocessor_setStartMode()

static HRESULT WINAPI xslprocessor_setStartMode ( IXSLProcessor iface,
BSTR  p,
BSTR  uri 
)
static

Definition at line 442 of file stylesheet.c.

446{
448
449 FIXME("(%p)->(%s %s): stub\n", This, debugstr_w(p), debugstr_w(uri));
450 return E_NOTIMPL;
451}

◆ xslprocessor_transform()

static HRESULT WINAPI xslprocessor_transform ( IXSLProcessor iface,
VARIANT_BOOL ret 
)
static

Definition at line 558 of file stylesheet.c.

561{
564 HRESULT hr;
565
566 TRACE("(%p)->(%p)\n", This, ret);
567
568 if (!ret)
569 return E_INVALIDARG;
570
571 if (This->output_type == PROCESSOR_OUTPUT_STREAM)
572 {
573 stream = This->output.stream;
574 ISequentialStream_AddRef(stream);
575 }
576 else if (This->output_type == PROCESSOR_OUTPUT_PERSISTSTREAM ||
577 This->output_type == PROCESSOR_OUTPUT_RESPONSE)
578 {
580 return hr;
581 }
582
583 SysFreeString(This->outstr);
584
585 hr = node_transform_node_params(get_node_obj(This->input), This->stylesheet->node,
586 &This->outstr, stream, &This->params);
587 if (SUCCEEDED(hr))
588 {
590
591 switch (This->output_type)
592 {
594 {
596
597 /* for IPersistStream* output seekable stream is used */
598 zero.QuadPart = 0;
599 IStream_Seek(src, zero, STREAM_SEEK_SET, NULL);
600 hr = IPersistStream_Load(This->output.persiststream, src);
601 break;
602 }
604 {
605 SAFEARRAYBOUND bound;
607 HGLOBAL hglobal;
608 VARIANT bin;
609 DWORD size;
610 void *dest;
611
612 if (FAILED(hr = GetHGlobalFromStream(src, &hglobal)))
613 break;
614 size = GlobalSize(hglobal);
615
616 bound.lLbound = 0;
617 bound.cElements = size;
618 if (!(array = SafeArrayCreate(VT_UI1, 1, &bound)))
619 break;
620
621 V_VT(&bin) = VT_ARRAY | VT_UI1;
622 V_ARRAY(&bin) = array;
623
625 if (hr == S_OK)
626 {
627 void *data = GlobalLock(hglobal);
628 memcpy(dest, data, size);
629 GlobalUnlock(hglobal);
631
632 IResponse_BinaryWrite(This->output.response, bin);
633 }
634
636 break;
637 }
638 default:
639 ;
640 }
641 }
642
643 if (stream)
644 ISequentialStream_Release(stream);
645
646 *ret = hr == S_OK ? VARIANT_TRUE : VARIANT_FALSE;
647 return hr;
648}
#define TRUE
Definition: types.h:120
@ VT_ARRAY
Definition: compat.h:2341
@ VT_UI1
Definition: compat.h:2311
HRESULT WINAPI GetHGlobalFromStream(IStream *pstm, HGLOBAL *phglobal)
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
Definition: safearray.c:1137
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
Definition: safearray.c:1168
SAFEARRAY *WINAPI SafeArrayCreate(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabound)
Definition: safearray.c:600
return ret
Definition: mutex.c:146
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum src
Definition: glext.h:6340
GLsizeiptr size
Definition: glext.h:5919
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090
static HTMLDOMNode * get_node_obj(IHTMLDOMNode *)
Definition: htmlnode.c:1045
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static ERESOURCE GlobalLock
Definition: sys_arch.c:8
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static struct _PeImage bin
static char * dest
Definition: rtl.c:135
HRESULT node_transform_node_params(const xmlnode *, IXMLDOMNode *, BSTR *, ISequentialStream *, const struct xslprocessor_params *)
Definition: node.c:1480
#define V_ARRAY(A)
Definition: oleauto.h:222
int zero
Definition: sehframes.cpp:29
Definition: undname.c:54
Definition: parse.h:23
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648

◆ xsltemplate_AddRef()

static ULONG WINAPI xsltemplate_AddRef ( IXSLTemplate iface)
static

Definition at line 138 of file stylesheet.c.

139{
142 TRACE("%p, refcount %lu.\n", iface, ref);
143 return ref;
144}
static xsltemplate * impl_from_IXSLTemplate(IXSLTemplate *iface)
Definition: stylesheet.c:83

◆ XSLTemplate_create()

HRESULT XSLTemplate_create ( void **  ppObj)

Definition at line 264 of file stylesheet.c.

265{
267
268 TRACE("(%p)\n", ppObj);
269
270 This = malloc(sizeof(*This));
271 if(!This)
272 return E_OUTOFMEMORY;
273
274 This->IXSLTemplate_iface.lpVtbl = &XSLTemplateVtbl;
275 This->ref = 1;
276 This->node = NULL;
277 init_dispex(&This->dispex, (IUnknown*)&This->IXSLTemplate_iface, &xsltemplate_dispex);
278
279 *ppObj = &This->IXSLTemplate_iface;
280
281 TRACE("returning iface %p\n", *ppObj);
282
283 return S_OK;
284}
static dispex_static_data_t xsltemplate_dispex
Definition: stylesheet.c:257
static const struct IXSLTemplateVtbl XSLTemplateVtbl
Definition: stylesheet.c:238

◆ xsltemplate_createProcessor()

static HRESULT WINAPI xsltemplate_createProcessor ( IXSLTemplate iface,
IXSLProcessor **  processor 
)
static

Definition at line 226 of file stylesheet.c.

228{
230
231 TRACE("(%p)->(%p)\n", This, processor);
232
233 if (!processor) return E_INVALIDARG;
234
235 return XSLProcessor_create(This, processor);
236}
static HRESULT XSLProcessor_create(xsltemplate *, IXSLProcessor **)
Definition: stylesheet.c:807

◆ xsltemplate_get_stylesheet()

static HRESULT WINAPI xsltemplate_get_stylesheet ( IXSLTemplate iface,
IXMLDOMNode **  node 
)
static

Definition at line 217 of file stylesheet.c.

219{
221
222 FIXME("(%p)->(%p): stub\n", This, node);
223 return E_NOTIMPL;
224}

◆ xsltemplate_GetIDsOfNames()

static HRESULT WINAPI xsltemplate_GetIDsOfNames ( IXSLTemplate iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 177 of file stylesheet.c.

181{
183 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface,
184 riid, rgszNames, cNames, lcid, rgDispId);
185}

◆ xsltemplate_GetTypeInfo()

static HRESULT WINAPI xsltemplate_GetTypeInfo ( IXSLTemplate iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 167 of file stylesheet.c.

171{
173 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface,
174 iTInfo, lcid, ppTInfo);
175}

◆ xsltemplate_GetTypeInfoCount()

static HRESULT WINAPI xsltemplate_GetTypeInfoCount ( IXSLTemplate iface,
UINT pctinfo 
)
static

Definition at line 161 of file stylesheet.c.

162{
164 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
165}

◆ xsltemplate_Invoke()

static HRESULT WINAPI xsltemplate_Invoke ( IXSLTemplate iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 187 of file stylesheet.c.

192{
194 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface,
195 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
196}

◆ xsltemplate_putref_stylesheet()

static HRESULT WINAPI xsltemplate_putref_stylesheet ( IXSLTemplate iface,
IXMLDOMNode node 
)
static

Definition at line 198 of file stylesheet.c.

200{
202
203 TRACE("(%p)->(%p)\n", This, node);
204
205 if (!node)
206 {
208 return S_OK;
209 }
210
211 /* FIXME: test for document type */
213
214 return S_OK;
215}
static void xsltemplate_set_node(xsltemplate *This, IXMLDOMNode *node)
Definition: stylesheet.c:102

◆ xsltemplate_QueryInterface()

static HRESULT WINAPI xsltemplate_QueryInterface ( IXSLTemplate iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 109 of file stylesheet.c.

113{
115 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
116
117 if ( IsEqualGUID( riid, &IID_IXSLTemplate ) ||
120 {
121 *ppvObject = iface;
122 }
123 else if (dispex_query_interface(&This->dispex, riid, ppvObject))
124 {
125 return *ppvObject ? S_OK : E_NOINTERFACE;
126 }
127 else
128 {
129 FIXME("Unsupported interface %s\n", debugstr_guid(riid));
130 *ppvObject = NULL;
131 return E_NOINTERFACE;
132 }
133
134 IUnknown_AddRef((IUnknown*)*ppvObject);
135 return S_OK;
136}

◆ xsltemplate_Release()

static ULONG WINAPI xsltemplate_Release ( IXSLTemplate iface)
static

Definition at line 146 of file stylesheet.c.

147{
150
151 TRACE("%p, refcount %lu.\n", iface, ref);
152 if ( ref == 0 )
153 {
154 if (This->node) IXMLDOMNode_Release( This->node );
155 free( This );
156 }
157
158 return ref;
159}

◆ xsltemplate_set_node()

static void xsltemplate_set_node ( xsltemplate This,
IXMLDOMNode node 
)
static

Definition at line 102 of file stylesheet.c.

103{
104 if (This->node) IXMLDOMNode_Release(This->node);
105 This->node = node;
106 if (node) IXMLDOMNode_AddRef(node);
107}

Referenced by xsltemplate_putref_stylesheet().

Variable Documentation

◆ xslprocessor_dispex

dispex_static_data_t xslprocessor_dispex
static
Initial value:
= {
}
@ IXSLProcessor_tid
Definition: msxml_dispex.h:62
static const tid_t xslprocessor_iface_tids[]
Definition: stylesheet.c:795

Definition at line 800 of file stylesheet.c.

Referenced by XSLProcessor_create().

◆ xslprocessor_iface_tids

const tid_t xslprocessor_iface_tids[]
static
Initial value:

Definition at line 795 of file stylesheet.c.

◆ XSLProcessorVtbl

const struct IXSLProcessorVtbl XSLProcessorVtbl
static
Initial value:
=
{
}
static ULONG WINAPI xslprocessor_Release(IXSLProcessor *iface)
Definition: stylesheet.c:324
static HRESULT WINAPI xslprocessor_setStartMode(IXSLProcessor *iface, BSTR p, BSTR uri)
Definition: stylesheet.c:442
static HRESULT WINAPI xslprocessor_QueryInterface(IXSLProcessor *iface, REFIID riid, void **ppvObject)
Definition: stylesheet.c:287
static HRESULT WINAPI xslprocessor_get_readyState(IXSLProcessor *iface, LONG *state)
Definition: stylesheet.c:658
static HRESULT WINAPI xslprocessor_put_input(IXSLProcessor *iface, VARIANT input)
Definition: stylesheet.c:386
static ULONG WINAPI xslprocessor_AddRef(IXSLProcessor *iface)
Definition: stylesheet.c:316
static HRESULT WINAPI xslprocessor_transform(IXSLProcessor *iface, VARIANT_BOOL *ret)
Definition: stylesheet.c:558
static HRESULT WINAPI xslprocessor_reset(IXSLProcessor *iface)
Definition: stylesheet.c:650
static HRESULT WINAPI xslprocessor_put_output(IXSLProcessor *iface, VARIANT var)
Definition: stylesheet.c:473
static HRESULT WINAPI xslprocessor_addObject(IXSLProcessor *iface, IDispatch *obj, BSTR uri)
Definition: stylesheet.c:749
static HRESULT WINAPI xslprocessor_get_stylesheet(IXSLProcessor *iface, IXMLDOMNode **node)
Definition: stylesheet.c:760
static HRESULT WINAPI xslprocessor_get_startModeURI(IXSLProcessor *iface, BSTR *uri)
Definition: stylesheet.c:463
static HRESULT WINAPI xslprocessor_GetIDsOfNames(IXSLProcessor *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: stylesheet.c:365
static HRESULT WINAPI xslprocessor_get_input(IXSLProcessor *iface, VARIANT *input)
Definition: stylesheet.c:424
static HRESULT WINAPI xslprocessor_GetTypeInfoCount(IXSLProcessor *iface, UINT *pctinfo)
Definition: stylesheet.c:349
static HRESULT WINAPI xslprocessor_GetTypeInfo(IXSLProcessor *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: stylesheet.c:355
static HRESULT WINAPI xslprocessor_get_ownerTemplate(IXSLProcessor *iface, IXSLTemplate **template)
Definition: stylesheet.c:432
static HRESULT WINAPI xslprocessor_addParameter(IXSLProcessor *iface, BSTR p, VARIANT var, BSTR uri)
Definition: stylesheet.c:688
static HRESULT WINAPI xslprocessor_Invoke(IXSLProcessor *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: stylesheet.c:375
static HRESULT WINAPI xslprocessor_get_output(IXSLProcessor *iface, VARIANT *output)
Definition: stylesheet.c:531
static HRESULT WINAPI xslprocessor_get_startMode(IXSLProcessor *iface, BSTR *p)
Definition: stylesheet.c:453

Definition at line 770 of file stylesheet.c.

Referenced by XSLProcessor_create().

◆ xsltemplate_dispex

dispex_static_data_t xsltemplate_dispex
static
Initial value:
= {
}
@ IXSLTemplate_tid
Definition: msxml_dispex.h:63
static const tid_t xsltemplate_iface_tids[]
Definition: stylesheet.c:252

Definition at line 257 of file stylesheet.c.

Referenced by XSLTemplate_create().

◆ xsltemplate_iface_tids

const tid_t xsltemplate_iface_tids[]
static
Initial value:

Definition at line 252 of file stylesheet.c.

◆ XSLTemplateVtbl

const struct IXSLTemplateVtbl XSLTemplateVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI xsltemplate_Invoke(IXSLTemplate *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: stylesheet.c:187
static HRESULT WINAPI xsltemplate_QueryInterface(IXSLTemplate *iface, REFIID riid, void **ppvObject)
Definition: stylesheet.c:109
static HRESULT WINAPI xsltemplate_GetIDsOfNames(IXSLTemplate *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: stylesheet.c:177
static HRESULT WINAPI xsltemplate_createProcessor(IXSLTemplate *iface, IXSLProcessor **processor)
Definition: stylesheet.c:226
static HRESULT WINAPI xsltemplate_GetTypeInfoCount(IXSLTemplate *iface, UINT *pctinfo)
Definition: stylesheet.c:161
static HRESULT WINAPI xsltemplate_GetTypeInfo(IXSLTemplate *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: stylesheet.c:167
static HRESULT WINAPI xsltemplate_putref_stylesheet(IXSLTemplate *iface, IXMLDOMNode *node)
Definition: stylesheet.c:198
static ULONG WINAPI xsltemplate_AddRef(IXSLTemplate *iface)
Definition: stylesheet.c:138
static HRESULT WINAPI xsltemplate_get_stylesheet(IXSLTemplate *iface, IXMLDOMNode **node)
Definition: stylesheet.c:217
static ULONG WINAPI xsltemplate_Release(IXSLTemplate *iface)
Definition: stylesheet.c:146

Definition at line 238 of file stylesheet.c.

Referenced by XSLTemplate_create().