59#define XML_SAVE_FORMAT 1
60#define XML_SAVE_NO_DECL 2
61#define XML_SAVE_NO_EMPTY 4
62#define XML_SAVE_NO_XHTML 8
63#define XML_SAVE_XHTML 16
64#define XML_SAVE_AS_XML 32
65#define XML_SAVE_AS_HTML 64
67static const WCHAR PropertySelectionLanguageW[] = {
'S',
'e',
'l',
'e',
'c',
't',
'i',
'o',
'n',
'L',
'a',
'n',
'g',
'u',
'a',
'g',
'e',0};
68static const WCHAR PropertySelectionNamespacesW[] = {
'S',
'e',
'l',
'e',
'c',
't',
'i',
'o',
'n',
'N',
'a',
'm',
'e',
's',
'p',
'a',
'c',
'e',
's',0};
69static const WCHAR PropertyProhibitDTDW[] = {
'P',
'r',
'o',
'h',
'i',
'b',
'i',
't',
'D',
'T',
'D',0};
70static const WCHAR PropertyNewParserW[] = {
'N',
'e',
'w',
'P',
'a',
'r',
's',
'e',
'r',0};
71static const WCHAR PropValueXPathW[] = {
'X',
'P',
'a',
't',
'h',0};
72static const WCHAR PropValueXSLPatternW[] = {
'X',
'S',
'L',
'P',
'a',
't',
't',
'e',
'r',
'n',0};
73static const WCHAR PropertyResolveExternalsW[] = {
'R',
'e',
's',
'o',
'l',
'v',
'e',
'E',
'x',
't',
'e',
'r',
'n',
'a',
'l',
's',0};
74static const WCHAR PropertyAllowXsltScriptW[] = {
'A',
'l',
'l',
'o',
'w',
'X',
's',
'l',
't',
'S',
'c',
'r',
'i',
'p',
't',0};
75static const WCHAR PropertyAllowDocumentFunctionW[] = {
'A',
'l',
'l',
'o',
'w',
'D',
'o',
'c',
'u',
'm',
'e',
'n',
't',
'F',
'u',
'n',
'c',
't',
'i',
'o',
'n',0};
76static const WCHAR PropertyNormalizeAttributeValuesW[] = {
'N',
'o',
'r',
'm',
'a',
'l',
'i',
'z',
'e',
'A',
't',
't',
'r',
'i',
'b',
'u',
't',
'e',
'V',
'a',
'l',
'u',
'e',
's',0};
85 IXMLDOMSchemaCollection2* schemaCache;
86 struct list selectNsList;
94typedef struct domdoc domdoc;
117 EVENTID_TRANSFORMNODE,
124 IXMLDOMDocument3 IXMLDOMDocument3_iface;
133 domdoc_properties* properties;
151 IXMLDOMSchemaCollection2 *namespaces;
168 if (disp) IDispatch_AddRef(disp);
174 if (doc->events[eid]) IDispatch_Release(doc->events[eid]);
175 doc->events[eid] = disp;
207typedef struct _xmldoc_priv {
210 domdoc_properties* properties;
213typedef struct _orphan_entry {
218typedef struct _select_ns_entry {
226static inline xmldoc_priv * priv_from_xmlDocPtr(
const xmlDocPtr doc)
231static inline domdoc_properties * properties_from_xmlDocPtr(
xmlDocPtr doc)
233 return priv_from_xmlDocPtr(doc)->properties;
238 return properties_from_xmlDocPtr(doc)->XPath;
243 properties_from_xmlDocPtr(doc)->XPath = xpath;
246int registerNamespaces(xmlXPathContextPtr ctxt)
249 const select_ns_entry*
ns =
NULL;
250 const struct list* pNsList = &properties_from_xmlDocPtr(ctxt->doc)->selectNsList;
252 TRACE(
"(%p)\n", ctxt);
256 xmlXPathRegisterNs(ctxt,
ns->
prefix,
ns->href);
263static inline void clear_selectNsList(
struct list* pNsList)
265 select_ns_entry *
ns, *ns2;
273static xmldoc_priv * create_priv(
void)
282 priv->properties =
NULL;
290 domdoc_properties *properties =
heap_alloc(
sizeof(domdoc_properties));
293 properties->preserving = VARIANT_FALSE;
294 properties->schemaCache =
NULL;
295 properties->selectNsStr = heap_alloc_zero(
sizeof(
xmlChar));
296 properties->selectNsStr_len = 0;
303 properties->uri =
NULL;
308static domdoc_properties* copy_properties(domdoc_properties
const* properties)
310 domdoc_properties* pcopy =
heap_alloc(
sizeof(domdoc_properties));
311 select_ns_entry
const*
ns =
NULL;
312 select_ns_entry* new_ns =
NULL;
313 int len = (properties->selectNsStr_len+1)*
sizeof(
xmlChar);
318 pcopy->version = properties->version;
319 pcopy->preserving = properties->preserving;
320 pcopy->schemaCache = properties->schemaCache;
321 if (pcopy->schemaCache)
322 IXMLDOMSchemaCollection2_AddRef(pcopy->schemaCache);
323 pcopy->XPath = properties->XPath;
324 pcopy->selectNsStr_len = properties->selectNsStr_len;
328 offset = pcopy->selectNsStr - properties->selectNsStr;
333 memcpy(new_ns,
ns,
sizeof(select_ns_entry));
339 pcopy->uri = properties->uri;
341 IUri_AddRef(pcopy->uri);
347static void free_properties(domdoc_properties* properties)
351 if (properties->schemaCache)
352 IXMLDOMSchemaCollection2_Release(properties->schemaCache);
353 clear_selectNsList(&properties->selectNsList);
356 IUri_Release(properties->uri);
361static void release_namespaces(domdoc *
This)
363 if (
This->namespaces)
365 IXMLDOMSchemaCollection2_Release(
This->namespaces);
380 static const xmlChar xmlA[] =
"xml";
401 return properties_from_xmlDocPtr(doc)->version;
406 domdoc_properties* properties =
NULL;
408 if (priv_from_xmlDocPtr(
node->doc))
409 properties = properties_from_xmlDocPtr(
node->doc);
410 return ((properties && properties->preserving == VARIANT_TRUE) ||
423static void sax_characters(
void *
ctx,
const xmlChar *ch,
int len)
447 if (!
This->properties->preserving &&
448 !is_preserving_whitespace(ctxt->
node) &&
449 strn_isspace(ch,
len) &&
466static void LIBXML2_LOG_CALLBACK sax_error(
void*
ctx,
char const*
msg, ...)
470 LIBXML2_CALLBACK_ERR(doparse,
msg,
ap);
474static void LIBXML2_LOG_CALLBACK sax_warning(
void*
ctx,
char const*
msg, ...)
478 LIBXML2_CALLBACK_WARN(doparse,
msg,
ap);
484 LIBXML2_CALLBACK_SERROR(doparse,
err);
529 ERR(
"Failed to create parser context\n");
534 pctx->
sax = &sax_handler;
581 xmldoc_link_xmldecl( doc,
node );
590 priv_from_xmlDocPtr(doc)->properties = create_properties(
version);
602 return xmldoc_add_refs(doc, 1);
607 xmldoc_priv *priv = priv_from_xmlDocPtr(doc);
612 WARN(
"negative refcount, expect troubles\n");
616 orphan_entry *
orphan, *orphan2;
617 TRACE(
"freeing docptr %p\n", doc);
624 free_properties(priv->properties);
635 return xmldoc_release_refs(doc, 1);
640 xmldoc_priv *priv = priv_from_xmlDocPtr(doc);
654 xmldoc_priv *priv = priv_from_xmlDocPtr(doc);
655 orphan_entry *
entry, *entry2;
672 return This->node.node->doc;
677 release_namespaces(
This);
681 priv_from_xmlDocPtr(get_doc(
This))->properties =
NULL;
682 if (xmldoc_release(get_doc(
This)) != 0)
683 priv_from_xmlDocPtr(get_doc(
This))->properties =
684 copy_properties(
This->properties);
691 xmldoc_add_ref(get_doc(
This));
692 priv_from_xmlDocPtr(get_doc(
This))->properties =
This->properties;
698static inline domdoc *impl_from_IXMLDOMDocument3( IXMLDOMDocument3 *iface )
730 return IXMLDOMDocument3_QueryInterface(&
This->IXMLDOMDocument3_iface,
riid, ppvObj);
737 return IXMLDOMDocument3_AddRef(&
This->IXMLDOMDocument3_iface);
744 return IXMLDOMDocument3_Release(&
This->IXMLDOMDocument3_iface);
787 hr = IStream_Write(hstream,
buf,
read, &written);
792 ERR(
"failed to copy stream 0x%08x\n",
hr);
793 IStream_Release(hstream);
809 ERR(
"Failed to parse xml\n");
815 return attach_xmldoc(doc, xmldoc);
839 hr = IXMLDOMDocument3_get_xml(&
This->IXMLDOMDocument3_iface, &xmlString);
869static const IPersistStreamInitVtbl xmldoc_IPersistStreamInit_VTable =
884static const tid_t domdoc_se_tids[] = {
894 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
924 return node_create_supporterrorinfo(domdoc_se_tids,
ppvObject);
945static ULONG WINAPI domdoc_AddRef( IXMLDOMDocument3 *iface )
947 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
953static ULONG WINAPI domdoc_Release( IXMLDOMDocument3 *iface )
955 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
965 IUnknown_Release(
This->site );
966 destroy_xmlnode(&
This->node);
969 if (
This->events[eid]) IDispatch_Release(
This->events[eid]);
971 release_namespaces(
This);
978static HRESULT WINAPI domdoc_GetTypeInfoCount( IXMLDOMDocument3 *iface,
UINT* pctinfo )
980 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
981 return IDispatchEx_GetTypeInfoCount(&
This->node.dispex.IDispatchEx_iface, pctinfo);
985 IXMLDOMDocument3 *iface,
988 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
989 return IDispatchEx_GetTypeInfo(&
This->node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
993 IXMLDOMDocument3 *iface,
1000 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1001 return IDispatchEx_GetIDsOfNames(&
This->node.dispex.IDispatchEx_iface,
1002 riid, rgszNames, cNames, lcid, rgDispId);
1006 IXMLDOMDocument3 *iface,
1011 DISPPARAMS* pDispParams,
1013 EXCEPINFO* pExcepInfo,
1016 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1017 return IDispatchEx_Invoke(&
This->node.dispex.IDispatchEx_iface,
1018 dispIdMember,
riid, lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1022 IXMLDOMDocument3 *iface,
1025 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1027 static const WCHAR documentW[] = {
'#',
'd',
'o',
'c',
'u',
'm',
'e',
'n',
't',0};
1036 IXMLDOMDocument3 *iface,
1039 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1053 IXMLDOMDocument3 *iface,
1056 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1063 IXMLDOMDocument3 *iface,
1066 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1076 IXMLDOMDocument3 *iface,
1079 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1088 IXMLDOMDocument3 *iface,
1091 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1095 return node_get_child_nodes(&
This->node, childList);
1100 IXMLDOMDocument3 *iface,
1103 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1105 TRACE(
"(%p)->(%p)\n",
This, firstChild);
1107 return node_get_first_child(&
This->node, firstChild);
1112 IXMLDOMDocument3 *iface,
1115 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1119 return node_get_last_child(&
This->node, lastChild);
1124 IXMLDOMDocument3 *iface,
1127 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1129 TRACE(
"(%p)->(%p)\n",
This, previousSibling);
1136 IXMLDOMDocument3 *iface,
1139 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1141 TRACE(
"(%p)->(%p)\n",
This, nextSibling);
1148 IXMLDOMDocument3 *iface,
1151 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1153 TRACE(
"(%p)->(%p)\n",
This, attributeMap);
1160 IXMLDOMDocument3 *iface,
1165 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1171 hr = IXMLDOMNode_get_nodeType(newChild, &
type);
1180 if (outNewChild) *outNewChild =
NULL;
1183 return node_insert_before(&
This->node, newChild, &refChild, outNewChild);
1188 IXMLDOMDocument3 *iface,
1193 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1195 TRACE(
"(%p)->(%p %p %p)\n",
This, newChild, oldChild, outOldChild);
1197 return node_replace_child(&
This->node, newChild, oldChild, outOldChild);
1202 IXMLDOMDocument3 *iface,
1206 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1208 return node_remove_child(&
This->node,
child, oldChild);
1213 IXMLDOMDocument3 *iface,
1217 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1219 return node_append_child(&
This->node,
child, outChild);
1224 IXMLDOMDocument3 *iface,
1227 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1229 return node_has_childnodes(&
This->node,
ret);
1234 IXMLDOMDocument3 *iface,
1237 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1239 return node_get_owner_doc(&
This->node, doc);
1244 IXMLDOMDocument3 *iface,
1248 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1251 TRACE(
"(%p)->(%d %p)\n",
This, deep, outNode);
1262 clone->
doc->_private = create_priv();
1263 xmldoc_add_orphan(clone->
doc, clone);
1264 xmldoc_add_ref(clone->
doc);
1266 priv_from_xmlDocPtr(clone->
doc)->properties = copy_properties(
This->properties);
1267 if (!(*outNode = (
IXMLDOMNode*)create_domdoc(clone)))
1269 xmldoc_release(clone->
doc);
1278 IXMLDOMDocument3 *iface,
1281 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1282 static const WCHAR documentW[] = {
'd',
'o',
'c',
'u',
'm',
'e',
'n',
't',0};
1291 IXMLDOMDocument3 *iface,
1294 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1296 return node_get_text(&
This->node,
p);
1301 IXMLDOMDocument3 *iface,
1304 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1311 IXMLDOMDocument3 *iface,
1314 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1315 FIXME(
"(%p)->(%p) stub!\n",
This, isSpecified);
1316 *isSpecified = VARIANT_TRUE;
1322 IXMLDOMDocument3 *iface,
1325 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1326 FIXME(
"(%p)->(%p)\n",
This, definitionNode);
1332 IXMLDOMDocument3 *iface,
1335 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1341 IXMLDOMDocument3 *iface,
1344 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1351 IXMLDOMDocument3 *iface,
1354 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1361 IXMLDOMDocument3 *iface,
1364 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1374static int XMLCALL domdoc_get_xml_writecallback(
void *
ctx,
const char *
data,
int len)
1380 IXMLDOMDocument3 *iface,
1383 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1384 xmlSaveCtxtPtr ctxt;
1400 options = XML_SAVE_FORMAT | XML_SAVE_NO_DECL;
1401 ctxt = xmlSaveToIO(domdoc_get_xml_writecallback,
NULL,
buf,
"UTF-8",
options);
1409 ret = xmlSaveDoc(ctxt, get_doc(
This));
1435 IXMLDOMDocument3 *iface,
1439 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1441 return node_transform_node(&
This->node,
node,
p);
1446 IXMLDOMDocument3 *iface,
1450 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1452 return node_select_nodes(&
This->node,
p, outList);
1457 IXMLDOMDocument3 *iface,
1461 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1463 return node_select_singlenode(&
This->node,
p, outNode);
1468 IXMLDOMDocument3 *iface,
1471 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1472 FIXME(
"(%p)->(%p) stub!\n",
This, isParsed);
1473 *isParsed = VARIANT_TRUE;
1478 IXMLDOMDocument3 *iface,
1479 BSTR* namespaceURI )
1481 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1482 TRACE(
"(%p)->(%p)\n",
This, namespaceURI);
1487 IXMLDOMDocument3 *iface,
1490 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1497 IXMLDOMDocument3 *iface,
1500 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1507 IXMLDOMDocument3 *iface,
1511 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1515 switch (
V_VT(&output))
1528 if (IUnknown_QueryInterface(
V_UNKNOWN(&output), &IID_IXMLDOMDocument, (
void **)&doc) ==
S_OK)
1536 hr = IXMLDOMDocument_loadXML(doc,
str, &
b);
1542 FIXME(
"Unsupported destination type.\n");
1547 FIXME(
"Output type %d not handled.\n",
V_VT(&output));
1556 IXMLDOMDocument3 *iface,
1559 domdoc *
This = impl_from_IXMLDOMDocument3(iface);
1576 hr = IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMDocumentType, (
void**)doctype);
1577 IXMLDOMNode_Release(
node);
1584 IXMLDOMDocument3 *iface,
1587 domdoc *
This = impl_from_IXMLDOMDocument3(iface);
1600 IXMLDOMDocument3 *iface,
1603 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1608 TRACE(
"(%p)->(%p)\n",
This, DOMElement);
1620 if(!element_node)
return S_FALSE;
1622 hr = IXMLDOMNode_QueryInterface(element_node, &IID_IXMLDOMElement, (
void**)DOMElement);
1623 IXMLDOMNode_Release(element_node);
1630 IXMLDOMDocument3 *iface,
1633 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1641 TRACE(
"(%p)->(%p)\n",
This, DOMElement);
1643 hr = IXMLDOMElement_QueryInterface( DOMElement, &IID_IXMLDOMNode, (
void**)&elementNode );
1655 if (old_doc != get_doc(
This))
1656 refcount = xmlnode_get_inst_cnt(
xmlNode);
1659 if (refcount) xmldoc_add_refs(get_doc(
This), refcount);
1660 oldRoot = xmlDocSetRootElement( get_doc(
This),
xmlNode->node);
1661 if (refcount) xmldoc_release_refs(old_doc, refcount);
1662 IXMLDOMNode_Release( elementNode );
1665 xmldoc_add_orphan(oldRoot->
doc, oldRoot);
1672 IXMLDOMDocument3 *iface,
1676 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1691 IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMElement, (
void**)
element);
1692 IXMLDOMNode_Release(
node);
1700 IXMLDOMDocument3 *iface,
1703 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1720 IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMDocumentFragment, (
void**)frag);
1721 IXMLDOMNode_Release(
node);
1729 IXMLDOMDocument3 *iface,
1733 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1750 IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMText, (
void**)
text);
1751 IXMLDOMNode_Release(
node);
1760 IXMLDOMDocument3 *iface,
1764 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1781 IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMComment, (
void**)
comment);
1782 IXMLDOMNode_Release(
node);
1791 IXMLDOMDocument3 *iface,
1795 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1812 IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMCDATASection, (
void**)cdata);
1813 IXMLDOMNode_Release(
node);
1814 hr = IXMLDOMCDATASection_put_data(*cdata,
data);
1822 IXMLDOMDocument3 *iface,
1827 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1848 hr = node_set_content(node_obj,
data);
1850 IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMProcessingInstruction, (
void**)
pi);
1851 IXMLDOMNode_Release(
node);
1859 IXMLDOMDocument3 *iface,
1863 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1878 IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMAttribute, (
void**)
attribute);
1879 IXMLDOMNode_Release(
node);
1887 IXMLDOMDocument3 *iface,
1891 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1908 IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMEntityReference, (
void**)entityref);
1909 IXMLDOMNode_Release(
node);
1918 static const xmlChar everything[] =
"/descendant::node()";
1919 static const xmlChar mod_pre[] =
"*[local-name()='";
1920 static const xmlChar mod_post[] =
"']";
1921 static const xmlChar prefix[] =
"descendant::";
1922 const WCHAR *tokBegin, *tokEnd;
1933 while (tokBegin && *tokBegin)
1948 while (*tokEnd && *tokEnd !=
'/')
1964 IXMLDOMDocument3 *iface,
1968 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
1977 XPath =
This->properties->XPath;
1979 query = tagName_to_XPath(tagName);
1982 This->properties->XPath = XPath;
2003 IXMLDOMDocument3 *iface,
2009 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2022 TRACE(
"node_type %d\n", node_type);
2037 xml_name = xmlchar_from_wchar(
name);
2039 href = namespaceURI ? xmlchar_from_wchar(namespaceURI) :
NULL;
2052 if (
local || (href && *href))
2071 if (
local || (href && *href))
2094#ifdef HAVE_XMLNEWDOCPI
2097 FIXME(
"xmlNewDocPI() not supported, use libxml2 2.6.15 or greater\n");
2105 xmlnode = xmlNewDocFragment(get_doc(
This));
2115 FIXME(
"unhandled node type %d\n", node_type);
2126 TRACE(
"created node (%d, %p, %p)\n", node_type, *
node, xmlnode);
2127 xmldoc_add_orphan(xmlnode->
doc, xmlnode);
2135 IXMLDOMDocument3 *iface,
2139 domdoc *
This = impl_from_IXMLDOMDocument3(iface);
2152 return attach_xmldoc(
This, xmldoc);
2171 IXMLDOMDocument3 *iface,
2175 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2184 *isSuccessful = VARIANT_FALSE;
2207 ERR(
"SAFEARRAY == NULL\n");
2217 WARN(
"failed to access array data, 0x%08x\n",
hr);
2225 *isSuccessful = VARIANT_TRUE;
2226 TRACE(
"parsed document %p\n", xmldoc);
2231 TRACE(
"failed to parse document\n");
2239 return attach_xmldoc(
This, xmldoc);
2243 FIXME(
"unhandled SAFEARRAY dim: %d\n", dim);
2251 IXMLDOMDocument3 *newdoc =
NULL;
2255 hr = IUnknown_QueryInterface(
V_UNKNOWN(&
source), &IID_IXMLDOMDocument3, (
void**)&newdoc);
2260 domdoc *newDoc = impl_from_IXMLDOMDocument3( newdoc );
2262 xmldoc = xmlCopyDoc(get_doc(newDoc), 1);
2264 hr = attach_xmldoc(
This, xmldoc);
2267 *isSuccessful = VARIANT_TRUE;
2281 *isSuccessful = VARIANT_TRUE;
2282 ISequentialStream_Release(
stream);
2298 if (
This->properties->uri)
2300 IUri_Release(
This->properties->uri);
2309 hr = domdoc_load_moniker(
This, mon );
2310 IMoniker_Release(mon);
2318 *isSuccessful = VARIANT_TRUE;
2331 hr = attach_xmldoc(
This, xmldoc);
2343 IXMLDOMDocument3 *iface,
2346 domdoc *
This = impl_from_IXMLDOMDocument3(iface);
2352 *
value = READYSTATE_COMPLETE;
2358 IXMLDOMDocument3 *iface,
2361 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2362 static const WCHAR err[] = {
'e',
'r',
'r',
'o',
'r',0};
2365 FIXME(
"(%p)->(%p): creating a dummy parseError\n", iface, errorObj);
2377 IXMLDOMDocument3 *iface,
2380 domdoc *
This = impl_from_IXMLDOMDocument3(iface);
2387 if (!
This->properties->uri)
2390 return IUri_GetPropertyBSTR(
This->properties->uri, Uri_PROPERTY_DISPLAY_URI,
url, 0);
2395 IXMLDOMDocument3 *iface,
2398 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2401 *isAsync =
This->async;
2407 IXMLDOMDocument3 *iface,
2410 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2413 This->async = isAsync;
2419 IXMLDOMDocument3 *iface )
2421 domdoc *
This = impl_from_IXMLDOMDocument3(iface);
2428 IXMLDOMDocument3 *iface,
2432 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2442 *isSuccessful = VARIANT_FALSE;
2456 TRACE(
"failed to parse document\n");
2461 *isSuccessful = VARIANT_TRUE;
2462 TRACE(
"parsed document %p\n", xmldoc);
2470 hr2 = attach_xmldoc(
This, xmldoc);
2483 WARN(
"write error\n");
2490static int XMLCALL domdoc_save_closecallback(
void *
ctx)
2495static int XMLCALL domdoc_stream_save_writecallback(
void *
ctx,
const char *
buffer,
int len)
2504 WARN(
"stream write error: 0x%08x\n",
hr);
2511static int XMLCALL domdoc_stream_save_closecallback(
void *
ctx)
2518 IXMLDOMDocument3 *iface,
2521 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2528 switch (
V_VT(&destination))
2533 IXMLDOMDocument3 *document;
2536 ret = IUnknown_QueryInterface(
pUnk, &IID_IXMLDOMDocument3, (
void**)&document);
2542 ret = IXMLDOMDocument3_get_xml(iface, &xml);
2545 ret = IXMLDOMDocument3_loadXML(document, xml, &
success);
2549 IXMLDOMDocument3_Release(document);
2553 ret = IUnknown_QueryInterface(
pUnk, &IID_IStream, (
void**)&
stream);
2556 int options = get_doc(
This)->standalone == -1 ? XML_SAVE_NO_DECL : 0;
2557 ctx = xmlSaveToIO(domdoc_stream_save_writecallback,
2572 int options = get_doc(
This)->standalone == -1 ? XML_SAVE_NO_DECL : 0;
2579 WARN(
"failed to create file\n");
2584 ctx = xmlSaveToIO(domdoc_save_writecallback, domdoc_save_closecallback,
2599 xmldecl = xmldoc_unlink_xmldecl(get_doc(
This));
2601 xmldoc_link_xmldecl(get_doc(
This), xmldecl);
2610 IXMLDOMDocument3 *iface,
2613 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2614 TRACE(
"(%p)->(%p: %d)\n",
This, isValidating,
This->validating);
2615 *isValidating =
This->validating;
2621 IXMLDOMDocument3 *iface,
2624 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2625 TRACE(
"(%p)->(%d)\n",
This, isValidating);
2626 This->validating = isValidating;
2632 IXMLDOMDocument3 *iface,
2635 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2636 TRACE(
"(%p)->(%p: %d)\n",
This, isResolving,
This->resolving);
2637 *isResolving =
This->resolving;
2643 IXMLDOMDocument3 *iface,
2646 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2647 TRACE(
"(%p)->(%d)\n",
This, isResolving);
2648 This->resolving = isResolving;
2654 IXMLDOMDocument3 *iface,
2657 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2658 TRACE(
"(%p)->(%p: %d)\n",
This, isPreserving,
This->properties->preserving);
2659 *isPreserving =
This->properties->preserving;
2665 IXMLDOMDocument3 *iface,
2668 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2669 TRACE(
"(%p)->(%d)\n",
This, isPreserving);
2670 This->properties->preserving = isPreserving;
2676 IXMLDOMDocument3 *iface,
2679 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2688 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2695 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2701 IXMLDOMDocument3* iface,
2704 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2711 if (!
This->namespaces)
2716 hr = cache_from_doc_ns(
This->namespaces, &
This->node);
2718 release_namespaces(
This);
2721 if (
This->namespaces)
2722 return IXMLDOMSchemaCollection2_QueryInterface(
This->namespaces,
2723 &IID_IXMLDOMSchemaCollection, (
void**)
collection);
2729 IXMLDOMDocument3* iface,
2732 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2733 IXMLDOMSchemaCollection2* cur_schema =
This->properties->schemaCache;
2752 IXMLDOMDocument3* iface,
2755 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2757 IXMLDOMSchemaCollection2* new_schema =
NULL;
2765 hr = IUnknown_QueryInterface(
V_UNKNOWN(&
schema), &IID_IXMLDOMSchemaCollection, (
void**)&new_schema);
2772 hr = IDispatch_QueryInterface(
V_DISPATCH(&
schema), &IID_IXMLDOMSchemaCollection, (
void**)&new_schema);
2788 if(old_schema) IXMLDOMSchemaCollection2_Release(old_schema);
2796#ifdef HAVE_XMLDOC_PROPERTIES
2805 switch (
child->type)
2824static void LIBXML2_LOG_CALLBACK validate_error(
void*
ctx,
char const*
msg, ...)
2828 LIBXML2_CALLBACK_ERR(domdoc_validateNode,
msg,
ap);
2832static void LIBXML2_LOG_CALLBACK validate_warning(
void*
ctx,
char const*
msg, ...)
2836 LIBXML2_CALLBACK_WARN(domdoc_validateNode,
msg,
ap);
2841 IXMLDOMDocument3* iface,
2845 domdoc*
This = impl_from_IXMLDOMDocument3(iface);
2851 IXMLDOMDocument3_get_readyState(iface, &
state);
2852 if (
state != READYSTATE_COMPLETE)
2873 if (!is_wellformed(get_doc(
This)))
2875 ERR(
"doc not well-formed\n");
2882 if (get_doc(
This)->intSubset || get_doc(
This)->extSubset)
2885 vctx->error = validate_error;
2886 vctx->warning = validate_warning;
2890 xmlValidateDocument(vctx, get_doc(
This)) :
2894 TRACE(
"DTD validation failed\n");
2895 err_code = E_XML_INVALID;
2898 xmlFreeValidCtxt(vctx);
2912 TRACE(
"schema validation succeeded\n");
2916 ERR(
"schema validation failed\n");
2917 err_code = E_XML_INVALID;
2929 ERR(
"no DTD or schema found\n");
2930 err_code = E_XML_NODTD;
2941 IXMLDOMDocument3* iface,
2944 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2946 return IXMLDOMDocument3_validateNode(iface, (
IXMLDOMNode*)iface,
err);
2950 IXMLDOMDocument3* iface,
2954 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
2958 if (
lstrcmpiW(
p, PropertySelectionLanguageW) == 0)
2975 if (
lstrcmpiW(bstr, PropValueXPathW) == 0)
2977 else if (
lstrcmpiW(bstr, PropValueXSLPatternW) == 0)
2985 else if (
lstrcmpiW(
p, PropertySelectionNamespacesW) == 0)
2988 struct list *pNsList;
3005 pNsList = &(
This->properties->selectNsList);
3006 clear_selectNsList(pNsList);
3008 nsStr = xmlchar_from_wchar(bstr);
3012 This->properties->selectNsStr = nsStr;
3016 xmlChar *pTokBegin, *pTokEnd, *pTokInner;
3017 select_ns_entry* ns_entry =
NULL;
3018 xmlXPathContextPtr
ctx;
3020 ctx = xmlXPathNewContext(
This->node.node->doc);
3024 while (*pTokBegin ==
' ' || *pTokBegin ==
'\n' ||
3025 *pTokBegin ==
'\t' || *pTokBegin ==
'\r')
3028 for (; *pTokBegin; pTokBegin = pTokEnd)
3031 memset(ns_entry, 0,
sizeof(select_ns_entry));
3033 ns_entry = heap_alloc_zero(
sizeof(select_ns_entry));
3035 while (*pTokBegin ==
' ')
3037 pTokEnd = pTokBegin;
3038 while (*pTokEnd !=
' ' && *pTokEnd != 0)
3042 if (pTokEnd == pTokBegin)
break;
3047 WARN(
"Syntax error in xmlns string: %s\n\tat token: %s\n",
3053 if (*pTokBegin ==
'=')
3056 FIXME(
"Setting default xmlns not supported - skipping.\n");
3059 else if (*pTokBegin ==
':')
3061 ns_entry->prefix = ++pTokBegin;
3062 for (pTokInner = pTokBegin; pTokInner != pTokEnd && *pTokInner !=
'='; ++pTokInner)
3065 if (pTokInner == pTokEnd)
3068 WARN(
"Syntax error in xmlns string: %s\n\tat token: %s\n",
3073 ns_entry->prefix_end = *pTokInner;
3077 if (pTokEnd-pTokInner > 1 &&
3078 ((*pTokInner ==
'\'' && *(pTokEnd-1) ==
'\'') ||
3079 (*pTokInner ==
'"' && *(pTokEnd-1) ==
'"')))
3081 ns_entry->href = ++pTokInner;
3082 ns_entry->href_end = *(pTokEnd-1);
3086 if (xmlXPathRegisterNs(
ctx, ns_entry->prefix, ns_entry->href) != 0)
3095 WARN(
"Syntax error in xmlns string: %s\n\tat token: %s\n",
3111 xmlXPathFreeContext(
ctx);
3117 else if (
lstrcmpiW(
p, PropertyProhibitDTDW) == 0 ||
3119 lstrcmpiW(
p, PropertyResolveExternalsW) == 0 ||
3120 lstrcmpiW(
p, PropertyAllowXsltScriptW) == 0 ||
3121 lstrcmpiW(
p, PropertyNormalizeAttributeValuesW) == 0 ||
3122 lstrcmpiW(
p, PropertyAllowDocumentFunctionW) == 0)
3134 IXMLDOMDocument3* iface,
3138 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
3145 if (
lstrcmpiW(
p, PropertySelectionLanguageW) == 0)
3153 else if (
lstrcmpiW(
p, PropertySelectionNamespacesW) == 0)
3158 struct list *pNsList;
3159 select_ns_entry* pNsEntry;
3162 nsStr =
This->properties->selectNsStr;
3163 pNsList = &
This->properties->selectNsList;
3164 lenA =
This->properties->selectNsStr_len;
3173 if (pNsEntry->prefix_end)
3175 *
cur = pNsEntry->prefix_end;
3179 if (pNsEntry->href_end)
3181 *
cur = pNsEntry->href_end;
3194 IXMLDOMDocument3* iface,
3199 domdoc *
This = impl_from_IXMLDOMDocument3( iface );
3204static const struct IXMLDOMDocument3Vtbl XMLDOMDocument3Vtbl =
3206 domdoc_QueryInterface,
3209 domdoc_GetTypeInfoCount,
3211 domdoc_GetIDsOfNames,
3213 domdoc_get_nodeName,
3214 domdoc_get_nodeValue,
3215 domdoc_put_nodeValue,
3216 domdoc_get_nodeType,
3217 domdoc_get_parentNode,
3218 domdoc_get_childNodes,
3219 domdoc_get_firstChild,
3220 domdoc_get_lastChild,
3221 domdoc_get_previousSibling,
3222 domdoc_get_nextSibling,
3223 domdoc_get_attributes,
3224 domdoc_insertBefore,
3225 domdoc_replaceChild,
3228 domdoc_hasChildNodes,
3229 domdoc_get_ownerDocument,
3231 domdoc_get_nodeTypeString,
3234 domdoc_get_specified,
3235 domdoc_get_definition,
3236 domdoc_get_nodeTypedValue,
3237 domdoc_put_nodeTypedValue,
3238 domdoc_get_dataType,
3239 domdoc_put_dataType,
3241 domdoc_transformNode,
3243 domdoc_selectSingleNode,
3245 domdoc_get_namespaceURI,
3247 domdoc_get_baseName,
3248 domdoc_transformNodeToObject,
3250 domdoc_get_implementation,
3251 domdoc_get_documentElement,
3252 domdoc_put_documentElement,
3253 domdoc_createElement,
3254 domdoc_createDocumentFragment,
3255 domdoc_createTextNode,
3256 domdoc_createComment,
3257 domdoc_createCDATASection,
3258 domdoc_createProcessingInstruction,
3259 domdoc_createAttribute,
3260 domdoc_createEntityReference,
3261 domdoc_getElementsByTagName,
3265 domdoc_get_readyState,
3266 domdoc_get_parseError,
3273 domdoc_get_validateOnParse,
3274 domdoc_put_validateOnParse,
3275 domdoc_get_resolveExternals,
3276 domdoc_put_resolveExternals,
3277 domdoc_get_preserveWhiteSpace,
3278 domdoc_put_preserveWhiteSpace,
3279 domdoc_put_onreadystatechange,
3280 domdoc_put_onDataAvailable,
3281 domdoc_put_onTransformNode,
3282 domdoc_get_namespaces,
3284 domdoc_putref_schemas,
3288 domdoc_validateNode,
3297 return IXMLDOMDocument3_QueryInterface(&
This->IXMLDOMDocument3_iface,
riid,
ppv);
3303 return IXMLDOMDocument3_AddRef(&
This->IXMLDOMDocument3_iface);
3309 return IXMLDOMDocument3_Release(&
This->IXMLDOMDocument3_iface);
3316 FIXME(
"(%p)->(%p): stub\n",
This, ppEnum);
3330 for(iter =
This->cp_list; iter; iter = iter->next)
3338 IConnectionPoint_AddRef(*
cp);
3374 IConnectionPoint_AddRef(iface);
3385 return IConnectionPointContainer_AddRef(
This->container);
3391 return IConnectionPointContainer_Release(
This->container);
3416 IConnectionPointContainer_AddRef(*
container);
3430 hr = IUnknown_QueryInterface(unk_sink,
This->iid, (
void**)&
sink);
3438 for (
i = 0;
i <
This->sinks_size;
i++)
3439 if (!
This->sinks[
i].unk)
3442 if (
i ==
This->sinks_size)
3448 This->sinks_size = 1;
3478 FIXME(
"(%p)->(%p): stub\n",
This, ppEnum);
3502 cp->next = doc->cp_list;
3505 cp->container = &doc->IConnectionPointContainer_iface;
3513 return IXMLDOMDocument3_QueryInterface(&
This->IXMLDOMDocument3_iface,
riid,
ppvObject);
3519 return IXMLDOMDocument3_AddRef(&
This->IXMLDOMDocument3_iface);
3525 return IXMLDOMDocument3_Release(&
This->IXMLDOMDocument3_iface);
3537 return IUnknown_QueryInterface(
This->site, iid, ppvSite );
3544 TRACE(
"(%p)->(%p)\n", iface, punk);
3550 IUnknown_Release(
This->site );
3557 IUnknown_AddRef( punk );
3560 IUnknown_Release(
This->site );
3567static const IObjectWithSiteVtbl domdocObjectSite =
3569 domdoc_ObjectWithSite_QueryInterface,
3570 domdoc_ObjectWithSite_AddRef,
3571 domdoc_ObjectWithSite_Release,
3572 domdoc_ObjectWithSite_SetSite,
3573 domdoc_ObjectWithSite_GetSite
3579 return IXMLDOMDocument3_QueryInterface(&
This->IXMLDOMDocument3_iface,
riid,
ppv);
3585 return IXMLDOMDocument3_AddRef(&
This->IXMLDOMDocument3_iface);
3591 return IXMLDOMDocument3_Release(&
This->IXMLDOMDocument3_iface);
3594#define SAFETY_SUPPORTED_OPTIONS (INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_SECURITY_MANAGER)
3605 *supported = SAFETY_SUPPORTED_OPTIONS;
3617 if ((
mask & ~SAFETY_SUPPORTED_OPTIONS) != 0)
3625#undef SAFETY_SUPPORTED_OPTIONS
3627static const IObjectSafetyVtbl domdocObjectSafetyVtbl = {
3628 domdoc_Safety_QueryInterface,
3629 domdoc_Safety_AddRef,
3630 domdoc_Safety_Release,
3631 domdoc_Safety_GetInterfaceSafetyOptions,
3632 domdoc_Safety_SetInterfaceSafetyOptions
3635static const tid_t domdoc_iface_tids[] = {
3647HRESULT get_domdoc_from_xmldoc(
xmlDocPtr xmldoc, IXMLDOMDocument3 **document)
3655 doc->IXMLDOMDocument3_iface.lpVtbl = &XMLDOMDocument3Vtbl;
3656 doc->IPersistStreamInit_iface.lpVtbl = &xmldoc_IPersistStreamInit_VTable;
3657 doc->IObjectWithSite_iface.lpVtbl = &domdocObjectSite;
3658 doc->IObjectSafety_iface.lpVtbl = &domdocObjectSafetyVtbl;
3661 doc->async = VARIANT_TRUE;
3662 doc->validating = 0;
3664 doc->properties = properties_from_xmlDocPtr(xmldoc);
3668 doc->cp_list =
NULL;
3669 doc->namespaces =
NULL;
3670 memset(doc->events, 0,
sizeof(doc->events));
3680 *document = &doc->IXMLDOMDocument3_iface;
3682 TRACE(
"returning iface %p\n", *document);
3699 hr = get_domdoc_from_xmldoc(xmldoc, (IXMLDOMDocument3**)ppObj);
3702 free_properties(properties_from_xmlDocPtr(xmldoc));
3716 TRACE(
"(%p)\n", document);
3718 hr = get_domdoc_from_xmldoc((
xmlDocPtr)document, (IXMLDOMDocument3**)&
obj);
3729 MESSAGE(
"This program tried to use a DOMDocument object, but\n"
3730 "libxml2 support was not present at compile time.\n");
XMLPUBFUN void XMLCALL xmlSAX2Characters(void *ctx, const xmlChar *ch, int len)
XMLPUBFUN void XMLCALL xmlSAX2EndDocument(void *ctx)
XMLPUBFUN int XMLCALL xmlSAX2HasExternalSubset(void *ctx)
XMLPUBFUN void XMLCALL xmlSAX2Comment(void *ctx, const xmlChar *value)
XMLPUBFUN void XMLCALL xmlSAX2SetDocumentLocator(void *ctx, xmlSAXLocatorPtr loc)
XMLPUBFUN void XMLCALL xmlSAX2EndElementNs(void *ctx, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI)
XMLPUBFUN void XMLCALL xmlSAX2EntityDecl(void *ctx, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
XMLPUBFUN void XMLCALL xmlSAX2UnparsedEntityDecl(void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName)
XMLPUBFUN xmlParserInputPtr XMLCALL xmlSAX2ResolveEntity(void *ctx, const xmlChar *publicId, const xmlChar *systemId)
XMLPUBFUN void XMLCALL xmlSAX2NotationDecl(void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId)
XMLPUBFUN void XMLCALL xmlSAX2ProcessingInstruction(void *ctx, const xmlChar *target, const xmlChar *data)
XMLPUBFUN void XMLCALL xmlSAX2AttributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree)
XMLPUBFUN void XMLCALL xmlSAX2InternalSubset(void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID)
XMLPUBFUN xmlEntityPtr XMLCALL xmlSAX2GetParameterEntity(void *ctx, const xmlChar *name)
XMLPUBFUN xmlEntityPtr XMLCALL xmlSAX2GetEntity(void *ctx, const xmlChar *name)
XMLPUBFUN void XMLCALL xmlSAX2StartDocument(void *ctx)
XMLPUBFUN void XMLCALL xmlSAX2ExternalSubset(void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID)
XMLPUBFUN int XMLCALL xmlSAX2IsStandalone(void *ctx)
XMLPUBFUN void XMLCALL xmlSAX2ElementDecl(void *ctx, const xmlChar *name, int type, xmlElementContentPtr content)
XMLPUBFUN void XMLCALL xmlSAX2Reference(void *ctx, const xmlChar *name)
XMLPUBFUN void XMLCALL xmlSAX2StartElementNs(void *ctx, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI, int nb_namespaces, const xmlChar **namespaces, int nb_attributes, int nb_defaulted, const xmlChar **attributes)
XMLPUBFUN int XMLCALL xmlSAX2HasInternalSubset(void *ctx)
XMLPUBFUN void XMLCALL xmlSAX2CDataBlock(void *ctx, const xmlChar *value, int len)
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
static void * heap_realloc(void *mem, size_t len)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_remove(struct list_entry *entry)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
HRESULT create_uri(const WCHAR *, DWORD, IUri **) DECLSPEC_HIDDEN
HRESULT detach_bsc(bsc_t *bsc)
HRESULT bind_url(IMoniker *mon, HRESULT(*onDataAvailable)(void *, char *, DWORD), void *obj, bsc_t **ret)
static void ConnectionPoint_Init(ConnectionPoint *cp, ConnectionPointContainer *container, REFIID riid, cp_static_data_t *data)
static IFilterGraphImpl * impl_from_IObjectWithSite(IObjectWithSite *iface)
#define INVALID_HANDLE_VALUE
static __inline const char * debugstr_an(const char *s, int n)
#define FILE_ATTRIBUTE_NORMAL
#define WideCharToMultiByte
#define MultiByteToWideChar
static const WCHAR version[]
static ConnectionPoint * impl_from_IConnectionPoint(IConnectionPoint *iface)
static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *pUnkSink, DWORD *pdwCookie)
static ConnectionPointContainer * impl_from_IConnectionPointContainer(IConnectionPointContainer *iface)
static HRESULT WINAPI ConnectionPoint_GetConnectionInterface(IConnectionPoint *iface, IID *pIID)
static const IConnectionPointVtbl ConnectionPointVtbl
static HRESULT WINAPI ConnectionPoint_QueryInterface(IConnectionPoint *iface, REFIID riid, LPVOID *ppv)
static HRESULT WINAPI ConnectionPoint_Unadvise(IConnectionPoint *iface, DWORD dwCookie)
static HRESULT WINAPI ConnectionPointContainer_QueryInterface(IConnectionPointContainer *iface, REFIID riid, LPVOID *ppv)
static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl
static ULONG WINAPI ConnectionPointContainer_AddRef(IConnectionPointContainer *iface)
static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer *iface, LPENUMCONNECTIONPOINTS *ppEnum)
static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer *iface, REFIID riid, LPCONNECTIONPOINT *ppCP)
static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer(IConnectionPoint *iface, IConnectionPointContainer **ppCPC)
static HRESULT WINAPI ConnectionPoint_EnumConnections(IConnectionPoint *iface, IEnumConnections **ppEnum)
static ULONG WINAPI ConnectionPoint_AddRef(IConnectionPoint *iface)
static ULONG WINAPI ConnectionPointContainer_Release(IConnectionPointContainer *iface)
static ULONG WINAPI ConnectionPoint_Release(IConnectionPoint *iface)
static JScript * impl_from_IObjectSafety(IObjectSafety *iface)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
static const WCHAR documentW[]
HRESULT DOMDocument_create(MSXML_VERSION version, void **ppObj)
HRESULT WINAPI GetHGlobalFromStream(IStream *pstm, HGLOBAL *phglobal)
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
HRESULT WINAPI SafeArrayGetUBound(SAFEARRAY *psa, UINT nDim, LONG *plUbound)
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
UINT WINAPI SafeArrayGetDim(SAFEARRAY *psa)
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
__kernel_ptrdiff_t ptrdiff_t
#define InterlockedExchangePointer(Target, Value)
@ XML_CHAR_ENCODING_UTF16LE
static unsigned char buff[32768]
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum GLboolean sink
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
@ EVENTID_READYSTATECHANGE
static HRESULT set_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *var)
static HRESULT create_node(HTMLDocumentNode *, nsIDOMNode *, HTMLDOMNode **)
static HTMLDOMNode * get_node_obj(IHTMLDOMNode *)
static WebBrowser * impl_from_IPersistStreamInit(IPersistStreamInit *iface)
static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface, ULARGE_INTEGER *pcbSize)
static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID)
static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM pStg)
static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStg, BOOL fSameAsLoad)
static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface, REFIID riid, LPVOID *ppobj)
#define InterlockedExchangeAdd
#define memcpy(s1, s2, n)
#define sprintf(buf, format,...)
#define comment(fmt, arg1)
const IID IID_IObjectWithSite
static const char * debugstr_variant(const VARIANT *var)
static IActiveScriptSite * site
static ICollection collection
static VARIANTARG static DISPID
static IBindStatusCallbackEx bsc
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
#define NODE_PRIV_TRAILING_IGNORABLE_WS
static HRESULT return_null_bstr(BSTR *p)
static const CLSID * DOMDocument_version(MSXML_VERSION v)
static HRESULT return_null_var(VARIANT *p)
IXMLDOMParseError * create_parseError(LONG code, BSTR url, BSTR reason, BSTR srcText, LONG line, LONG linepos, LONG filepos) DECLSPEC_HIDDEN
static HRESULT return_bstr(const WCHAR *value, BSTR *p)
static HRESULT return_null_ptr(void **p)
#define NODE_PRIV_CHILD_IGNORABLE_WS
HRESULT SchemaCache_create(MSXML_VERSION, void **) DECLSPEC_HIDDEN
static HRESULT return_null_node(IXMLDOMNode **p)
BSTR WINAPI SysAllocString(LPCOLESTR str)
UINT WINAPI SysStringLen(BSTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
#define CONNECT_E_CANNOTCONNECT
#define CONNECT_E_NOCONNECTION
const GUID IID_IConnectionPointContainer
const GUID IID_IConnectionPoint
const GUID IID_IPropertyNotifySink
const GUID IID_IPersistStreamInit
XMLPUBFUN int XMLCALL xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc)
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateMemoryParserCtxt(const char *buffer, int size)
const GUID IID_IPersistStream
#define IsEqualGUID(rguid1, rguid2)
static unsigned __int64 next
XMLPUBVAR xmlMallocFunc xmlMalloc
XMLPUBVAR xmlFreeFunc xmlFree
XMLPUBFUN void XMLCALL xmlFreeParserCtxt(xmlParserCtxtPtr ctxt)
XMLPUBFUN int XMLCALL xmlParseDocument(xmlParserCtxtPtr ctxt)
XMLPUBFUN xmlNodePtr XMLCALL xmlNewReference(const xmlDoc *doc, const xmlChar *name)
XMLPUBFUN void XMLCALL xmlBufferFree(xmlBufferPtr buf)
XMLPUBFUN xmlNodePtr XMLCALL xmlDocGetRootElement(const xmlDoc *doc)
XMLPUBFUN void XMLCALL xmlFreeDoc(xmlDocPtr cur)
XMLPUBFUN int XMLCALL xmlBufferAdd(xmlBufferPtr buf, const xmlChar *str, int len)
XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocNode(xmlDocPtr doc, xmlNsPtr ns, const xmlChar *name, const xmlChar *content)
XMLPUBFUN xmlNodePtr XMLCALL xmlCopyNode(xmlNodePtr node, int recursive)
XMLPUBFUN int XMLCALL xmlNodeGetSpacePreserve(const xmlNode *cur)
XMLPUBFUN void XMLCALL xmlNodeAddContent(xmlNodePtr cur, const xmlChar *content)
XMLPUBFUN xmlDocPtr XMLCALL xmlNewDoc(const xmlChar *version)
XMLPUBFUN void XMLCALL xmlSetNs(xmlNodePtr node, xmlNsPtr ns)
XMLPUBFUN xmlAttrPtr XMLCALL xmlNewDocProp(xmlDocPtr doc, const xmlChar *name, const xmlChar *value)
XMLPUBFUN xmlDtdPtr XMLCALL xmlGetIntSubset(const xmlDoc *doc)
XMLPUBFUN void XMLCALL xmlUnlinkNode(xmlNodePtr cur)
XMLPUBFUN xmlBufferPtr XMLCALL xmlBufferCreate(void)
XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocPI(xmlDocPtr doc, const xmlChar *name, const xmlChar *content)
xmlParserCtxt * xmlParserCtxtPtr
XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocText(const xmlDoc *doc, const xmlChar *content)
XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocComment(xmlDocPtr doc, const xmlChar *content)
XMLPUBFUN const xmlChar *XMLCALL xmlBufferContent(const xmlBuffer *buf)
XMLPUBFUN void XMLCALL xmlFreeNode(xmlNodePtr cur)
XMLPUBFUN int XMLCALL xmlBufferLength(const xmlBuffer *buf)
XMLPUBFUN xmlNsPtr XMLCALL xmlNewNs(xmlNodePtr node, const xmlChar *href, const xmlChar *prefix)
XMLPUBFUN xmlChar *XMLCALL xmlSplitQName2(const xmlChar *name, xmlChar **prefix)
XMLPUBFUN xmlNodePtr XMLCALL xmlNewCDataBlock(xmlDocPtr doc, const xmlChar *content, int len)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
IConnectionPointContainer * container
IConnectionPoint IConnectionPoint_iface
IPropertyNotifySink * propnotif
struct _xmlNode * children
struct _xmlSAXHandler * sax
#define CONTAINING_RECORD(address, type, field)
HRESULT WINAPI CreateURLMonikerEx2(IMoniker *pmkContext, IUri *pUri, IMoniker **ppmk, DWORD dwFlags)
xmlValidCtxt * xmlValidCtxtPtr
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
void WINAPI VariantInit(VARIANTARG *pVarg)
#define success(from, fromstr, to, tostr)
_In_ DWORD _Out_ _In_ WORD wFlags
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
#define DISP_E_TYPEMISMATCH
void int int ULONGLONG int va_list * ap
enum tagDOMNodeType DOMNodeType
@ NODE_PROCESSING_INSTRUCTION
XMLPUBFUN xmlChar *XMLCALL xmlStrcat(xmlChar *cur, const xmlChar *add)
XMLPUBFUN xmlChar *XMLCALL xmlStrncat(xmlChar *cur, const xmlChar *add, int len)
XMLPUBFUN int XMLCALL xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len)
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN int XMLCALL xmlStrlen(const xmlChar *str)