Reactos

[MSXML3] Sync with wine-10.0

+2211 -2506
+8 -2
dll/win32/msxml3/CMakeLists.txt
··· 32 32 nodemap.c 33 33 parseerror.c 34 34 pi.c 35 + reactos.c 35 36 saxreader.c 36 37 schema.c 37 38 selection.c ··· 70 71 71 72 add_idl_headers(xmlparser_idlheader xmlparser.idl) 72 73 set_module_type(msxml3 win32dll) 73 - target_link_libraries(msxml3 libxml2 iconv-static uuid wine zlib) 74 + target_link_libraries(msxml3 libxml2 iconv-static uuid wine wine_dll_register zlib) 74 75 75 76 if(MSVC) 76 77 target_compile_options(msxml3 PRIVATE /FIwine/typeof.h /FImsvc.h) 77 78 78 79 # Disable warning C4090: 'function': different 'const' qualifiers 79 80 target_compile_options(msxml3 PRIVATE /wd4090) 81 + 82 + if(ARCH STREQUAL "amd64" OR ARCH STREQUAL "arm64") 83 + # Disable warning C4267: 'function': conversion from 'size_t' to 'UINT', possible loss of data 84 + target_compile_options(msxml3 PRIVATE "/wd4267") 85 + endif() 80 86 endif() 81 87 82 88 if(CMAKE_C_COMPILER_ID STREQUAL "Clang") 83 89 target_compile_options(msxml3 PRIVATE -Wno-incompatible-function-pointer-types) 84 90 endif() 85 91 86 - add_importlibs(msxml3 urlmon ws2_32 shlwapi oleaut32 ole32 user32 msvcrt kernel32 ntdll) 92 + add_importlibs(msxml3 libxslt urlmon ws2_32 shlwapi oleaut32 ole32 user32 msvcrt kernel32 ntdll) 87 93 add_dependencies(msxml3 xmlparser_idlheader stdole2) # msxml3_v1.tlb needs stdole2.tlb 88 94 add_pch(msxml3 precomp.h "${PCH_SKIP_SOURCE}") 89 95 add_cd_file(TARGET msxml3 DESTINATION reactos/system32 FOR all)
+43 -40
dll/win32/msxml3/attribute.c
··· 20 20 21 21 #define COBJMACROS 22 22 23 - #include "config.h" 24 - 25 23 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - # include <libxml/xmlerror.h> 29 - # include <libxml/HTMLtree.h> 30 - #endif 24 + #include <libxml/parser.h> 25 + #include <libxml/xmlerror.h> 26 + #include <libxml/HTMLtree.h> 31 27 32 28 #include "windef.h" 33 29 #include "winbase.h" ··· 38 34 #include "msxml_private.h" 39 35 40 36 #include "wine/debug.h" 41 - 42 - #ifdef HAVE_LIBXML2 43 37 44 38 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 45 39 ··· 101 95 static ULONG WINAPI domattr_AddRef( 102 96 IXMLDOMAttribute *iface ) 103 97 { 104 - domattr *This = impl_from_IXMLDOMAttribute( iface ); 105 - ULONG ref = InterlockedIncrement( &This->ref ); 106 - TRACE("(%p)->(%d)\n", This, ref); 98 + domattr *attr = impl_from_IXMLDOMAttribute( iface ); 99 + ULONG ref = InterlockedIncrement( &attr->ref ); 100 + TRACE("%p, refcount %lu.\n", iface, ref); 107 101 return ref; 108 102 } 109 103 ··· 113 107 domattr *This = impl_from_IXMLDOMAttribute( iface ); 114 108 ULONG ref = InterlockedDecrement( &This->ref ); 115 109 116 - TRACE("(%p)->(%d)\n", This, ref); 110 + TRACE("%p, refcount %lu.\n", iface, ref); 117 111 if ( ref == 0 ) 118 112 { 119 113 destroy_xmlnode(&This->node); ··· 122 116 xmlFreeNs( This->node.node->ns ); 123 117 xmlFreeNode( This->node.node ); 124 118 } 125 - heap_free( This ); 119 + free( This ); 126 120 } 127 121 128 122 return ref; ··· 549 543 IXMLDOMAttribute *iface, 550 544 BSTR* p) 551 545 { 552 - static const WCHAR w3xmlns[] = { 'h','t','t','p',':','/','/', 'w','w','w','.','w','3','.', 553 - 'o','r','g','/','2','0','0','0','/','x','m','l','n','s','/',0 }; 554 546 domattr *This = impl_from_IXMLDOMAttribute( iface ); 555 547 xmlNsPtr ns = This->node.node->ns; 548 + BSTR nodename, pfx; 549 + BOOL is6, isdefault; 550 + HRESULT hr; 556 551 557 552 TRACE("(%p)->(%p)\n", This, p); 558 553 ··· 560 555 return E_INVALIDARG; 561 556 562 557 *p = NULL; 558 + nodename = NULL; 559 + hr = IXMLDOMAttribute_get_nodeName(iface, &nodename); 560 + if (FAILED(hr)) 561 + return hr; 563 562 564 - if (ns) 563 + pfx = NULL; 564 + hr = IXMLDOMAttribute_get_prefix(iface, &pfx); 565 + if (FAILED(hr)) 566 + { 567 + SysFreeString(nodename); 568 + return hr; 569 + } 570 + 571 + is6 = xmldoc_version(This->node.node->doc) == MSXML6; 572 + isdefault = !wcscmp(nodename, L"xmlns"); 573 + if (isdefault || (pfx && !wcscmp(L"xmlns", pfx))) 565 574 { 566 - /* special case for default namespace definition */ 567 - if (xmlStrEqual(This->node.node->name, xmlns)) 568 - *p = bstr_from_xmlChar(xmlns); 569 - else if (xmlStrEqual(ns->prefix, xmlns)) 570 - { 571 - if (xmldoc_version(This->node.node->doc) == MSXML6) 572 - *p = SysAllocString(w3xmlns); 573 - else 574 - *p = SysAllocStringLen(NULL, 0); 575 - } 576 - else if (ns->href) 577 - *p = bstr_from_xmlChar(ns->href); 575 + if (is6) 576 + *p = SysAllocString(L"http://www.w3.org/2000/xmlns/"); 577 + else if (!ns || !isdefault) 578 + *p = SysAllocStringLen(NULL, 0); 579 + else 580 + *p = SysAllocString(L"xmlns"); 578 581 } 582 + else if (ns && ns->href) 583 + *p = bstr_from_xmlChar(ns->href); 584 + 585 + SysFreeString(nodename); 586 + SysFreeString(pfx); 579 587 580 588 TRACE("uri: %s\n", debugstr_w(*p)); 581 589 ··· 595 603 596 604 *prefix = NULL; 597 605 598 - if (ns) 599 - { 600 - /* special case for default namespace definition */ 601 - if (xmlStrEqual(This->node.node->name, xmlns)) 602 - *prefix = bstr_from_xmlChar(xmlns); 603 - else if (ns->prefix) 604 - *prefix = bstr_from_xmlChar(ns->prefix); 605 - } 606 + if (xmldoc_version(This->node.node->doc) != MSXML6 && 607 + xmlStrEqual(This->node.node->name, xmlns)) 608 + *prefix = bstr_from_xmlChar(xmlns); 609 + else if (ns && ns->prefix) 610 + *prefix = bstr_from_xmlChar(ns->prefix); 606 611 607 612 TRACE("prefix: %s\n", debugstr_w(*prefix)); 608 613 ··· 726 731 { 727 732 domattr *This; 728 733 729 - This = heap_alloc( sizeof *This ); 734 + This = malloc(sizeof(*This)); 730 735 if ( !This ) 731 736 return NULL; 732 737 ··· 738 743 739 744 return (IUnknown*)&This->IXMLDOMAttribute_iface; 740 745 } 741 - 742 - #endif
+42 -31
dll/win32/msxml3/bsc.c
··· 17 17 */ 18 18 19 19 #define COBJMACROS 20 - #define NONAMELESSUNION 21 - 22 - #include "config.h" 23 20 24 21 #include <stdarg.h> 25 - #ifdef HAVE_LIBXML2 26 - # include <libxml/parser.h> 27 - # include <libxml/xmlerror.h> 28 - #endif 29 22 30 23 #include "windef.h" 31 24 #include "winbase.h" ··· 39 32 40 33 #include "wine/debug.h" 41 34 42 - #include "msxml_private.h" 35 + #include "msxml_dispex.h" 43 36 44 37 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 45 38 ··· 82 75 static ULONG WINAPI bsc_AddRef( 83 76 IBindStatusCallback *iface ) 84 77 { 85 - bsc_t *This = impl_from_IBindStatusCallback(iface); 86 - LONG ref = InterlockedIncrement(&This->ref); 78 + bsc_t *bsc = impl_from_IBindStatusCallback(iface); 79 + LONG ref = InterlockedIncrement(&bsc->ref); 87 80 88 - TRACE("(%p) ref=%d\n", This, ref); 81 + TRACE("%p, refcount %ld.\n", iface, ref); 89 82 90 83 return ref; 91 84 } ··· 93 86 static ULONG WINAPI bsc_Release( 94 87 IBindStatusCallback *iface ) 95 88 { 96 - bsc_t *This = impl_from_IBindStatusCallback(iface); 97 - LONG ref = InterlockedDecrement(&This->ref); 89 + bsc_t *bsc = impl_from_IBindStatusCallback(iface); 90 + LONG ref = InterlockedDecrement(&bsc->ref); 98 91 99 - TRACE("(%p) ref=%d\n", This, ref); 92 + TRACE("%p, refcount %ld.\n", iface, ref); 100 93 101 - if(!ref) { 102 - if (This->binding) IBinding_Release(This->binding); 103 - if (This->memstream) IStream_Release(This->memstream); 104 - heap_free(This); 94 + if (!ref) 95 + { 96 + if (bsc->binding) 97 + IBinding_Release(bsc->binding); 98 + if (bsc->memstream) 99 + IStream_Release(bsc->memstream); 100 + free(bsc); 105 101 } 106 102 107 103 return ref; ··· 115 111 bsc_t *This = impl_from_IBindStatusCallback(iface); 116 112 HRESULT hr; 117 113 118 - TRACE("(%p)->(%x %p)\n", This, dwReserved, pib); 114 + TRACE("%p, %lx, %p.\n", iface, dwReserved, pib); 119 115 120 116 This->binding = pib; 121 117 IBinding_AddRef(pib); ··· 159 155 bsc_t *This = impl_from_IBindStatusCallback(iface); 160 156 HRESULT hr = S_OK; 161 157 162 - TRACE("(%p)->(%08x %s)\n", This, hresult, debugstr_w(szError)); 158 + TRACE("%p, %#lx, %s.\n", iface, hresult, debugstr_w(szError)); 163 159 164 160 if(This->binding) { 165 161 IBinding_Release(This->binding); ··· 200 196 FORMATETC* pformatetc, 201 197 STGMEDIUM* pstgmed) 202 198 { 203 - bsc_t *This = impl_from_IBindStatusCallback(iface); 199 + bsc_t *bsc = impl_from_IBindStatusCallback(iface); 204 200 BYTE buf[4096]; 205 201 DWORD read, written; 206 202 HRESULT hr; 207 203 208 - TRACE("(%p)->(%x %d %p %p)\n", This, grfBSCF, dwSize, pformatetc, pstgmed); 204 + TRACE("%p, %lx, %lu, %p, %p.\n", iface, grfBSCF, dwSize, pformatetc, pstgmed); 209 205 210 206 do 211 207 { 212 - hr = IStream_Read(pstgmed->u.pstm, buf, sizeof(buf), &read); 208 + hr = IStream_Read(pstgmed->pstm, buf, sizeof(buf), &read); 213 209 if(FAILED(hr)) 214 210 break; 215 211 216 - hr = IStream_Write(This->memstream, buf, read, &written); 212 + hr = IStream_Write(bsc->memstream, buf, read, &written); 217 213 } while(SUCCEEDED(hr) && written != 0 && read != 0); 218 214 219 215 return S_OK; ··· 242 238 bsc_OnObjectAvailable 243 239 }; 244 240 245 - HRESULT create_uri(const WCHAR *url, IUri **uri) 241 + HRESULT create_uri(IUri *base, const WCHAR *url, IUri **uri) 246 242 { 247 243 WCHAR fileUrl[INTERNET_MAX_URL_LENGTH]; 244 + HRESULT hr; 248 245 249 246 TRACE("%s\n", debugstr_w(url)); 250 247 ··· 253 250 WCHAR fullpath[MAX_PATH]; 254 251 DWORD needed = ARRAY_SIZE(fileUrl); 255 252 256 - if (!PathSearchAndQualifyW(url, fullpath, ARRAY_SIZE(fullpath))) 253 + lstrcpynW(fileUrl, url, ARRAY_SIZE(fileUrl)); 254 + UrlUnescapeW(fileUrl, NULL, NULL, URL_UNESCAPE_INPLACE); 255 + 256 + if (!PathSearchAndQualifyW(fileUrl, fullpath, ARRAY_SIZE(fullpath))) 257 257 { 258 258 WARN("can't find path\n"); 259 259 return E_FAIL; 260 260 } 261 261 262 - if (FAILED(UrlCreateFromPathW(fullpath, fileUrl, &needed, 0))) 262 + if (FAILED(UrlApplySchemeW(fullpath, fileUrl, &needed, URL_APPLY_GUESSSCHEME | URL_APPLY_GUESSFILE | 263 + URL_APPLY_DEFAULT))) 263 264 { 264 - ERR("can't create url from path\n"); 265 + ERR("Failed to apply url scheme.\n"); 265 266 return E_FAIL; 266 267 } 267 268 url = fileUrl; 268 269 } 269 270 270 - return CreateUri(url, Uri_CREATE_ALLOW_RELATIVE | Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, 0, uri); 271 + hr = CreateUri(url, Uri_CREATE_ALLOW_RELATIVE | Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, 0, uri); 272 + if (hr == S_OK && base) 273 + { 274 + IUri *rebased_uri; 275 + 276 + hr = CoInternetCombineIUri(base, *uri, 0, &rebased_uri, 0); 277 + IUri_Release(*uri); 278 + *uri = rebased_uri; 279 + } 280 + 281 + return hr; 271 282 } 272 283 273 284 HRESULT create_moniker_from_url(LPCWSTR url, IMoniker **mon) ··· 277 288 278 289 TRACE("%s\n", debugstr_w(url)); 279 290 280 - if (FAILED(hr = create_uri(url, &uri))) 291 + if (FAILED(hr = create_uri(NULL, url, &uri))) 281 292 return hr; 282 293 283 294 hr = CreateURLMonikerEx2(NULL, uri, mon, 0); ··· 298 309 if(FAILED(hr)) 299 310 return hr; 300 311 301 - bsc = heap_alloc(sizeof(bsc_t)); 312 + bsc = malloc(sizeof(bsc_t)); 302 313 303 314 bsc->IBindStatusCallback_iface.lpVtbl = &bsc_vtbl; 304 315 bsc->ref = 1;
+20 -34
dll/win32/msxml3/cdata.c
··· 20 20 21 21 #define COBJMACROS 22 22 23 - #include "config.h" 24 - 25 23 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - # include <libxml/xmlerror.h> 29 - #endif 24 + #include <libxml/parser.h> 25 + #include <libxml/xmlerror.h> 30 26 31 27 #include "windef.h" 32 28 #include "winbase.h" ··· 37 33 #include "msxml_private.h" 38 34 39 35 #include "wine/debug.h" 40 - 41 - #ifdef HAVE_LIBXML2 42 36 43 37 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 44 38 ··· 95 89 return S_OK; 96 90 } 97 91 98 - static ULONG WINAPI domcdata_AddRef( 99 - IXMLDOMCDATASection *iface ) 92 + static ULONG WINAPI domcdata_AddRef(IXMLDOMCDATASection *iface) 100 93 { 101 - domcdata *This = impl_from_IXMLDOMCDATASection( iface ); 102 - ULONG ref = InterlockedIncrement( &This->ref ); 103 - TRACE("(%p)->(%d)\n", This, ref); 94 + domcdata *cdata = impl_from_IXMLDOMCDATASection(iface); 95 + ULONG ref = InterlockedIncrement(&cdata->ref); 96 + TRACE("%p, refcount %lu.\n", iface, ref); 104 97 return ref; 105 98 } 106 99 107 - static ULONG WINAPI domcdata_Release( 108 - IXMLDOMCDATASection *iface ) 100 + static ULONG WINAPI domcdata_Release(IXMLDOMCDATASection *iface) 109 101 { 110 - domcdata *This = impl_from_IXMLDOMCDATASection( iface ); 111 - ULONG ref = InterlockedDecrement( &This->ref ); 102 + domcdata *cdata = impl_from_IXMLDOMCDATASection(iface); 103 + ULONG ref = InterlockedDecrement(&cdata->ref); 112 104 113 - TRACE("(%p)->(%d)\n", This, ref); 114 - if ( ref == 0 ) 105 + TRACE("%p, refcount %lu.\n", iface, ref); 106 + 107 + if (!ref) 115 108 { 116 - destroy_xmlnode(&This->node); 117 - heap_free( This ); 109 + destroy_xmlnode(&cdata->node); 110 + free(cdata); 118 111 } 119 112 120 113 return ref; ··· 583 576 IXMLDOMCDATASection *iface, 584 577 LONG offset, LONG count, BSTR *p) 585 578 { 586 - domcdata *This = impl_from_IXMLDOMCDATASection( iface ); 587 579 HRESULT hr; 588 580 BSTR data; 589 581 590 - TRACE("(%p)->(%d %d %p)\n", This, offset, count, p); 582 + TRACE("%p, %ld, %ld, %p.\n", iface, offset, count, p); 591 583 592 584 if(!p) 593 585 return E_INVALIDARG; ··· 657 649 IXMLDOMCDATASection *iface, 658 650 LONG offset, BSTR p) 659 651 { 660 - domcdata *This = impl_from_IXMLDOMCDATASection( iface ); 661 652 HRESULT hr; 662 653 BSTR data; 663 654 LONG p_len; 664 655 665 - TRACE("(%p)->(%d %s)\n", This, offset, debugstr_w(p)); 656 + TRACE("%p, %ld, %s.\n", iface, offset, debugstr_w(p)); 666 657 667 658 /* If have a NULL or empty string, don't do anything. */ 668 659 if((p_len = SysStringLen(p)) == 0) ··· 705 696 IXMLDOMCDATASection *iface, 706 697 LONG offset, LONG count) 707 698 { 708 - domcdata *This = impl_from_IXMLDOMCDATASection( iface ); 709 699 HRESULT hr; 710 700 LONG len = -1; 711 701 BSTR str; 712 702 713 - TRACE("(%p)->(%d %d)\n", This, offset, count); 703 + TRACE("%p, %ld, %ld.\n", iface, offset, count); 714 704 715 705 hr = IXMLDOMCDATASection_get_length(iface, &len); 716 706 if(hr != S_OK) return hr; ··· 753 743 IXMLDOMCDATASection *iface, 754 744 LONG offset, LONG count, BSTR p) 755 745 { 756 - domcdata *This = impl_from_IXMLDOMCDATASection( iface ); 757 746 HRESULT hr; 758 747 759 - TRACE("(%p)->(%d %d %s)\n", This, offset, count, debugstr_w(p)); 748 + TRACE("%p, %ld, %ld, %s.\n", iface, offset, count, debugstr_w(p)); 760 749 761 750 hr = IXMLDOMCDATASection_deleteData(iface, offset, count); 762 751 ··· 770 759 IXMLDOMCDATASection *iface, 771 760 LONG offset, IXMLDOMText **txtNode) 772 761 { 773 - domcdata *This = impl_from_IXMLDOMCDATASection( iface ); 774 762 IXMLDOMDocument *doc; 775 763 LONG length = 0; 776 764 HRESULT hr; 777 765 778 - TRACE("(%p)->(%d %p)\n", This, offset, txtNode); 766 + TRACE("%p, %ld, %p.\n", iface, offset, txtNode); 779 767 780 768 if (!txtNode || offset < 0) return E_INVALIDARG; 781 769 ··· 887 875 { 888 876 domcdata *This; 889 877 890 - This = heap_alloc( sizeof *This ); 878 + This = malloc(sizeof(*This)); 891 879 if ( !This ) 892 880 return NULL; 893 881 ··· 898 886 899 887 return (IUnknown*)&This->IXMLDOMCDATASection_iface; 900 888 } 901 - 902 - #endif
+20 -34
dll/win32/msxml3/comment.c
··· 20 20 21 21 #define COBJMACROS 22 22 23 - #include "config.h" 24 - 25 23 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - # include <libxml/xmlerror.h> 29 - #endif 24 + #include <libxml/parser.h> 25 + #include <libxml/xmlerror.h> 30 26 31 27 #include "windef.h" 32 28 #include "winbase.h" ··· 37 33 #include "msxml_private.h" 38 34 39 35 #include "wine/debug.h" 40 - 41 - #ifdef HAVE_LIBXML2 42 36 43 37 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 44 38 ··· 95 89 return S_OK; 96 90 } 97 91 98 - static ULONG WINAPI domcomment_AddRef( 99 - IXMLDOMComment *iface ) 92 + static ULONG WINAPI domcomment_AddRef(IXMLDOMComment *iface) 100 93 { 101 - domcomment *This = impl_from_IXMLDOMComment( iface ); 102 - ULONG ref = InterlockedIncrement( &This->ref ); 103 - TRACE("(%p)->(%d)\n", This, ref); 94 + domcomment *comment = impl_from_IXMLDOMComment(iface); 95 + ULONG ref = InterlockedIncrement(&comment->ref); 96 + TRACE("%p, refcount %lu.\n", iface, ref); 104 97 return ref; 105 98 } 106 99 107 - static ULONG WINAPI domcomment_Release( 108 - IXMLDOMComment *iface ) 100 + static ULONG WINAPI domcomment_Release(IXMLDOMComment *iface) 109 101 { 110 - domcomment *This = impl_from_IXMLDOMComment( iface ); 111 - ULONG ref = InterlockedDecrement( &This->ref ); 102 + domcomment *comment = impl_from_IXMLDOMComment(iface); 103 + ULONG ref = InterlockedDecrement(&comment->ref); 112 104 113 - TRACE("(%p)->(%d)\n", This, ref); 114 - if ( ref == 0 ) 105 + TRACE("%p, refcount %lu.\n", iface, ref); 106 + 107 + if (!ref) 115 108 { 116 - destroy_xmlnode(&This->node); 117 - heap_free( This ); 109 + destroy_xmlnode(&comment->node); 110 + free(comment); 118 111 } 119 112 120 113 return ref; ··· 581 574 return hr; 582 575 } 583 576 584 - static HRESULT WINAPI domcomment_substringData( 585 - IXMLDOMComment *iface, 586 - LONG offset, LONG count, BSTR *p) 577 + static HRESULT WINAPI domcomment_substringData(IXMLDOMComment *iface, LONG offset, LONG count, BSTR *p) 587 578 { 588 - domcomment *This = impl_from_IXMLDOMComment( iface ); 589 579 HRESULT hr; 590 580 BSTR data; 591 581 592 - TRACE("(%p)->(%d %d %p)\n", This, offset, count, p); 582 + TRACE("%p, %ld, %ld, %p.\n", iface, offset, count, p); 593 583 594 584 if(!p) 595 585 return E_INVALIDARG; ··· 659 649 IXMLDOMComment *iface, 660 650 LONG offset, BSTR p) 661 651 { 662 - domcomment *This = impl_from_IXMLDOMComment( iface ); 663 652 HRESULT hr; 664 653 BSTR data; 665 654 LONG p_len; 666 655 667 - TRACE("(%p)->(%d %s)\n", This, offset, debugstr_w(p)); 656 + TRACE("%p, %ld, %s.\n", iface, offset, debugstr_w(p)); 668 657 669 658 /* If have a NULL or empty string, don't do anything. */ 670 659 if((p_len = SysStringLen(p)) == 0) ··· 711 700 LONG len = -1; 712 701 BSTR str; 713 702 714 - TRACE("(%p)->(%d %d)\n", iface, offset, count); 703 + TRACE("%p, %ld, %ld.\n", iface, offset, count); 715 704 716 705 hr = IXMLDOMComment_get_length(iface, &len); 717 706 if(hr != S_OK) return hr; ··· 754 743 IXMLDOMComment *iface, 755 744 LONG offset, LONG count, BSTR p) 756 745 { 757 - domcomment *This = impl_from_IXMLDOMComment( iface ); 758 746 HRESULT hr; 759 747 760 - TRACE("(%p)->(%d %d %s)\n", This, offset, count, debugstr_w(p)); 748 + TRACE("%p, %ld, %ld, %s.\n", iface, offset, count, debugstr_w(p)); 761 749 762 750 hr = IXMLDOMComment_deleteData(iface, offset, count); 763 751 ··· 838 826 { 839 827 domcomment *This; 840 828 841 - This = heap_alloc( sizeof *This ); 829 + This = malloc(sizeof(*This)); 842 830 if ( !This ) 843 831 return NULL; 844 832 ··· 849 837 850 838 return (IUnknown*)&This->IXMLDOMComment_iface; 851 839 } 852 - 853 - #endif
+2 -2
dll/win32/msxml3/datatypes.xsd
··· 200 200 </xsd:annotation> 201 201 202 202 <xsd:restriction base="xsd:decimal"> 203 - <xsd:pattern value="([0-9]{,14})([.][0-9]{,4})?"/> 203 + <xsd:pattern value="([0-9]{0,14})([.][0-9]{0,4})?"/> 204 204 </xsd:restriction> 205 205 </xsd:simpleType> 206 206 ··· 539 539 </xsd:annotation> 540 540 541 541 <xsd:restriction base="xsd:string"> 542 - <xsd:pattern value="([0-9A-Fa-f]{4})([-]{,1}[0-9A-Fa-f]{4})*"/> 542 + <xsd:pattern value="([0-9A-Fa-f]{4})([-]{0,1}[0-9A-Fa-f]{4})*"/> 543 543 </xsd:restriction> 544 544 </xsd:simpleType> 545 545
+46 -69
dll/win32/msxml3/dispex.c
··· 18 18 19 19 #define COBJMACROS 20 20 21 - #include "config.h" 22 - 23 21 #include <stdarg.h> 24 - #ifdef HAVE_LIBXML2 25 - # include <libxml/parser.h> 26 - # include <libxml/xmlerror.h> 22 + 23 + #ifdef __REACTOS__ 24 + #include <ole2.h> 27 25 #endif 28 - 29 - #include "windef.h" 30 - #include "winbase.h" 31 - #include "winuser.h" 32 - #include "winnls.h" 33 - #include "ole2.h" 34 - #include "msxml6.h" 35 - #include "msxml6did.h" 36 - #include "wininet.h" 37 - #include "urlmon.h" 38 - #include "winreg.h" 39 - #include "shlwapi.h" 26 + #include "msxml2.h" 27 + #include "msxml2did.h" 28 + #include "dispex.h" 40 29 41 30 #include "wine/debug.h" 42 - #include "wine/unicode.h" 43 31 44 - #include "msxml_private.h" 32 + #include "msxml_dispex.h" 45 33 46 34 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 47 35 ··· 53 41 0, 0, { (DWORD_PTR)(__FILE__ ": dispex_static_data") } 54 42 }; 55 43 static CRITICAL_SECTION cs_dispex_static_data = { &cs_dispex_static_data_dbg, -1, 0, 0, 0, 0 }; 56 - 57 44 58 45 enum lib_version_t 59 46 { ··· 97 84 }; 98 85 99 86 static tid_id_t tid_ids[] = { 100 - { &IID_NULL, LibXml_Last }, 87 + { &IID_NULL, LibXml2 }, 101 88 { &IID_IXMLDOMAttribute, LibXml2 }, 102 89 { &IID_IXMLDOMCDATASection, LibXml2 }, 103 90 { &IID_IXMLDOMComment, LibXml2 }, ··· 157 144 if(!typelib[lib]) { 158 145 hres = LoadRegTypeLib(lib_ids[lib].iid, lib_ids[lib].major, 0, LOCALE_SYSTEM_DEFAULT, tl); 159 146 if(FAILED(hres)) { 160 - ERR("LoadRegTypeLib failed: %08x\n", hres); 147 + ERR("LoadRegTypeLib failed, hr %#lx.\n", hres); 161 148 return hres; 162 149 } 163 150 ··· 188 175 return hres; 189 176 hres = ITypeLib_GetTypeInfoOfGuid(typelib, get_riid_from_tid(tid), &ti); 190 177 if(FAILED(hres)) { 191 - ERR("GetTypeInfoOfGuid failed: %08x\n", hres); 178 + ERR("GetTypeInfoOfGuid failed, hr %#lx.\n", hres); 192 179 return hres; 193 180 } 194 181 } ··· 215 202 for(i=0; i < iter->func_cnt; i++) 216 203 SysFreeString(iter->funcs[i].name); 217 204 218 - heap_free(iter->funcs); 219 - heap_free(iter->name_table); 220 - heap_free(iter); 205 + free(iter->funcs); 206 + free(iter->name_table); 207 + free(iter); 221 208 } 222 209 223 210 for(i=0; i < ARRAY_SIZE(typeinfos); i++) ··· 239 226 return; 240 227 241 228 if(data->func_cnt == *size) 242 - data->funcs = heap_realloc(data->funcs, (*size <<= 1)*sizeof(func_info_t)); 229 + data->funcs = realloc(data->funcs, (*size <<= 1) * sizeof(func_info_t)); 243 230 244 231 hres = ITypeInfo_GetDocumentation(dti, id, &data->funcs[data->func_cnt].name, NULL, NULL, NULL); 245 232 if(FAILED(hres)) ··· 251 238 data->func_cnt++; 252 239 } 253 240 254 - static int dispid_cmp(const void *p1, const void *p2) 241 + static int __cdecl dispid_cmp(const void *p1, const void *p2) 255 242 { 256 243 return ((const func_info_t*)p1)->id - ((const func_info_t*)p2)->id; 257 244 } 258 245 259 - static int func_name_cmp(const void *p1, const void *p2) 246 + static int __cdecl func_name_cmp(const void *p1, const void *p2) 260 247 { 261 - return strcmpiW((*(func_info_t* const*)p1)->name, (*(func_info_t* const*)p2)->name); 248 + return lstrcmpiW((*(func_info_t* const*)p1)->name, (*(func_info_t* const*)p2)->name); 262 249 } 263 250 264 251 static dispex_data_t *preprocess_dispex_data(DispatchEx *This) ··· 274 261 275 262 hres = get_typeinfo(This->data->disp_tid, &dti); 276 263 if(FAILED(hres)) { 277 - ERR("Could not get disp type info: %08x\n", hres); 264 + ERR("Could not get disp type info, hr %#lx.\n", hres); 278 265 return NULL; 279 266 } 280 267 281 - data = heap_alloc(sizeof(dispex_data_t)); 268 + data = malloc(sizeof(dispex_data_t)); 282 269 data->func_cnt = 0; 283 - data->funcs = heap_alloc(size*sizeof(func_info_t)); 270 + data->funcs = malloc(size * sizeof(func_info_t)); 284 271 list_add_tail(&dispex_data_list, &data->entry); 285 272 286 273 while(*tid) { ··· 303 290 } 304 291 305 292 if(!data->func_cnt) { 306 - heap_free(data->funcs); 293 + free(data->funcs); 307 294 data->funcs = NULL; 308 295 }else if(data->func_cnt != size) { 309 - data->funcs = heap_realloc(data->funcs, data->func_cnt * sizeof(func_info_t)); 296 + data->funcs = realloc(data->funcs, data->func_cnt * sizeof(func_info_t)); 310 297 } 311 298 312 - qsort(data->funcs, data->func_cnt, sizeof(func_info_t), dispid_cmp); 299 + if(data->funcs) { 300 + qsort(data->funcs, data->func_cnt, sizeof(func_info_t), dispid_cmp); 313 301 314 - if(data->funcs) { 315 - data->name_table = heap_alloc(data->func_cnt * sizeof(func_info_t*)); 302 + data->name_table = malloc(data->func_cnt * sizeof(func_info_t*)); 316 303 for(i=0; i < data->func_cnt; i++) 317 304 data->name_table[i] = data->funcs+i; 318 305 qsort(data->name_table, data->func_cnt, sizeof(func_info_t*), func_name_cmp); ··· 378 365 static HRESULT WINAPI DispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, 379 366 LCID lcid, ITypeInfo **ppTInfo) 380 367 { 381 - DispatchEx *This = impl_from_IDispatchEx(iface); 368 + DispatchEx *dispex = impl_from_IDispatchEx(iface); 382 369 383 - TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); 370 + TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo); 384 371 385 - return get_typeinfo(This->data->disp_tid, ppTInfo); 372 + return get_typeinfo(dispex->data->disp_tid, ppTInfo); 386 373 } 387 374 388 375 static HRESULT WINAPI DispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, 389 376 LPOLESTR *rgszNames, UINT cNames, 390 377 LCID lcid, DISPID *rgDispId) 391 378 { 392 - DispatchEx *This = impl_from_IDispatchEx(iface); 393 379 UINT i; 394 380 HRESULT hres; 395 381 396 - TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, 382 + TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, 397 383 lcid, rgDispId); 398 384 399 385 for(i=0; i < cNames; i++) { 400 - hres = IDispatchEx_GetDispID(&This->IDispatchEx_iface, rgszNames[i], 0, rgDispId+i); 386 + hres = IDispatchEx_GetDispID(iface, rgszNames[i], 0, rgDispId+i); 401 387 if(FAILED(hres)) 402 388 return hres; 403 389 } ··· 409 395 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, 410 396 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) 411 397 { 412 - DispatchEx *This = impl_from_IDispatchEx(iface); 413 - 414 - TRACE("(%p)->(%x %s %x %x %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), 398 + TRACE("%p, %ld, %s, %lx, %x, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid), 415 399 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 416 400 417 - return IDispatchEx_InvokeEx(&This->IDispatchEx_iface, dispIdMember, lcid, wFlags, 418 - pDispParams, pVarResult, pExcepInfo, NULL); 401 + return IDispatchEx_InvokeEx(iface, dispIdMember, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, NULL); 419 402 } 420 403 421 404 static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) ··· 424 407 dispex_data_t *data; 425 408 int min, max, n, c; 426 409 427 - TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid); 410 + TRACE("%p, %s, %lx, %p.\n", iface, debugstr_w(bstrName), grfdex, pid); 428 411 429 412 if(grfdex & ~(fdexNameCaseSensitive|fdexNameEnsure|fdexNameImplicit)) 430 - FIXME("Unsupported grfdex %x\n", grfdex); 413 + FIXME("Unsupported grfdex %lx.\n", grfdex); 431 414 432 415 data = get_dispex_data(This); 433 416 if(!data) ··· 439 422 while(min <= max) { 440 423 n = (min+max)/2; 441 424 442 - c = strcmpiW(data->name_table[n]->name, bstrName); 425 + c = lstrcmpiW(data->name_table[n]->name, bstrName); 443 426 if(!c) { 444 - if((grfdex & fdexNameCaseSensitive) && strcmpW(data->name_table[n]->name, bstrName)) 427 + if((grfdex & fdexNameCaseSensitive) && wcscmp(data->name_table[n]->name, bstrName)) 445 428 break; 446 429 447 430 *pid = data->name_table[n]->id; ··· 501 484 int min, max, n; 502 485 HRESULT hres; 503 486 504 - TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); 487 + TRACE("%p, %ld, %lx, %x, %p, %p, %p, %p.\n", iface, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); 505 488 506 489 if(This->data->vtbl && This->data->vtbl->invoke) { 507 490 hres = This->data->vtbl->invoke(This->outer, id, lcid, wFlags, pdp, pvarRes, pei); ··· 533 516 } 534 517 535 518 if(min > max) { 536 - WARN("invalid id %x\n", id); 519 + WARN("invalid id %lx.\n", id); 537 520 return DISP_E_UNKNOWNNAME; 538 521 } 539 522 540 523 hres = get_typeinfo(data->funcs[n].tid, &ti); 541 524 if(FAILED(hres)) { 542 - ERR("Could not get type info: %08x\n", hres); 525 + ERR("Could not get type info, hr %#lx.\n", hres); 543 526 return hres; 544 527 } 545 528 546 529 hres = IUnknown_QueryInterface(This->outer, get_riid_from_tid(data->funcs[n].tid), (void**)&unk); 547 530 if(FAILED(hres)) { 548 - ERR("Could not get iface: %08x\n", hres); 531 + ERR("Could not get interface, hr %#lx.\n", hres); 549 532 ITypeInfo_Release(ti); 550 533 return E_FAIL; 551 534 } ··· 561 544 562 545 static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) 563 546 { 564 - DispatchEx *This = impl_from_IDispatchEx(iface); 565 - TRACE("Not implemented in native msxml3 (%p)->(%s %x)\n", This, debugstr_w(bstrName), grfdex); 547 + TRACE("%p, %s, %lx.\n", iface, debugstr_w(bstrName), grfdex); 566 548 return E_NOTIMPL; 567 549 } 568 550 569 551 static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) 570 552 { 571 - DispatchEx *This = impl_from_IDispatchEx(iface); 572 - TRACE("Not implemented in native msxml3 (%p)->(%x)\n", This, id); 553 + TRACE("%p, %ld.\n", iface, id); 573 554 return E_NOTIMPL; 574 555 } 575 556 576 557 static HRESULT WINAPI DispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) 577 558 { 578 - DispatchEx *This = impl_from_IDispatchEx(iface); 579 - TRACE("Not implemented in native msxml3 (%p)->(%x %x %p)\n", This, id, grfdexFetch, pgrfdex); 559 + TRACE("%p, %ld, %lx, %p.\n", iface, id, grfdexFetch, pgrfdex); 580 560 return E_NOTIMPL; 581 561 } 582 562 583 563 static HRESULT WINAPI DispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName) 584 564 { 585 - DispatchEx *This = impl_from_IDispatchEx(iface); 586 - TRACE("Not implemented in native msxml3 (%p)->(%x %p)\n", This, id, pbstrName); 565 + TRACE("%p, %ld, %p.\n", iface, id, pbstrName); 587 566 return E_NOTIMPL; 588 567 } 589 568 590 569 static HRESULT WINAPI DispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid) 591 570 { 592 - DispatchEx *This = impl_from_IDispatchEx(iface); 593 - TRACE(" Not implemented in native msxml3 (%p)->(%x %x %p)\n", This, grfdex, id, pid); 571 + TRACE("%p, %lx, %ld, %p.\n", iface, grfdex, id, pid); 594 572 return E_NOTIMPL; 595 573 } 596 574 597 575 static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk) 598 576 { 599 - DispatchEx *This = impl_from_IDispatchEx(iface); 600 - TRACE("Not implemented in native msxml3 (%p)->(%p)\n", This, ppunk); 577 + TRACE("%p, %p.\n", iface, ppunk); 601 578 return E_NOTIMPL; 602 579 } 603 580
+15 -24
dll/win32/msxml3/docfrag.c
··· 20 20 21 21 #define COBJMACROS 22 22 23 - #include "config.h" 24 - 25 23 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - # include <libxml/xmlerror.h> 29 - #endif 24 + #include <libxml/parser.h> 25 + #include <libxml/xmlerror.h> 30 26 31 27 #include "windef.h" 32 28 #include "winbase.h" ··· 37 33 #include "msxml_private.h" 38 34 39 35 #include "wine/debug.h" 40 - 41 - #ifdef HAVE_LIBXML2 42 36 43 37 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 44 38 ··· 94 88 return S_OK; 95 89 } 96 90 97 - static ULONG WINAPI domfrag_AddRef( 98 - IXMLDOMDocumentFragment *iface ) 91 + static ULONG WINAPI domfrag_AddRef(IXMLDOMDocumentFragment *iface) 99 92 { 100 - domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); 101 - ULONG ref = InterlockedIncrement( &This->ref ); 102 - TRACE("(%p)->(%d)\n", This, ref); 93 + domfrag *domfrag = impl_from_IXMLDOMDocumentFragment(iface); 94 + ULONG ref = InterlockedIncrement(&domfrag->ref); 95 + TRACE("%p, refcount %lu.\n", iface, ref); 103 96 return ref; 104 97 } 105 98 106 - static ULONG WINAPI domfrag_Release( 107 - IXMLDOMDocumentFragment *iface ) 99 + static ULONG WINAPI domfrag_Release(IXMLDOMDocumentFragment *iface) 108 100 { 109 - domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); 110 - ULONG ref = InterlockedDecrement( &This->ref ); 101 + domfrag *domfrag = impl_from_IXMLDOMDocumentFragment(iface); 102 + ULONG ref = InterlockedDecrement(&domfrag->ref); 111 103 112 - TRACE("(%p)->(%d)\n", This, ref); 113 - if ( ref == 0 ) 104 + TRACE("%p, refcount %lu.\n", iface, ref); 105 + 106 + if (!ref) 114 107 { 115 - destroy_xmlnode(&This->node); 116 - heap_free( This ); 108 + destroy_xmlnode(&domfrag->node); 109 + free(domfrag); 117 110 } 118 111 119 112 return ref; ··· 588 581 { 589 582 domfrag *This; 590 583 591 - This = heap_alloc( sizeof *This ); 584 + This = malloc(sizeof(*This)); 592 585 if ( !This ) 593 586 return NULL; 594 587 ··· 599 592 600 593 return (IUnknown*)&This->IXMLDOMDocumentFragment_iface; 601 594 } 602 - 603 - #endif
+15 -24
dll/win32/msxml3/doctype.c
··· 20 20 21 21 #define COBJMACROS 22 22 23 - #include "config.h" 24 - 25 23 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - # include <libxml/xmlerror.h> 29 - #endif 24 + #include <libxml/parser.h> 25 + #include <libxml/xmlerror.h> 30 26 31 27 #include "windef.h" 32 28 #include "winbase.h" ··· 38 34 #include "msxml_private.h" 39 35 40 36 #include "wine/debug.h" 41 - 42 - #ifdef HAVE_LIBXML2 43 37 44 38 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 45 39 ··· 86 80 return S_OK; 87 81 } 88 82 89 - static ULONG WINAPI domdoctype_AddRef( 90 - IXMLDOMDocumentType *iface ) 83 + static ULONG WINAPI domdoctype_AddRef(IXMLDOMDocumentType *iface) 91 84 { 92 - domdoctype *This = impl_from_IXMLDOMDocumentType( iface ); 93 - LONG ref = InterlockedIncrement(&This->ref); 94 - TRACE("(%p)->(%d)\n", This, ref); 85 + domdoctype *doctype = impl_from_IXMLDOMDocumentType(iface); 86 + LONG ref = InterlockedIncrement(&doctype->ref); 87 + TRACE("%p, refcount %ld.\n", iface, ref); 95 88 return ref; 96 89 } 97 90 98 - static ULONG WINAPI domdoctype_Release( 99 - IXMLDOMDocumentType *iface ) 91 + static ULONG WINAPI domdoctype_Release(IXMLDOMDocumentType *iface) 100 92 { 101 - domdoctype *This = impl_from_IXMLDOMDocumentType( iface ); 102 - ULONG ref = InterlockedDecrement(&This->ref); 93 + domdoctype *doctype = impl_from_IXMLDOMDocumentType(iface); 94 + ULONG ref = InterlockedDecrement(&doctype->ref); 103 95 104 - TRACE("(%p)->(%d)\n", This, ref); 96 + TRACE("%p, refcount %ld.\n", iface, ref); 105 97 106 - if(!ref) { 107 - destroy_xmlnode(&This->node); 108 - heap_free(This); 98 + if (!ref) 99 + { 100 + destroy_xmlnode(&doctype->node); 101 + free(doctype); 109 102 } 110 103 111 104 return ref; ··· 577 570 { 578 571 domdoctype *This; 579 572 580 - This = heap_alloc( sizeof *This ); 573 + This = malloc(sizeof(*This)); 581 574 if ( !This ) 582 575 return NULL; 583 576 ··· 589 582 590 583 return (IUnknown*)&This->IXMLDOMDocumentType_iface; 591 584 } 592 - 593 - #endif
+236 -145
dll/win32/msxml3/domdoc.c
··· 21 21 22 22 #define COBJMACROS 23 23 24 - #include "config.h" 25 - 26 24 #include <stdarg.h> 27 25 #include <assert.h> 28 - #ifdef HAVE_LIBXML2 29 - # include <libxml/parser.h> 30 - # include <libxml/xmlerror.h> 31 - # include <libxml/xpathInternals.h> 26 + #include <libxml/parser.h> 27 + #include <libxml/xmlerror.h> 28 + #include <libxml/xpathInternals.h> 32 29 # include <libxml/xmlsave.h> 33 - # include <libxml/SAX2.h> 34 - # include <libxml/parserInternals.h> 35 - #endif 30 + #include <libxml/SAX2.h> 31 + #include <libxml/parserInternals.h> 36 32 37 33 #include "windef.h" 38 34 #include "winbase.h" ··· 51 47 52 48 #include "msxml_private.h" 53 49 54 - #ifdef HAVE_LIBXML2 55 - 56 50 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 57 51 58 - /* not defined in older versions */ 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 66 - 67 52 static const WCHAR PropertySelectionLanguageW[] = {'S','e','l','e','c','t','i','o','n','L','a','n','g','u','a','g','e',0}; 68 53 static const WCHAR PropertySelectionNamespacesW[] = {'S','e','l','e','c','t','i','o','n','N','a','m','e','s','p','a','c','e','s',0}; 69 54 static const WCHAR PropertyProhibitDTDW[] = {'P','r','o','h','i','b','i','t','D','T','D',0}; ··· 74 59 static const WCHAR PropertyAllowXsltScriptW[] = {'A','l','l','o','w','X','s','l','t','S','c','r','i','p','t',0}; 75 60 static 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}; 76 61 static 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}; 62 + static const WCHAR PropertyValidateOnParse[] = L"ValidateOnParse"; 63 + static const WCHAR PropertyMaxElementDepth[] = L"MaxElementDepth"; 77 64 78 65 /* Anything that passes the test_get_ownerDocument() 79 66 * tests can go here (data shared between all instances). 80 67 * We need to preserve this when reloading a document, 81 68 * and also need access to it from the libxml backend. */ 82 69 typedef struct { 70 + LONG refs; 83 71 MSXML_VERSION version; 84 72 VARIANT_BOOL preserving; 73 + VARIANT_BOOL validating; 85 74 IXMLDOMSchemaCollection2* schemaCache; 86 75 struct list selectNsList; 87 76 xmlChar const* selectNsStr; ··· 128 117 IConnectionPointContainer IConnectionPointContainer_iface; 129 118 LONG ref; 130 119 VARIANT_BOOL async; 131 - VARIANT_BOOL validating; 132 120 VARIANT_BOOL resolving; 133 121 domdoc_properties* properties; 134 122 HRESULT error; 135 123 136 124 /* IObjectWithSite */ 137 125 IUnknown *site; 126 + IUri *base_uri; 138 127 139 128 /* IObjectSafety */ 140 129 DWORD safeopt; ··· 265 254 select_ns_entry *ns, *ns2; 266 255 LIST_FOR_EACH_ENTRY_SAFE( ns, ns2, pNsList, select_ns_entry, entry ) 267 256 { 268 - heap_free( ns ); 257 + free(ns); 269 258 } 270 259 list_init(pNsList); 271 260 } ··· 273 262 static xmldoc_priv * create_priv(void) 274 263 { 275 264 xmldoc_priv *priv; 276 - priv = heap_alloc( sizeof (*priv) ); 265 + priv = malloc(sizeof(*priv)); 277 266 278 267 if (priv) 279 268 { ··· 287 276 288 277 static domdoc_properties *create_properties(MSXML_VERSION version) 289 278 { 290 - domdoc_properties *properties = heap_alloc(sizeof(domdoc_properties)); 279 + domdoc_properties *properties = malloc(sizeof(domdoc_properties)); 291 280 281 + properties->refs = 1; 292 282 list_init(&properties->selectNsList); 293 283 properties->preserving = VARIANT_FALSE; 284 + properties->validating = VARIANT_TRUE; 294 285 properties->schemaCache = NULL; 295 - properties->selectNsStr = heap_alloc_zero(sizeof(xmlChar)); 286 + properties->selectNsStr = calloc(1, sizeof(xmlChar)); 296 287 properties->selectNsStr_len = 0; 297 288 298 289 /* properties that are dependent on object versions */ ··· 307 298 308 299 static domdoc_properties* copy_properties(domdoc_properties const* properties) 309 300 { 310 - domdoc_properties* pcopy = heap_alloc(sizeof(domdoc_properties)); 301 + domdoc_properties* pcopy = malloc(sizeof(domdoc_properties)); 311 302 select_ns_entry const* ns = NULL; 312 303 select_ns_entry* new_ns = NULL; 313 304 int len = (properties->selectNsStr_len+1)*sizeof(xmlChar); ··· 315 306 316 307 if (pcopy) 317 308 { 309 + pcopy->refs = 1; 318 310 pcopy->version = properties->version; 319 311 pcopy->preserving = properties->preserving; 312 + pcopy->validating = properties->validating; 320 313 pcopy->schemaCache = properties->schemaCache; 321 314 if (pcopy->schemaCache) 322 315 IXMLDOMSchemaCollection2_AddRef(pcopy->schemaCache); 323 316 pcopy->XPath = properties->XPath; 324 317 pcopy->selectNsStr_len = properties->selectNsStr_len; 325 318 list_init( &pcopy->selectNsList ); 326 - pcopy->selectNsStr = heap_alloc(len); 319 + pcopy->selectNsStr = malloc(len); 327 320 memcpy((xmlChar*)pcopy->selectNsStr, properties->selectNsStr, len); 328 321 offset = pcopy->selectNsStr - properties->selectNsStr; 329 322 330 323 LIST_FOR_EACH_ENTRY( ns, (&properties->selectNsList), select_ns_entry, entry ) 331 324 { 332 - new_ns = heap_alloc(sizeof(select_ns_entry)); 325 + new_ns = malloc(sizeof(select_ns_entry)); 333 326 memcpy(new_ns, ns, sizeof(select_ns_entry)); 334 327 new_ns->href += offset; 335 328 new_ns->prefix += offset; ··· 344 337 return pcopy; 345 338 } 346 339 347 - static void free_properties(domdoc_properties* properties) 340 + static domdoc_properties * properties_add_ref(domdoc_properties *properties) 348 341 { 349 - if (properties) 342 + LONG ref; 343 + 344 + if (!properties) return NULL; 345 + 346 + ref = InterlockedIncrement(&properties->refs); 347 + TRACE("%p, %ld.\n", properties, ref); 348 + return properties; 349 + } 350 + 351 + static void properties_release(domdoc_properties *properties) 352 + { 353 + LONG ref; 354 + 355 + if (!properties) return; 356 + 357 + ref = InterlockedDecrement(&properties->refs); 358 + 359 + TRACE("%p, %ld.\n", properties, ref); 360 + 361 + if (ref < 0) 362 + WARN("negative refcount, expect troubles\n"); 363 + 364 + if (ref == 0) 350 365 { 351 366 if (properties->schemaCache) 352 367 IXMLDOMSchemaCollection2_Release(properties->schemaCache); 353 368 clear_selectNsList(&properties->selectNsList); 354 - heap_free((xmlChar*)properties->selectNsStr); 369 + free((xmlChar*)properties->selectNsStr); 355 370 if (properties->uri) 356 371 IUri_Release(properties->uri); 357 - heap_free(properties); 372 + free(properties); 358 373 } 359 374 } 360 375 ··· 479 494 va_end(ap); 480 495 } 481 496 482 - static void sax_serror(void* ctx, xmlErrorPtr err) 497 + static void sax_serror(void* ctx, const xmlError* err) 483 498 { 484 499 LIBXML2_CALLBACK_SERROR(doparse, err); 485 500 } 486 501 487 502 static xmlDocPtr doparse(domdoc* This, char const* ptr, int len, xmlCharEncoding encoding) 488 503 { 504 + char *ctx_encoding; 489 505 xmlDocPtr doc = NULL; 490 506 xmlParserCtxtPtr pctx; 491 507 static xmlSAXHandler sax_handler = { ··· 550 566 pctx->myDoc = NULL; 551 567 } 552 568 pctx->sax = NULL; 569 + ctx_encoding = (char *)pctx->encoding; 570 + pctx->encoding = NULL; 553 571 xmlFreeParserCtxt(pctx); 554 572 555 573 /* TODO: put this in one of the SAX callbacks */ ··· 566 584 sprintf(buff, "version=\"%s\"", doc->version ? (char*)doc->version : "1.0"); 567 585 xmlNodeAddContent( node, xmlbuff ); 568 586 569 - if (doc->encoding) 587 + if (ctx_encoding) 570 588 { 571 - sprintf(buff, " encoding=\"%s\"", doc->encoding); 589 + sprintf(buff, " encoding=\"%s\"", ctx_encoding); 572 590 xmlNodeAddContent( node, xmlbuff ); 573 591 } 574 592 ··· 581 599 xmldoc_link_xmldecl( doc, node ); 582 600 } 583 601 602 + xmlFree( ctx_encoding ); 584 603 return doc; 585 604 } 586 605 ··· 593 612 LONG xmldoc_add_refs(xmlDocPtr doc, LONG refs) 594 613 { 595 614 LONG ref = InterlockedExchangeAdd(&priv_from_xmlDocPtr(doc)->refs, refs) + refs; 596 - TRACE("(%p)->(%d)\n", doc, ref); 615 + TRACE("%p, refcount %ld.\n", doc, ref); 597 616 return ref; 598 617 } 599 618 ··· 606 625 { 607 626 xmldoc_priv *priv = priv_from_xmlDocPtr(doc); 608 627 LONG ref = InterlockedExchangeAdd(&priv->refs, -refs) - refs; 609 - TRACE("(%p)->(%d)\n", doc, ref); 628 + 629 + TRACE("%p, refcount %ld.\n", doc, ref); 610 630 611 631 if (ref < 0) 612 632 WARN("negative refcount, expect troubles\n"); ··· 619 639 LIST_FOR_EACH_ENTRY_SAFE( orphan, orphan2, &priv->orphans, orphan_entry, entry ) 620 640 { 621 641 xmlFreeNode( orphan->node ); 622 - heap_free( orphan ); 642 + free( orphan ); 623 643 } 624 - free_properties(priv->properties); 625 - heap_free(doc->_private); 644 + properties_release(priv->properties); 645 + free(doc->_private); 626 646 627 647 xmlFreeDoc(doc); 628 648 } ··· 640 660 xmldoc_priv *priv = priv_from_xmlDocPtr(doc); 641 661 orphan_entry *entry; 642 662 643 - entry = heap_alloc( sizeof (*entry) ); 663 + entry = malloc(sizeof(*entry)); 644 664 if(!entry) 645 665 return E_OUTOFMEMORY; 646 666 ··· 659 679 if( entry->node == node ) 660 680 { 661 681 list_remove( &entry->entry ); 662 - heap_free( entry ); 682 + free( entry ); 663 683 return S_OK; 664 684 } 665 685 } ··· 678 698 679 699 if(This->node.node) 680 700 { 701 + properties_release(properties_from_xmlDocPtr(get_doc(This))); 681 702 priv_from_xmlDocPtr(get_doc(This))->properties = NULL; 682 703 if (xmldoc_release(get_doc(This)) != 0) 704 + { 705 + /* The xmlDocPtr object can no longer use the properties of this 706 + * domdoc object. So give it its own copy. 707 + */ 683 708 priv_from_xmlDocPtr(get_doc(This))->properties = 684 709 copy_properties(This->properties); 710 + } 685 711 } 686 712 687 713 This->node.node = (xmlNodePtr) xml; ··· 689 715 if(This->node.node) 690 716 { 691 717 xmldoc_add_ref(get_doc(This)); 692 - priv_from_xmlDocPtr(get_doc(This))->properties = This->properties; 718 + /* Only attach new xmlDocPtr objects, i.e. ones for which properties 719 + * is still NULL. 720 + */ 721 + priv_from_xmlDocPtr(get_doc(This))->properties = properties_add_ref(This->properties); 693 722 } 694 723 695 724 return S_OK; ··· 789 818 790 819 if (FAILED(hr)) 791 820 { 792 - ERR("failed to copy stream 0x%08x\n", hr); 821 + ERR("failed to copy stream, hr %#lx.\n", hr); 793 822 IStream_Release(hstream); 794 823 return hr; 795 824 } 796 825 797 826 hr = GetHGlobalFromStream(hstream, &hglobal); 798 827 if (FAILED(hr)) 828 + { 829 + IStream_Release(hstream); 799 830 return hr; 831 + } 800 832 801 833 len = GlobalSize(hglobal); 802 834 ptr = GlobalLock(hglobal); 803 835 if (len) 804 836 xmldoc = doparse(doc, ptr, len, XML_CHAR_ENCODING_NONE); 805 837 GlobalUnlock(hglobal); 838 + IStream_Release(hstream); 806 839 807 840 if (!xmldoc) 808 841 { ··· 824 857 if (!stream) 825 858 return E_INVALIDARG; 826 859 827 - return domdoc_load_from_stream(This, (ISequentialStream*)stream); 860 + return This->error = domdoc_load_from_stream(This, (ISequentialStream*)stream); 828 861 } 829 862 830 863 static HRESULT WINAPI PersistStreamInit_Save( ··· 845 878 SysFreeString(xmlString); 846 879 } 847 880 848 - TRACE("ret 0x%08x\n", hr); 881 + TRACE("hr %#lx.\n", hr); 849 882 850 883 return hr; 851 884 } ··· 944 977 945 978 static ULONG WINAPI domdoc_AddRef( IXMLDOMDocument3 *iface ) 946 979 { 947 - domdoc *This = impl_from_IXMLDOMDocument3( iface ); 948 - ULONG ref = InterlockedIncrement( &This->ref ); 949 - TRACE("(%p)->(%d)\n", This, ref ); 980 + domdoc *doc = impl_from_IXMLDOMDocument3(iface); 981 + ULONG ref = InterlockedIncrement(&doc->ref); 982 + TRACE("%p, refcount %ld.\n", iface, ref); 950 983 return ref; 951 984 } 952 985 ··· 955 988 domdoc *This = impl_from_IXMLDOMDocument3( iface ); 956 989 LONG ref = InterlockedDecrement( &This->ref ); 957 990 958 - TRACE("(%p)->(%d)\n", This, ref ); 991 + TRACE("%p, refcount %ld.\n", iface, ref); 959 992 960 - if ( ref == 0 ) 993 + if (!ref) 961 994 { 962 995 int eid; 963 996 964 997 if (This->site) 965 998 IUnknown_Release( This->site ); 999 + if (This->base_uri) 1000 + IUri_Release( This->base_uri ); 966 1001 destroy_xmlnode(&This->node); 967 1002 968 1003 for (eid = 0; eid < EVENTID_LAST; eid++) 969 1004 if (This->events[eid]) IDispatch_Release(This->events[eid]); 970 1005 1006 + properties_release(This->properties); 971 1007 release_namespaces(This); 972 - heap_free(This); 1008 + free(This); 973 1009 } 974 1010 975 1011 return ref; ··· 1167 1203 HRESULT hr; 1168 1204 1169 1205 TRACE("(%p)->(%p %s %p)\n", This, newChild, debugstr_variant(&refChild), outNewChild); 1206 + 1207 + if (!newChild) return E_INVALIDARG; 1170 1208 1171 1209 hr = IXMLDOMNode_get_nodeType(newChild, &type); 1172 1210 if (hr != S_OK) return hr; ··· 1517 1555 case VT_UNKNOWN: 1518 1556 case VT_DISPATCH: 1519 1557 { 1558 + ISequentialStream *stream; 1520 1559 IXMLDOMDocument *doc; 1521 1560 HRESULT hr; 1561 + BSTR str; 1522 1562 1523 1563 if (!V_UNKNOWN(&output)) 1524 1564 return E_INVALIDARG; ··· 1528 1568 if (IUnknown_QueryInterface(V_UNKNOWN(&output), &IID_IXMLDOMDocument, (void **)&doc) == S_OK) 1529 1569 { 1530 1570 VARIANT_BOOL b; 1531 - BSTR str; 1532 1571 1533 1572 if (FAILED(hr = node_transform_node(&This->node, stylesheet, &str))) 1534 1573 return hr; 1535 1574 1536 1575 hr = IXMLDOMDocument_loadXML(doc, str, &b); 1537 1576 SysFreeString(str); 1577 + return hr; 1578 + } 1579 + else if (IUnknown_QueryInterface(V_UNKNOWN(&output), &IID_ISequentialStream, (void**)&stream) == S_OK) 1580 + { 1581 + hr = node_transform_node_params(&This->node, stylesheet, NULL, stream, NULL); 1582 + ISequentialStream_Release(stream); 1538 1583 return hr; 1539 1584 } 1540 1585 else ··· 1591 1636 if(!impl) 1592 1637 return E_INVALIDARG; 1593 1638 1594 - *impl = (IXMLDOMImplementation*)create_doc_Implementation(); 1595 - 1596 - return S_OK; 1639 + return create_dom_implementation(impl); 1597 1640 } 1598 1641 1599 1642 static HRESULT WINAPI domdoc_get_documentElement( ··· 1841 1884 hr = IXMLDOMDocument3_createNode(iface, type, target, NULL, &node); 1842 1885 if (hr == S_OK) 1843 1886 { 1844 - xmlnode *node_obj; 1845 - 1846 1887 /* this is to bypass check in ::put_data() that blocks "<?xml" PIs */ 1847 - node_obj = get_node_obj(node); 1848 - hr = node_set_content(node_obj, data); 1849 - 1850 - IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMProcessingInstruction, (void**)pi); 1888 + hr = dom_pi_put_xml_decl(node, data); 1889 + if (SUCCEEDED(hr)) 1890 + hr = IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMProcessingInstruction, (void**)pi); 1851 1891 IXMLDOMNode_Release(node); 1852 1892 } 1853 1893 ··· 2091 2131 xmlnode = xmlNewReference(get_doc(This), xml_name); 2092 2132 break; 2093 2133 case NODE_PROCESSING_INSTRUCTION: 2094 - #ifdef HAVE_XMLNEWDOCPI 2095 2134 xmlnode = xmlNewDocPI(get_doc(This), xml_name, NULL); 2096 - #else 2097 - FIXME("xmlNewDocPI() not supported, use libxml2 2.6.15 or greater\n"); 2098 - xmlnode = NULL; 2099 - #endif 2100 2135 break; 2101 2136 case NODE_COMMENT: 2102 2137 xmlnode = xmlNewDocComment(get_doc(This), NULL); ··· 2109 2144 case NODE_DOCUMENT_TYPE: 2110 2145 case NODE_ENTITY: 2111 2146 case NODE_NOTATION: 2112 - heap_free(xml_name); 2147 + free(xml_name); 2113 2148 return E_INVALIDARG; 2114 2149 default: 2115 2150 FIXME("unhandled node type %d\n", node_type); ··· 2118 2153 } 2119 2154 2120 2155 *node = create_node(xmlnode); 2121 - heap_free(xml_name); 2122 - heap_free(href); 2156 + free(xml_name); 2157 + free(href); 2123 2158 2124 2159 if(*node) 2125 2160 { ··· 2214 2249 if (FAILED(hr)) 2215 2250 { 2216 2251 This->error = hr; 2217 - WARN("failed to access array data, 0x%08x\n", hr); 2252 + WARN("failed to access array data, hr %#lx.\n", hr); 2218 2253 break; 2219 2254 } 2220 2255 SafeArrayGetUBound(psa, 1, &len); ··· 2276 2311 2277 2312 if (hr == S_OK) 2278 2313 { 2279 - hr = domdoc_load_from_stream(This, stream); 2314 + hr = This->error = domdoc_load_from_stream(This, stream); 2280 2315 if (hr == S_OK) 2281 2316 *isSuccessful = VARIANT_TRUE; 2282 2317 ISequentialStream_Release(stream); 2283 2318 return hr; 2284 2319 } 2285 2320 2286 - FIXME("unsupported IUnknown type (0x%08x) (%p)\n", hr, V_UNKNOWN(&source)->lpVtbl); 2321 + FIXME("unsupported IUnknown type (%#lx) (%p)\n", hr, V_UNKNOWN(&source)->lpVtbl); 2287 2322 break; 2288 2323 } 2289 2324 default: ··· 2301 2336 This->properties->uri = NULL; 2302 2337 } 2303 2338 2304 - hr = create_uri(filename, &uri); 2339 + hr = create_uri(This->base_uri, filename, &uri); 2305 2340 if (SUCCEEDED(hr)) 2306 2341 hr = CreateURLMonikerEx2(NULL, uri, &mon, 0); 2307 2342 if ( SUCCEEDED(hr) ) ··· 2333 2368 hr = S_FALSE; 2334 2369 } 2335 2370 2336 - TRACE("ret (%d)\n", hr); 2371 + TRACE("hr %#lx.\n", hr); 2337 2372 2338 2373 return hr; 2339 2374 } ··· 2447 2482 2448 2483 /* skip leading spaces if needed */ 2449 2484 if (This->properties->version == MSXML_DEFAULT || This->properties->version == MSXML26) 2450 - while (*ptr && isspaceW(*ptr)) ptr++; 2485 + while (*ptr && iswspace(*ptr)) ptr++; 2451 2486 2452 - xmldoc = doparse(This, (char*)ptr, strlenW(ptr)*sizeof(WCHAR), XML_CHAR_ENCODING_UTF16LE); 2487 + xmldoc = doparse(This, (char*)ptr, lstrlenW(ptr)*sizeof(WCHAR), XML_CHAR_ENCODING_UTF16LE); 2453 2488 if ( !xmldoc ) 2454 2489 { 2455 2490 This->error = E_FAIL; ··· 2498 2533 HRESULT hr; 2499 2534 2500 2535 hr = IStream_Write((IStream*)ctx, buffer, len, &written); 2501 - TRACE("0x%08x %p %d %u\n", hr, buffer, len, written); 2536 + TRACE("hr %#lx, %p, %d, %lu.\n", hr, buffer, len, written); 2502 2537 if (hr != S_OK) 2503 2538 { 2504 - WARN("stream write error: 0x%08x\n", hr); 2539 + WARN("stream write error, hr %#lx.\n", hr); 2505 2540 return -1; 2506 2541 } 2507 2542 else ··· 2514 2549 return 0; 2515 2550 } 2516 2551 2552 + static char *xmldoc_encoding(IXMLDOMDocument3 *doc) 2553 + { 2554 + HRESULT hr; 2555 + IXMLDOMNode *node; 2556 + char *encoding = NULL; 2557 + 2558 + hr = IXMLDOMDocument3_get_firstChild(doc, &node); 2559 + if (hr == S_OK) 2560 + { 2561 + DOMNodeType type; 2562 + 2563 + hr = IXMLDOMNode_get_nodeType(node, &type); 2564 + if (hr == S_OK && type == NODE_PROCESSING_INSTRUCTION) 2565 + { 2566 + IXMLDOMProcessingInstruction *pi; 2567 + IXMLDOMNode *item; 2568 + IXMLDOMNamedNodeMap *node_map; 2569 + 2570 + hr = IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMProcessingInstruction, (void **)&pi); 2571 + if (hr == S_OK) 2572 + { 2573 + hr = IXMLDOMNode_get_attributes(node, &node_map); 2574 + if (hr == S_OK) 2575 + { 2576 + static const WCHAR encodingW[] = {'e','n','c','o','d','i','n','g',0}; 2577 + BSTR bstr; 2578 + 2579 + bstr = SysAllocString(encodingW); 2580 + hr = IXMLDOMNamedNodeMap_getNamedItem(node_map, bstr, &item); 2581 + SysFreeString(bstr); 2582 + if (hr == S_OK) 2583 + { 2584 + VARIANT var; 2585 + 2586 + hr = IXMLDOMNode_get_nodeValue(item, &var); 2587 + if (hr == S_OK) 2588 + { 2589 + if (V_VT(&var) == VT_BSTR) 2590 + encoding = (char *)xmlchar_from_wchar(V_BSTR(&var)); 2591 + 2592 + VariantClear(&var); 2593 + } 2594 + } 2595 + 2596 + IXMLDOMNamedNodeMap_Release(node_map); 2597 + } 2598 + 2599 + IXMLDOMProcessingInstruction_Release(pi); 2600 + } 2601 + } 2602 + 2603 + IXMLDOMNode_Release(node); 2604 + } 2605 + 2606 + if (!encoding && (encoding = malloc(sizeof("UTF-8")))) 2607 + strcpy(encoding, "UTF-8"); 2608 + 2609 + return encoding; 2610 + } 2611 + 2517 2612 static HRESULT WINAPI domdoc_save( 2518 2613 IXMLDOMDocument3 *iface, 2519 2614 VARIANT destination ) 2520 2615 { 2521 2616 domdoc *This = impl_from_IXMLDOMDocument3( iface ); 2522 2617 xmlSaveCtxtPtr ctx = NULL; 2523 - xmlNodePtr xmldecl; 2524 2618 HRESULT ret = S_OK; 2525 2619 2526 2620 TRACE("(%p)->(%s)\n", This, debugstr_variant(&destination)); ··· 2553 2647 ret = IUnknown_QueryInterface(pUnk, &IID_IStream, (void**)&stream); 2554 2648 if(ret == S_OK) 2555 2649 { 2556 - int options = get_doc(This)->standalone == -1 ? XML_SAVE_NO_DECL : 0; 2650 + char *encoding = xmldoc_encoding(iface); 2651 + 2652 + TRACE("using encoding %s\n", encoding ? debugstr_a(encoding) : "default"); 2557 2653 ctx = xmlSaveToIO(domdoc_stream_save_writecallback, 2558 - domdoc_stream_save_closecallback, stream, NULL, options); 2654 + domdoc_stream_save_closecallback, stream, encoding, XML_SAVE_NO_DECL); 2655 + free(encoding); 2559 2656 2560 2657 if(!ctx) 2561 2658 { ··· 2569 2666 case VT_BSTR: 2570 2667 case VT_BSTR | VT_BYREF: 2571 2668 { 2572 - int options = get_doc(This)->standalone == -1 ? XML_SAVE_NO_DECL : 0; 2573 - 2669 + char *encoding; 2574 2670 /* save with file path */ 2575 2671 HANDLE handle = CreateFileW( (V_VT(&destination) & VT_BYREF)? *V_BSTRREF(&destination) : V_BSTR(&destination), 2576 2672 GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL ); ··· 2580 2676 return E_FAIL; 2581 2677 } 2582 2678 2583 - /* disable top XML declaration */ 2679 + encoding = xmldoc_encoding(iface); 2680 + TRACE("using encoding %s\n", encoding ? debugstr_a(encoding) : "default"); 2584 2681 ctx = xmlSaveToIO(domdoc_save_writecallback, domdoc_save_closecallback, 2585 - handle, NULL, options); 2682 + handle, encoding, XML_SAVE_NO_DECL); 2683 + free(encoding); 2684 + 2586 2685 if (!ctx) 2587 2686 { 2588 2687 CloseHandle(handle); ··· 2596 2695 return S_FALSE; 2597 2696 } 2598 2697 2599 - xmldecl = xmldoc_unlink_xmldecl(get_doc(This)); 2600 2698 if (xmlSaveDoc(ctx, get_doc(This)) == -1) ret = S_FALSE; 2601 - xmldoc_link_xmldecl(get_doc(This), xmldecl); 2602 2699 2603 2700 /* will release resources through close callback */ 2604 2701 xmlSaveClose(ctx); ··· 2611 2708 VARIANT_BOOL* isValidating ) 2612 2709 { 2613 2710 domdoc *This = impl_from_IXMLDOMDocument3( iface ); 2614 - TRACE("(%p)->(%p: %d)\n", This, isValidating, This->validating); 2615 - *isValidating = This->validating; 2711 + TRACE("(%p)->(%p: %d)\n", This, isValidating, This->properties->validating); 2712 + *isValidating = This->properties->validating; 2616 2713 return S_OK; 2617 2714 } 2618 2715 ··· 2623 2720 { 2624 2721 domdoc *This = impl_from_IXMLDOMDocument3( iface ); 2625 2722 TRACE("(%p)->(%d)\n", This, isValidating); 2626 - This->validating = isValidating; 2723 + This->properties->validating = isValidating; 2627 2724 return S_OK; 2628 2725 } 2629 2726 ··· 2793 2890 2794 2891 static inline BOOL is_wellformed(xmlDocPtr doc) 2795 2892 { 2796 - #ifdef HAVE_XMLDOC_PROPERTIES 2797 2893 return doc->properties & XML_DOC_WELLFORMED; 2798 - #else 2799 - /* Not a full check, but catches the worst violations */ 2800 - xmlNodePtr child; 2801 - int root = 0; 2802 - 2803 - for (child = doc->children; child != NULL; child = child->next) 2804 - { 2805 - switch (child->type) 2806 - { 2807 - case XML_ELEMENT_NODE: 2808 - if (++root > 1) 2809 - return FALSE; 2810 - break; 2811 - case XML_TEXT_NODE: 2812 - case XML_CDATA_SECTION_NODE: 2813 - return FALSE; 2814 - break; 2815 - default: 2816 - break; 2817 - } 2818 - } 2819 - 2820 - return root == 1; 2821 - #endif 2822 2894 } 2823 2895 2824 2896 static void LIBXML2_LOG_CALLBACK validate_error(void* ctx, char const* msg, ...) ··· 3004 3076 3005 3077 pNsList = &(This->properties->selectNsList); 3006 3078 clear_selectNsList(pNsList); 3007 - heap_free(nsStr); 3079 + free(nsStr); 3008 3080 nsStr = xmlchar_from_wchar(bstr); 3009 3081 3010 3082 TRACE("property value: \"%s\"\n", debugstr_w(bstr)); ··· 3030 3102 if (ns_entry) 3031 3103 memset(ns_entry, 0, sizeof(select_ns_entry)); 3032 3104 else 3033 - ns_entry = heap_alloc_zero(sizeof(select_ns_entry)); 3105 + ns_entry = calloc(1, sizeof(select_ns_entry)); 3034 3106 3035 3107 while (*pTokBegin == ' ') 3036 3108 ++pTokBegin; ··· 3107 3179 continue; 3108 3180 } 3109 3181 } 3110 - heap_free(ns_entry); 3182 + free(ns_entry); 3111 3183 xmlXPathFreeContext(ctx); 3112 3184 } 3113 3185 3114 3186 VariantClear(&varStr); 3115 3187 return hr; 3116 3188 } 3189 + else if (lstrcmpiW(p, PropertyValidateOnParse) == 0) 3190 + { 3191 + if (This->properties->version < MSXML4) 3192 + return E_FAIL; 3193 + else 3194 + { 3195 + This->properties->validating = V_BOOL(&value); 3196 + return S_OK; 3197 + } 3198 + } 3117 3199 else if (lstrcmpiW(p, PropertyProhibitDTDW) == 0 || 3118 3200 lstrcmpiW(p, PropertyNewParserW) == 0 || 3119 3201 lstrcmpiW(p, PropertyResolveExternalsW) == 0 || 3120 3202 lstrcmpiW(p, PropertyAllowXsltScriptW) == 0 || 3121 3203 lstrcmpiW(p, PropertyNormalizeAttributeValuesW) == 0 || 3122 - lstrcmpiW(p, PropertyAllowDocumentFunctionW) == 0) 3204 + lstrcmpiW(p, PropertyAllowDocumentFunctionW) == 0 || 3205 + lstrcmpiW(p, PropertyMaxElementDepth) == 0) 3123 3206 { 3124 3207 /* Ignore */ 3125 3208 FIXME("Ignoring property %s, value %s\n", debugstr_w(p), debugstr_variant(&value)); ··· 3163 3246 pNsList = &This->properties->selectNsList; 3164 3247 lenA = This->properties->selectNsStr_len; 3165 3248 lenW = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)nsStr, lenA+1, NULL, 0); 3166 - rebuiltStr = heap_alloc(lenW*sizeof(WCHAR)); 3249 + rebuiltStr = malloc(lenW * sizeof(WCHAR)); 3167 3250 MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)nsStr, lenA+1, rebuiltStr, lenW); 3168 3251 cur = rebuiltStr; 3169 3252 /* this is fine because all of the chars that end tokens are ASCII*/ ··· 3182 3265 } 3183 3266 } 3184 3267 V_BSTR(var) = SysAllocString(rebuiltStr); 3185 - heap_free(rebuiltStr); 3268 + free(rebuiltStr); 3186 3269 return S_OK; 3187 3270 } 3271 + else if (lstrcmpiW(p, PropertyValidateOnParse) == 0) 3272 + { 3273 + if (This->properties->version < MSXML4) 3274 + return E_FAIL; 3275 + else 3276 + { 3277 + V_VT(var) = VT_BOOL; 3278 + V_BOOL(var) = This->properties->validating; 3279 + return S_OK; 3280 + } 3281 + } 3188 3282 3189 3283 FIXME("Unknown property %s\n", debugstr_w(p)); 3190 3284 return E_FAIL; ··· 3440 3534 break; 3441 3535 3442 3536 if (i == This->sinks_size) 3443 - This->sinks = heap_realloc(This->sinks,(++This->sinks_size)*sizeof(*This->sinks)); 3537 + This->sinks = realloc(This->sinks, (++This->sinks_size) * sizeof(*This->sinks)); 3444 3538 } 3445 3539 else 3446 3540 { 3447 - This->sinks = heap_alloc(sizeof(*This->sinks)); 3541 + This->sinks = malloc(sizeof(*This->sinks)); 3448 3542 This->sinks_size = 1; 3449 3543 i = 0; 3450 3544 } ··· 3460 3554 { 3461 3555 ConnectionPoint *This = impl_from_IConnectionPoint(iface); 3462 3556 3463 - TRACE("(%p)->(%d)\n", This, cookie); 3557 + TRACE("%p, %ld.\n", iface, cookie); 3464 3558 3465 3559 if (cookie == 0 || cookie > This->sinks_size || !This->sinks[cookie-1].unk) 3466 3560 return CONNECT_E_NOCONNECTION; ··· 3551 3645 This->site = NULL; 3552 3646 } 3553 3647 3648 + if(This->base_uri) 3649 + { 3650 + IUri_Release(This->base_uri); 3651 + This->base_uri = NULL; 3652 + } 3653 + 3554 3654 return S_OK; 3555 3655 } 3556 3656 ··· 3560 3660 IUnknown_Release( This->site ); 3561 3661 3562 3662 This->site = punk; 3663 + This->base_uri = get_base_uri(This->site); 3563 3664 3564 3665 return S_OK; 3565 3666 } ··· 3611 3712 static HRESULT WINAPI domdoc_Safety_SetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, 3612 3713 DWORD mask, DWORD enabled) 3613 3714 { 3614 - domdoc *This = impl_from_IObjectSafety(iface); 3615 - TRACE("(%p)->(%s %x %x)\n", This, debugstr_guid(riid), mask, enabled); 3715 + domdoc *doc = impl_from_IObjectSafety(iface); 3716 + 3717 + TRACE("%p, %s, %lx, %lx.\n", iface, debugstr_guid(riid), mask, enabled); 3616 3718 3617 3719 if ((mask & ~SAFETY_SUPPORTED_OPTIONS) != 0) 3618 3720 return E_FAIL; 3619 3721 3620 - This->safeopt = (This->safeopt & ~mask) | (mask & enabled); 3722 + doc->safeopt = (doc->safeopt & ~mask) | (mask & enabled); 3621 3723 3622 3724 return S_OK; 3623 3725 } ··· 3648 3750 { 3649 3751 domdoc *doc; 3650 3752 3651 - doc = heap_alloc( sizeof (*doc) ); 3753 + doc = malloc(sizeof(*doc)); 3652 3754 if( !doc ) 3653 3755 return E_OUTOFMEMORY; 3654 3756 ··· 3659 3761 doc->IConnectionPointContainer_iface.lpVtbl = &ConnectionPointContainerVtbl; 3660 3762 doc->ref = 1; 3661 3763 doc->async = VARIANT_TRUE; 3662 - doc->validating = 0; 3663 3764 doc->resolving = 0; 3664 - doc->properties = properties_from_xmlDocPtr(xmldoc); 3765 + doc->properties = properties_add_ref(properties_from_xmlDocPtr(xmldoc)); 3665 3766 doc->error = S_OK; 3666 3767 doc->site = NULL; 3768 + doc->base_uri = NULL; 3667 3769 doc->safeopt = 0; 3668 3770 doc->cp_list = NULL; 3669 3771 doc->namespaces = NULL; ··· 3683 3785 return S_OK; 3684 3786 } 3685 3787 3686 - HRESULT DOMDocument_create(MSXML_VERSION version, void **ppObj) 3788 + HRESULT dom_document_create(MSXML_VERSION version, void **ppObj) 3687 3789 { 3688 3790 xmlDocPtr xmldoc; 3689 3791 HRESULT hr; ··· 3699 3801 hr = get_domdoc_from_xmldoc(xmldoc, (IXMLDOMDocument3**)ppObj); 3700 3802 if(FAILED(hr)) 3701 3803 { 3702 - free_properties(properties_from_xmlDocPtr(xmldoc)); 3703 - heap_free(xmldoc->_private); 3804 + properties_release(properties_from_xmlDocPtr(xmldoc)); 3805 + free(xmldoc->_private); 3704 3806 xmlFreeDoc(xmldoc); 3705 3807 return hr; 3706 3808 } ··· 3721 3823 3722 3824 return obj; 3723 3825 } 3724 - 3725 - #else 3726 - 3727 - HRESULT DOMDocument_create(MSXML_VERSION version, void **ppObj) 3728 - { 3729 - MESSAGE("This program tried to use a DOMDocument object, but\n" 3730 - "libxml2 support was not present at compile time.\n"); 3731 - return E_NOTIMPL; 3732 - } 3733 - 3734 - #endif
+42 -50
dll/win32/msxml3/domimpl.c
··· 20 20 21 21 #define COBJMACROS 22 22 23 - #include "config.h" 24 - 25 23 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - # include <libxml/xmlerror.h> 29 - #endif 30 24 31 25 #include "windef.h" 32 26 #include "winbase.h" ··· 34 28 #include "ole2.h" 35 29 #include "msxml6.h" 36 30 37 - #include "msxml_private.h" 31 + #include "msxml_dispex.h" 38 32 39 33 #include "wine/debug.h" 40 - 41 - #ifdef HAVE_LIBXML2 42 34 43 35 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 44 36 ··· 54 46 return CONTAINING_RECORD(iface, domimpl, IXMLDOMImplementation_iface); 55 47 } 56 48 57 - static HRESULT WINAPI dimimpl_QueryInterface( 49 + static HRESULT WINAPI domimpl_QueryInterface( 58 50 IXMLDOMImplementation *iface, 59 51 REFIID riid, 60 52 void** ppvObject ) ··· 84 76 return S_OK; 85 77 } 86 78 87 - static ULONG WINAPI dimimpl_AddRef( 88 - IXMLDOMImplementation *iface ) 79 + static ULONG WINAPI domimpl_AddRef(IXMLDOMImplementation *iface) 89 80 { 90 - domimpl *This = impl_from_IXMLDOMImplementation( iface ); 91 - ULONG ref = InterlockedIncrement( &This->ref ); 92 - TRACE("(%p)->(%d)\n", This, ref); 81 + domimpl *domimpl = impl_from_IXMLDOMImplementation(iface); 82 + ULONG ref = InterlockedIncrement(&domimpl->ref); 83 + TRACE("%p, refcount %lu.\n", iface, ref); 93 84 return ref; 94 85 } 95 86 96 - static ULONG WINAPI dimimpl_Release( 97 - IXMLDOMImplementation *iface ) 87 + static ULONG WINAPI domimpl_Release(IXMLDOMImplementation *iface) 98 88 { 99 - domimpl *This = impl_from_IXMLDOMImplementation( iface ); 100 - ULONG ref = InterlockedDecrement( &This->ref ); 89 + domimpl *domimpl = impl_from_IXMLDOMImplementation(iface); 90 + ULONG ref = InterlockedDecrement(&domimpl->ref); 101 91 102 - TRACE("(%p)->(%d)\n", This, ref); 103 - if ( ref == 0 ) 104 - heap_free( This ); 92 + TRACE("%p, refcount %lu.\n", iface, ref); 93 + 94 + if (!ref) 95 + free(domimpl); 105 96 106 97 return ref; 107 98 } 108 99 109 - static HRESULT WINAPI dimimpl_GetTypeInfoCount( 100 + static HRESULT WINAPI domimpl_GetTypeInfoCount( 110 101 IXMLDOMImplementation *iface, 111 102 UINT* pctinfo ) 112 103 { ··· 114 105 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo); 115 106 } 116 107 117 - static HRESULT WINAPI dimimpl_GetTypeInfo( 108 + static HRESULT WINAPI domimpl_GetTypeInfo( 118 109 IXMLDOMImplementation *iface, 119 110 UINT iTInfo, LCID lcid, 120 111 ITypeInfo** ppTInfo ) ··· 124 115 iTInfo, lcid, ppTInfo); 125 116 } 126 117 127 - static HRESULT WINAPI dimimpl_GetIDsOfNames( 118 + static HRESULT WINAPI domimpl_GetIDsOfNames( 128 119 IXMLDOMImplementation *iface, 129 120 REFIID riid, LPOLESTR* rgszNames, 130 121 UINT cNames, LCID lcid, DISPID* rgDispId ) ··· 134 125 riid, rgszNames, cNames, lcid, rgDispId); 135 126 } 136 127 137 - static HRESULT WINAPI dimimpl_Invoke( 128 + static HRESULT WINAPI domimpl_Invoke( 138 129 IXMLDOMImplementation *iface, 139 130 DISPID dispIdMember, REFIID riid, LCID lcid, 140 131 WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, ··· 145 136 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 146 137 } 147 138 148 - static HRESULT WINAPI dimimpl_hasFeature(IXMLDOMImplementation* This, BSTR feature, BSTR version, VARIANT_BOOL *hasFeature) 139 + static HRESULT WINAPI domimpl_hasFeature(IXMLDOMImplementation* This, BSTR feature, BSTR version, VARIANT_BOOL *hasFeature) 149 140 { 150 141 static const WCHAR bVersion[] = {'1','.','0',0}; 151 142 static const WCHAR bXML[] = {'X','M','L',0}; ··· 173 164 return S_OK; 174 165 } 175 166 176 - static const struct IXMLDOMImplementationVtbl dimimpl_vtbl = 167 + static const struct IXMLDOMImplementationVtbl domimpl_vtbl = 177 168 { 178 - dimimpl_QueryInterface, 179 - dimimpl_AddRef, 180 - dimimpl_Release, 181 - dimimpl_GetTypeInfoCount, 182 - dimimpl_GetTypeInfo, 183 - dimimpl_GetIDsOfNames, 184 - dimimpl_Invoke, 185 - dimimpl_hasFeature 169 + domimpl_QueryInterface, 170 + domimpl_AddRef, 171 + domimpl_Release, 172 + domimpl_GetTypeInfoCount, 173 + domimpl_GetTypeInfo, 174 + domimpl_GetIDsOfNames, 175 + domimpl_Invoke, 176 + domimpl_hasFeature 186 177 }; 187 178 188 - static const tid_t dimimpl_iface_tids[] = { 179 + static const tid_t domimpl_iface_tids[] = 180 + { 189 181 IXMLDOMImplementation_tid, 190 182 0 191 183 }; 192 184 193 - static dispex_static_data_t dimimpl_dispex = { 185 + static dispex_static_data_t domimpl_dispex = 186 + { 194 187 NULL, 195 188 IXMLDOMImplementation_tid, 196 189 NULL, 197 - dimimpl_iface_tids 190 + domimpl_iface_tids 198 191 }; 199 192 200 - IUnknown* create_doc_Implementation(void) 193 + HRESULT create_dom_implementation(IXMLDOMImplementation **ret) 201 194 { 202 - domimpl *This; 195 + domimpl *object; 203 196 204 - This = heap_alloc( sizeof *This ); 205 - if ( !This ) 206 - return NULL; 197 + if (!(object = malloc(sizeof(*object)))) 198 + return E_OUTOFMEMORY; 199 + 200 + object->IXMLDOMImplementation_iface.lpVtbl = &domimpl_vtbl; 201 + object->ref = 1; 202 + init_dispex(&object->dispex, (IUnknown *)&object->IXMLDOMImplementation_iface, &domimpl_dispex); 207 203 208 - This->IXMLDOMImplementation_iface.lpVtbl = &dimimpl_vtbl; 209 - This->ref = 1; 210 - init_dispex(&This->dispex, (IUnknown*)&This->IXMLDOMImplementation_iface, &dimimpl_dispex); 204 + *ret = &object->IXMLDOMImplementation_iface; 211 205 212 - return (IUnknown*)&This->IXMLDOMImplementation_iface; 206 + return S_OK; 213 207 } 214 - 215 - #endif
+111 -63
dll/win32/msxml3/element.c
··· 20 20 21 21 #define COBJMACROS 22 22 23 - #include "config.h" 24 - 25 23 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - # include <libxml/xmlerror.h> 29 - #endif 24 + #include <libxml/parser.h> 25 + #include <libxml/xmlerror.h> 30 26 31 27 #include "windef.h" 32 28 #include "winbase.h" ··· 38 34 #include "msxml_private.h" 39 35 40 36 #include "wine/debug.h" 41 - 42 - #ifdef HAVE_LIBXML2 43 37 44 38 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 45 39 ··· 106 100 return S_OK; 107 101 } 108 102 109 - static ULONG WINAPI domelem_AddRef( 110 - IXMLDOMElement *iface ) 103 + static ULONG WINAPI domelem_AddRef(IXMLDOMElement *iface) 111 104 { 112 - domelem *This = impl_from_IXMLDOMElement( iface ); 113 - LONG ref = InterlockedIncrement(&This->ref); 105 + domelem *element = impl_from_IXMLDOMElement(iface); 106 + LONG ref = InterlockedIncrement(&element->ref); 114 107 115 - TRACE("(%p)->(%d)\n", This, ref); 108 + TRACE("%p, refcount %ld.\n", iface, ref); 116 109 117 110 return ref; 118 111 } 119 112 120 - static ULONG WINAPI domelem_Release( 121 - IXMLDOMElement *iface ) 113 + static ULONG WINAPI domelem_Release(IXMLDOMElement *iface) 122 114 { 123 - domelem *This = impl_from_IXMLDOMElement( iface ); 124 - ULONG ref = InterlockedDecrement(&This->ref); 115 + domelem *element = impl_from_IXMLDOMElement(iface); 116 + ULONG ref = InterlockedDecrement(&element->ref); 125 117 126 - TRACE("(%p)->(%d)\n", This, ref); 118 + TRACE("%p, refcount %lu.\n", iface, ref); 127 119 128 - if(!ref) { 129 - destroy_xmlnode(&This->node); 130 - heap_free(This); 120 + if (!ref) 121 + { 122 + destroy_xmlnode(&element->node); 123 + free(element); 131 124 } 132 125 133 126 return ref; ··· 309 302 310 303 TRACE("(%p)->(%p %s %p)\n", This, newNode, debugstr_variant(&refChild), old_node); 311 304 305 + if (!newNode) return E_INVALIDARG; 306 + 312 307 hr = IXMLDOMNode_get_nodeType(newNode, &type); 313 308 if (hr != S_OK) return hr; 314 309 ··· 459 454 460 455 switch (dt) 461 456 { 462 - case DT_INVALID: 463 457 case DT_STRING: 464 458 case DT_NMTOKEN: 465 459 case DT_NMTOKENS: ··· 502 496 503 497 if(p+4<e && *(p+4)=='-') /* parse date (yyyy-mm-dd) */ 504 498 { 505 - st.wYear = atoiW(p); 506 - st.wMonth = atoiW(p+5); 507 - st.wDay = atoiW(p+8); 499 + st.wYear = wcstol(p, NULL, 10); 500 + st.wMonth = wcstol(p+5, NULL, 10); 501 + st.wDay = wcstol(p+8, NULL, 10); 508 502 p += 10; 509 503 510 504 if(*p == 'T') p++; ··· 512 506 513 507 if(p+2<e && *(p+2)==':') /* parse time (hh:mm:ss.?) */ 514 508 { 515 - st.wHour = atoiW(p); 516 - st.wMinute = atoiW(p+3); 517 - st.wSecond = atoiW(p+6); 509 + st.wHour = wcstol(p, NULL, 10); 510 + st.wMinute = wcstol(p+3, NULL, 10); 511 + st.wSecond = wcstol(p+6, NULL, 10); 518 512 p += 8; 519 513 520 514 if(*p == '.') 521 515 { 522 516 p++; 523 - while(isdigitW(*p)) p++; 517 + while (*p >= '0' && *p <= '9') p++; 524 518 } 525 519 } 526 520 ··· 529 523 V_DATE(v) = date; 530 524 531 525 if(*p == '+') /* parse timezone offset (+hh:mm) */ 532 - V_DATE(v) += (DOUBLE)atoiW(p+1)/24 + (DOUBLE)atoiW(p+4)/1440; 526 + V_DATE(v) += (DOUBLE)wcstol(p+1, NULL, 10)/24 + (DOUBLE)wcstol(p+4, NULL, 10)/1440; 533 527 else if(*p == '-') /* parse timezone offset (-hh:mm) */ 534 - V_DATE(v) -= (DOUBLE)atoiW(p+1)/24 + (DOUBLE)atoiW(p+4)/1440; 528 + V_DATE(v) -= (DOUBLE)wcstol(p+1, NULL, 10)/24 + (DOUBLE)wcstol(p+4, NULL, 10)/1440; 535 529 536 530 VariantClear(&src); 537 531 handled = TRUE; ··· 741 735 V_VT(v) = VT_NULL; 742 736 743 737 dt = element_get_dt(get_element(This)); 738 + 739 + if (dt == DT_INVALID) 740 + { 741 + if (SUCCEEDED(hr = node_get_text(&This->node, &V_BSTR(v)))) 742 + V_VT(v) = VT_BSTR; 743 + return hr; 744 + } 744 745 content = xmlNodeGetContent(get_element(This)); 745 746 hr = variant_from_dt(dt, content, v); 746 747 xmlFree(content); ··· 847 848 { 848 849 /* for untyped node coerce to BSTR and set */ 849 850 case DT_INVALID: 851 + case DT_INT: 850 852 if (V_VT(&value) != VT_BSTR) 851 853 { 852 854 VARIANT content; ··· 1247 1249 xml_value = xmlGetNsProp(element, xml_name, NULL); 1248 1250 } 1249 1251 1250 - heap_free(xml_name); 1252 + free(xml_name); 1251 1253 if(xml_value) 1252 1254 { 1253 1255 V_VT(value) = VT_BSTR; ··· 1309 1311 if (ns) 1310 1312 { 1311 1313 int cmp = xmlStrEqual(ns->href, xml_value); 1312 - heap_free(xml_value); 1313 - heap_free(xml_name); 1314 + free(xml_value); 1315 + free(xml_name); 1314 1316 return cmp ? S_OK : E_INVALIDARG; 1315 1317 } 1316 1318 } ··· 1318 1320 if (!xmlSetNsProp(element, NULL, xml_name, xml_value)) 1319 1321 hr = E_FAIL; 1320 1322 1321 - heap_free(xml_value); 1322 - heap_free(xml_name); 1323 + free(xml_value); 1324 + free(xml_name); 1323 1325 1324 1326 return hr; 1325 1327 } ··· 1363 1365 nameA = xmlchar_from_wchar(p); 1364 1366 if (!xmlValidateNameValue(nameA)) 1365 1367 { 1366 - heap_free(nameA); 1368 + free(nameA); 1367 1369 return E_FAIL; 1368 1370 } 1369 1371 1370 1372 if (!attributeNode) 1371 1373 { 1372 - heap_free(nameA); 1374 + free(nameA); 1373 1375 return S_FALSE; 1374 1376 } 1375 1377 ··· 1394 1396 if (attr && attr->ns) attr = NULL; 1395 1397 } 1396 1398 1397 - heap_free(nameA); 1399 + free(nameA); 1398 1400 1399 1401 if (attr) 1400 1402 { ··· 1437 1439 if (hr != S_OK) return hr; 1438 1440 1439 1441 /* adding xmlns attribute doesn't change a tree or existing namespace definition */ 1440 - if (!strcmpW(nameW, xmlnsW)) 1442 + if (!wcscmp(nameW, xmlnsW)) 1441 1443 { 1442 1444 SysFreeString(nameW); 1443 1445 return DISP_E_UNKNOWNNAME; ··· 1468 1470 { 1469 1471 SysFreeString(nameW); 1470 1472 VariantClear(&valueW); 1471 - heap_free(name); 1472 - heap_free(value); 1473 + free(name); 1474 + free(value); 1473 1475 return E_OUTOFMEMORY; 1474 1476 } 1475 1477 ··· 1479 1481 1480 1482 SysFreeString(nameW); 1481 1483 VariantClear(&valueW); 1482 - heap_free(name); 1483 - heap_free(value); 1484 + free(name); 1485 + free(value); 1484 1486 1485 1487 return attr ? S_OK : E_FAIL; 1486 1488 } ··· 1604 1606 nameA = xmlchar_from_wchar(name); 1605 1607 if (!nameA) 1606 1608 { 1607 - heap_free(href); 1609 + free(href); 1608 1610 return E_OUTOFMEMORY; 1609 1611 } 1610 1612 1611 1613 attr = xmlHasNsProp(node, nameA, href); 1612 1614 1613 - heap_free(nameA); 1614 - heap_free(href); 1615 + free(nameA); 1616 + free(href); 1615 1617 1616 1618 if (!attr) 1617 1619 { ··· 1635 1637 1636 1638 nameA = xmlchar_from_wchar(name); 1637 1639 local = xmlSplitQName2(nameA, &prefix); 1638 - heap_free(nameA); 1640 + free(nameA); 1639 1641 1640 1642 if (!local) 1641 1643 return domelem_get_qualified_item(node, name, NULL, item); ··· 1716 1718 nameA = xmlchar_from_wchar(name); 1717 1719 if (!nameA) 1718 1720 { 1719 - heap_free(href); 1721 + free(href); 1720 1722 return E_OUTOFMEMORY; 1721 1723 } 1722 1724 1723 1725 attr = xmlHasNsProp(node, nameA, href); 1724 1726 1725 - heap_free(nameA); 1726 - heap_free(href); 1727 + free(nameA); 1728 + free(href); 1727 1729 1728 1730 if (!attr) 1729 1731 { ··· 1748 1750 1749 1751 static HRESULT domelem_remove_named_item(xmlNodePtr node, BSTR name, IXMLDOMNode **item) 1750 1752 { 1753 + xmlChar *nameA, *local, *prefix; 1754 + BSTR uriW, localW; 1755 + xmlNsPtr ns; 1756 + HRESULT hr; 1757 + 1751 1758 TRACE("(%p)->(%s %p)\n", node, debugstr_w(name), item); 1752 - return domelem_remove_qualified_item(node, name, NULL, item); 1759 + 1760 + nameA = xmlchar_from_wchar(name); 1761 + local = xmlSplitQName2(nameA, &prefix); 1762 + free(nameA); 1763 + 1764 + if (!local) 1765 + return domelem_remove_qualified_item(node, name, NULL, item); 1766 + 1767 + ns = xmlSearchNs(node->doc, node, prefix); 1768 + 1769 + xmlFree(prefix); 1770 + 1771 + if (!ns) 1772 + { 1773 + xmlFree(local); 1774 + if (item) *item = NULL; 1775 + return item ? S_FALSE : E_INVALIDARG; 1776 + } 1777 + 1778 + uriW = bstr_from_xmlChar(ns->href); 1779 + localW = bstr_from_xmlChar(local); 1780 + xmlFree(local); 1781 + 1782 + TRACE("removing qualified node %s, uri=%s\n", debugstr_w(localW), debugstr_w(uriW)); 1783 + 1784 + hr = domelem_remove_qualified_item(node, localW, uriW, item); 1785 + 1786 + SysFreeString(localW); 1787 + SysFreeString(uriW); 1788 + 1789 + return hr; 1753 1790 } 1754 1791 1755 1792 static HRESULT domelem_get_item(const xmlNodePtr node, LONG index, IXMLDOMNode **item) ··· 1760 1797 IUnknown *unk; 1761 1798 HRESULT hr; 1762 1799 1763 - TRACE("(%p)->(%d %p)\n", node, index, item); 1800 + TRACE("%p, %ld, %p.\n", node, index, item); 1764 1801 1765 1802 *item = NULL; 1766 1803 ··· 1782 1819 if (!node->nsDef) 1783 1820 return S_FALSE; 1784 1821 1785 - attrIndex++; 1786 1822 ns = node->nsDef; 1787 - for (; attrIndex < index && ns->next != NULL; attrIndex++) 1823 + while (attrIndex < index) 1824 + { 1825 + attrIndex++; 1826 + 1827 + if (!ns->next) 1828 + break; 1829 + 1788 1830 ns = ns->next; 1831 + } 1789 1832 1790 1833 if (attrIndex < index) 1791 1834 return S_FALSE; 1792 1835 1793 - xmlns = xmlNewNs(NULL, BAD_CAST "http://www.w3.org/2000/xmlns/", BAD_CAST "xmlns"); 1794 - if (!xmlns) 1795 - return E_OUTOFMEMORY; 1836 + if (!ns->prefix) { 1837 + xmlns = NULL; 1838 + curr = xmlNewProp(NULL, BAD_CAST "xmlns", ns->href); 1839 + } else { 1840 + xmlns = xmlNewNs(NULL, BAD_CAST "http://www.w3.org/2000/xmlns/", BAD_CAST "xmlns"); 1841 + if (!xmlns) 1842 + return E_OUTOFMEMORY; 1796 1843 1797 - curr = xmlNewNsProp(NULL, xmlns, ns->prefix, ns->href); 1844 + curr = xmlNewNsProp(NULL, xmlns, ns->prefix, ns->href); 1845 + } 1798 1846 if (!curr) { 1799 1847 xmlFreeNs(xmlns); 1800 1848 return E_OUTOFMEMORY; ··· 1847 1895 xmlAttrPtr curr; 1848 1896 LONG i; 1849 1897 1850 - TRACE("(%p)->(%d: %p)\n", node, *iter, nextNode); 1898 + TRACE("%p, %ld, %p.\n", node, *iter, nextNode); 1851 1899 1852 1900 *nextNode = NULL; 1853 1901 1854 1902 curr = node->properties; 1903 + if (curr == NULL) 1904 + return S_FALSE; 1855 1905 1856 1906 for (i = 0; i < *iter; i++) { 1857 1907 if (curr->next == NULL) ··· 1893 1943 { 1894 1944 domelem *This; 1895 1945 1896 - This = heap_alloc( sizeof *This ); 1946 + This = malloc(sizeof *This); 1897 1947 if ( !This ) 1898 1948 return NULL; 1899 1949 ··· 1904 1954 1905 1955 return (IUnknown*)&This->IXMLDOMElement_iface; 1906 1956 } 1907 - 1908 - #endif
+8 -15
dll/win32/msxml3/entityref.c
··· 20 20 21 21 #define COBJMACROS 22 22 23 - #include "config.h" 24 - 25 23 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - # include <libxml/xmlerror.h> 29 - #endif 24 + #include <libxml/parser.h> 25 + #include <libxml/xmlerror.h> 30 26 31 27 #include "windef.h" 32 28 #include "winbase.h" ··· 37 33 #include "msxml_private.h" 38 34 39 35 #include "wine/debug.h" 40 - 41 - #ifdef HAVE_LIBXML2 42 36 43 37 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 44 38 ··· 99 93 { 100 94 entityref *This = impl_from_IXMLDOMEntityReference( iface ); 101 95 ULONG ref = InterlockedIncrement( &This->ref ); 102 - TRACE("(%p)->(%d)\n", This, ref); 96 + TRACE("%p, refcount %lu.\n", iface, ref); 103 97 return ref; 104 98 } 105 99 ··· 109 103 entityref *This = impl_from_IXMLDOMEntityReference( iface ); 110 104 ULONG ref = InterlockedDecrement( &This->ref ); 111 105 112 - TRACE("(%p)->(%d)\n", This, ref); 113 - if ( ref == 0 ) 106 + TRACE("%p, refcount %lu.\n", iface, ref); 107 + 108 + if (!ref) 114 109 { 115 110 destroy_xmlnode(&This->node); 116 - heap_free( This ); 111 + free(This); 117 112 } 118 113 119 114 return ref; ··· 583 578 { 584 579 entityref *This; 585 580 586 - This = heap_alloc( sizeof *This ); 581 + This = malloc(sizeof(*This)); 587 582 if ( !This ) 588 583 return NULL; 589 584 ··· 594 589 595 590 return (IUnknown*)&This->IXMLDOMEntityReference_iface; 596 591 } 597 - 598 - #endif
+21 -19
dll/win32/msxml3/factory.c
··· 21 21 22 22 #define COBJMACROS 23 23 24 - #include "config.h" 25 - 26 24 #include <stdarg.h> 27 - #ifdef HAVE_LIBXML2 28 - # include <libxml/parser.h> 29 - # include <libxml/xmlerror.h> 30 - #endif 25 + #include <libxml/parser.h> 26 + #include <libxml/xmlerror.h> 31 27 32 28 #include "windef.h" 33 29 #include "winbase.h" ··· 46 42 #include "msxml_private.h" 47 43 48 44 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 45 + 46 + #ifndef __REACTOS__ 47 + extern GUID CLSID_XMLSchemaCache60; 48 + #endif 49 49 50 50 typedef HRESULT (*ClassFactoryCreateInstanceFunc)(void**); 51 51 typedef HRESULT (*DOMFactoryCreateInstanceFunc)(MSXML_VERSION, void**); ··· 199 199 200 200 static ULONG WINAPI DOMClassFactory_AddRef(IClassFactory *iface ) 201 201 { 202 - DOMFactory *This = DOMFactory_from_IClassFactory(iface); 203 - ULONG ref = InterlockedIncrement(&This->ref); 204 - TRACE("(%p) ref = %u\n", This, ref); 202 + DOMFactory *factory = DOMFactory_from_IClassFactory(iface); 203 + ULONG ref = InterlockedIncrement(&factory->ref); 204 + TRACE("%p, refcount %lu.\n", iface, ref); 205 205 return ref; 206 206 } 207 207 208 208 static ULONG WINAPI DOMClassFactory_Release(IClassFactory *iface ) 209 209 { 210 - DOMFactory *This = DOMFactory_from_IClassFactory(iface); 211 - ULONG ref = InterlockedDecrement(&This->ref); 212 - TRACE("(%p) ref = %u\n", This, ref); 213 - if(!ref) { 214 - heap_free(This); 215 - } 210 + DOMFactory *factory = DOMFactory_from_IClassFactory(iface); 211 + ULONG ref = InterlockedDecrement(&factory->ref); 212 + 213 + TRACE("%p, refcount %lu.\n", iface, ref); 214 + 215 + if (!ref) 216 + free(factory); 217 + 216 218 return ref; 217 219 } 218 220 ··· 262 264 263 265 static HRESULT DOMClassFactory_Create(const GUID *clsid, REFIID riid, void **ppv, DOMFactoryCreateInstanceFunc fnCreateInstance) 264 266 { 265 - DOMFactory *ret = heap_alloc(sizeof(DOMFactory)); 267 + DOMFactory *ret = malloc(sizeof(DOMFactory)); 266 268 HRESULT hres; 267 269 268 270 ret->IClassFactory_iface.lpVtbl = &DOMClassFactoryVtbl; ··· 272 274 273 275 hres = IClassFactory_QueryInterface(&ret->IClassFactory_iface, riid, ppv); 274 276 if(FAILED(hres)) { 275 - heap_free(ret); 277 + free(ret); 276 278 *ppv = NULL; 277 279 } 278 280 return hres; ··· 302 304 IsEqualCLSID( rclsid, &CLSID_DOMDocument40 )|| /* Version dep. v 4.0 */ 303 305 IsEqualCLSID( rclsid, &CLSID_DOMDocument60 )) /* Version dep. v 6.0 */ 304 306 { 305 - return DOMClassFactory_Create(rclsid, riid, ppv, DOMDocument_create); 307 + return DOMClassFactory_Create(rclsid, riid, ppv, dom_document_create); 306 308 } 307 309 else if( IsEqualCLSID( rclsid, &CLSID_XMLSchemaCache ) || 308 310 IsEqualCLSID( rclsid, &CLSID_XMLSchemaCache26 ) || ··· 323 325 IsEqualCLSID( rclsid, &CLSID_FreeThreadedDOMDocument40 ) || 324 326 IsEqualCLSID( rclsid, &CLSID_FreeThreadedDOMDocument60 )) 325 327 { 326 - return DOMClassFactory_Create(rclsid, riid, ppv, DOMDocument_create); 328 + return DOMClassFactory_Create(rclsid, riid, ppv, dom_document_create); 327 329 } 328 330 else if( IsEqualCLSID( rclsid, &CLSID_SAXXMLReader) || 329 331 IsEqualCLSID( rclsid, &CLSID_SAXXMLReader30 ) ||
+159 -154
dll/win32/msxml3/httprequest.c
··· 20 20 */ 21 21 22 22 #define COBJMACROS 23 - #define NONAMELESSUNION 24 - 25 - #include "config.h" 26 23 27 24 #include <stdarg.h> 28 - #ifdef HAVE_LIBXML2 29 - # include <libxml/parser.h> 30 - # include <libxml/xmlerror.h> 31 - # include <libxml/encoding.h> 32 - #endif 33 25 34 26 #include "windef.h" 35 27 #include "winbase.h" ··· 44 36 #include "docobj.h" 45 37 #include "shlwapi.h" 46 38 47 - #include "msxml_private.h" 39 + #include "msxml_dispex.h" 48 40 49 41 #include "wine/debug.h" 50 42 51 - #ifdef HAVE_LIBXML2 52 - 53 43 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 54 44 55 45 static const WCHAR colspaceW[] = {':',' ',0}; ··· 174 164 list_remove(&header->entry); 175 165 SysFreeString(header->header); 176 166 SysFreeString(header->value); 177 - heap_free(header); 167 + free(header); 178 168 } 179 169 180 170 SysFreeString(This->raw_respheaders); ··· 190 180 list_remove(&header->entry); 191 181 SysFreeString(header->header); 192 182 SysFreeString(header->value); 193 - heap_free(header); 183 + free(header); 194 184 } 195 185 } 196 186 ··· 283 273 BindStatusCallback *This = impl_from_IBindStatusCallback(iface); 284 274 LONG ref = InterlockedIncrement(&This->ref); 285 275 286 - TRACE("(%p) ref = %d\n", This, ref); 276 + TRACE("%p, refcount %ld.\n", iface, ref); 287 277 288 278 return ref; 289 279 } ··· 293 283 BindStatusCallback *This = impl_from_IBindStatusCallback(iface); 294 284 LONG ref = InterlockedDecrement(&This->ref); 295 285 296 - TRACE("(%p) ref = %d\n", This, ref); 286 + TRACE("%p, refcount %ld.\n", iface, ref); 297 287 298 288 if (!ref) 299 289 { 300 290 if (This->binding) IBinding_Release(This->binding); 301 291 if (This->stream) IStream_Release(This->stream); 302 292 if (This->body) GlobalFree(This->body); 303 - heap_free(This); 293 + free(This); 304 294 } 305 295 306 296 return ref; ··· 311 301 { 312 302 BindStatusCallback *This = impl_from_IBindStatusCallback(iface); 313 303 314 - TRACE("(%p)->(%d %p)\n", This, reserved, pbind); 304 + TRACE("%p, %ld, %p.\n", iface, reserved, pbind); 315 305 316 306 if (!pbind) return E_INVALIDARG; 317 307 ··· 334 324 335 325 static HRESULT WINAPI BindStatusCallback_OnLowResource(IBindStatusCallback *iface, DWORD reserved) 336 326 { 337 - BindStatusCallback *This = impl_from_IBindStatusCallback(iface); 338 - 339 - TRACE("(%p)->(%d)\n", This, reserved); 327 + TRACE("%p, %ld.\n", iface, reserved); 340 328 341 329 return E_NOTIMPL; 342 330 } ··· 344 332 static HRESULT WINAPI BindStatusCallback_OnProgress(IBindStatusCallback *iface, ULONG ulProgress, 345 333 ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText) 346 334 { 347 - BindStatusCallback *This = impl_from_IBindStatusCallback(iface); 348 - 349 - TRACE("(%p)->(%u %u %u %s)\n", This, ulProgress, ulProgressMax, ulStatusCode, 335 + TRACE("%p, %lu, %lu, %lu, %s.\n", iface, ulProgress, ulProgressMax, ulStatusCode, 350 336 debugstr_w(szStatusText)); 351 337 352 338 return S_OK; ··· 357 343 { 358 344 BindStatusCallback *This = impl_from_IBindStatusCallback(iface); 359 345 360 - TRACE("(%p)->(0x%08x %s)\n", This, hr, debugstr_w(error)); 346 + TRACE("%p, %#lx, %s.\n", iface, hr, debugstr_w(error)); 361 347 362 348 if (This->binding) 363 349 { ··· 388 374 if (This->request->verb != BINDVERB_GET && This->body) 389 375 { 390 376 pbindinfo->stgmedData.tymed = TYMED_HGLOBAL; 391 - pbindinfo->stgmedData.u.hGlobal = This->body; 377 + pbindinfo->stgmedData.hGlobal = This->body; 392 378 pbindinfo->cbstgmedData = GlobalSize(This->body); 393 379 /* callback owns passed body pointer */ 394 380 IBindStatusCallback_QueryInterface(iface, &IID_IUnknown, (void**)&pbindinfo->stgmedData.pUnkForRelease); ··· 398 384 if (This->request->verb == BINDVERB_CUSTOM) 399 385 { 400 386 pbindinfo->szCustomVerb = CoTaskMemAlloc(SysStringByteLen(This->request->custom)+sizeof(WCHAR)); 401 - strcpyW(pbindinfo->szCustomVerb, This->request->custom); 387 + lstrcpyW(pbindinfo->szCustomVerb, This->request->custom); 402 388 } 403 389 404 390 return S_OK; ··· 412 398 BYTE buf[4096]; 413 399 HRESULT hr; 414 400 415 - TRACE("(%p)->(%08x %d %p %p)\n", This, flags, size, format, stgmed); 401 + TRACE("%p, %#lx, %lu, %p, %p.\n", iface, flags, size, format, stgmed); 416 402 417 403 do 418 404 { 419 - hr = IStream_Read(stgmed->u.pstm, buf, sizeof(buf), &read); 405 + hr = IStream_Read(stgmed->pstm, buf, sizeof(buf), &read); 420 406 if (hr != S_OK) break; 421 407 422 408 hr = IStream_Write(This->stream, buf, read, &written); ··· 483 469 WCHAR *buff, *ptr; 484 470 int size = 0; 485 471 486 - TRACE("(%p)->(%s %s %d %p)\n", This, debugstr_w(url), debugstr_w(headers), reserved, add_headers); 472 + TRACE("%p, %s, %s, %ld, %p.\n", iface, debugstr_w(url), debugstr_w(headers), reserved, add_headers); 487 473 488 474 *add_headers = NULL; 489 475 ··· 521 507 522 508 if (base_uri) 523 509 { 524 - strcpyW(ptr, refererW); 525 - strcatW(ptr, base_uri); 526 - strcatW(ptr, crlfW); 527 - ptr += strlenW(refererW) + SysStringLen(base_uri) + strlenW(crlfW); 510 + lstrcpyW(ptr, refererW); 511 + lstrcatW(ptr, base_uri); 512 + lstrcatW(ptr, crlfW); 513 + ptr += lstrlenW(refererW) + SysStringLen(base_uri) + lstrlenW(crlfW); 528 514 SysFreeString(base_uri); 529 515 } 530 516 ··· 574 560 /* new header */ 575 561 TRACE("got header %s:%s\n", debugstr_w(header), debugstr_w(value)); 576 562 577 - entry = heap_alloc(sizeof(*entry)); 563 + entry = malloc(sizeof(*entry)); 578 564 entry->header = header; 579 565 entry->value = value; 580 566 list_add_head(&This->respheaders, &entry->entry); ··· 585 571 { 586 572 BindStatusCallback *This = impl_from_IHttpNegotiate(iface); 587 573 588 - TRACE("(%p)->(%d %s %s %p)\n", This, code, debugstr_w(resp_headers), 574 + TRACE("%p, %ld, %s, %s, %p.\n", iface, code, debugstr_w(resp_headers), 589 575 debugstr_w(req_headers), add_reqheaders); 590 576 591 577 This->request->status = code; ··· 600 586 ptr = line = resp_headers; 601 587 602 588 /* skip HTTP-Version */ 603 - ptr = strchrW(ptr, ' '); 589 + ptr = wcschr(ptr, ' '); 604 590 if (ptr) 605 591 { 606 592 /* skip Status-Code */ 607 - ptr = strchrW(++ptr, ' '); 593 + ptr = wcschr(++ptr, ' '); 608 594 if (ptr) 609 595 { 610 596 status_text = ++ptr; ··· 694 680 static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback **obj, const VARIANT *body) 695 681 { 696 682 BindStatusCallback *bsc; 697 - IBindCtx *pbc; 683 + IBindCtx *pbc = NULL; 698 684 HRESULT hr; 699 - int size; 685 + LONG size; 700 686 701 - hr = CreateBindCtx(0, &pbc); 702 - if (hr != S_OK) return hr; 703 - 704 - bsc = heap_alloc(sizeof(*bsc)); 705 - if (!bsc) 706 - { 707 - IBindCtx_Release(pbc); 687 + if (!(bsc = malloc(sizeof(*bsc)))) 708 688 return E_OUTOFMEMORY; 709 - } 710 689 711 690 bsc->IBindStatusCallback_iface.lpVtbl = &BindStatusCallbackVtbl; 712 691 bsc->IHttpNegotiate_iface.lpVtbl = &BSCHttpNegotiateVtbl; ··· 747 726 } 748 727 749 728 size = WideCharToMultiByte(cp, 0, str, len, NULL, 0, NULL, NULL); 750 - if (!(ptr = heap_alloc(size))) 729 + if (!(ptr = malloc(size))) 751 730 { 752 - heap_free(bsc); 731 + free(bsc); 753 732 return E_OUTOFMEMORY; 754 733 } 755 734 WideCharToMultiByte(cp, 0, str, len, ptr, size, NULL, NULL); ··· 761 740 sa = V_ARRAY(body); 762 741 if ((hr = SafeArrayAccessData(sa, &ptr)) != S_OK) 763 742 { 764 - heap_free(bsc); 743 + free(bsc); 765 744 return hr; 766 745 } 767 746 if ((hr = SafeArrayGetUBound(sa, 1, &size)) != S_OK) 768 747 { 769 748 SafeArrayUnaccessData(sa); 770 - heap_free(bsc); 749 + free(bsc); 771 750 return hr; 772 751 } 773 752 size++; ··· 790 769 if (!bsc->body) 791 770 { 792 771 if (V_VT(body) == VT_BSTR) 793 - heap_free(ptr); 772 + free(ptr); 794 773 else if (V_VT(body) == (VT_ARRAY|VT_UI1)) 795 774 SafeArrayUnaccessData(sa); 796 775 797 - heap_free(bsc); 776 + free(bsc); 798 777 return E_OUTOFMEMORY; 799 778 } 800 779 ··· 804 783 } 805 784 806 785 if (V_VT(body) == VT_BSTR) 807 - heap_free(ptr); 786 + free(ptr); 808 787 else if (V_VT(body) == (VT_ARRAY|VT_UI1)) 809 788 SafeArrayUnaccessData(sa); 810 789 } 811 790 812 - hr = RegisterBindStatusCallback(pbc, &bsc->IBindStatusCallback_iface, NULL, 0); 791 + hr = CreateBindCtx(0, &pbc); 792 + if (hr == S_OK) 793 + hr = RegisterBindStatusCallback(pbc, &bsc->IBindStatusCallback_iface, NULL, 0); 813 794 if (hr == S_OK) 814 795 { 815 796 IMoniker *moniker; ··· 823 804 IMoniker_Release(moniker); 824 805 if (stream) IStream_Release(stream); 825 806 } 826 - IBindCtx_Release(pbc); 827 807 } 828 808 809 + if (pbc) 810 + IBindCtx_Release(pbc); 811 + 829 812 if (FAILED(hr)) 830 813 { 831 814 IBindStatusCallback_Release(&bsc->IBindStatusCallback_iface); ··· 872 855 873 856 hr = IUri_GetHost(This->base_uri, &base_host); 874 857 if(SUCCEEDED(hr)) { 875 - if(strcmpiW(host, base_host)) { 858 + if(wcsicmp(host, base_host)) { 876 859 WARN("Hosts don't match\n"); 877 860 hr = E_ACCESSDENIED; 878 861 } ··· 909 892 This->user = This->password = NULL; 910 893 free_request_headers(This); 911 894 912 - if (!strcmpiW(method, MethodGetW)) 895 + if (!wcsicmp(method, MethodGetW)) 913 896 { 914 897 This->verb = BINDVERB_GET; 915 898 } 916 - else if (!strcmpiW(method, MethodPutW)) 899 + else if (!wcsicmp(method, MethodPutW)) 917 900 { 918 901 This->verb = BINDVERB_PUT; 919 902 } 920 - else if (!strcmpiW(method, MethodPostW)) 903 + else if (!wcsicmp(method, MethodPostW)) 921 904 { 922 905 This->verb = BINDVERB_POST; 923 906 } 924 - else if (!strcmpiW(method, MethodDeleteW) || 925 - !strcmpiW(method, MethodHeadW) || 926 - !strcmpiW(method, MethodPropFindW)) 907 + else if (!wcsicmp(method, MethodDeleteW) || 908 + !wcsicmp(method, MethodHeadW) || 909 + !wcsicmp(method, MethodPropFindW)) 927 910 { 928 911 This->verb = BINDVERB_CUSTOM; 929 912 SysReAllocString(&This->custom, method); ··· 940 923 else 941 924 hr = CreateUri(url, 0, 0, &uri); 942 925 if(FAILED(hr)) { 943 - WARN("Could not create IUri object: %08x\n", hr); 926 + WARN("Could not create IUri object, hr %#lx.\n", hr); 944 927 return hr; 945 928 } 946 929 ··· 979 962 uri = full_uri; 980 963 } 981 964 else 982 - WARN("failed to create modified uri, 0x%08x\n", hr); 965 + WARN("failed to create modified uri, hr %#lx.\n", hr); 983 966 IUriBuilder_Release(builder); 984 967 } 985 968 else 986 - WARN("IUriBuilder creation failed, 0x%08x\n", hr); 969 + WARN("IUriBuilder creation failed, hr %#lx.\n", hr); 987 970 } 988 971 989 972 This->uri = uri; ··· 1008 991 /* replace existing header value if already added */ 1009 992 LIST_FOR_EACH_ENTRY(entry, &This->reqheaders, struct httpheader, entry) 1010 993 { 1011 - if (lstrcmpW(entry->header, header) == 0) 994 + if (wcscmp(entry->header, header) == 0) 1012 995 { 1013 996 LONG length = SysStringLen(entry->value); 1014 997 HRESULT hr; ··· 1022 1005 } 1023 1006 } 1024 1007 1025 - entry = heap_alloc(sizeof(*entry)); 1008 + entry = malloc(sizeof(*entry)); 1026 1009 if (!entry) return E_OUTOFMEMORY; 1027 1010 1028 1011 /* new header */ ··· 1064 1047 1065 1048 LIST_FOR_EACH_ENTRY(entry, &This->respheaders, struct httpheader, entry) 1066 1049 { 1067 - if (!strcmpiW(entry->header, header)) 1050 + if (!wcsicmp(entry->header, header)) 1068 1051 { 1069 1052 *value = SysAllocString(entry->value); 1070 1053 TRACE("header value %s\n", debugstr_w(*value)); ··· 1127 1110 return S_OK; 1128 1111 } 1129 1112 1113 + enum response_encoding 1114 + { 1115 + RESPONSE_ENCODING_NONE, 1116 + RESPONSE_ENCODING_UCS4BE, 1117 + RESPONSE_ENCODING_UCS4LE, 1118 + RESPONSE_ENCODING_UCS4_2143, 1119 + RESPONSE_ENCODING_UCS4_3412, 1120 + RESPONSE_ENCODING_EBCDIC, 1121 + RESPONSE_ENCODING_UTF8, 1122 + RESPONSE_ENCODING_UTF16LE, 1123 + RESPONSE_ENCODING_UTF16BE, 1124 + }; 1125 + 1126 + static unsigned int detect_response_encoding(const BYTE *in, unsigned int len) 1127 + { 1128 + if (len >= 4) 1129 + { 1130 + if (in[0] == 0 && in[1] == 0 && in[2] == 0 && in[3] == 0x3c) 1131 + return RESPONSE_ENCODING_UCS4BE; 1132 + if (in[0] == 0x3c && in[1] == 0 && in[2] == 0 && in[3] == 0) 1133 + return RESPONSE_ENCODING_UCS4LE; 1134 + if (in[0] == 0 && in[1] == 0 && in[2] == 0x3c && in[3] == 0) 1135 + return RESPONSE_ENCODING_UCS4_2143; 1136 + if (in[0] == 0 && in[1] == 0x3c && in[2] == 0 && in[3] == 0) 1137 + return RESPONSE_ENCODING_UCS4_3412; 1138 + if (in[0] == 0x4c && in[1] == 0x6f && in[2] == 0xa7 && in[3] == 0x94) 1139 + return RESPONSE_ENCODING_EBCDIC; 1140 + if (in[0] == 0x3c && in[1] == 0x3f && in[2] == 0x78 && in[3] == 0x6d) 1141 + return RESPONSE_ENCODING_UTF8; 1142 + if (in[0] == 0x3c && in[1] == 0 && in[2] == 0x3f && in[3] == 0) 1143 + return RESPONSE_ENCODING_UTF16LE; 1144 + if (in[0] == 0 && in[1] == 0x3c && in[2] == 0 && in[3] == 0x3f) 1145 + return RESPONSE_ENCODING_UTF16BE; 1146 + } 1147 + 1148 + if (len >= 3) 1149 + { 1150 + if (in[0] == 0xef && in[1] == 0xbb && in[2] == 0xbf) 1151 + return RESPONSE_ENCODING_UTF8; 1152 + } 1153 + 1154 + if (len >= 2) 1155 + { 1156 + if (in[0] == 0xfe && in[1] == 0xff) 1157 + return RESPONSE_ENCODING_UTF16BE; 1158 + if (in[0] == 0xff && in[1] == 0xfe) 1159 + return RESPONSE_ENCODING_UTF16LE; 1160 + } 1161 + 1162 + return RESPONSE_ENCODING_NONE; 1163 + } 1164 + 1130 1165 static HRESULT httprequest_get_responseText(httprequest *This, BSTR *body) 1131 1166 { 1132 1167 HGLOBAL hglobal; ··· 1138 1173 hr = GetHGlobalFromStream(This->bsc->stream, &hglobal); 1139 1174 if (hr == S_OK) 1140 1175 { 1141 - xmlChar *ptr = GlobalLock(hglobal); 1176 + const char *ptr = GlobalLock(hglobal); 1142 1177 DWORD size = GlobalSize(hglobal); 1143 - xmlCharEncoding encoding = XML_CHAR_ENCODING_UTF8; 1178 + unsigned int encoding = RESPONSE_ENCODING_NONE; 1144 1179 1145 1180 /* try to determine data encoding */ 1146 1181 if (size >= 4) 1147 1182 { 1148 - encoding = xmlDetectCharEncoding(ptr, 4); 1149 - TRACE("detected encoding: %s\n", debugstr_a(xmlGetCharEncodingName(encoding))); 1150 - if ( encoding != XML_CHAR_ENCODING_UTF8 && 1151 - encoding != XML_CHAR_ENCODING_UTF16LE && 1152 - encoding != XML_CHAR_ENCODING_NONE ) 1183 + encoding = detect_response_encoding((const BYTE *)ptr, 4); 1184 + TRACE("detected encoding: %u.\n", encoding); 1185 + 1186 + if (encoding != RESPONSE_ENCODING_UTF8 && 1187 + encoding != RESPONSE_ENCODING_UTF16LE && 1188 + encoding != RESPONSE_ENCODING_NONE ) 1153 1189 { 1154 - FIXME("unsupported encoding: %s\n", debugstr_a(xmlGetCharEncodingName(encoding))); 1190 + FIXME("unsupported response encoding: %u.\n", encoding); 1155 1191 GlobalUnlock(hglobal); 1156 1192 return E_FAIL; 1157 1193 } 1158 1194 } 1159 1195 1160 1196 /* without BOM assume UTF-8 */ 1161 - if (encoding == XML_CHAR_ENCODING_UTF8 || 1162 - encoding == XML_CHAR_ENCODING_NONE ) 1197 + if (encoding == RESPONSE_ENCODING_UTF8 || encoding == RESPONSE_ENCODING_NONE) 1163 1198 { 1164 - DWORD length = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)ptr, size, NULL, 0); 1199 + DWORD length = MultiByteToWideChar(CP_UTF8, 0, ptr, size, NULL, 0); 1165 1200 1166 1201 *body = SysAllocStringLen(NULL, length); 1167 1202 if (*body) 1168 - MultiByteToWideChar( CP_UTF8, 0, (LPCSTR)ptr, size, *body, length); 1203 + MultiByteToWideChar( CP_UTF8, 0, ptr, size, *body, length); 1169 1204 } 1170 1205 else 1171 1206 *body = SysAllocStringByteLen((LPCSTR)ptr, size); ··· 1186 1221 if (!body) return E_INVALIDARG; 1187 1222 if (This->state != READYSTATE_COMPLETE) return E_FAIL; 1188 1223 1189 - hr = DOMDocument_create(MSXML_DEFAULT, (void**)&doc); 1224 + hr = dom_document_create(MSXML_DEFAULT, (void**)&doc); 1190 1225 if (hr != S_OK) return hr; 1191 1226 1192 1227 hr = httprequest_get_responseText(This, &str); ··· 1353 1388 1354 1389 static ULONG WINAPI XMLHTTPRequest_AddRef(IXMLHTTPRequest *iface) 1355 1390 { 1356 - httprequest *This = impl_from_IXMLHTTPRequest( iface ); 1357 - ULONG ref = InterlockedIncrement( &This->ref ); 1358 - TRACE("(%p)->(%u)\n", This, ref ); 1391 + httprequest *request = impl_from_IXMLHTTPRequest(iface); 1392 + ULONG ref = InterlockedIncrement(&request->ref); 1393 + TRACE("%p, refcount %lu.\n", iface, ref); 1359 1394 return ref; 1360 1395 } 1361 1396 1362 1397 static ULONG WINAPI XMLHTTPRequest_Release(IXMLHTTPRequest *iface) 1363 1398 { 1364 - httprequest *This = impl_from_IXMLHTTPRequest( iface ); 1365 - ULONG ref = InterlockedDecrement( &This->ref ); 1399 + httprequest *request = impl_from_IXMLHTTPRequest(iface); 1400 + ULONG ref = InterlockedDecrement(&request->ref); 1366 1401 1367 - TRACE("(%p)->(%u)\n", This, ref ); 1402 + TRACE("%p, refcount %lu.\n", iface, ref); 1368 1403 1369 - if ( ref == 0 ) 1404 + if (!ref) 1370 1405 { 1371 - httprequest_release( This ); 1372 - heap_free( This ); 1406 + httprequest_release(request); 1407 + free(request); 1373 1408 } 1374 1409 1375 1410 return ref; ··· 1377 1412 1378 1413 static HRESULT WINAPI XMLHTTPRequest_GetTypeInfoCount(IXMLHTTPRequest *iface, UINT *pctinfo) 1379 1414 { 1380 - httprequest *This = impl_from_IXMLHTTPRequest( iface ); 1381 - 1382 - TRACE("(%p)->(%p)\n", This, pctinfo); 1415 + TRACE("%p, %p.\n", iface, pctinfo); 1383 1416 1384 1417 *pctinfo = 1; 1385 1418 ··· 1389 1422 static HRESULT WINAPI XMLHTTPRequest_GetTypeInfo(IXMLHTTPRequest *iface, UINT iTInfo, 1390 1423 LCID lcid, ITypeInfo **ppTInfo) 1391 1424 { 1392 - httprequest *This = impl_from_IXMLHTTPRequest( iface ); 1393 - 1394 - TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); 1425 + TRACE("%p, %u, %lx,%p.\n", iface, iTInfo, lcid, ppTInfo); 1395 1426 1396 1427 return get_typeinfo(IXMLHTTPRequest_tid, ppTInfo); 1397 1428 } ··· 1399 1430 static HRESULT WINAPI XMLHTTPRequest_GetIDsOfNames(IXMLHTTPRequest *iface, REFIID riid, 1400 1431 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) 1401 1432 { 1402 - httprequest *This = impl_from_IXMLHTTPRequest( iface ); 1403 1433 ITypeInfo *typeinfo; 1404 1434 HRESULT hr; 1405 1435 1406 - TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, 1436 + TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, 1407 1437 lcid, rgDispId); 1408 1438 1409 1439 if(!rgszNames || cNames == 0 || !rgDispId) ··· 1423 1453 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, 1424 1454 EXCEPINFO *pExcepInfo, UINT *puArgErr) 1425 1455 { 1426 - httprequest *This = impl_from_IXMLHTTPRequest( iface ); 1427 1456 ITypeInfo *typeinfo; 1428 1457 HRESULT hr; 1429 1458 1430 - TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), 1459 + TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid), 1431 1460 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 1432 1461 1433 1462 hr = get_typeinfo(IXMLHTTPRequest_tid, &typeinfo); 1434 1463 if(SUCCEEDED(hr)) 1435 1464 { 1436 - hr = ITypeInfo_Invoke(typeinfo, &This->IXMLHTTPRequest_iface, dispIdMember, wFlags, 1437 - pDispParams, pVarResult, pExcepInfo, puArgErr); 1465 + hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 1438 1466 ITypeInfo_Release(typeinfo); 1439 1467 } 1440 1468 ··· 1598 1626 return IUnknown_QueryInterface( This->site, iid, ppvSite ); 1599 1627 } 1600 1628 1601 - static void get_base_uri(httprequest *This) 1629 + IUri *get_base_uri(IUnknown *site) 1602 1630 { 1603 1631 IServiceProvider *provider; 1604 1632 IHTMLDocument2 *doc; ··· 1606 1634 BSTR url; 1607 1635 HRESULT hr; 1608 1636 1609 - hr = IUnknown_QueryInterface(This->site, &IID_IServiceProvider, (void**)&provider); 1637 + hr = IUnknown_QueryInterface(site, &IID_IServiceProvider, (void**)&provider); 1610 1638 if(FAILED(hr)) 1611 - return; 1639 + return NULL; 1612 1640 1613 1641 hr = IServiceProvider_QueryService(provider, &SID_SContainerDispatch, &IID_IHTMLDocument2, (void**)&doc); 1614 1642 if(FAILED(hr)) 1615 1643 hr = IServiceProvider_QueryService(provider, &SID_SInternetHostSecurityManager, &IID_IHTMLDocument2, (void**)&doc); 1616 1644 IServiceProvider_Release(provider); 1617 1645 if(FAILED(hr)) 1618 - return; 1646 + return NULL; 1619 1647 1620 1648 hr = IHTMLDocument2_get_URL(doc, &url); 1621 1649 IHTMLDocument2_Release(doc); 1622 1650 if(FAILED(hr) || !url || !*url) 1623 - return; 1651 + return NULL; 1624 1652 1625 1653 TRACE("host url %s\n", debugstr_w(url)); 1626 1654 1627 1655 hr = CreateUri(url, 0, 0, &uri); 1628 1656 SysFreeString(url); 1629 1657 if(FAILED(hr)) 1630 - return; 1658 + return NULL; 1631 1659 1632 - This->base_uri = uri; 1660 + return uri; 1633 1661 } 1634 1662 1635 1663 static HRESULT WINAPI httprequest_ObjectWithSite_SetSite( IObjectWithSite *iface, IUnknown *punk ) ··· 1648 1676 if (punk) 1649 1677 { 1650 1678 IUnknown_AddRef( punk ); 1651 - get_base_uri(This); 1679 + This->base_uri = get_base_uri(This->site); 1652 1680 } 1653 1681 1654 1682 return S_OK; ··· 1700 1728 static HRESULT WINAPI httprequest_Safety_SetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, 1701 1729 DWORD mask, DWORD enabled) 1702 1730 { 1703 - httprequest *This = impl_from_IObjectSafety(iface); 1704 - TRACE("(%p)->(%s %x %x)\n", This, debugstr_guid(riid), mask, enabled); 1731 + httprequest *request = impl_from_IObjectSafety(iface); 1732 + 1733 + TRACE("%p, %s, %lx, %lx.\n", iface, debugstr_guid(riid), mask, enabled); 1705 1734 1706 1735 if ((mask & ~safety_supported_options)) 1707 1736 return E_FAIL; 1708 1737 1709 - This->safeopt = (This->safeopt & ~mask) | (mask & enabled); 1738 + request->safeopt = (request->safeopt & ~mask) | (mask & enabled); 1710 1739 1711 1740 return S_OK; 1712 1741 } ··· 1786 1815 1787 1816 static ULONG WINAPI ServerXMLHTTPRequest_AddRef(IServerXMLHTTPRequest *iface) 1788 1817 { 1789 - serverhttp *This = impl_from_IServerXMLHTTPRequest( iface ); 1790 - ULONG ref = InterlockedIncrement( &This->req.ref ); 1791 - TRACE("(%p)->(%u)\n", This, ref ); 1818 + serverhttp *request = impl_from_IServerXMLHTTPRequest(iface); 1819 + ULONG ref = InterlockedIncrement(&request->req.ref); 1820 + TRACE("%p, refcount %lu.\n", iface, ref ); 1792 1821 return ref; 1793 1822 } 1794 1823 1795 1824 static ULONG WINAPI ServerXMLHTTPRequest_Release(IServerXMLHTTPRequest *iface) 1796 1825 { 1797 - serverhttp *This = impl_from_IServerXMLHTTPRequest( iface ); 1798 - ULONG ref = InterlockedDecrement( &This->req.ref ); 1826 + serverhttp *request = impl_from_IServerXMLHTTPRequest(iface); 1827 + ULONG ref = InterlockedDecrement(&request->req.ref); 1799 1828 1800 - TRACE("(%p)->(%u)\n", This, ref ); 1829 + TRACE("%p, refcount %lu.\n", iface, ref ); 1801 1830 1802 - if ( ref == 0 ) 1831 + if (!ref) 1803 1832 { 1804 - httprequest_release( &This->req ); 1805 - heap_free( This ); 1833 + httprequest_release(&request->req); 1834 + free(request); 1806 1835 } 1807 1836 1808 1837 return ref; ··· 1821 1850 static HRESULT WINAPI ServerXMLHTTPRequest_GetTypeInfo(IServerXMLHTTPRequest *iface, UINT iTInfo, 1822 1851 LCID lcid, ITypeInfo **ppTInfo) 1823 1852 { 1824 - serverhttp *This = impl_from_IServerXMLHTTPRequest( iface ); 1825 - 1826 - TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); 1853 + TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo); 1827 1854 1828 1855 return get_typeinfo(IServerXMLHTTPRequest_tid, ppTInfo); 1829 1856 } ··· 1831 1858 static HRESULT WINAPI ServerXMLHTTPRequest_GetIDsOfNames(IServerXMLHTTPRequest *iface, REFIID riid, 1832 1859 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) 1833 1860 { 1834 - serverhttp *This = impl_from_IServerXMLHTTPRequest( iface ); 1835 1861 ITypeInfo *typeinfo; 1836 1862 HRESULT hr; 1837 1863 1838 - TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, 1864 + TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, 1839 1865 lcid, rgDispId); 1840 1866 1841 1867 if(!rgszNames || cNames == 0 || !rgDispId) ··· 1855 1881 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, 1856 1882 EXCEPINFO *pExcepInfo, UINT *puArgErr) 1857 1883 { 1858 - serverhttp *This = impl_from_IServerXMLHTTPRequest( iface ); 1859 1884 ITypeInfo *typeinfo; 1860 1885 HRESULT hr; 1861 1886 1862 - TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), 1887 + TRACE("%p, %ld, %s %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid), 1863 1888 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 1864 1889 1865 1890 hr = get_typeinfo(IServerXMLHTTPRequest_tid, &typeinfo); 1866 1891 if(SUCCEEDED(hr)) 1867 1892 { 1868 - hr = ITypeInfo_Invoke(typeinfo, &This->IServerXMLHTTPRequest_iface, dispIdMember, wFlags, 1869 - pDispParams, pVarResult, pExcepInfo, puArgErr); 1893 + hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 1870 1894 ITypeInfo_Release(typeinfo); 1871 1895 } 1872 1896 ··· 1976 2000 static HRESULT WINAPI ServerXMLHTTPRequest_setTimeouts(IServerXMLHTTPRequest *iface, LONG resolveTimeout, LONG connectTimeout, 1977 2001 LONG sendTimeout, LONG receiveTimeout) 1978 2002 { 1979 - serverhttp *This = impl_from_IServerXMLHTTPRequest( iface ); 1980 - FIXME("(%p)->(%d %d %d %d): stub\n", This, resolveTimeout, connectTimeout, sendTimeout, receiveTimeout); 2003 + FIXME("%p, %ld, %ld, %ld, %ld: stub\n", iface, resolveTimeout, connectTimeout, sendTimeout, receiveTimeout); 1981 2004 return S_OK; 1982 2005 } 1983 2006 ··· 2068 2091 2069 2092 TRACE("(%p)\n", obj); 2070 2093 2071 - req = heap_alloc( sizeof (*req) ); 2094 + req = malloc(sizeof(*req)); 2072 2095 if( !req ) 2073 2096 return E_OUTOFMEMORY; 2074 2097 ··· 2086 2109 2087 2110 TRACE("(%p)\n", obj); 2088 2111 2089 - req = heap_alloc( sizeof (*req) ); 2112 + req = malloc(sizeof(*req)); 2090 2113 if( !req ) 2091 2114 return E_OUTOFMEMORY; 2092 2115 ··· 2099 2122 2100 2123 return S_OK; 2101 2124 } 2102 - 2103 - #else 2104 - 2105 - HRESULT XMLHTTPRequest_create(void **ppObj) 2106 - { 2107 - MESSAGE("This program tried to use a XMLHTTPRequest object, but\n" 2108 - "libxml2 support was not present at compile time.\n"); 2109 - return E_NOTIMPL; 2110 - } 2111 - 2112 - HRESULT ServerXMLHTTP_create(void **obj) 2113 - { 2114 - MESSAGE("This program tried to use a ServerXMLHTTP object, but\n" 2115 - "libxml2 support was not present at compile time.\n"); 2116 - return E_NOTIMPL; 2117 - } 2118 - 2119 - #endif
+70 -138
dll/win32/msxml3/main.c
··· 19 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 20 20 */ 21 21 22 - #include "config.h" 23 - #include "wine/port.h" 24 - 25 22 #define COBJMACROS 26 23 27 24 #include <stdarg.h> 28 - #ifdef HAVE_LIBXML2 29 - # include <libxml/parser.h> 30 - # include <libxml/xmlerror.h> 31 - # ifdef SONAME_LIBXSLT 32 - # ifdef HAVE_LIBXSLT_PATTERN_H 33 - # include <libxslt/pattern.h> 34 - # endif 35 - # ifdef HAVE_LIBXSLT_TRANSFORM_H 36 - # include <libxslt/transform.h> 37 - # endif 38 - # include <libxslt/imports.h> 39 - # include <libxslt/xsltutils.h> 40 - # include <libxslt/variables.h> 41 - # include <libxslt/xsltInternals.h> 42 - # include <libxslt/documents.h> 43 - # include <libxslt/extensions.h> 44 - # include <libxslt/extra.h> 45 - # endif 46 - #endif 25 + #include <libxml/parser.h> 26 + #include <libxml/xmlerror.h> 27 + #include <libxml/xmlsave.h> 28 + #include <libxslt/pattern.h> 29 + #include <libxslt/transform.h> 30 + #include <libxslt/imports.h> 31 + #include <libxslt/xsltutils.h> 32 + #include <libxslt/variables.h> 33 + #include <libxslt/xsltInternals.h> 34 + #include <libxslt/documents.h> 35 + #include <libxslt/extensions.h> 36 + #include <libxslt/extra.h> 47 37 48 38 #include "windef.h" 49 39 #include "winbase.h" ··· 51 41 #include "ole2.h" 52 42 #include "rpcproxy.h" 53 43 #include "msxml.h" 44 + #include "msxml2.h" 54 45 #include "msxml6.h" 55 46 56 - #include "wine/unicode.h" 57 47 #include "wine/debug.h" 58 - #include "wine/library.h" 59 48 60 49 #include "msxml_private.h" 61 50 62 51 HINSTANCE MSXML_hInstance = NULL; 63 - 64 - #ifdef HAVE_LIBXML2 65 52 66 53 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 67 54 ··· 91 78 wine_dbg_log(dbcl, &__wine_dbch_msxml, caller, "%s", buff); 92 79 } 93 80 94 - void wineXmlCallbackError(char const* caller, xmlErrorPtr err) 81 + void wineXmlCallbackError(char const* caller, const xmlError* err) 95 82 { 96 83 enum __wine_debug_class dbcl; 97 84 ··· 156 143 return -1; 157 144 } 158 145 159 - TRACE("Read %d\n", dwBytesRead); 146 + TRACE("Read %ld bytes.\n", dwBytesRead); 160 147 161 148 return dwBytesRead; 162 149 } ··· 166 153 return CloseHandle(context) ? 0 : -1; 167 154 } 168 155 169 - void* libxslt_handle = NULL; 170 - #ifdef SONAME_LIBXSLT 171 - # define DECL_FUNCPTR(f) typeof(f) * p##f = NULL 172 - DECL_FUNCPTR(xsltApplyStylesheet); 173 - DECL_FUNCPTR(xsltApplyStylesheetUser); 174 - DECL_FUNCPTR(xsltCleanupGlobals); 175 - DECL_FUNCPTR(xsltFreeStylesheet); 176 - DECL_FUNCPTR(xsltFreeTransformContext); 177 - DECL_FUNCPTR(xsltFunctionNodeSet); 178 - DECL_FUNCPTR(xsltNewTransformContext); 179 - DECL_FUNCPTR(xsltNextImport); 180 - DECL_FUNCPTR(xsltParseStylesheetDoc); 181 - DECL_FUNCPTR(xsltQuoteUserParams); 182 - DECL_FUNCPTR(xsltRegisterExtModuleFunction); 183 - DECL_FUNCPTR(xsltSaveResultTo); 184 - DECL_FUNCPTR(xsltSetLoaderFunc); 185 - # undef DECL_FUNCPTR 186 - #endif 187 - 188 156 static void init_libxslt(void) 189 157 { 190 - #ifdef SONAME_LIBXSLT 191 - void (*pxsltInit)(void); /* Missing in libxslt <= 1.1.14 */ 192 - 193 - libxslt_handle = wine_dlopen(SONAME_LIBXSLT, RTLD_NOW, NULL, 0); 194 - if (!libxslt_handle) 195 - return; 196 - 197 - #define LOAD_FUNCPTR(f, needed) \ 198 - if ((p##f = wine_dlsym(libxslt_handle, #f, NULL, 0)) == NULL) \ 199 - if (needed) { WARN("Can't find symbol %s\n", #f); goto sym_not_found; } 200 - LOAD_FUNCPTR(xsltInit, 0); 201 - LOAD_FUNCPTR(xsltApplyStylesheet, 1); 202 - LOAD_FUNCPTR(xsltApplyStylesheetUser, 1); 203 - LOAD_FUNCPTR(xsltCleanupGlobals, 1); 204 - LOAD_FUNCPTR(xsltFreeStylesheet, 1); 205 - LOAD_FUNCPTR(xsltFreeTransformContext, 1); 206 - LOAD_FUNCPTR(xsltFunctionNodeSet, 1); 207 - LOAD_FUNCPTR(xsltNewTransformContext, 1); 208 - LOAD_FUNCPTR(xsltNextImport, 1); 209 - LOAD_FUNCPTR(xsltParseStylesheetDoc, 1); 210 - LOAD_FUNCPTR(xsltQuoteUserParams, 1); 211 - LOAD_FUNCPTR(xsltRegisterExtModuleFunction, 1); 212 - LOAD_FUNCPTR(xsltSaveResultTo, 1); 213 - LOAD_FUNCPTR(xsltSetLoaderFunc, 1); 214 - #undef LOAD_FUNCPTR 215 - 216 - if (pxsltInit) 217 - pxsltInit(); 218 - 219 - pxsltSetLoaderFunc(xslt_doc_default_loader); 220 - pxsltRegisterExtModuleFunction( 158 + xsltInit(); 159 + xsltSetLoaderFunc(xslt_doc_default_loader); 160 + xsltRegisterExtModuleFunction( 221 161 (const xmlChar *)"node-set", 222 162 (const xmlChar *)"urn:schemas-microsoft-com:xslt", 223 - pxsltFunctionNodeSet); 224 - 225 - return; 226 - 227 - sym_not_found: 228 - wine_dlclose(libxslt_handle, NULL, 0); 229 - libxslt_handle = NULL; 230 - #endif 163 + xsltFunctionNodeSet); 231 164 } 232 165 233 166 static int to_utf8(int cp, unsigned char *out, int *outlen, const unsigned char *in, int *inlen) 234 167 { 235 168 WCHAR *tmp; 236 - int len; 169 + int len = 0; 237 170 238 - if (!in || !inlen) return 0; 171 + if (!in || !inlen || !*inlen) goto done; 239 172 240 173 len = MultiByteToWideChar(cp, 0, (const char *)in, *inlen, NULL, 0); 241 - tmp = heap_alloc(len * sizeof(WCHAR)); 174 + tmp = malloc(len * sizeof(WCHAR)); 242 175 if (!tmp) return -1; 243 176 MultiByteToWideChar(cp, 0, (const char *)in, *inlen, tmp, len); 244 177 245 178 len = WideCharToMultiByte(CP_UTF8, 0, tmp, len, (char *)out, *outlen, NULL, NULL); 246 - heap_free(tmp); 179 + free(tmp); 247 180 if (!len) return -1; 248 - 181 + done: 249 182 *outlen = len; 250 183 return len; 251 184 } ··· 253 186 static int from_utf8(int cp, unsigned char *out, int *outlen, const unsigned char *in, int *inlen) 254 187 { 255 188 WCHAR *tmp; 256 - int len; 189 + int len = 0; 257 190 258 - if (!in || !inlen) return 0; 191 + if (!in || !inlen || !*inlen) goto done; 259 192 260 193 len = MultiByteToWideChar(CP_UTF8, 0, (const char *)in, *inlen, NULL, 0); 261 - tmp = heap_alloc(len * sizeof(WCHAR)); 194 + tmp = malloc(len * sizeof(WCHAR)); 262 195 if (!tmp) return -1; 263 196 MultiByteToWideChar(CP_UTF8, 0, (const char *)in, *inlen, tmp, len); 264 197 265 198 len = WideCharToMultiByte(cp, 0, tmp, len, (char *)out, *outlen, NULL, NULL); 266 - heap_free(tmp); 199 + free(tmp); 267 200 if (!len) return -1; 268 - 201 + done: 269 202 *outlen = len; 270 203 return len; 204 + } 205 + 206 + static int gbk_to_utf8(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) 207 + { 208 + return to_utf8(936, out, outlen, in, inlen); 209 + } 210 + 211 + static int utf8_to_gbk(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) 212 + { 213 + return from_utf8(936, out, outlen, in, inlen); 214 + } 215 + 216 + static int iso8859_1_to_utf8(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) 217 + { 218 + return to_utf8(28591, out, outlen, in, inlen); 219 + } 220 + 221 + static int utf8_to_iso8859_1(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) 222 + { 223 + return from_utf8(28591, out, outlen, in, inlen); 271 224 } 272 225 273 226 static int win1250_to_utf8(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) ··· 368 321 xmlCharEncodingOutputFunc output; 369 322 } encoder[] = 370 323 { 371 - { "windows-1250", win1250_to_utf8, utf8_to_win1250 }, 372 - { "windows-1251", win1251_to_utf8, utf8_to_win1251 }, 373 - { "windows-1252", win1252_to_utf8, utf8_to_win1252 }, 374 - { "windows-1253", win1253_to_utf8, utf8_to_win1253 }, 375 - { "windows-1254", win1254_to_utf8, utf8_to_win1254 }, 376 - { "windows-1255", win1255_to_utf8, utf8_to_win1255 }, 377 - { "windows-1256", win1256_to_utf8, utf8_to_win1256 }, 378 - { "windows-1257", win1257_to_utf8, utf8_to_win1257 }, 379 - { "windows-1258", win1258_to_utf8, utf8_to_win1258 } 324 + { "gbk", gbk_to_utf8, utf8_to_gbk }, 325 + { "iso8859-1", iso8859_1_to_utf8, utf8_to_iso8859_1 }, 326 + { "windows-1250", win1250_to_utf8, utf8_to_win1250 }, 327 + { "windows-1251", win1251_to_utf8, utf8_to_win1251 }, 328 + { "windows-1252", win1252_to_utf8, utf8_to_win1252 }, 329 + { "windows-1253", win1253_to_utf8, utf8_to_win1253 }, 330 + { "windows-1254", win1254_to_utf8, utf8_to_win1254 }, 331 + { "windows-1255", win1255_to_utf8, utf8_to_win1255 }, 332 + { "windows-1256", win1256_to_utf8, utf8_to_win1256 }, 333 + { "windows-1257", win1257_to_utf8, utf8_to_win1257 }, 334 + { "windows-1258", win1258_to_utf8, utf8_to_win1258 } 380 335 }; 381 336 int i; 382 337 ··· 390 345 } 391 346 } 392 347 393 - #endif /* HAVE_LIBXML2 */ 394 - 395 - 396 - HRESULT WINAPI DllCanUnloadNow(void) 348 + const CLSID* DOMDocument_version(MSXML_VERSION v) 397 349 { 398 - return S_FALSE; 350 + switch (v) 351 + { 352 + default: 353 + case MSXML_DEFAULT: return &CLSID_DOMDocument; 354 + case MSXML3: return &CLSID_DOMDocument30; 355 + case MSXML4: return &CLSID_DOMDocument40; 356 + case MSXML6: return &CLSID_DOMDocument60; 357 + } 399 358 } 400 - 401 359 402 360 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID reserved) 403 361 { ··· 406 364 switch(fdwReason) 407 365 { 408 366 case DLL_PROCESS_ATTACH: 409 - #ifdef HAVE_LIBXML2 410 367 xmlInitParser(); 411 368 412 369 /* Set the default indent character to a single tab, ··· 423 380 424 381 schemasInit(); 425 382 init_libxslt(); 426 - #endif 427 383 DisableThreadLibraryCalls(hInstDLL); 428 384 break; 429 385 case DLL_PROCESS_DETACH: 430 386 if (reserved) break; 431 - #ifdef HAVE_LIBXML2 432 - #ifdef SONAME_LIBXSLT 433 - if (libxslt_handle) 434 - { 435 - pxsltCleanupGlobals(); 436 - wine_dlclose(libxslt_handle, NULL, 0); 437 - } 438 - #endif 387 + xsltCleanupGlobals(); 439 388 /* Restore default Callbacks */ 440 389 xmlCleanupInputCallbacks(); 441 390 xmlRegisterDefaultInputCallbacks(); 442 391 443 392 xmlCleanupParser(); 444 393 schemasCleanup(); 445 - #endif 446 394 release_typelib(); 447 395 break; 448 396 } 449 397 return TRUE; 450 398 } 451 - 452 - /*********************************************************************** 453 - * DllRegisterServer (MSXML3.@) 454 - */ 455 - HRESULT WINAPI DllRegisterServer(void) 456 - { 457 - return __wine_register_resources( MSXML_hInstance ); 458 - } 459 - 460 - /*********************************************************************** 461 - * DllUnregisterServer (MSXML3.@) 462 - */ 463 - HRESULT WINAPI DllUnregisterServer(void) 464 - { 465 - return __wine_unregister_resources( MSXML_hInstance ); 466 - }
+1 -1
dll/win32/msxml3/msxml3.manifest
··· 1 1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 2 2 <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 3 - <assemblyIdentity type="win32" name="Microsoft-Windows-MSXML30" version="6.0.6000.16386" processorArchitecture="*" publicKeyToken="31bf3856ad364e35"/> 3 + <assemblyIdentity type="win32" name="Microsoft-Windows-MSXML30" version="6.0.6000.16386" processorArchitecture="" publicKeyToken="31bf3856ad364e35"/> 4 4 <file name="msxml3.dll"/> 5 5 </assembly>
+156
dll/win32/msxml3/msxml_dispex.h
··· 1 + /* 2 + * Copyright 2005 Mike McCormack 3 + * 4 + * This library is free software; you can redistribute it and/or 5 + * modify it under the terms of the GNU Lesser General Public 6 + * License as published by the Free Software Foundation; either 7 + * version 2.1 of the License, or (at your option) any later version. 8 + * 9 + * This library is distributed in the hope that it will be useful, 10 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 + * Lesser General Public License for more details. 13 + * 14 + * You should have received a copy of the GNU Lesser General Public 15 + * License along with this library; if not, write to the Free Software 16 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 17 + */ 18 + 19 + #ifndef __MSXML_DISPEX__ 20 + #define __MSXML_DISPEX__ 21 + 22 + #include "dispex.h" 23 + 24 + #include "wine/list.h" 25 + 26 + typedef enum 27 + { 28 + MSXML_DEFAULT = 0, 29 + MSXML2 = 20, 30 + MSXML26 = 26, 31 + MSXML3 = 30, 32 + MSXML4 = 40, 33 + MSXML6 = 60 34 + } MSXML_VERSION; 35 + 36 + typedef enum tid_t 37 + { 38 + NULL_tid, 39 + IXMLDOMAttribute_tid, 40 + IXMLDOMCDATASection_tid, 41 + IXMLDOMComment_tid, 42 + IXMLDOMDocument_tid, 43 + IXMLDOMDocument2_tid, 44 + IXMLDOMDocument3_tid, 45 + IXMLDOMDocumentFragment_tid, 46 + IXMLDOMDocumentType_tid, 47 + IXMLDOMElement_tid, 48 + IXMLDOMEntityReference_tid, 49 + IXMLDOMImplementation_tid, 50 + IXMLDOMNamedNodeMap_tid, 51 + IXMLDOMNode_tid, 52 + IXMLDOMNodeList_tid, 53 + IXMLDOMParseError2_tid, 54 + IXMLDOMProcessingInstruction_tid, 55 + IXMLDOMSchemaCollection_tid, 56 + IXMLDOMSchemaCollection2_tid, 57 + IXMLDOMSelection_tid, 58 + IXMLDOMText_tid, 59 + IXMLElement_tid, 60 + IXMLDocument_tid, 61 + IXMLHTTPRequest_tid, 62 + IXSLProcessor_tid, 63 + IXSLTemplate_tid, 64 + IVBSAXAttributes_tid, 65 + IVBSAXContentHandler_tid, 66 + IVBSAXDeclHandler_tid, 67 + IVBSAXDTDHandler_tid, 68 + IVBSAXEntityResolver_tid, 69 + IVBSAXErrorHandler_tid, 70 + IVBSAXLexicalHandler_tid, 71 + IVBSAXLocator_tid, 72 + IVBSAXXMLFilter_tid, 73 + IVBSAXXMLReader_tid, 74 + IMXAttributes_tid, 75 + IMXReaderControl_tid, 76 + IMXWriter_tid, 77 + IVBMXNamespaceManager_tid, 78 + IServerXMLHTTPRequest_tid, 79 + LAST_tid 80 + } tid_t; 81 + 82 + extern HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo); 83 + extern void release_typelib(void); 84 + 85 + typedef struct dispex_data_t dispex_data_t; 86 + 87 + typedef struct 88 + { 89 + HRESULT (*get_dispid)(IUnknown*,BSTR,DWORD,DISPID*); 90 + HRESULT (*invoke)(IUnknown*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*); 91 + } dispex_static_data_vtbl_t; 92 + 93 + typedef struct 94 + { 95 + const dispex_static_data_vtbl_t *vtbl; 96 + const tid_t disp_tid; 97 + dispex_data_t *data; 98 + const tid_t* const iface_tids; 99 + } dispex_static_data_t; 100 + 101 + typedef struct 102 + { 103 + IDispatchEx IDispatchEx_iface; 104 + 105 + IUnknown *outer; 106 + 107 + dispex_static_data_t *data; 108 + } DispatchEx; 109 + 110 + void init_dispex(DispatchEx*,IUnknown*,dispex_static_data_t*); 111 + void release_dispex(DispatchEx*); 112 + BOOL dispex_query_interface(DispatchEx*,REFIID,void**); 113 + const IID *get_riid_from_tid(enum tid_t tid); 114 + 115 + static inline HRESULT return_bstr(const WCHAR *value, BSTR *p) 116 + { 117 + if (!p) 118 + return E_INVALIDARG; 119 + 120 + if (value) 121 + { 122 + *p = SysAllocString(value); 123 + if (!*p) 124 + return E_OUTOFMEMORY; 125 + } 126 + else 127 + *p = NULL; 128 + 129 + return S_OK; 130 + } 131 + 132 + static inline HRESULT return_bstrn(const WCHAR *value, int len, BSTR *p) 133 + { 134 + if (value) 135 + { 136 + *p = SysAllocStringLen(value, len); 137 + if (!*p) 138 + return E_OUTOFMEMORY; 139 + } 140 + else 141 + *p = NULL; 142 + 143 + return S_OK; 144 + } 145 + 146 + extern HRESULT dom_document_create(MSXML_VERSION class_version, void **document); 147 + 148 + typedef struct bsc_t bsc_t; 149 + 150 + HRESULT create_moniker_from_url(LPCWSTR, IMoniker**); 151 + HRESULT create_uri(IUri *base, const WCHAR *, IUri **); 152 + HRESULT bind_url(IMoniker*, HRESULT (*onDataAvailable)(void*,char*,DWORD), void*, bsc_t**); 153 + HRESULT detach_bsc(bsc_t*); 154 + IUri *get_base_uri(IUnknown *site); 155 + 156 + #endif /* __MSXML_DISPEX__ */
+111 -294
dll/win32/msxml3/msxml_private.h
··· 23 23 24 24 #include "dispex.h" 25 25 26 - #include "wine/unicode.h" 27 - #include "wine/heap.h" 28 26 #include "wine/list.h" 29 - 30 - #ifndef __WINE_CONFIG_H 31 - # error You must include config.h to use this header 27 + #ifdef __REACTOS__ 28 + #include "wine/unicode.h" 32 29 #endif 33 30 34 - typedef enum { 35 - MSXML_DEFAULT = 0, 36 - MSXML2 = 20, 37 - MSXML26 = 26, 38 - MSXML3 = 30, 39 - MSXML4 = 40, 40 - MSXML6 = 60 41 - } MSXML_VERSION; 31 + #include "msxml_dispex.h" 42 32 43 - /* typelibs */ 44 - typedef enum tid_t { 45 - NULL_tid, 46 - IXMLDOMAttribute_tid, 47 - IXMLDOMCDATASection_tid, 48 - IXMLDOMComment_tid, 49 - IXMLDOMDocument_tid, 50 - IXMLDOMDocument2_tid, 51 - IXMLDOMDocument3_tid, 52 - IXMLDOMDocumentFragment_tid, 53 - IXMLDOMDocumentType_tid, 54 - IXMLDOMElement_tid, 55 - IXMLDOMEntityReference_tid, 56 - IXMLDOMImplementation_tid, 57 - IXMLDOMNamedNodeMap_tid, 58 - IXMLDOMNode_tid, 59 - IXMLDOMNodeList_tid, 60 - IXMLDOMParseError2_tid, 61 - IXMLDOMProcessingInstruction_tid, 62 - IXMLDOMSchemaCollection_tid, 63 - IXMLDOMSchemaCollection2_tid, 64 - IXMLDOMSelection_tid, 65 - IXMLDOMText_tid, 66 - IXMLElement_tid, 67 - IXMLDocument_tid, 68 - IXMLHTTPRequest_tid, 69 - IXSLProcessor_tid, 70 - IXSLTemplate_tid, 71 - IVBSAXAttributes_tid, 72 - IVBSAXContentHandler_tid, 73 - IVBSAXDeclHandler_tid, 74 - IVBSAXDTDHandler_tid, 75 - IVBSAXEntityResolver_tid, 76 - IVBSAXErrorHandler_tid, 77 - IVBSAXLexicalHandler_tid, 78 - IVBSAXLocator_tid, 79 - IVBSAXXMLFilter_tid, 80 - IVBSAXXMLReader_tid, 81 - IMXAttributes_tid, 82 - IMXReaderControl_tid, 83 - IMXWriter_tid, 84 - IVBMXNamespaceManager_tid, 85 - IServerXMLHTTPRequest_tid, 86 - LAST_tid 87 - } tid_t; 33 + extern const CLSID * DOMDocument_version(MSXML_VERSION v); 34 + 88 35 89 36 /* The XDR datatypes (urn:schemas-microsoft-com:datatypes) 90 37 * These are actually valid for XSD schemas as well ··· 131 78 LAST_DT 132 79 } XDR_DT; 133 80 134 - extern HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo) DECLSPEC_HIDDEN; 135 - extern void release_typelib(void) DECLSPEC_HIDDEN; 136 - 137 - typedef struct dispex_data_t dispex_data_t; 138 - 139 - typedef struct { 140 - HRESULT (*get_dispid)(IUnknown*,BSTR,DWORD,DISPID*); 141 - HRESULT (*invoke)(IUnknown*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*); 142 - } dispex_static_data_vtbl_t; 143 - 144 - typedef struct { 145 - const dispex_static_data_vtbl_t *vtbl; 146 - const tid_t disp_tid; 147 - dispex_data_t *data; 148 - const tid_t* const iface_tids; 149 - } dispex_static_data_t; 150 - 151 - typedef struct { 152 - IDispatchEx IDispatchEx_iface; 153 - 154 - IUnknown *outer; 155 - 156 - dispex_static_data_t *data; 157 - } DispatchEx; 158 - 159 - extern HINSTANCE MSXML_hInstance DECLSPEC_HIDDEN; 160 - 161 - void init_dispex(DispatchEx*,IUnknown*,dispex_static_data_t*) DECLSPEC_HIDDEN; 162 - void release_dispex(DispatchEx*) DECLSPEC_HIDDEN; 163 - BOOL dispex_query_interface(DispatchEx*,REFIID,void**) DECLSPEC_HIDDEN; 164 - const IID *get_riid_from_tid(enum tid_t tid) DECLSPEC_HIDDEN; 165 - 166 - /* memory allocation functions */ 167 - 168 - static inline void* __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t size) 169 - { 170 - return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, size); 171 - } 172 - 173 - static inline LPWSTR heap_strdupW(LPCWSTR str) 174 - { 175 - LPWSTR ret = NULL; 176 - 177 - if(str) { 178 - DWORD size; 179 - 180 - size = (strlenW(str)+1)*sizeof(WCHAR); 181 - ret = heap_alloc(size); 182 - if(ret) 183 - memcpy(ret, str, size); 184 - } 185 - 186 - return ret; 187 - } 81 + extern HINSTANCE MSXML_hInstance; 188 82 189 83 /* XSLProcessor parameter list */ 190 84 struct xslprocessor_par ··· 200 94 unsigned int count; 201 95 }; 202 96 203 - #ifdef HAVE_LIBXML2 204 - 205 - extern void schemasInit(void) DECLSPEC_HIDDEN; 206 - extern void schemasCleanup(void) DECLSPEC_HIDDEN; 207 - 208 - #ifndef HAVE_XMLFIRSTELEMENTCHILD 209 - static inline xmlNodePtr wine_xmlFirstElementChild(xmlNodePtr parent) 210 - { 211 - xmlNodePtr child; 212 - for (child = parent->children; child != NULL; child = child->next) 213 - if (child->type == XML_ELEMENT_NODE) 214 - break; 215 - 216 - return child; 217 - } 218 - #define xmlFirstElementChild wine_xmlFirstElementChild 219 - #endif 97 + extern void schemasInit(void); 98 + extern void schemasCleanup(void); 220 99 221 100 /* IXMLDOMNode Internal Structure */ 222 101 typedef struct _xmlnode ··· 248 127 }; 249 128 250 129 /* constructors */ 251 - extern IUnknown *create_domdoc( xmlNodePtr ) DECLSPEC_HIDDEN; 252 - extern IUnknown *create_xmldoc( void ) DECLSPEC_HIDDEN; 253 - extern IXMLDOMNode *create_node( xmlNodePtr ) DECLSPEC_HIDDEN; 254 - extern IUnknown *create_element( xmlNodePtr ) DECLSPEC_HIDDEN; 255 - extern IUnknown *create_attribute( xmlNodePtr, BOOL ) DECLSPEC_HIDDEN; 256 - extern IUnknown *create_text( xmlNodePtr ) DECLSPEC_HIDDEN; 257 - extern IUnknown *create_pi( xmlNodePtr ) DECLSPEC_HIDDEN; 258 - extern IUnknown *create_comment( xmlNodePtr ) DECLSPEC_HIDDEN; 259 - extern IUnknown *create_cdata( xmlNodePtr ) DECLSPEC_HIDDEN; 260 - extern IXMLDOMNodeList *create_children_nodelist( xmlNodePtr ) DECLSPEC_HIDDEN; 261 - extern IXMLDOMNamedNodeMap *create_nodemap( xmlNodePtr, const struct nodemap_funcs* ) DECLSPEC_HIDDEN; 262 - extern IUnknown *create_doc_Implementation(void) DECLSPEC_HIDDEN; 263 - extern IUnknown *create_doc_fragment( xmlNodePtr ) DECLSPEC_HIDDEN; 264 - extern IUnknown *create_doc_entity_ref( xmlNodePtr ) DECLSPEC_HIDDEN; 265 - extern IUnknown *create_doc_type( xmlNodePtr ) DECLSPEC_HIDDEN; 266 - extern HRESULT create_selection( xmlNodePtr, xmlChar*, IXMLDOMNodeList** ) DECLSPEC_HIDDEN; 267 - extern HRESULT create_enumvariant( IUnknown*, BOOL, const struct enumvariant_funcs*, IEnumVARIANT**) DECLSPEC_HIDDEN; 130 + extern IUnknown *create_domdoc( xmlNodePtr ); 131 + extern IUnknown *create_xmldoc( void ); 132 + extern IXMLDOMNode *create_node( xmlNodePtr ); 133 + extern IUnknown *create_element( xmlNodePtr ); 134 + extern IUnknown *create_attribute( xmlNodePtr, BOOL ); 135 + extern IUnknown *create_text( xmlNodePtr ); 136 + extern IUnknown *create_pi( xmlNodePtr ); 137 + extern IUnknown *create_comment( xmlNodePtr ); 138 + extern IUnknown *create_cdata( xmlNodePtr ); 139 + extern IXMLDOMNodeList *create_children_nodelist( xmlNodePtr ); 140 + extern IXMLDOMNamedNodeMap *create_nodemap( xmlNodePtr, const struct nodemap_funcs* ); 141 + extern IUnknown *create_doc_fragment( xmlNodePtr ); 142 + extern IUnknown *create_doc_entity_ref( xmlNodePtr ); 143 + extern IUnknown *create_doc_type( xmlNodePtr ); 144 + extern HRESULT create_selection( xmlNodePtr, xmlChar*, IXMLDOMNodeList** ); 145 + extern HRESULT create_enumvariant( IUnknown*, BOOL, const struct enumvariant_funcs*, IEnumVARIANT**); 146 + extern HRESULT create_dom_implementation(IXMLDOMImplementation **obj); 268 147 269 148 /* data accessors */ 270 - xmlNodePtr xmlNodePtr_from_domnode( IXMLDOMNode *iface, xmlElementType type ) DECLSPEC_HIDDEN; 149 + xmlNodePtr xmlNodePtr_from_domnode( IXMLDOMNode *iface, xmlElementType type ); 271 150 272 151 /* helpers */ 273 - extern xmlChar *xmlChar_from_wchar( LPCWSTR str ) DECLSPEC_HIDDEN; 152 + extern xmlChar *xmlChar_from_wchar( LPCWSTR str ); 274 153 275 - extern void xmldoc_init( xmlDocPtr doc, MSXML_VERSION version ) DECLSPEC_HIDDEN; 276 - extern LONG xmldoc_add_ref( xmlDocPtr doc ) DECLSPEC_HIDDEN; 277 - extern LONG xmldoc_release( xmlDocPtr doc ) DECLSPEC_HIDDEN; 278 - extern LONG xmldoc_add_refs( xmlDocPtr doc, LONG refs ) DECLSPEC_HIDDEN; 279 - extern LONG xmldoc_release_refs ( xmlDocPtr doc, LONG refs ) DECLSPEC_HIDDEN; 280 - extern void xmlnode_add_ref(xmlNodePtr node) DECLSPEC_HIDDEN; 281 - extern void xmlnode_release(xmlNodePtr node) DECLSPEC_HIDDEN; 282 - extern int xmlnode_get_inst_cnt( xmlnode *node ) DECLSPEC_HIDDEN; 283 - extern HRESULT xmldoc_add_orphan( xmlDocPtr doc, xmlNodePtr node ) DECLSPEC_HIDDEN; 284 - extern HRESULT xmldoc_remove_orphan( xmlDocPtr doc, xmlNodePtr node ) DECLSPEC_HIDDEN; 285 - extern void xmldoc_link_xmldecl(xmlDocPtr doc, xmlNodePtr node) DECLSPEC_HIDDEN; 286 - extern xmlNodePtr xmldoc_unlink_xmldecl(xmlDocPtr doc) DECLSPEC_HIDDEN; 287 - extern MSXML_VERSION xmldoc_version( xmlDocPtr doc ) DECLSPEC_HIDDEN; 154 + extern void xmldoc_init( xmlDocPtr doc, MSXML_VERSION version ); 155 + extern LONG xmldoc_add_ref( xmlDocPtr doc ); 156 + extern LONG xmldoc_release( xmlDocPtr doc ); 157 + extern LONG xmldoc_add_refs( xmlDocPtr doc, LONG refs ); 158 + extern LONG xmldoc_release_refs ( xmlDocPtr doc, LONG refs ); 159 + extern void xmlnode_add_ref(xmlNodePtr node); 160 + extern void xmlnode_release(xmlNodePtr node); 161 + extern int xmlnode_get_inst_cnt( xmlnode *node ); 162 + extern HRESULT xmldoc_add_orphan( xmlDocPtr doc, xmlNodePtr node ); 163 + extern HRESULT xmldoc_remove_orphan( xmlDocPtr doc, xmlNodePtr node ); 164 + extern void xmldoc_link_xmldecl(xmlDocPtr doc, xmlNodePtr node); 165 + extern xmlNodePtr xmldoc_unlink_xmldecl(xmlDocPtr doc); 166 + extern MSXML_VERSION xmldoc_version( xmlDocPtr doc ); 288 167 289 - extern HRESULT XMLElement_create( xmlNodePtr node, LPVOID *ppObj, BOOL own ) DECLSPEC_HIDDEN; 168 + extern HRESULT XMLElement_create( xmlNodePtr node, LPVOID *ppObj, BOOL own ); 290 169 291 - extern void wineXmlCallbackLog(char const* caller, xmlErrorLevel lvl, char const* msg, va_list ap) DECLSPEC_HIDDEN; 292 - extern void wineXmlCallbackError(char const* caller, xmlErrorPtr err) DECLSPEC_HIDDEN; 170 + extern void wineXmlCallbackLog(char const* caller, xmlErrorLevel lvl, char const* msg, va_list ap); 171 + extern void wineXmlCallbackError(char const* caller, const xmlError* err); 293 172 294 - #define LIBXML2_LOG_CALLBACK __WINE_PRINTF_ATTR(2,3) 173 + #define LIBXML2_LOG_CALLBACK WINAPIV __WINE_PRINTF_ATTR(2,3) 295 174 296 175 #define LIBXML2_CALLBACK_TRACE(caller, msg, ap) \ 297 176 wineXmlCallbackLog(#caller, XML_ERR_NONE, msg, ap) ··· 304 183 305 184 #define LIBXML2_CALLBACK_SERROR(caller, err) wineXmlCallbackError(#caller, err) 306 185 307 - extern BOOL is_preserving_whitespace(xmlNodePtr node) DECLSPEC_HIDDEN; 308 - extern BOOL is_xpathmode(const xmlDocPtr doc) DECLSPEC_HIDDEN; 309 - extern void set_xpathmode(xmlDocPtr doc, BOOL xpath) DECLSPEC_HIDDEN; 186 + extern BOOL is_preserving_whitespace(xmlNodePtr node); 187 + extern BOOL is_xpathmode(const xmlDocPtr doc); 188 + extern void set_xpathmode(xmlDocPtr doc, BOOL xpath); 310 189 311 - extern void init_xmlnode(xmlnode*,xmlNodePtr,IXMLDOMNode*,dispex_static_data_t*) DECLSPEC_HIDDEN; 312 - extern void destroy_xmlnode(xmlnode*) DECLSPEC_HIDDEN; 313 - extern BOOL node_query_interface(xmlnode*,REFIID,void**) DECLSPEC_HIDDEN; 314 - extern xmlnode *get_node_obj(IXMLDOMNode*) DECLSPEC_HIDDEN; 190 + extern void init_xmlnode(xmlnode*,xmlNodePtr,IXMLDOMNode*,dispex_static_data_t*); 191 + extern void destroy_xmlnode(xmlnode*); 192 + extern BOOL node_query_interface(xmlnode*,REFIID,void**); 193 + extern xmlnode *get_node_obj(IXMLDOMNode*); 315 194 316 - extern HRESULT node_append_child(xmlnode*,IXMLDOMNode*,IXMLDOMNode**) DECLSPEC_HIDDEN; 317 - extern HRESULT node_get_nodeName(xmlnode*,BSTR*) DECLSPEC_HIDDEN; 318 - extern HRESULT node_get_content(xmlnode*,VARIANT*) DECLSPEC_HIDDEN; 319 - extern HRESULT node_set_content(xmlnode*,LPCWSTR) DECLSPEC_HIDDEN; 320 - extern HRESULT node_put_value(xmlnode*,VARIANT*) DECLSPEC_HIDDEN; 321 - extern HRESULT node_put_value_escaped(xmlnode*,VARIANT*) DECLSPEC_HIDDEN; 322 - extern HRESULT node_get_parent(xmlnode*,IXMLDOMNode**) DECLSPEC_HIDDEN; 323 - extern HRESULT node_get_child_nodes(xmlnode*,IXMLDOMNodeList**) DECLSPEC_HIDDEN; 324 - extern HRESULT node_get_first_child(xmlnode*,IXMLDOMNode**) DECLSPEC_HIDDEN; 325 - extern HRESULT node_get_last_child(xmlnode*,IXMLDOMNode**) DECLSPEC_HIDDEN; 326 - extern HRESULT node_get_previous_sibling(xmlnode*,IXMLDOMNode**) DECLSPEC_HIDDEN; 327 - extern HRESULT node_get_next_sibling(xmlnode*,IXMLDOMNode**) DECLSPEC_HIDDEN; 328 - extern HRESULT node_insert_before(xmlnode*,IXMLDOMNode*,const VARIANT*,IXMLDOMNode**) DECLSPEC_HIDDEN; 329 - extern HRESULT node_replace_child(xmlnode*,IXMLDOMNode*,IXMLDOMNode*,IXMLDOMNode**) DECLSPEC_HIDDEN; 330 - extern HRESULT node_put_text(xmlnode*,BSTR) DECLSPEC_HIDDEN; 331 - extern HRESULT node_get_xml(xmlnode*,BOOL,BSTR*) DECLSPEC_HIDDEN; 332 - extern HRESULT node_clone(xmlnode*,VARIANT_BOOL,IXMLDOMNode**) DECLSPEC_HIDDEN; 333 - extern HRESULT node_get_prefix(xmlnode*,BSTR*) DECLSPEC_HIDDEN; 334 - extern HRESULT node_get_base_name(xmlnode*,BSTR*) DECLSPEC_HIDDEN; 335 - extern HRESULT node_get_namespaceURI(xmlnode*,BSTR*) DECLSPEC_HIDDEN; 336 - extern HRESULT node_remove_child(xmlnode*,IXMLDOMNode*,IXMLDOMNode**) DECLSPEC_HIDDEN; 337 - extern HRESULT node_has_childnodes(const xmlnode*,VARIANT_BOOL*) DECLSPEC_HIDDEN; 338 - extern HRESULT node_get_owner_doc(const xmlnode*,IXMLDOMDocument**) DECLSPEC_HIDDEN; 339 - extern HRESULT node_get_text(const xmlnode*,BSTR*) DECLSPEC_HIDDEN; 340 - extern HRESULT node_select_nodes(const xmlnode*,BSTR,IXMLDOMNodeList**) DECLSPEC_HIDDEN; 341 - extern HRESULT node_select_singlenode(const xmlnode*,BSTR,IXMLDOMNode**) DECLSPEC_HIDDEN; 342 - extern HRESULT node_transform_node(const xmlnode*,IXMLDOMNode*,BSTR*) DECLSPEC_HIDDEN; 195 + extern HRESULT node_append_child(xmlnode*,IXMLDOMNode*,IXMLDOMNode**); 196 + extern HRESULT node_get_nodeName(xmlnode*,BSTR*); 197 + extern HRESULT node_get_content(xmlnode*,VARIANT*); 198 + extern HRESULT node_set_content(xmlnode*,LPCWSTR); 199 + extern HRESULT node_put_value(xmlnode*,VARIANT*); 200 + extern HRESULT node_put_value_escaped(xmlnode*,VARIANT*); 201 + extern HRESULT node_get_parent(xmlnode*,IXMLDOMNode**); 202 + extern HRESULT node_get_child_nodes(xmlnode*,IXMLDOMNodeList**); 203 + extern HRESULT node_get_first_child(xmlnode*,IXMLDOMNode**); 204 + extern HRESULT node_get_last_child(xmlnode*,IXMLDOMNode**); 205 + extern HRESULT node_get_previous_sibling(xmlnode*,IXMLDOMNode**); 206 + extern HRESULT node_get_next_sibling(xmlnode*,IXMLDOMNode**); 207 + extern HRESULT node_insert_before(xmlnode*,IXMLDOMNode*,const VARIANT*,IXMLDOMNode**); 208 + extern HRESULT node_replace_child(xmlnode*,IXMLDOMNode*,IXMLDOMNode*,IXMLDOMNode**); 209 + extern HRESULT node_put_text(xmlnode*,BSTR); 210 + extern HRESULT node_get_xml(xmlnode*,BOOL,BSTR*); 211 + extern HRESULT node_clone(xmlnode*,VARIANT_BOOL,IXMLDOMNode**); 212 + extern HRESULT node_get_prefix(xmlnode*,BSTR*); 213 + extern HRESULT node_get_base_name(xmlnode*,BSTR*); 214 + extern HRESULT node_get_namespaceURI(xmlnode*,BSTR*); 215 + extern HRESULT node_remove_child(xmlnode*,IXMLDOMNode*,IXMLDOMNode**); 216 + extern HRESULT node_has_childnodes(const xmlnode*,VARIANT_BOOL*); 217 + extern HRESULT node_get_owner_doc(const xmlnode*,IXMLDOMDocument**); 218 + extern HRESULT node_get_text(const xmlnode*,BSTR*); 219 + extern HRESULT node_select_nodes(const xmlnode*,BSTR,IXMLDOMNodeList**); 220 + extern HRESULT node_select_singlenode(const xmlnode*,BSTR,IXMLDOMNode**); 221 + extern HRESULT node_transform_node(const xmlnode*,IXMLDOMNode*,BSTR*); 343 222 extern HRESULT node_transform_node_params(const xmlnode*,IXMLDOMNode*,BSTR*,ISequentialStream*, 344 - const struct xslprocessor_params*) DECLSPEC_HIDDEN; 345 - extern HRESULT node_create_supporterrorinfo(const tid_t*,void**) DECLSPEC_HIDDEN; 223 + const struct xslprocessor_params*); 224 + extern HRESULT node_create_supporterrorinfo(const tid_t*,void**); 346 225 347 - extern HRESULT get_domdoc_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document) DECLSPEC_HIDDEN; 226 + extern HRESULT get_domdoc_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document); 348 227 349 - extern HRESULT SchemaCache_validate_tree(IXMLDOMSchemaCollection2*, xmlNodePtr) DECLSPEC_HIDDEN; 350 - extern XDR_DT SchemaCache_get_node_dt(IXMLDOMSchemaCollection2*, xmlNodePtr) DECLSPEC_HIDDEN; 351 - extern HRESULT cache_from_doc_ns(IXMLDOMSchemaCollection2*, xmlnode*) DECLSPEC_HIDDEN; 228 + extern HRESULT SchemaCache_validate_tree(IXMLDOMSchemaCollection2*, xmlNodePtr); 229 + extern XDR_DT SchemaCache_get_node_dt(IXMLDOMSchemaCollection2*, xmlNodePtr); 230 + extern HRESULT cache_from_doc_ns(IXMLDOMSchemaCollection2*, xmlnode*); 352 231 353 - extern XDR_DT str_to_dt(xmlChar const* str, int len /* calculated if -1 */) DECLSPEC_HIDDEN; 354 - extern XDR_DT bstr_to_dt(OLECHAR const* bstr, int len /* calculated if -1 */) DECLSPEC_HIDDEN; 355 - extern xmlChar const* dt_to_str(XDR_DT dt) DECLSPEC_HIDDEN; 356 - extern const char* debugstr_dt(XDR_DT dt) DECLSPEC_HIDDEN; 357 - extern OLECHAR const* dt_to_bstr(XDR_DT dt) DECLSPEC_HIDDEN; 358 - extern HRESULT dt_validate(XDR_DT dt, xmlChar const* content) DECLSPEC_HIDDEN; 232 + extern XDR_DT str_to_dt(xmlChar const* str, int len /* calculated if -1 */); 233 + extern XDR_DT bstr_to_dt(OLECHAR const* bstr, int len /* calculated if -1 */); 234 + extern xmlChar const* dt_to_str(XDR_DT dt); 235 + extern const char* debugstr_dt(XDR_DT dt); 236 + extern OLECHAR const* dt_to_bstr(XDR_DT dt); 237 + extern HRESULT dt_validate(XDR_DT dt, xmlChar const* content); 359 238 360 - extern BSTR EnsureCorrectEOL(BSTR) DECLSPEC_HIDDEN; 239 + extern BSTR EnsureCorrectEOL(BSTR); 361 240 362 - extern xmlChar* tagName_to_XPath(const BSTR tagName) DECLSPEC_HIDDEN; 241 + extern xmlChar* tagName_to_XPath(const BSTR tagName); 242 + 243 + extern HRESULT dom_pi_put_xml_decl(IXMLDOMNode *node, BSTR data); 363 244 364 - #ifdef SONAME_LIBXSLT 365 - # include <libxslt/documents.h> 245 + #include <libxslt/documents.h> 366 246 extern xmlDocPtr xslt_doc_default_loader(const xmlChar *uri, xmlDictPtr dict, int options, 367 - void *_ctxt, xsltLoadType type) DECLSPEC_HIDDEN; 368 - #endif /* SONAME_LIBXSLT */ 247 + void *_ctxt, xsltLoadType type); 369 248 370 249 static inline BSTR bstr_from_xmlChar(const xmlChar *str) 371 250 { ··· 388 267 xmlChar *xmlstr; 389 268 DWORD len = WideCharToMultiByte( CP_UTF8, 0, str, nchars, NULL, 0, NULL, NULL ); 390 269 391 - xmlstr = use_xml_alloc ? xmlMalloc( len + 1 ) : heap_alloc( len + 1 ); 270 + xmlstr = use_xml_alloc ? xmlMalloc( len + 1 ) : malloc( len + 1 ); 392 271 if ( xmlstr ) 393 272 { 394 273 WideCharToMultiByte( CP_UTF8, 0, str, nchars, (LPSTR) xmlstr, len+1, NULL, NULL ); ··· 402 281 return xmlchar_from_wcharn(str, -1, FALSE); 403 282 } 404 283 405 - static inline xmlChar *heap_strdupxmlChar(const xmlChar *str) 284 + static inline xmlChar *strdupxmlChar(const xmlChar *str) 406 285 { 407 286 xmlChar *ret = NULL; 408 287 ··· 410 289 DWORD size; 411 290 412 291 size = (xmlStrlen(str)+1)*sizeof(xmlChar); 413 - ret = heap_alloc(size); 292 + ret = malloc(size); 414 293 memcpy(ret, str, size); 415 294 } 416 295 417 296 return ret; 418 297 } 419 298 420 - #endif 421 - 422 - static inline HRESULT return_bstr(const WCHAR *value, BSTR *p) 423 - { 424 - if(!p) 425 - return E_INVALIDARG; 426 - 427 - if(value) { 428 - *p = SysAllocString(value); 429 - if(!*p) 430 - return E_OUTOFMEMORY; 431 - }else { 432 - *p = NULL; 433 - } 434 - 435 - return S_OK; 436 - } 437 - 438 - static inline HRESULT return_bstrn(const WCHAR *value, int len, BSTR *p) 439 - { 440 - if(value) { 441 - *p = SysAllocStringLen(value, len); 442 - if(!*p) 443 - return E_OUTOFMEMORY; 444 - }else 445 - *p = NULL; 446 - 447 - return S_OK; 448 - } 449 - 450 299 static inline HRESULT return_null_node(IXMLDOMNode **p) 451 300 { 452 301 if(!p) ··· 491 340 } 492 341 493 342 extern IXMLDOMParseError *create_parseError( LONG code, BSTR url, BSTR reason, BSTR srcText, 494 - LONG line, LONG linepos, LONG filepos ) DECLSPEC_HIDDEN; 495 - extern HRESULT DOMDocument_create(MSXML_VERSION, void**) DECLSPEC_HIDDEN; 496 - extern HRESULT SchemaCache_create(MSXML_VERSION, void**) DECLSPEC_HIDDEN; 497 - extern HRESULT XMLDocument_create(void**) DECLSPEC_HIDDEN; 498 - extern HRESULT SAXXMLReader_create(MSXML_VERSION, void**) DECLSPEC_HIDDEN; 499 - extern HRESULT SAXAttributes_create(MSXML_VERSION, void**) DECLSPEC_HIDDEN; 500 - extern HRESULT XMLHTTPRequest_create(void **) DECLSPEC_HIDDEN; 501 - extern HRESULT ServerXMLHTTP_create(void **) DECLSPEC_HIDDEN; 502 - extern HRESULT XSLTemplate_create(void**) DECLSPEC_HIDDEN; 503 - extern HRESULT MXWriter_create(MSXML_VERSION, void**) DECLSPEC_HIDDEN; 504 - extern HRESULT MXNamespaceManager_create(void**) DECLSPEC_HIDDEN; 505 - extern HRESULT XMLParser_create(void**) DECLSPEC_HIDDEN; 506 - extern HRESULT XMLView_create(void**) DECLSPEC_HIDDEN; 507 - 508 - static inline const CLSID* DOMDocument_version(MSXML_VERSION v) 509 - { 510 - switch (v) 511 - { 512 - default: 513 - case MSXML_DEFAULT: return &CLSID_DOMDocument; 514 - case MSXML3: return &CLSID_DOMDocument30; 515 - case MSXML4: return &CLSID_DOMDocument40; 516 - case MSXML6: return &CLSID_DOMDocument60; 517 - } 518 - } 519 - 520 - static inline const CLSID* SchemaCache_version(MSXML_VERSION v) 521 - { 522 - switch (v) 523 - { 524 - default: 525 - case MSXML_DEFAULT: return &CLSID_XMLSchemaCache; 526 - case MSXML3: return &CLSID_XMLSchemaCache30; 527 - case MSXML4: return &CLSID_XMLSchemaCache40; 528 - case MSXML6: return &CLSID_XMLSchemaCache60; 529 - } 530 - } 531 - 532 - typedef struct bsc_t bsc_t; 533 - 534 - HRESULT create_moniker_from_url(LPCWSTR, IMoniker**) DECLSPEC_HIDDEN; 535 - HRESULT create_uri(const WCHAR *, IUri **) DECLSPEC_HIDDEN; 536 - HRESULT bind_url(IMoniker*, HRESULT (*onDataAvailable)(void*,char*,DWORD), void*, bsc_t**) DECLSPEC_HIDDEN; 537 - HRESULT detach_bsc(bsc_t*) DECLSPEC_HIDDEN; 343 + LONG line, LONG linepos, LONG filepos ); 344 + extern HRESULT SchemaCache_create(MSXML_VERSION, void**); 345 + extern HRESULT XMLDocument_create(void**); 346 + extern HRESULT SAXXMLReader_create(MSXML_VERSION, void**); 347 + extern HRESULT SAXAttributes_create(MSXML_VERSION, void**); 348 + extern HRESULT XMLHTTPRequest_create(void **); 349 + extern HRESULT ServerXMLHTTP_create(void **); 350 + extern HRESULT XSLTemplate_create(void**); 351 + extern HRESULT MXWriter_create(MSXML_VERSION, void**); 352 + extern HRESULT MXNamespaceManager_create(void**); 353 + extern HRESULT XMLParser_create(void**); 354 + extern HRESULT XMLView_create(void**); 538 355 539 356 /* Error Codes - not defined anywhere in the public headers */ 540 357 #define E_XML_ELEMENT_UNDECLARED 0xC00CE00D
+28 -35
dll/win32/msxml3/mxnamespace.c
··· 20 20 21 21 #define COBJMACROS 22 22 23 - #include "config.h" 24 - 25 23 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - # include <libxml/xmlerror.h> 29 - # include <libxml/encoding.h> 30 - #endif 31 24 32 25 #include "windef.h" 33 26 #include "winbase.h" ··· 35 28 #include "ole2.h" 36 29 #include "msxml6.h" 37 30 38 - #include "msxml_private.h" 31 + #include "msxml_dispex.h" 39 32 40 33 #include "wine/debug.h" 41 34 ··· 94 87 if (ctxt->count == ctxt->max_alloc) 95 88 { 96 89 ctxt->max_alloc *= 2; 97 - ctxt->ns = heap_realloc(ctxt->ns, ctxt->max_alloc*sizeof(*ctxt->ns)); 90 + ctxt->ns = realloc(ctxt->ns, ctxt->max_alloc * sizeof(*ctxt->ns)); 98 91 } 99 92 100 93 if (!prefix) prefix = emptyW; 101 94 102 95 ns = NULL; 103 96 for (i = 0; i < ctxt->count; i++) 104 - if (!strcmpW(ctxt->ns[i].prefix, prefix)) 97 + if (!wcscmp(ctxt->ns[i].prefix, prefix)) 105 98 { 106 99 ns = &ctxt->ns[i]; 107 100 break; ··· 150 143 { 151 144 int i; 152 145 for (i = 0; i < ctxt->count; i++) 153 - if (!strcmpW(ctxt->ns[i].uri, uri)) 146 + if (!wcscmp(ctxt->ns[i].uri, uri)) 154 147 { 155 148 *prefix = ctxt->ns[i].prefix; 156 149 return S_OK; ··· 166 159 int i; 167 160 168 161 for (i = 0; i < ctxt->count; i++) 169 - if (!strcmpW(ctxt->ns[i].prefix, prefix)) 162 + if (!wcscmp(ctxt->ns[i].prefix, prefix)) 170 163 { 171 164 *uri = ctxt->ns[i].uri; 172 165 return S_OK; ··· 180 173 { 181 174 struct nscontext *ctxt; 182 175 183 - ctxt = heap_alloc(sizeof(*ctxt)); 176 + ctxt = malloc(sizeof(*ctxt)); 184 177 if (!ctxt) return NULL; 185 178 186 179 ctxt->count = 0; 187 180 ctxt->max_alloc = DEFAULT_PREFIX_ALLOC_COUNT; 188 - ctxt->ns = heap_alloc(ctxt->max_alloc*sizeof(*ctxt->ns)); 181 + ctxt->ns = malloc(ctxt->max_alloc * sizeof(*ctxt->ns)); 189 182 if (!ctxt->ns) 190 183 { 191 - heap_free(ctxt); 184 + free(ctxt); 192 185 return NULL; 193 186 } 194 187 ··· 198 191 ctxt->count++; 199 192 if (!ctxt->ns[0].prefix || !ctxt->ns[0].uri) 200 193 { 201 - heap_free(ctxt->ns); 202 - heap_free(ctxt); 194 + free(ctxt->ns); 195 + free(ctxt); 203 196 return NULL; 204 197 } 205 198 ··· 216 209 SysFreeString(ctxt->ns[i].uri); 217 210 } 218 211 219 - heap_free(ctxt->ns); 220 - heap_free(ctxt); 212 + free(ctxt->ns); 213 + free(ctxt); 221 214 } 222 215 223 216 static HRESULT WINAPI namespacemanager_QueryInterface(IMXNamespaceManager *iface, REFIID riid, void **ppvObject) ··· 286 279 287 280 TRACE("(%p)->(%s %s)\n", This, debugstr_w(prefix), debugstr_w(namespaceURI)); 288 281 289 - if (prefix && (!strcmpW(prefix, xmlW) || !strcmpW(prefix, xmlnsW) || !namespaceURI)) 282 + if (prefix && (!wcscmp(prefix, xmlW) || !wcscmp(prefix, xmlnsW) || !namespaceURI)) 290 283 return E_INVALIDARG; 291 284 292 285 return declare_prefix(This, prefix, namespaceURI); ··· 300 293 HRESULT hr; 301 294 BSTR prfx; 302 295 303 - TRACE("(%p)->(%d %p %p)\n", This, index, prefix, prefix_len); 296 + TRACE("%p, %ld, %p, %p.\n", This, index, prefix, prefix_len); 304 297 305 298 if (!prefix_len) return E_POINTER; 306 299 ··· 311 304 if (prefix) 312 305 { 313 306 if (*prefix_len < (INT)SysStringLen(prfx)) return E_XML_BUFFERTOOSMALL; 314 - strcpyW(prefix, prfx); 307 + lstrcpyW(prefix, prfx); 315 308 } 316 309 317 310 *prefix_len = SysStringLen(prfx); ··· 322 315 static HRESULT WINAPI namespacemanager_getPrefix(IMXNamespaceManager *iface, 323 316 const WCHAR *uri, LONG index, WCHAR *prefix, int *prefix_len) 324 317 { 325 - namespacemanager *This = impl_from_IMXNamespaceManager( iface ); 318 + namespacemanager *manager = impl_from_IMXNamespaceManager(iface); 326 319 HRESULT hr; 327 320 BSTR prfx; 328 321 329 - TRACE("(%p)->(%s %d %p %p)\n", This, debugstr_w(uri), index, prefix, prefix_len); 322 + TRACE("%p, %s, %ld, %p, %p.\n", iface, debugstr_w(uri), index, prefix, prefix_len); 330 323 331 324 if (!uri || !*uri || !prefix_len) return E_INVALIDARG; 332 325 333 - hr = get_declared_prefix_uri(&This->ctxts, uri, &prfx); 326 + hr = get_declared_prefix_uri(&manager->ctxts, uri, &prfx); 334 327 if (hr == S_OK) 335 328 { 336 329 /* TODO: figure out what index argument is for */ ··· 339 332 if (prefix) 340 333 { 341 334 if (*prefix_len < (INT)SysStringLen(prfx)) return E_XML_BUFFERTOOSMALL; 342 - strcpyW(prefix, prfx); 335 + lstrcpyW(prefix, prfx); 343 336 } 344 337 345 338 *prefix_len = SysStringLen(prfx); ··· 375 368 if (uri) 376 369 { 377 370 if (*uri_len < (INT)SysStringLen(urib)) return E_XML_BUFFERTOOSMALL; 378 - strcpyW(uri, urib); 371 + lstrcpyW(uri, urib); 379 372 } 380 373 } 381 374 else ··· 436 429 437 430 static ULONG WINAPI vbnamespacemanager_AddRef(IVBMXNamespaceManager *iface) 438 431 { 439 - namespacemanager *This = impl_from_IVBMXNamespaceManager( iface ); 440 - ULONG ref = InterlockedIncrement( &This->ref ); 441 - TRACE("(%p)->(%u)\n", This, ref ); 432 + namespacemanager *manager = impl_from_IVBMXNamespaceManager(iface); 433 + ULONG ref = InterlockedIncrement(&manager->ref); 434 + TRACE("%p, refcount %lu.\n", iface, ref); 442 435 return ref; 443 436 } 444 437 ··· 447 440 namespacemanager *This = impl_from_IVBMXNamespaceManager( iface ); 448 441 ULONG ref = InterlockedDecrement( &This->ref ); 449 442 450 - TRACE("(%p)->(%u)\n", This, ref ); 443 + TRACE("%p, refcount %lu.\n", iface, ref); 451 444 452 - if ( ref == 0 ) 445 + if (!ref) 453 446 { 454 447 struct nscontext *ctxt, *ctxt2; 455 448 ··· 459 452 free_ns_context(ctxt); 460 453 } 461 454 462 - heap_free( This ); 455 + free(This); 463 456 } 464 457 465 458 return ref; ··· 649 642 650 643 TRACE("(%p)\n", obj); 651 644 652 - This = heap_alloc( sizeof (*This) ); 645 + This = malloc(sizeof(*This)); 653 646 if( !This ) 654 647 return E_OUTOFMEMORY; 655 648 ··· 662 655 ctxt = alloc_ns_context(); 663 656 if (!ctxt) 664 657 { 665 - heap_free(This); 658 + free(This); 666 659 return E_OUTOFMEMORY; 667 660 } 668 661
+82 -80
dll/win32/msxml3/mxwriter.c
··· 20 20 */ 21 21 22 22 #define COBJMACROS 23 - #include "config.h" 24 23 25 24 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - #endif 29 25 30 26 #include "windef.h" 31 27 #include "winbase.h" ··· 34 30 #include "msxml6.h" 35 31 36 32 #include "wine/debug.h" 37 - #include "wine/list.h" 38 33 39 - #include "msxml_private.h" 34 + #include "msxml_dispex.h" 40 35 41 36 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 42 37 ··· 63 58 XmlEncoding_ISO_8859_9, 64 59 XmlEncoding_UTF16, 65 60 XmlEncoding_UTF8, 61 + XmlEncoding_windows_1250, 62 + XmlEncoding_windows_1251, 63 + XmlEncoding_windows_1252, 64 + XmlEncoding_windows_1253, 65 + XmlEncoding_windows_1254, 66 + XmlEncoding_windows_1255, 67 + XmlEncoding_windows_1256, 68 + XmlEncoding_windows_1257, 69 + XmlEncoding_windows_1258, 66 70 XmlEncoding_Unknown 67 71 } xml_encoding; 68 72 ··· 84 88 static const WCHAR iso_8859_15W[] = {'i','s','o','-','8','8','5','9','-','1','5',0}; 85 89 static const WCHAR utf16W[] = {'U','T','F','-','1','6',0}; 86 90 static const WCHAR utf8W[] = {'U','T','F','-','8',0}; 91 + static const WCHAR windows_1250W[] = {'w','i','n','d','o','w','s','-','1','2','5','0',0}; 92 + static const WCHAR windows_1251W[] = {'w','i','n','d','o','w','s','-','1','2','5','1',0}; 93 + static const WCHAR windows_1252W[] = {'w','i','n','d','o','w','s','-','1','2','5','2',0}; 94 + static const WCHAR windows_1253W[] = {'w','i','n','d','o','w','s','-','1','2','5','3',0}; 95 + static const WCHAR windows_1254W[] = {'w','i','n','d','o','w','s','-','1','2','5','4',0}; 96 + static const WCHAR windows_1255W[] = {'w','i','n','d','o','w','s','-','1','2','5','5',0}; 97 + static const WCHAR windows_1256W[] = {'w','i','n','d','o','w','s','-','1','2','5','6',0}; 98 + static const WCHAR windows_1257W[] = {'w','i','n','d','o','w','s','-','1','2','5','7',0}; 99 + static const WCHAR windows_1258W[] = {'w','i','n','d','o','w','s','-','1','2','5','8',0}; 87 100 88 101 static const struct xml_encoding_data xml_encoding_map[] = { 89 102 { iso_8859_1W, XmlEncoding_ISO_8859_1, 28591 }, ··· 96 109 { iso_8859_7W, XmlEncoding_ISO_8859_7, 28597 }, 97 110 { iso_8859_9W, XmlEncoding_ISO_8859_9, 28599 }, 98 111 { utf16W, XmlEncoding_UTF16, ~0 }, 99 - { utf8W, XmlEncoding_UTF8, CP_UTF8 } 112 + { utf8W, XmlEncoding_UTF8, CP_UTF8 }, 113 + { windows_1250W,XmlEncoding_windows_1250, 1250 }, 114 + { windows_1251W,XmlEncoding_windows_1251, 1251 }, 115 + { windows_1252W,XmlEncoding_windows_1252, 1252 }, 116 + { windows_1253W,XmlEncoding_windows_1253, 1253 }, 117 + { windows_1254W,XmlEncoding_windows_1254, 1254 }, 118 + { windows_1255W,XmlEncoding_windows_1255, 1255 }, 119 + { windows_1256W,XmlEncoding_windows_1256, 1256 }, 120 + { windows_1257W,XmlEncoding_windows_1257, 1257 }, 121 + { windows_1258W,XmlEncoding_windows_1258, 1258 } 100 122 }; 101 123 102 124 typedef enum ··· 215 237 if (This->length < This->allocated) return S_OK; 216 238 217 239 This->allocated *= 2; 218 - This->attr = heap_realloc(This->attr, This->allocated*sizeof(mxattribute)); 240 + This->attr = realloc(This->attr, This->allocated * sizeof(mxattribute)); 219 241 220 242 return This->attr ? S_OK : E_OUTOFMEMORY; 221 243 } ··· 231 253 { 232 254 n = (min+max)/2; 233 255 234 - c = strcmpiW(xml_encoding_map[n].encoding, encoding); 256 + c = lstrcmpiW(xml_encoding_map[n].encoding, encoding); 235 257 if (!c) 236 258 return xml_encoding_map[n].enc; 237 259 ··· 247 269 static HRESULT init_encoded_buffer(encoded_buffer *buffer) 248 270 { 249 271 const int initial_len = 0x1000; 250 - buffer->data = heap_alloc(initial_len); 272 + buffer->data = malloc(initial_len); 251 273 if (!buffer->data) return E_OUTOFMEMORY; 252 274 253 275 memset(buffer->data, 0, 4); ··· 259 281 260 282 static void free_encoded_buffer(encoded_buffer *buffer) 261 283 { 262 - heap_free(buffer->data); 284 + free(buffer->data); 263 285 } 264 286 265 287 static HRESULT get_code_page(xml_encoding encoding, UINT *cp) ··· 306 328 { 307 329 list_remove(&cur->entry); 308 330 free_encoded_buffer(cur); 309 - heap_free(cur); 331 + free(cur); 310 332 } 311 333 } 312 334 ··· 314 336 { 315 337 output_buffer *buffer = &writer->buffer; 316 338 encoded_buffer *buff; 317 - unsigned int written; 339 + ULONG written; 318 340 int src_len; 319 341 320 342 if (!len || !*data) 321 343 return S_OK; 322 344 323 - src_len = len == -1 ? strlenW(data) : len; 345 + src_len = len == -1 ? lstrlenW(data) : len; 324 346 if (writer->dest) 325 347 { 326 348 buff = &buffer->encoded; ··· 386 408 char *mb; 387 409 388 410 /* if current chunk is larger than total buffer size, convert it at once using temporary allocated buffer */ 389 - mb = heap_alloc(length); 411 + mb = malloc(length); 390 412 if (!mb) 391 413 return E_OUTOFMEMORY; 392 414 393 415 length = WideCharToMultiByte(buffer->code_page, 0, data, src_len, mb, length, NULL, NULL); 394 416 IStream_Write(writer->dest, mb, length, &written); 395 - heap_free(mb); 417 + free(mb); 396 418 } 397 419 } 398 420 } ··· 430 452 /* alloc new block if needed and retry */ 431 453 if (src_len) 432 454 { 433 - encoded_buffer *next = heap_alloc(sizeof(*next)); 455 + encoded_buffer *next = malloc(sizeof(*next)); 434 456 HRESULT hr; 435 457 436 458 if (FAILED(hr = init_encoded_buffer(next))) { 437 - heap_free(next); 459 + free(next); 438 460 return hr; 439 461 } 440 462 ··· 461 483 { 462 484 encoded_buffer *cur, *cur2; 463 485 464 - heap_free(writer->buffer.encoded.data); 486 + free(writer->buffer.encoded.data); 465 487 466 488 LIST_FOR_EACH_ENTRY_SAFE(cur, cur2, &writer->buffer.blocks, encoded_buffer, entry) 467 489 { 468 490 list_remove(&cur->entry); 469 491 free_encoded_buffer(cur); 470 - heap_free(cur); 492 + free(cur); 471 493 } 472 494 473 495 init_encoded_buffer(&writer->buffer.encoded); ··· 499 521 500 522 /* default buffer size to something if length is unknown */ 501 523 conv_len = max(2**len, default_alloc); 502 - ptr = ret = heap_alloc(conv_len*sizeof(WCHAR)); 524 + ptr = ret = malloc(conv_len * sizeof(WCHAR)); 503 525 504 526 while (p) 505 527 { ··· 507 529 { 508 530 int written = ptr - ret; 509 531 conv_len *= 2; 510 - ptr = ret = heap_realloc(ret, conv_len*sizeof(WCHAR)); 532 + ptr = ret = realloc(ret, conv_len * sizeof(WCHAR)); 511 533 ptr += written; 512 534 } 513 535 ··· 666 688 return write_data_to_stream(This); 667 689 } 668 690 669 - /* Resets the mxwriter's output buffer by closing it, then creating a new 670 - * output buffer using the given encoding. 671 - */ 672 - static inline void reset_output_buffer(mxwriter *This) 673 - { 674 - close_output_buffer(This); 675 - } 676 - 677 691 static HRESULT writer_set_property(mxwriter *writer, mxwriter_prop property, VARIANT_BOOL value) 678 692 { 679 693 writer->props[property] = value; ··· 814 828 815 829 static ULONG WINAPI mxwriter_AddRef(IMXWriter *iface) 816 830 { 817 - mxwriter *This = impl_from_IMXWriter( iface ); 818 - LONG ref = InterlockedIncrement(&This->ref); 831 + mxwriter *writer = impl_from_IMXWriter(iface); 832 + LONG ref = InterlockedIncrement(&writer->ref); 819 833 820 - TRACE("(%p)->(%d)\n", This, ref); 834 + TRACE("%p, refcount %lu.\n", iface, ref); 821 835 822 836 return ref; 823 837 } ··· 827 841 mxwriter *This = impl_from_IMXWriter( iface ); 828 842 ULONG ref = InterlockedDecrement(&This->ref); 829 843 830 - TRACE("(%p)->(%d)\n", This, ref); 844 + TRACE("%p, refcount %lu.\n", iface, ref); 831 845 832 - if(!ref) 846 + if (!ref) 833 847 { 834 848 /* Windows flushes the buffer when the interface is destroyed. */ 835 849 flush_output_buffer(This); ··· 840 854 SysFreeString(This->encoding); 841 855 842 856 SysFreeString(This->element); 843 - heap_free(This); 857 + free(This); 844 858 } 845 859 846 860 return ref; ··· 900 914 { 901 915 if (This->dest) IStream_Release(This->dest); 902 916 This->dest = NULL; 903 - reset_output_buffer(This); 917 + close_output_buffer(This); 904 918 break; 905 919 } 906 920 case VT_UNKNOWN: ··· 911 925 if (hr == S_OK) 912 926 { 913 927 /* Recreate the output buffer to make sure it's using the correct encoding. */ 914 - reset_output_buffer(This); 928 + close_output_buffer(This); 915 929 916 930 if (This->dest) IStream_Release(This->dest); 917 931 This->dest = stream; ··· 1001 1015 This->xml_enc = enc; 1002 1016 1003 1017 TRACE("got encoding %d\n", This->xml_enc); 1004 - reset_output_buffer(This); 1018 + close_output_buffer(This); 1005 1019 return S_OK; 1006 1020 } 1007 1021 ··· 1202 1216 * be how Windows works. 1203 1217 */ 1204 1218 if (This->prop_changed) { 1205 - reset_output_buffer(This); 1219 + close_output_buffer(This); 1206 1220 This->prop_changed = FALSE; 1207 1221 } 1208 1222 ··· 1267 1281 { 1268 1282 WCHAR *escaped = get_escaped_string(value, EscapeValue, &value_len); 1269 1283 write_output_buffer_quoted(writer, escaped, value_len); 1270 - heap_free(escaped); 1284 + free(escaped); 1271 1285 } 1272 1286 else 1273 1287 write_output_buffer_quoted(writer, value, value_len); ··· 1406 1420 1407 1421 escaped = get_escaped_string(chars, EscapeText, &len); 1408 1422 write_output_buffer(This, escaped, len); 1409 - heap_free(escaped); 1423 + free(escaped); 1410 1424 } 1411 1425 } 1412 1426 ··· 2140 2154 2141 2155 TRACE("(%p)->(%p %p %p %p)\n", This, namespaceURI, localName, QName, attrs); 2142 2156 2143 - if (!namespaceURI || !localName || !QName) 2144 - return E_POINTER; 2157 + if (!namespaceURI || !*namespaceURI || !localName || !QName) 2158 + return E_INVALIDARG; 2145 2159 2146 2160 TRACE("(%s %s %s)\n", debugstr_w(*namespaceURI), debugstr_w(*localName), debugstr_w(*QName)); 2147 2161 ··· 2454 2468 static HRESULT WINAPI SAXErrorHandler_error(ISAXErrorHandler *iface, 2455 2469 ISAXLocator *locator, const WCHAR *message, HRESULT hr) 2456 2470 { 2457 - mxwriter *This = impl_from_ISAXErrorHandler( iface ); 2458 - 2459 - FIXME("(%p)->(%p %s 0x%08x)\n", This, locator, debugstr_w(message), hr); 2471 + FIXME("%p, %p, %s, %#lx.\n", iface, locator, debugstr_w(message), hr); 2460 2472 2461 2473 return E_NOTIMPL; 2462 2474 } ··· 2464 2476 static HRESULT WINAPI SAXErrorHandler_fatalError(ISAXErrorHandler *iface, 2465 2477 ISAXLocator *locator, const WCHAR *message, HRESULT hr) 2466 2478 { 2467 - mxwriter *This = impl_from_ISAXErrorHandler( iface ); 2468 - 2469 - FIXME("(%p)->(%p %s 0x%08x)\n", This, locator, debugstr_w(message), hr); 2479 + FIXME("%p, %p, %s, %#lx.\n", iface, locator, debugstr_w(message), hr); 2470 2480 2471 2481 return E_NOTIMPL; 2472 2482 } ··· 2474 2484 static HRESULT WINAPI SAXErrorHandler_ignorableWarning(ISAXErrorHandler *iface, 2475 2485 ISAXLocator *locator, const WCHAR *message, HRESULT hr) 2476 2486 { 2477 - mxwriter *This = impl_from_ISAXErrorHandler( iface ); 2478 - 2479 - FIXME("(%p)->(%p %s 0x%08x)\n", This, locator, debugstr_w(message), hr); 2487 + FIXME("%p, %p, %s, %#lx.\n", iface, locator, debugstr_w(message), hr); 2480 2488 2481 2489 return E_NOTIMPL; 2482 2490 } ··· 2538 2546 2539 2547 static HRESULT WINAPI VBSAXErrorHandler_error(IVBSAXErrorHandler *iface, IVBSAXLocator *locator, BSTR *message, LONG code) 2540 2548 { 2541 - mxwriter *This = impl_from_IVBSAXErrorHandler( iface ); 2542 - FIXME("(%p)->(%p %p %x): stub\n", This, locator, message, code); 2549 + FIXME("%p, %p, %p, %lx: stub\n", iface, locator, message, code); 2543 2550 return E_NOTIMPL; 2544 2551 } 2545 2552 2546 2553 static HRESULT WINAPI VBSAXErrorHandler_fatalError(IVBSAXErrorHandler *iface, IVBSAXLocator *locator, BSTR *message, LONG code) 2547 2554 { 2548 - mxwriter *This = impl_from_IVBSAXErrorHandler( iface ); 2549 - FIXME("(%p)->(%p %p %x): stub\n", This, locator, message, code); 2555 + FIXME("%p, %p, %p, %lx: stub\n", iface, locator, message, code); 2550 2556 return E_NOTIMPL; 2551 2557 } 2552 2558 2553 2559 static HRESULT WINAPI VBSAXErrorHandler_ignorableWarning(IVBSAXErrorHandler *iface, IVBSAXLocator *locator, BSTR *message, LONG code) 2554 2560 { 2555 - mxwriter *This = impl_from_IVBSAXErrorHandler( iface ); 2556 - FIXME("(%p)->(%p %p %x): stub\n", This, locator, message, code); 2561 + FIXME("%p, %p, %p, %lx: stub\n", iface, locator, message, code); 2557 2562 return E_NOTIMPL; 2558 2563 } 2559 2564 ··· 2590 2595 2591 2596 TRACE("(%p)\n", ppObj); 2592 2597 2593 - This = heap_alloc( sizeof (*This) ); 2598 + This = malloc(sizeof(*This)); 2594 2599 if(!This) 2595 2600 return E_OUTOFMEMORY; 2596 2601 ··· 2630 2635 if (hr != S_OK) { 2631 2636 SysFreeString(This->encoding); 2632 2637 SysFreeString(This->version); 2633 - heap_free(This); 2638 + free(This); 2634 2639 return hr; 2635 2640 } 2636 2641 ··· 2684 2689 { 2685 2690 mxattributes *This = impl_from_IMXAttributes( iface ); 2686 2691 ULONG ref = InterlockedIncrement( &This->ref ); 2687 - TRACE("(%p)->(%d)\n", This, ref ); 2692 + TRACE("%p, refcount %lu.\n", iface, ref ); 2688 2693 return ref; 2689 2694 } 2690 2695 2691 2696 static ULONG WINAPI MXAttributes_Release(IMXAttributes *iface) 2692 2697 { 2693 2698 mxattributes *This = impl_from_IMXAttributes( iface ); 2694 - LONG ref = InterlockedDecrement( &This->ref ); 2699 + ULONG ref = InterlockedDecrement( &This->ref ); 2695 2700 2696 - TRACE("(%p)->(%d)\n", This, ref); 2701 + TRACE("%p, refcount %lu.\n", iface, ref); 2697 2702 2698 - if (ref == 0) 2703 + if (!ref) 2699 2704 { 2700 2705 int i; 2701 2706 ··· 2708 2713 SysFreeString(This->attr[i].value); 2709 2714 } 2710 2715 2711 - heap_free(This->attr); 2712 - heap_free(This); 2716 + free(This->attr); 2717 + free(This); 2713 2718 } 2714 2719 2715 2720 return ref; ··· 3062 3067 for (i = 0; i < This->length; i++) 3063 3068 { 3064 3069 if (uri_len != SysStringLen(This->attr[i].uri)) continue; 3065 - if (strncmpW(uri, This->attr[i].uri, uri_len)) continue; 3070 + if (wcsncmp(uri, This->attr[i].uri, uri_len)) continue; 3066 3071 3067 3072 if (len != SysStringLen(This->attr[i].local)) continue; 3068 - if (strncmpW(name, This->attr[i].local, len)) continue; 3073 + if (wcsncmp(name, This->attr[i].local, len)) continue; 3069 3074 3070 3075 *index = i; 3071 3076 return S_OK; ··· 3090 3095 for (i = 0; i < This->length; i++) 3091 3096 { 3092 3097 if (len != SysStringLen(This->attr[i].qname)) continue; 3093 - if (strncmpW(qname, This->attr[i].qname, len)) continue; 3098 + if (wcsncmp(qname, This->attr[i].qname, len)) continue; 3094 3099 3095 3100 *index = i; 3096 3101 return S_OK; ··· 3247 3252 IVBSAXAttributes *iface, 3248 3253 UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo ) 3249 3254 { 3250 - mxattributes *This = impl_from_IVBSAXAttributes( iface ); 3251 - TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); 3255 + TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo); 3256 + 3252 3257 return get_typeinfo(IVBSAXAttributes_tid, ppTInfo); 3253 3258 } 3254 3259 ··· 3260 3265 LCID lcid, 3261 3266 DISPID* rgDispId) 3262 3267 { 3263 - mxattributes *This = impl_from_IVBSAXAttributes( iface ); 3264 3268 ITypeInfo *typeinfo; 3265 3269 HRESULT hr; 3266 3270 3267 - TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, 3271 + TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, 3268 3272 lcid, rgDispId); 3269 3273 3270 3274 if(!rgszNames || cNames == 0 || !rgDispId) ··· 3291 3295 EXCEPINFO* pExcepInfo, 3292 3296 UINT* puArgErr) 3293 3297 { 3294 - mxattributes *This = impl_from_IVBSAXAttributes( iface ); 3295 3298 ITypeInfo *typeinfo; 3296 3299 HRESULT hr; 3297 3300 3298 - TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), 3301 + TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid), 3299 3302 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 3300 3303 3301 3304 hr = get_typeinfo(IVBSAXAttributes_tid, &typeinfo); 3302 3305 if(SUCCEEDED(hr)) 3303 3306 { 3304 - hr = ITypeInfo_Invoke(typeinfo, &This->IVBSAXAttributes_iface, dispIdMember, wFlags, 3305 - pDispParams, pVarResult, pExcepInfo, puArgErr); 3307 + hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 3306 3308 ITypeInfo_Release(typeinfo); 3307 3309 } 3308 3310 ··· 3557 3559 3558 3560 TRACE("(%p)\n", ppObj); 3559 3561 3560 - This = heap_alloc( sizeof (*This) ); 3562 + This = malloc(sizeof(*This)); 3561 3563 if( !This ) 3562 3564 return E_OUTOFMEMORY; 3563 3565 ··· 3568 3570 3569 3571 This->class_version = version; 3570 3572 3571 - This->attr = heap_alloc(default_count*sizeof(mxattribute)); 3573 + This->attr = malloc(default_count * sizeof(mxattribute)); 3572 3574 This->length = 0; 3573 3575 This->allocated = default_count; 3574 3576
+78 -112
dll/win32/msxml3/node.c
··· 18 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 19 19 */ 20 20 21 - #include "config.h" 22 - 23 21 #define COBJMACROS 24 22 25 23 #include <stdarg.h> 26 24 27 - #ifdef HAVE_LIBXML2 28 - # include <libxml/parser.h> 29 - # include <libxml/parserInternals.h> 30 - # include <libxml/xmlerror.h> 31 - # include <libxml/HTMLtree.h> 32 - # ifdef SONAME_LIBXSLT 33 - # ifdef HAVE_LIBXSLT_PATTERN_H 34 - # include <libxslt/pattern.h> 35 - # endif 36 - # ifdef HAVE_LIBXSLT_TRANSFORM_H 37 - # include <libxslt/transform.h> 38 - # endif 39 - # include <libxslt/imports.h> 40 - # include <libxslt/variables.h> 41 - # include <libxslt/xsltutils.h> 42 - # include <libxslt/xsltInternals.h> 43 - # include <libxslt/documents.h> 44 - # endif 45 - #endif 25 + #include <libxml/parser.h> 26 + #include <libxml/parserInternals.h> 27 + #include <libxml/xmlerror.h> 28 + #include <libxml/HTMLtree.h> 29 + #include <libxslt/pattern.h> 30 + #include <libxslt/transform.h> 31 + #include <libxslt/imports.h> 32 + #include <libxslt/variables.h> 33 + #include <libxslt/xsltutils.h> 34 + #include <libxslt/xsltInternals.h> 35 + #include <libxslt/documents.h> 46 36 47 37 #include "windef.h" 48 38 #include "winbase.h" ··· 55 45 56 46 #include "wine/debug.h" 57 47 58 - #ifdef HAVE_LIBXML2 59 - 60 48 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 61 49 62 - #ifdef SONAME_LIBXSLT 63 - extern void* libxslt_handle; 64 - # define MAKE_FUNCPTR(f) extern typeof(f) * p##f 65 - MAKE_FUNCPTR(xsltApplyStylesheet); 66 - MAKE_FUNCPTR(xsltApplyStylesheetUser); 67 - MAKE_FUNCPTR(xsltCleanupGlobals); 68 - MAKE_FUNCPTR(xsltFreeStylesheet); 69 - MAKE_FUNCPTR(xsltFreeTransformContext); 70 - MAKE_FUNCPTR(xsltNewTransformContext); 71 - MAKE_FUNCPTR(xsltNextImport); 72 - MAKE_FUNCPTR(xsltParseStylesheetDoc); 73 - MAKE_FUNCPTR(xsltQuoteUserParams); 74 - MAKE_FUNCPTR(xsltSaveResultTo); 75 - # undef MAKE_FUNCPTR 76 - #else 77 - WINE_DECLARE_DEBUG_CHANNEL(winediag); 78 - #endif 79 - 80 50 static const IID IID_xmlnode = {0x4f2f4ba2,0xb822,0x11df,{0x8b,0x8a,0x68,0x50,0xdf,0xd7,0x20,0x85}}; 81 51 82 52 xmlNodePtr xmlNodePtr_from_domnode( IXMLDOMNode *iface, xmlElementType type ) ··· 137 107 { 138 108 SupportErrorInfo *This = impl_from_ISupportErrorInfo(iface); 139 109 ULONG ref = InterlockedIncrement(&This->ref); 140 - TRACE("(%p)->(%d)\n", This, ref ); 110 + TRACE("%p, refcount %ld.\n", iface, ref ); 141 111 return ref; 142 112 } 143 113 ··· 146 116 SupportErrorInfo *This = impl_from_ISupportErrorInfo(iface); 147 117 LONG ref = InterlockedDecrement(&This->ref); 148 118 149 - TRACE("(%p)->(%d)\n", This, ref); 119 + TRACE("%p, refcount %ld.\n", iface, ref); 150 120 151 - if (ref == 0) 152 - heap_free(This); 121 + if (!ref) 122 + free(This); 153 123 154 124 return ref; 155 125 } ··· 183 153 { 184 154 SupportErrorInfo *This; 185 155 186 - This = heap_alloc(sizeof(*This)); 156 + This = malloc(sizeof(*This)); 187 157 if (!This) return E_OUTOFMEMORY; 188 158 189 159 This->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl; ··· 216 186 hr = node_get_base_name(This, &base); 217 187 if (hr != S_OK) return hr; 218 188 189 + if (!base[0] && xmldoc_version(This->node->doc) != MSXML6) 190 + { 191 + SysFreeString(base); 192 + *name = SysAllocString(L"xmlns"); 193 + return S_OK; 194 + } 195 + 219 196 hr = node_get_prefix(This, &prefix); 220 197 if (hr == S_OK) 221 198 { ··· 224 201 225 202 /* +1 for ':' */ 226 203 ptr = *name = SysAllocStringLen(NULL, SysStringLen(base) + SysStringLen(prefix) + 1); 227 - memcpy(ptr, prefix, SysStringByteLen(prefix)); 228 - ptr += SysStringLen(prefix); 229 - memcpy(ptr++, &colW, sizeof(WCHAR)); 230 - memcpy(ptr, base, SysStringByteLen(base)); 204 + if (SysStringByteLen(prefix)) 205 + { 206 + memcpy(ptr, prefix, SysStringByteLen(prefix)); 207 + ptr += SysStringLen(prefix); 208 + } 209 + if (SysStringByteLen(base)) 210 + { 211 + if (SysStringByteLen(prefix)) 212 + memcpy(ptr++, &colW, sizeof(WCHAR)); 213 + memcpy(ptr, base, SysStringByteLen(base)); 214 + } 231 215 232 216 SysFreeString(base); 233 217 SysFreeString(prefix); ··· 264 248 return E_OUTOFMEMORY; 265 249 266 250 xmlNodeSetContent(This->node, str); 267 - heap_free(str); 251 + free(str); 268 252 return S_OK; 269 253 } 270 254 ··· 280 264 escaped = xmlEncodeSpecialChars(NULL, str); 281 265 if(!escaped) 282 266 { 283 - heap_free(str); 267 + free(str); 284 268 return E_OUTOFMEMORY; 285 269 } 286 270 287 271 xmlNodeSetContent(This->node, escaped); 288 272 289 - heap_free(str); 273 + free(str); 290 274 xmlFree(escaped); 291 275 292 276 return S_OK; ··· 432 416 } 433 417 434 418 /* _private field holds a number of COM instances spawned from this libxml2 node 435 - * most significant bits are used to store information about ignorrable whitespace nodes */ 419 + * most significant bits are used to store information about ignorable whitespace nodes */ 436 420 void xmlnode_add_ref(xmlNodePtr node) 437 421 { 438 422 if (node->type == XML_DOCUMENT_NODE) return; ··· 890 874 891 875 /* Escape the string. */ 892 876 str2 = xmlEncodeEntitiesReentrant(This->node->doc, str); 893 - heap_free(str); 877 + free(str); 894 878 895 879 xmlNodeSetContent(This->node, str2); 896 880 xmlFree(str2); ··· 988 972 return *ret ? S_OK : E_OUTOFMEMORY; 989 973 } 990 974 991 - #ifdef SONAME_LIBXSLT 992 - 993 975 /* duplicates xmlBufferWriteQuotedString() logic */ 994 976 static void xml_write_quotedstring(xmlOutputBufferPtr buf, const xmlChar *string) 995 977 { ··· 1090 1072 res = NULL; \ 1091 1073 while (st != NULL) { \ 1092 1074 if (st->name != NULL) { res = st->name; break; } \ 1093 - st = pxsltNextImport(st); \ 1075 + st = xsltNextImport(st); \ 1094 1076 }} 1095 1077 1096 1078 #undef XSLT_GET_IMPORT_INT ··· 1099 1081 res = -1; \ 1100 1082 while (st != NULL) { \ 1101 1083 if (st->name != -1) { res = st->name; break; } \ 1102 - st = pxsltNextImport(st); \ 1084 + st = xsltNextImport(st); \ 1103 1085 }} 1104 1086 1105 1087 static void transform_write_xmldecl(xmlDocPtr result, xsltStylesheetPtr style, BOOL omit_encoding, xmlOutputBufferPtr output) ··· 1266 1248 return E_OUTOFMEMORY; 1267 1249 1268 1250 hr = node_transform_write(style, result, TRUE, "UTF-16", output); 1269 - #ifdef LIBXML2_NEW_BUFFER 1270 1251 content = xmlBufContent(output->conv); 1271 1252 len = xmlBufUse(output->conv); 1272 - #else 1273 - content = xmlBufferContent(output->conv); 1274 - len = xmlBufferLength(output->conv); 1275 - #endif 1276 1253 /* UTF-16 encoder places UTF-16 bom, we don't need it for BSTR */ 1277 1254 content += sizeof(WCHAR); 1278 1255 *str = SysAllocStringLen((WCHAR*)content, len/sizeof(WCHAR) - 1); ··· 1346 1323 1347 1324 TRACE("%p\n", context); 1348 1325 1349 - heap_free(buffer->data); 1350 - heap_free(buffer); 1326 + free(buffer->data); 1327 + free(buffer); 1351 1328 return 0; 1352 1329 } 1353 1330 ··· 1357 1334 xmlParserInputBufferPtr inputbuffer; 1358 1335 struct import_buffer *buffer; 1359 1336 1360 - buffer = heap_alloc(sizeof(*buffer)); 1337 + buffer = malloc(sizeof(*buffer)); 1361 1338 1362 - buffer->data = heap_alloc(len); 1339 + buffer->data = malloc(len); 1363 1340 memcpy(buffer->data, ptr, len); 1364 1341 buffer->cur = 0; 1365 1342 buffer->len = len; 1366 1343 1367 1344 inputbuffer = xmlParserInputBufferCreateIO(import_loader_io_read, import_loader_io_close, buffer, 1368 1345 XML_CHAR_ENCODING_NONE); 1369 - *input = xmlNewIOInputStream(ctxt, inputbuffer, XML_CHAR_ENCODING_NONE); 1346 + *input = xmlNewIOInputStream(NULL, inputbuffer, XML_CHAR_ENCODING_NONE); 1370 1347 if (!*input) 1371 1348 xmlFreeParserInputBuffer(inputbuffer); 1372 1349 ··· 1387 1364 SysFreeString(uriW); 1388 1365 if (FAILED(hr)) 1389 1366 { 1390 - WARN("Failed to create href uri, %#x.\n", hr); 1367 + WARN("Failed to create href uri, %#lx.\n", hr); 1391 1368 return hr; 1392 1369 } 1393 1370 ··· 1401 1378 SysFreeString(baseuriW); 1402 1379 if (FAILED(hr)) 1403 1380 { 1404 - WARN("Failed to create base uri, %#x.\n", hr); 1381 + WARN("Failed to create base uri, %#lx.\n", hr); 1405 1382 return hr; 1406 1383 } 1407 1384 1408 1385 hr = CoInternetCombineIUri(base_uri, href_uri, 0, doc_uri, 0); 1409 1386 IUri_Release(base_uri); 1410 1387 if (FAILED(hr)) 1411 - WARN("Failed to combine uris, %#x.\n", hr); 1388 + WARN("Failed to combine uris, hr %#lx.\n", hr); 1412 1389 } 1413 1390 else 1414 1391 { ··· 1500 1477 return doc; 1501 1478 } 1502 1479 1503 - #endif /* SONAME_LIBXSLT */ 1504 - 1505 1480 HRESULT node_transform_node_params(const xmlnode *This, IXMLDOMNode *stylesheet, BSTR *p, 1506 1481 ISequentialStream *stream, const struct xslprocessor_params *params) 1507 1482 { 1508 - #ifdef SONAME_LIBXSLT 1509 1483 xsltStylesheetPtr xsltSS; 1510 1484 xmlDocPtr sheet_doc; 1511 1485 HRESULT hr = S_OK; 1512 1486 xmlnode *sheet; 1513 1487 1514 - if (!libxslt_handle) return E_NOTIMPL; 1515 - if (!stylesheet || !p) return E_INVALIDARG; 1488 + if (!stylesheet || (!p && !stream)) return E_INVALIDARG; 1516 1489 1517 - *p = NULL; 1490 + if (p) *p = NULL; 1518 1491 1519 1492 sheet = get_node_obj(stylesheet); 1520 1493 if(!sheet) return E_FAIL; 1521 1494 1522 1495 sheet_doc = xmlCopyDoc(sheet->node->doc, 1); 1523 - xsltSS = pxsltParseStylesheetDoc(sheet_doc); 1496 + xsltSS = xsltParseStylesheetDoc(sheet_doc); 1524 1497 if (xsltSS) 1525 1498 { 1526 1499 const char **xslparams = NULL; ··· 1533 1506 struct xslprocessor_par *par; 1534 1507 1535 1508 i = 0; 1536 - xslparams = heap_alloc((params->count*2 + 1)*sizeof(char*)); 1509 + xslparams = malloc((params->count * 2 + 1) * sizeof(char*)); 1537 1510 LIST_FOR_EACH_ENTRY(par, &params->list, struct xslprocessor_par, entry) 1538 1511 { 1539 1512 xslparams[i++] = (char*)xmlchar_from_wchar(par->name); ··· 1544 1517 1545 1518 if (xslparams) 1546 1519 { 1547 - xsltTransformContextPtr ctxt = pxsltNewTransformContext(xsltSS, This->node->doc); 1520 + xsltTransformContextPtr ctxt = xsltNewTransformContext(xsltSS, This->node->doc); 1548 1521 1549 1522 /* push parameters to user context */ 1550 - pxsltQuoteUserParams(ctxt, xslparams); 1551 - result = pxsltApplyStylesheetUser(xsltSS, This->node->doc, NULL, NULL, NULL, ctxt); 1552 - pxsltFreeTransformContext(ctxt); 1523 + xsltQuoteUserParams(ctxt, xslparams); 1524 + result = xsltApplyStylesheetUser(xsltSS, This->node->doc, NULL, NULL, NULL, ctxt); 1525 + xsltFreeTransformContext(ctxt); 1553 1526 1554 1527 for (i = 0; i < params->count*2; i++) 1555 - heap_free((char*)xslparams[i]); 1556 - heap_free(xslparams); 1528 + free((char*)xslparams[i]); 1529 + free(xslparams); 1557 1530 } 1558 1531 else 1559 - result = pxsltApplyStylesheet(xsltSS, This->node->doc, NULL); 1532 + result = xsltApplyStylesheet(xsltSS, This->node->doc, NULL); 1560 1533 1561 1534 if (result) 1562 1535 { ··· 1567 1540 xmlFreeDoc(result); 1568 1541 } 1569 1542 1570 - pxsltFreeStylesheet(xsltSS); 1543 + xsltFreeStylesheet(xsltSS); 1571 1544 } 1572 1545 else 1573 1546 xmlFreeDoc(sheet_doc); 1574 1547 1575 - if(!*p) *p = SysAllocStringLen(NULL, 0); 1548 + if (p && !*p) *p = SysAllocStringLen(NULL, 0); 1576 1549 1577 1550 return hr; 1578 - #else 1579 - ERR_(winediag)("libxslt headers were not found at compile time. Expect problems.\n"); 1580 - 1581 - return E_NOTIMPL; 1582 - #endif 1583 1551 } 1584 1552 1585 1553 HRESULT node_transform_node(const xmlnode *node, IXMLDOMNode *stylesheet, BSTR *p) ··· 1596 1564 1597 1565 str = xmlchar_from_wchar(query); 1598 1566 hr = create_selection(This->node, str, nodes); 1599 - heap_free(str); 1567 + free(str); 1600 1568 1601 1569 return hr; 1602 1570 } ··· 1605 1573 { 1606 1574 IXMLDOMNodeList *list; 1607 1575 HRESULT hr; 1576 + 1577 + if (node) 1578 + *node = NULL; 1608 1579 1609 1580 hr = node_select_nodes(This, query, &list); 1610 1581 if (hr == S_OK) ··· 1652 1623 { 1653 1624 if (!name) return E_INVALIDARG; 1654 1625 1655 - *name = bstr_from_xmlChar(This->node->name); 1626 + if (xmldoc_version(This->node->doc) != MSXML6 && 1627 + xmlStrEqual(This->node->name, BAD_CAST "xmlns")) 1628 + *name = SysAllocString(L""); 1629 + else 1630 + *name = bstr_from_xmlChar(This->node->name); 1656 1631 if (!*name) return E_OUTOFMEMORY; 1657 1632 1658 1633 TRACE("returning %s\n", debugstr_w(*name)); ··· 1738 1713 ref = InterlockedDecrement( &This->ref ); 1739 1714 if(!ref) { 1740 1715 destroy_xmlnode(&This->node); 1741 - heap_free(This); 1716 + free(This); 1742 1717 } 1743 1718 1744 1719 return ref; ··· 1763 1738 LCID lcid, 1764 1739 ITypeInfo** ppTInfo ) 1765 1740 { 1766 - unknode *This = unknode_from_IXMLDOMNode( iface ); 1767 - HRESULT hr; 1768 - 1769 - TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); 1770 - 1771 - hr = get_typeinfo(IXMLDOMNode_tid, ppTInfo); 1741 + TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo); 1772 1742 1773 - return hr; 1743 + return get_typeinfo(IXMLDOMNode_tid, ppTInfo); 1774 1744 } 1775 1745 1776 1746 static HRESULT WINAPI unknode_GetIDsOfNames( ··· 1781 1751 LCID lcid, 1782 1752 DISPID* rgDispId ) 1783 1753 { 1784 - unknode *This = unknode_from_IXMLDOMNode( iface ); 1785 - 1786 1754 ITypeInfo *typeinfo; 1787 1755 HRESULT hr; 1788 1756 1789 - TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, 1757 + TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, 1790 1758 lcid, rgDispId); 1791 1759 1792 1760 if(!rgszNames || cNames == 0 || !rgDispId) ··· 1813 1781 EXCEPINFO* pExcepInfo, 1814 1782 UINT* puArgErr ) 1815 1783 { 1816 - unknode *This = unknode_from_IXMLDOMNode( iface ); 1817 1784 ITypeInfo *typeinfo; 1818 1785 HRESULT hr; 1819 1786 1820 - TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), 1787 + TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid), 1821 1788 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 1822 1789 1823 1790 hr = get_typeinfo(IXMLDOMNode_tid, &typeinfo); 1824 1791 if(SUCCEEDED(hr)) 1825 1792 { 1826 - hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMNode_iface, dispIdMember, wFlags, pDispParams, 1793 + hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags, pDispParams, 1827 1794 pVarResult, pExcepInfo, puArgErr); 1828 1795 ITypeInfo_Release(typeinfo); 1829 1796 } ··· 2304 2271 2305 2272 FIXME("only creating basic node for type %d\n", node->type); 2306 2273 2307 - new_node = heap_alloc(sizeof(unknode)); 2274 + new_node = malloc(sizeof(unknode)); 2308 2275 if(!new_node) 2309 2276 return NULL; 2310 2277 ··· 2324 2291 if(FAILED(hr)) return NULL; 2325 2292 return ret; 2326 2293 } 2327 - #endif
+12 -19
dll/win32/msxml3/nodelist.c
··· 20 20 21 21 #define COBJMACROS 22 22 23 - #include "config.h" 24 - 25 23 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - # include <libxml/xmlerror.h> 29 - #endif 24 + #include <libxml/parser.h> 25 + #include <libxml/xmlerror.h> 30 26 31 27 #include "windef.h" 32 28 #include "winbase.h" ··· 47 43 * - note that an attribute node have a text child in DOM but not in the XPath data model 48 44 * thus the child is inaccessible by an XPath query 49 45 */ 50 - 51 - #ifdef HAVE_LIBXML2 52 46 53 47 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 54 48 ··· 135 129 { 136 130 xmlnodelist *This = impl_from_IXMLDOMNodeList( iface ); 137 131 ULONG ref = InterlockedIncrement( &This->ref ); 138 - TRACE("(%p)->(%d)\n", This, ref); 132 + TRACE("%p, refcount %lu.\n", iface, ref); 139 133 return ref; 140 134 } 141 135 ··· 145 139 xmlnodelist *This = impl_from_IXMLDOMNodeList( iface ); 146 140 ULONG ref = InterlockedDecrement( &This->ref ); 147 141 148 - TRACE("(%p)->(%d)\n", This, ref); 149 - if ( ref == 0 ) 142 + TRACE("%p, refcount %lu.\n", iface, ref); 143 + 144 + if (!ref) 150 145 { 151 146 xmldoc_release( This->parent->doc ); 152 147 if (This->enumvariant) IEnumVARIANT_Release(This->enumvariant); 153 - heap_free( This ); 148 + free( This ); 154 149 } 155 150 156 151 return ref; ··· 213 208 xmlNodePtr curr; 214 209 LONG nodeIndex = 0; 215 210 216 - TRACE("(%p)->(%d %p)\n", This, index, listItem); 211 + TRACE("%p, %ld, %p.\n", iface, index, listItem); 217 212 218 213 if(!listItem) 219 214 return E_INVALIDARG; ··· 323 318 WCHAR *ptr; 324 319 int idx = 0; 325 320 326 - for(ptr = name; *ptr && isdigitW(*ptr); ptr++) 321 + for(ptr = name; *ptr >= '0' && *ptr <= '9'; ptr++) 327 322 idx = idx*10 + (*ptr-'0'); 328 323 if(*ptr) 329 324 return DISP_E_UNKNOWNNAME; 330 325 331 326 *dispid = DISPID_DOM_COLLECTION_BASE + idx; 332 - TRACE("ret %x\n", *dispid); 327 + TRACE("ret %lx\n", *dispid); 333 328 return S_OK; 334 329 } 335 330 ··· 338 333 { 339 334 xmlnodelist *This = impl_from_IXMLDOMNodeList( (IXMLDOMNodeList*)iface ); 340 335 341 - TRACE("(%p)->(%x %x %x %p %p %p)\n", This, id, lcid, flags, params, res, ei); 336 + TRACE("%p, %ld, %lx, %x, %p, %p, %p.\n", iface, id, lcid, flags, params, res, ei); 342 337 343 338 if (id >= DISPID_DOM_COLLECTION_BASE && id <= DISPID_DOM_COLLECTION_MAX) 344 339 { ··· 422 417 { 423 418 xmlnodelist *This; 424 419 425 - This = heap_alloc( sizeof *This ); 420 + This = malloc(sizeof(*This)); 426 421 if ( !This ) 427 422 return NULL; 428 423 ··· 437 432 438 433 return &This->IXMLDOMNodeList_iface; 439 434 } 440 - 441 - #endif
+14 -21
dll/win32/msxml3/nodemap.c
··· 18 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 19 19 */ 20 20 21 - #include "config.h" 22 - 23 21 #define COBJMACROS 24 22 25 23 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - # include <libxml/xmlerror.h> 29 - #endif 24 + #include <libxml/parser.h> 25 + #include <libxml/xmlerror.h> 30 26 31 27 #include "windef.h" 32 28 #include "winbase.h" ··· 39 35 #include "msxml_private.h" 40 36 41 37 #include "wine/debug.h" 42 - 43 - #ifdef HAVE_LIBXML2 44 38 45 39 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 46 40 ··· 127 121 { 128 122 xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface ); 129 123 ULONG ref = InterlockedIncrement( &This->ref ); 130 - TRACE("(%p)->(%d)\n", This, ref); 124 + TRACE("%p, refcount %lu.\n", iface, ref); 131 125 return ref; 132 126 } 133 127 ··· 137 131 xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface ); 138 132 ULONG ref = InterlockedDecrement( &This->ref ); 139 133 140 - TRACE("(%p)->(%d)\n", This, ref); 141 - if ( ref == 0 ) 134 + TRACE("%p, refcount %lu.\n", iface, ref); 135 + 136 + if (!ref) 142 137 { 143 138 xmlnode_release( This->node ); 144 139 xmldoc_release( This->node->doc ); 145 140 if (This->enumvariant) IEnumVARIANT_Release(This->enumvariant); 146 - heap_free( This ); 141 + free( This ); 147 142 } 148 143 149 144 return ref; ··· 231 226 { 232 227 xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface ); 233 228 234 - TRACE("(%p)->(%d %p)\n", This, index, item); 229 + TRACE("%p, %ld, %p.\n", iface, index, item); 235 230 236 231 return This->funcs->get_item(This->node, index, item); 237 232 } ··· 279 274 { 280 275 xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface ); 281 276 282 - TRACE("(%p)->(%p: %d)\n", This, nextItem, This->iterator); 277 + TRACE("%p, %p, %ld.\n", iface, nextItem, This->iterator); 283 278 284 279 return This->funcs->next_node(This->node, &This->iterator, nextItem); 285 280 } ··· 289 284 { 290 285 xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface ); 291 286 292 - TRACE("(%p)->(%d)\n", This, This->iterator); 287 + TRACE("%p, %ld.\n", iface, This->iterator); 293 288 294 289 This->iterator = 0; 295 290 ··· 371 366 WCHAR *ptr; 372 367 int idx = 0; 373 368 374 - for(ptr = name; *ptr && isdigitW(*ptr); ptr++) 369 + for(ptr = name; *ptr >= '0' && *ptr <= '9'; ptr++) 375 370 idx = idx*10 + (*ptr-'0'); 376 371 if(*ptr) 377 372 return DISP_E_UNKNOWNNAME; 378 373 379 374 *dispid = DISPID_DOM_COLLECTION_BASE + idx; 380 - TRACE("ret %x\n", *dispid); 375 + TRACE("ret %lx\n", *dispid); 381 376 return S_OK; 382 377 } 383 378 ··· 386 381 { 387 382 xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( (IXMLDOMNamedNodeMap*)iface ); 388 383 389 - TRACE("(%p)->(%x %x %x %p %p %p)\n", This, id, lcid, flags, params, res, ei); 384 + TRACE("%p, %ld, %lx, %x, %p, %p, %p.\n", iface, id, lcid, flags, params, res, ei); 390 385 391 386 V_VT(res) = VT_DISPATCH; 392 387 V_DISPATCH(res) = NULL; ··· 437 432 { 438 433 xmlnodemap *This; 439 434 440 - This = heap_alloc( sizeof *This ); 435 + This = malloc(sizeof(*This)); 441 436 if ( !This ) 442 437 return NULL; 443 438 ··· 456 451 457 452 return &This->IXMLDOMNamedNodeMap_iface; 458 453 } 459 - 460 - #endif
+8 -17
dll/win32/msxml3/parseerror.c
··· 21 21 22 22 #define COBJMACROS 23 23 24 - #include "config.h" 25 - 26 24 #include <stdarg.h> 27 - #ifdef HAVE_LIBXML2 28 - # include <libxml/parser.h> 29 - # include <libxml/xmlerror.h> 30 - #endif 31 25 32 - #include "windef.h" 33 - #include "winbase.h" 34 - #include "winerror.h" 35 - #include "winuser.h" 36 26 #include "ole2.h" 37 27 #include "msxml6.h" 38 28 39 - #include "msxml_private.h" 29 + #include "msxml_dispex.h" 40 30 41 31 #include "wine/debug.h" 42 32 ··· 93 83 { 94 84 parse_error_t *This = impl_from_IXMLDOMParseError2( iface ); 95 85 ULONG ref = InterlockedIncrement( &This->ref ); 96 - TRACE("(%p)->(%d)\n", This, ref); 86 + TRACE("%p, refcount %lu.\n", iface, ref); 97 87 return ref; 98 88 } 99 89 ··· 103 93 parse_error_t *This = impl_from_IXMLDOMParseError2( iface ); 104 94 ULONG ref = InterlockedDecrement( &This->ref ); 105 95 106 - TRACE("(%p)->(%d)\n", This, ref); 107 - if ( ref == 0 ) 96 + TRACE("%p, refcount %lu.\n", iface, ref); 97 + 98 + if (!ref) 108 99 { 109 100 SysFreeString(This->url); 110 101 SysFreeString(This->reason); 111 102 SysFreeString(This->srcText); 112 - heap_free( This ); 103 + free(This); 113 104 } 114 105 115 106 return ref; ··· 224 215 { 225 216 parse_error_t *This = impl_from_IXMLDOMParseError2( iface ); 226 217 227 - TRACE("(%p)->(%p): stub\n", This, line); 218 + TRACE("%p, %p.\n", This, line); 228 219 229 220 if (!line) return E_INVALIDARG; 230 221 ··· 331 322 { 332 323 parse_error_t *This; 333 324 334 - This = heap_alloc( sizeof(*This) ); 325 + This = malloc(sizeof(*This)); 335 326 if ( !This ) 336 327 return NULL; 337 328
+216 -28
dll/win32/msxml3/pi.c
··· 20 20 21 21 #define COBJMACROS 22 22 23 - #include "config.h" 24 - 25 23 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - # include <libxml/xmlerror.h> 29 - #endif 24 + #include <libxml/parser.h> 25 + #include <libxml/xmlerror.h> 30 26 31 27 #include "windef.h" 32 28 #include "winbase.h" ··· 34 30 #include "ole2.h" 35 31 #include "msxml6.h" 36 32 33 + #include "xmlparser.h" 37 34 #include "msxml_private.h" 38 35 39 36 #include "wine/debug.h" 40 - 41 - #ifdef HAVE_LIBXML2 42 37 43 38 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 44 39 ··· 101 96 { 102 97 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface ); 103 98 ULONG ref = InterlockedIncrement( &This->ref ); 104 - TRACE("(%p)->(%d)\n", This, ref); 99 + TRACE("%p, refcount %lu.\n", iface, ref); 105 100 return ref; 106 101 } 107 102 ··· 111 106 dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface ); 112 107 ULONG ref = InterlockedDecrement( &This->ref ); 113 108 114 - TRACE("(%p)->(%d)\n", This, ref); 109 + TRACE("%p, refcount %lu.\n", iface, ref); 115 110 if ( ref == 0 ) 116 111 { 117 112 destroy_xmlnode(&This->node); 118 - heap_free( This ); 113 + free(This); 119 114 } 120 115 121 116 return ref; ··· 197 192 if(hr == S_OK) 198 193 { 199 194 static const WCHAR xmlW[] = {'x','m','l',0}; 200 - if(!strcmpW(target, xmlW)) 195 + if(!wcscmp(target, xmlW)) 201 196 { 202 197 SysFreeString(target); 203 198 return E_FAIL; ··· 287 282 return node_get_next_sibling(&This->node, domNode); 288 283 } 289 284 285 + static HRESULT xml_get_value(xmlChar **p, xmlChar **value) 286 + { 287 + xmlChar *v, q; 288 + int len; 289 + 290 + while (isspace(**p)) *p += 1; 291 + if (**p != '=') return XML_E_MISSINGEQUALS; 292 + *p += 1; 293 + 294 + while (isspace(**p)) *p += 1; 295 + if (**p != '"' && **p != '\'') return XML_E_MISSINGQUOTE; 296 + q = **p; 297 + *p += 1; 298 + 299 + v = *p; 300 + while (**p && **p != q) *p += 1; 301 + if (!**p) return XML_E_BADCHARINSTRING; 302 + len = *p - v; 303 + if (!len) return XML_E_MISSINGNAME; 304 + *p += 1; 305 + 306 + *value = malloc(len + 1); 307 + if (!*value) return E_OUTOFMEMORY; 308 + memcpy(*value, v, len); 309 + *(*value + len) = 0; 310 + 311 + return S_OK; 312 + } 313 + 314 + static void set_prop(xmlNodePtr node, xmlAttrPtr attr) 315 + { 316 + xmlAttrPtr prop; 317 + 318 + if (!node->properties) 319 + { 320 + node->properties = attr; 321 + return; 322 + } 323 + 324 + prop = node->properties; 325 + while (prop->next) prop = prop->next; 326 + 327 + prop->next = attr; 328 + } 329 + 330 + static HRESULT parse_xml_decl(xmlNodePtr node) 331 + { 332 + xmlChar *version, *encoding, *standalone, *p; 333 + xmlAttrPtr attr; 334 + HRESULT hr = S_OK; 335 + 336 + if (!node->content) return S_OK; 337 + 338 + version = encoding = standalone = NULL; 339 + 340 + p = node->content; 341 + 342 + while (*p) 343 + { 344 + while (isspace(*p)) p++; 345 + if (!*p) break; 346 + 347 + if (!strncmp((const char *)p, "version", 7)) 348 + { 349 + p += 7; 350 + if ((hr = xml_get_value(&p, &version)) != S_OK) goto fail; 351 + } 352 + else if (!strncmp((const char *)p, "encoding", 8)) 353 + { 354 + p += 8; 355 + if ((hr = xml_get_value(&p, &encoding)) != S_OK) goto fail; 356 + } 357 + else if (!strncmp((const char *)p, "standalone", 10)) 358 + { 359 + p += 10; 360 + if ((hr = xml_get_value(&p, &standalone)) != S_OK) goto fail; 361 + } 362 + else 363 + { 364 + FIXME("unexpected XML attribute %s\n", debugstr_a((const char *)p)); 365 + hr = XML_E_UNEXPECTED_ATTRIBUTE; 366 + goto fail; 367 + } 368 + } 369 + 370 + /* xmlSetProp/xmlSetNsProp accept only nodes of type XML_ELEMENT_NODE, 371 + * so we have to create and assign attributes to a node by hand. 372 + */ 373 + 374 + if (version) 375 + { 376 + attr = xmlSetNsProp(NULL, NULL, (const xmlChar *)"version", version); 377 + if (attr) 378 + { 379 + attr->doc = node->doc; 380 + set_prop(node, attr); 381 + } 382 + else hr = E_OUTOFMEMORY; 383 + } 384 + if (encoding) 385 + { 386 + attr = xmlSetNsProp(NULL, NULL, (const xmlChar *)"encoding", encoding); 387 + if (attr) 388 + { 389 + attr->doc = node->doc; 390 + set_prop(node, attr); 391 + } 392 + else hr = E_OUTOFMEMORY; 393 + } 394 + if (standalone) 395 + { 396 + attr = xmlSetNsProp(NULL, NULL, (const xmlChar *)"standalone", standalone); 397 + if (attr) 398 + { 399 + attr->doc = node->doc; 400 + set_prop(node, attr); 401 + } 402 + else hr = E_OUTOFMEMORY; 403 + } 404 + 405 + fail: 406 + if (hr != S_OK) 407 + { 408 + xmlFreePropList(node->properties); 409 + node->properties = NULL; 410 + } 411 + 412 + free(version); 413 + free(encoding); 414 + free(standalone); 415 + return hr; 416 + } 417 + 290 418 static HRESULT WINAPI dom_pi_get_attributes( 291 419 IXMLDOMProcessingInstruction *iface, 292 420 IXMLDOMNamedNodeMap** map) ··· 305 433 hr = node_get_nodeName(&This->node, &name); 306 434 if (hr != S_OK) return hr; 307 435 308 - if (!strcmpW(name, xmlW)) 309 - { 310 - FIXME("created dummy map for <?xml ?>\n"); 436 + if (!wcscmp(name, xmlW)) 311 437 *map = create_nodemap(This->node.node, &dom_pi_attr_map); 312 - SysFreeString(name); 313 - return S_OK; 314 - } 315 438 316 439 SysFreeString(name); 317 440 318 - return S_FALSE; 441 + return *map ? S_OK : S_FALSE; 319 442 } 320 443 321 444 static HRESULT WINAPI dom_pi_insertBefore( ··· 612 735 if(hr == S_OK) 613 736 { 614 737 static const WCHAR xmlW[] = {'x','m','l',0}; 615 - if(!strcmpW(target, xmlW)) 738 + if(!wcscmp(target, xmlW)) 616 739 { 617 740 SysFreeString(target); 618 741 return E_FAIL; ··· 622 745 } 623 746 624 747 return node_set_content(&This->node, data); 748 + } 749 + 750 + HRESULT dom_pi_put_xml_decl(IXMLDOMNode *node, BSTR data) 751 + { 752 + static const WCHAR xmlW[] = {'x','m','l',0}; 753 + xmlnode *node_obj; 754 + HRESULT hr; 755 + BSTR name; 756 + 757 + if (!data) 758 + return XML_E_XMLDECLSYNTAX; 759 + 760 + node_obj = get_node_obj(node); 761 + hr = node_set_content(node_obj, data); 762 + if (FAILED(hr)) 763 + return hr; 764 + 765 + hr = node_get_nodeName(node_obj, &name); 766 + if (FAILED(hr)) 767 + return hr; 768 + 769 + if (!lstrcmpW(name, xmlW) && !node_obj->node->properties) 770 + hr = parse_xml_decl(node_obj->node); 771 + else 772 + hr = S_OK; 773 + 774 + SysFreeString(name); 775 + return hr; 625 776 } 626 777 627 778 static const struct IXMLDOMProcessingInstructionVtbl dom_pi_vtbl = ··· 675 826 dom_pi_put_data 676 827 }; 677 828 829 + static xmlAttrPtr node_has_prop(const xmlNode *node, const xmlChar *name) 830 + { 831 + xmlAttrPtr prop; 832 + 833 + /* xmlHasNsProp accepts only nodes of type XML_ELEMENT_NODE, 834 + * so we have to look for an attribute in the node by hand. 835 + */ 836 + 837 + prop = node->properties; 838 + 839 + while (prop) 840 + { 841 + if (xmlStrEqual(prop->name, name)) 842 + return prop; 843 + 844 + prop = prop->next; 845 + } 846 + 847 + return NULL; 848 + } 849 + 678 850 static HRESULT dom_pi_get_qualified_item(const xmlNodePtr node, BSTR name, BSTR uri, 679 851 IXMLDOMNode **item) 680 852 { ··· 684 856 685 857 static HRESULT dom_pi_get_named_item(const xmlNodePtr node, BSTR name, IXMLDOMNode **item) 686 858 { 687 - FIXME("(%p)->(%s %p): stub\n", node, debugstr_w(name), item ); 688 - if (item) 859 + xmlChar *nameA; 860 + xmlAttrPtr attr; 861 + 862 + TRACE("(%p)->(%s %p)\n", node, debugstr_w(name), item); 863 + 864 + if (!item) return E_POINTER; 865 + 866 + nameA = xmlchar_from_wchar(name); 867 + if (!nameA) return E_OUTOFMEMORY; 868 + 869 + attr = node_has_prop(node, nameA); 870 + free(nameA); 871 + 872 + if (!attr) 873 + { 689 874 *item = NULL; 690 - return S_FALSE; 875 + return S_FALSE; 876 + } 877 + 878 + *item = create_node((xmlNodePtr)attr); 879 + 880 + return S_OK; 691 881 } 692 882 693 883 static HRESULT dom_pi_set_named_item(xmlNodePtr node, IXMLDOMNode *newItem, IXMLDOMNode **namedItem) ··· 710 900 711 901 static HRESULT dom_pi_get_item(const xmlNodePtr node, LONG index, IXMLDOMNode **item) 712 902 { 713 - FIXME("(%p)->(%d %p): stub\n", node, index, item); 903 + FIXME("%p, %ld, %p: stub\n", node, index, item); 714 904 return E_NOTIMPL; 715 905 } 716 906 ··· 724 914 725 915 static HRESULT dom_pi_next_node(const xmlNodePtr node, LONG *iter, IXMLDOMNode **nextNode) 726 916 { 727 - FIXME("(%p)->(%d %p): stub\n", node, *iter, nextNode); 917 + FIXME("%p, %ld, %p: stub\n", node, *iter, nextNode); 728 918 return E_NOTIMPL; 729 919 } 730 920 ··· 755 945 { 756 946 dom_pi *This; 757 947 758 - This = heap_alloc( sizeof *This ); 948 + This = malloc(sizeof(*This)); 759 949 if ( !This ) 760 950 return NULL; 761 951 ··· 766 956 767 957 return (IUnknown*)&This->IXMLDOMProcessingInstruction_iface; 768 958 } 769 - 770 - #endif
-1
dll/win32/msxml3/precomp.h
··· 12 12 #define _INC_WINDOWS 13 13 14 14 #define COBJMACROS 15 - #define NONAMELESSUNION 16 15 17 16 #include <windef.h> 18 17 #include <winbase.h>
+8
dll/win32/msxml3/reactos.c
··· 1 + 2 + #include <windef.h> 3 + #include <winbase.h> 4 + 5 + HRESULT WINAPI DllCanUnloadNow(void) 6 + { 7 + return S_FALSE; 8 + }
+56 -90
dll/win32/msxml3/saxreader.c
··· 20 20 */ 21 21 #define COBJMACROS 22 22 23 - #include "config.h" 24 - 25 23 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - # include <libxml/xmlerror.h> 29 - # include <libxml/SAX2.h> 30 - # include <libxml/parserInternals.h> 31 - #endif 24 + #include <libxml/parser.h> 25 + #include <libxml/xmlerror.h> 26 + #include <libxml/SAX2.h> 27 + #include <libxml/parserInternals.h> 32 28 33 29 #include "windef.h" 34 30 #include "winbase.h" ··· 44 40 #include "wine/debug.h" 45 41 46 42 #include "msxml_private.h" 47 - 48 - #ifdef HAVE_LIBXML2 49 43 50 44 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 51 45 ··· 136 130 { 137 131 n = (min+max)/2; 138 132 139 - c = strcmpW(saxreader_feature_map[n].name, name); 133 + c = wcscmp(saxreader_feature_map[n].name, name); 140 134 if (!c) 141 135 return saxreader_feature_map[n].feature; 142 136 ··· 456 450 WCHAR *ptr; 457 451 458 452 ptr = qname; 459 - strcpyW(ptr, prefix); 453 + lstrcpyW(ptr, prefix); 460 454 ptr += SysStringLen(prefix); 461 455 *ptr++ = ':'; 462 - strcpyW(ptr, local); 456 + lstrcpyW(ptr, local); 463 457 return qname; 464 458 } 465 459 else ··· 472 466 element_entry *ret; 473 467 int i; 474 468 475 - ret = heap_alloc(sizeof(*ret)); 469 + ret = malloc(sizeof(*ret)); 476 470 if (!ret) return ret; 477 471 478 472 ret->local = bstr_from_xmlChar(local); 479 473 ret->prefix = bstr_from_xmlChar(prefix); 480 474 ret->qname = build_qname(ret->prefix, ret->local); 481 - ret->ns = nb_ns ? heap_alloc(nb_ns*sizeof(ns)) : NULL; 475 + ret->ns = nb_ns ? malloc(nb_ns * sizeof(ns)) : NULL; 482 476 ret->ns_count = nb_ns; 483 477 484 478 for (i=0; i < nb_ns; i++) ··· 504 498 SysFreeString(element->local); 505 499 SysFreeString(element->qname); 506 500 507 - heap_free(element->ns); 508 - heap_free(element); 501 + free(element->ns); 502 + free(element); 509 503 } 510 504 511 505 static void push_element_ns(saxlocator *locator, element_entry *element) ··· 536 530 LIST_FOR_EACH_ENTRY(element, &locator->elements, element_entry, entry) 537 531 { 538 532 for (i=0; i < element->ns_count; i++) 539 - if (!strcmpW(uriW, element->ns[i].uri)) 533 + if (!wcscmp(uriW, element->ns[i].uri)) 540 534 { 541 535 SysFreeString(uriW); 542 536 return element->ns[i].uri; ··· 573 567 { 574 568 if (!pool->pool) 575 569 { 576 - pool->pool = heap_alloc(16 * sizeof(*pool->pool)); 570 + pool->pool = malloc(16 * sizeof(*pool->pool)); 577 571 if (!pool->pool) 578 572 return FALSE; 579 573 ··· 582 576 } 583 577 else if (pool->index == pool->len) 584 578 { 585 - BSTR *realloc = heap_realloc(pool->pool, pool->len * 2 * sizeof(*realloc)); 579 + BSTR *new_pool = realloc(pool->pool, pool->len * 2 * sizeof(*new_pool)); 586 580 587 - if (!realloc) 581 + if (!new_pool) 588 582 return FALSE; 589 583 590 - pool->pool = realloc; 584 + pool->pool = new_pool; 591 585 pool->len *= 2; 592 586 } 593 587 ··· 602 596 for (i = 0; i < pool->index; i++) 603 597 SysFreeString(pool->pool[i]); 604 598 605 - heap_free(pool->pool); 599 + free(pool->pool); 606 600 607 601 pool->pool = NULL; 608 602 pool->index = pool->len = 0; ··· 755 749 IVBSAXAttributes *iface, 756 750 UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo ) 757 751 { 758 - saxlocator *This = impl_from_IVBSAXAttributes( iface ); 759 - 760 - TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); 752 + TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo); 761 753 762 754 return get_typeinfo(IVBSAXAttributes_tid, ppTInfo); 763 755 } ··· 770 762 LCID lcid, 771 763 DISPID* rgDispId) 772 764 { 773 - saxlocator *This = impl_from_IVBSAXAttributes( iface ); 774 765 ITypeInfo *typeinfo; 775 766 HRESULT hr; 776 767 777 - TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, 768 + TRACE("%p, %s, %p, %u, %lx %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, 778 769 lcid, rgDispId); 779 770 780 771 if(!rgszNames || cNames == 0 || !rgDispId) ··· 801 792 EXCEPINFO* pExcepInfo, 802 793 UINT* puArgErr) 803 794 { 804 - saxlocator *This = impl_from_IVBSAXAttributes( iface ); 805 795 ITypeInfo *typeinfo; 806 796 HRESULT hr; 807 797 808 - TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), 798 + TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid), 809 799 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 810 800 811 801 hr = get_typeinfo(IVBSAXAttributes_tid, &typeinfo); 812 802 if(SUCCEEDED(hr)) 813 803 { 814 - hr = ITypeInfo_Invoke(typeinfo, &This->IVBSAXAttributes_iface, dispIdMember, wFlags, 815 - pDispParams, pVarResult, pExcepInfo, puArgErr); 804 + hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 816 805 ITypeInfo_Release(typeinfo); 817 806 } 818 807 ··· 1410 1399 str_len = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)buf, len, NULL, 0); 1411 1400 if (len != -1) str_len++; 1412 1401 1413 - str = heap_alloc(str_len*sizeof(WCHAR)); 1402 + str = malloc(str_len * sizeof(WCHAR)); 1414 1403 if (!str) return NULL; 1415 1404 1416 1405 MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)buf, len, str, str_len); 1417 1406 if (len != -1) str[str_len-1] = 0; 1418 1407 1419 1408 ptrW = str; 1420 - while ((dest = strstrW(ptrW, ampescW))) 1409 + while ((dest = wcsstr(ptrW, ampescW))) 1421 1410 { 1422 1411 WCHAR *src; 1423 1412 ··· 1426 1415 dest++; 1427 1416 1428 1417 /* move together with null terminator */ 1429 - memmove(dest, src, (strlenW(src) + 1)*sizeof(WCHAR)); 1418 + memmove(dest, src, (lstrlenW(src) + 1)*sizeof(WCHAR)); 1430 1419 1431 1420 ptrW++; 1432 1421 } 1433 1422 1434 1423 bstr = SysAllocString(str); 1435 - heap_free(str); 1424 + free(str); 1436 1425 1437 1426 return bstr; 1438 1427 } ··· 1472 1461 if(locator->attr_count > locator->attr_alloc_count) 1473 1462 { 1474 1463 int new_size = locator->attr_count * 2; 1475 - attrs = heap_realloc_zero(locator->attributes, new_size * sizeof(struct _attributes)); 1464 + attrs = realloc(locator->attributes, new_size * sizeof(*locator->attributes)); 1476 1465 if(!attrs) 1477 1466 { 1478 1467 free_attribute_values(locator); 1479 1468 locator->attr_count = 0; 1480 1469 return E_OUTOFMEMORY; 1481 1470 } 1471 + memset(attrs + locator->attr_alloc_count, 0, 1472 + (new_size - locator->attr_alloc_count) * sizeof(*locator->attributes)); 1482 1473 locator->attributes = attrs; 1483 1474 locator->attr_alloc_count = new_size; 1484 1475 } ··· 1922 1913 format_error_message_from_id(This, hr); 1923 1914 } 1924 1915 1925 - static void libxmlFatalError(void *ctx, const char *msg, ...) 1916 + static void WINAPIV libxmlFatalError(void *ctx, const char *msg, ...) 1926 1917 { 1927 1918 saxlocator *This = ctx; 1928 1919 struct saxerrorhandler_iface *handler = saxreader_get_errorhandler(This->saxreader); ··· 1941 1932 va_end(args); 1942 1933 1943 1934 len = MultiByteToWideChar(CP_UNIXCP, 0, message, -1, NULL, 0); 1944 - error = heap_alloc(sizeof(WCHAR)*len); 1935 + error = malloc(sizeof(WCHAR) * len); 1945 1936 if(error) 1946 1937 { 1947 1938 MultiByteToWideChar(CP_UNIXCP, 0, message, -1, error, len); ··· 1952 1943 { 1953 1944 xmlStopParser(This->pParserCtxt); 1954 1945 This->ret = E_FAIL; 1955 - heap_free(error); 1946 + free(error); 1956 1947 return; 1957 1948 } 1958 1949 ··· 1968 1959 else 1969 1960 ISAXErrorHandler_fatalError(handler->handler, &This->ISAXLocator_iface, error, E_FAIL); 1970 1961 1971 - heap_free(error); 1962 + free(error); 1972 1963 1973 1964 xmlStopParser(This->pParserCtxt); 1974 1965 This->ret = E_FAIL; ··· 2156 2147 IVBSAXLocator *iface, 2157 2148 UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo ) 2158 2149 { 2159 - saxlocator *This = impl_from_IVBSAXLocator( iface ); 2160 - 2161 - TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); 2150 + TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo); 2162 2151 2163 2152 return get_typeinfo(IVBSAXLocator_tid, ppTInfo); 2164 2153 } ··· 2171 2160 LCID lcid, 2172 2161 DISPID* rgDispId) 2173 2162 { 2174 - saxlocator *This = impl_from_IVBSAXLocator( iface ); 2175 2163 ITypeInfo *typeinfo; 2176 2164 HRESULT hr; 2177 2165 2178 - TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, 2166 + TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, 2179 2167 lcid, rgDispId); 2180 2168 2181 2169 if(!rgszNames || cNames == 0 || !rgDispId) ··· 2202 2190 EXCEPINFO* pExcepInfo, 2203 2191 UINT* puArgErr) 2204 2192 { 2205 - saxlocator *This = impl_from_IVBSAXLocator( iface ); 2206 2193 ITypeInfo *typeinfo; 2207 2194 HRESULT hr; 2208 2195 2209 - TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), 2196 + TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid), 2210 2197 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 2211 2198 2212 2199 hr = get_typeinfo(IVBSAXLocator_tid, &typeinfo); 2213 2200 if(SUCCEEDED(hr)) 2214 2201 { 2215 - hr = ITypeInfo_Invoke(typeinfo, &This->IVBSAXLocator_iface, dispIdMember, wFlags, 2216 - pDispParams, pVarResult, pExcepInfo, puArgErr); 2202 + hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 2217 2203 ITypeInfo_Release(typeinfo); 2218 2204 } 2219 2205 ··· 2324 2310 { 2325 2311 saxlocator *This = impl_from_ISAXLocator( iface ); 2326 2312 ULONG ref = InterlockedIncrement( &This->ref ); 2327 - TRACE("(%p)->(%d)\n", This, ref); 2313 + TRACE("%p, refcount %lu.\n", iface, ref); 2328 2314 return ref; 2329 2315 } 2330 2316 ··· 2332 2318 ISAXLocator* iface) 2333 2319 { 2334 2320 saxlocator *This = impl_from_ISAXLocator( iface ); 2335 - LONG ref = InterlockedDecrement( &This->ref ); 2321 + ULONG ref = InterlockedDecrement( &This->ref ); 2336 2322 2337 - TRACE("(%p)->(%d)\n", This, ref ); 2323 + TRACE("%p, refcount %ld.\n", iface, ref ); 2338 2324 2339 - if (ref == 0) 2325 + if (!ref) 2340 2326 { 2341 2327 element_entry *element, *element2; 2342 2328 int index; ··· 2351 2337 SysFreeString(This->attributes[index].szValue); 2352 2338 SysFreeString(This->attributes[index].szQName); 2353 2339 } 2354 - heap_free(This->attributes); 2340 + free(This->attributes); 2355 2341 2356 2342 /* element stack */ 2357 2343 LIST_FOR_EACH_ENTRY_SAFE(element, element2, &This->elements, element_entry, entry) ··· 2361 2347 } 2362 2348 2363 2349 ISAXXMLReader_Release(&This->saxreader->ISAXXMLReader_iface); 2364 - heap_free( This ); 2350 + free(This); 2365 2351 } 2366 2352 2367 2353 return ref; ··· 2450 2436 2451 2437 saxlocator *locator; 2452 2438 2453 - locator = heap_alloc( sizeof (*locator) ); 2439 + locator = malloc(sizeof(*locator)); 2454 2440 if( !locator ) 2455 2441 return E_OUTOFMEMORY; 2456 2442 ··· 2477 2463 if(!locator->namespaceUri) 2478 2464 { 2479 2465 ISAXXMLReader_Release(&reader->ISAXXMLReader_iface); 2480 - heap_free(locator); 2466 + free(locator); 2481 2467 return E_OUTOFMEMORY; 2482 2468 } 2483 2469 2484 2470 locator->attr_alloc_count = 8; 2485 2471 locator->attr_count = 0; 2486 - locator->attributes = heap_alloc_zero(sizeof(struct _attributes)*locator->attr_alloc_count); 2472 + locator->attributes = calloc(locator->attr_alloc_count, sizeof(*locator->attributes)); 2487 2473 if(!locator->attributes) 2488 2474 { 2489 2475 ISAXXMLReader_Release(&reader->ISAXXMLReader_iface); 2490 2476 SysFreeString(locator->namespaceUri); 2491 - heap_free(locator); 2477 + free(locator); 2492 2478 return E_OUTOFMEMORY; 2493 2479 } 2494 2480 ··· 2517 2503 2518 2504 if (size >= 4) 2519 2505 { 2520 - const unsigned char *buff = (unsigned char*)buffer; 2521 - 2522 2506 encoding = xmlDetectCharEncoding((xmlChar*)buffer, 4); 2523 2507 enc_name = (xmlChar*)xmlGetCharEncodingName(encoding); 2524 2508 TRACE("detected encoding: %s\n", enc_name); 2525 - /* skip BOM, parser won't switch encodings and so won't skip it on its own */ 2526 - if ((encoding == XML_CHAR_ENCODING_UTF8) && 2527 - buff[0] == 0xEF && buff[1] == 0xBB && buff[2] == 0xBF) 2528 - { 2529 - buffer += 3; 2530 - size -= 3; 2531 - } 2532 2509 } 2533 2510 2534 2511 /* if libxml2 detection failed try to guess */ ··· 2653 2630 case VT_BSTR|VT_BYREF: 2654 2631 { 2655 2632 BSTR str = V_ISBYREF(&varInput) ? *V_BSTRREF(&varInput) : V_BSTR(&varInput); 2656 - hr = internal_parseBuffer(This, (const char*)str, strlenW(str)*sizeof(WCHAR), vbInterface); 2633 + hr = internal_parseBuffer(This, (const char*)str, lstrlenW(str)*sizeof(WCHAR), vbInterface); 2657 2634 break; 2658 2635 } 2659 2636 case VT_ARRAY|VT_UI1: { ··· 2734 2711 return internal_parseBuffer(This, ptr, len, FALSE); 2735 2712 } 2736 2713 2737 - static HRESULT internal_parseURL( 2738 - saxreader* This, 2739 - const WCHAR *url, 2740 - BOOL vbInterface) 2714 + static HRESULT internal_parseURL(saxreader *reader, const WCHAR *url, BOOL vbInterface) 2741 2715 { 2742 2716 IMoniker *mon; 2743 2717 bsc_t *bsc; 2744 2718 HRESULT hr; 2745 2719 2746 - TRACE("(%p)->(%s)\n", This, debugstr_w(url)); 2720 + TRACE("%p, %s.\n", reader, debugstr_w(url)); 2721 + 2722 + if (!url && reader->version < MSXML4) 2723 + return E_INVALIDARG; 2747 2724 2748 2725 hr = create_moniker_from_url(url, &mon); 2749 2726 if(FAILED(hr)) 2750 2727 return hr; 2751 2728 2752 - if(vbInterface) hr = bind_url(mon, internal_vbonDataAvailable, This, &bsc); 2753 - else hr = bind_url(mon, internal_onDataAvailable, This, &bsc); 2729 + if(vbInterface) hr = bind_url(mon, internal_vbonDataAvailable, reader, &bsc); 2730 + else hr = bind_url(mon, internal_onDataAvailable, reader, &bsc); 2754 2731 IMoniker_Release(mon); 2755 2732 2756 2733 if(FAILED(hr)) ··· 2964 2941 SysFreeString(This->xmldecl_version); 2965 2942 free_bstr_pool(&This->pool); 2966 2943 2967 - heap_free( This ); 2944 + free(This); 2968 2945 } 2969 2946 2970 2947 return ref; ··· 3453 3430 3454 3431 TRACE("(%p)\n", ppObj); 3455 3432 3456 - reader = heap_alloc( sizeof (*reader) ); 3433 + reader = malloc(sizeof(*reader)); 3457 3434 if( !reader ) 3458 3435 return E_OUTOFMEMORY; 3459 3436 ··· 3491 3468 3492 3469 return S_OK; 3493 3470 } 3494 - 3495 - #else 3496 - 3497 - HRESULT SAXXMLReader_create(MSXML_VERSION version, LPVOID *ppObj) 3498 - { 3499 - MESSAGE("This program tried to use a SAX XML Reader object, but\n" 3500 - "libxml2 support was not present at compile time.\n"); 3501 - return E_NOTIMPL; 3502 - } 3503 - 3504 - #endif
+47 -79
dll/win32/msxml3/schema.c
··· 21 21 22 22 #define COBJMACROS 23 23 24 - #include "config.h" 25 - 26 24 #include <assert.h> 27 25 #include <stdarg.h> 28 - #ifdef HAVE_LIBXML2 29 - # include <libxml/xmlerror.h> 30 - # include <libxml/tree.h> 31 - # include <libxml/xmlschemas.h> 32 - # include <libxml/schemasInternals.h> 33 - # include <libxml/hash.h> 34 - # include <libxml/parser.h> 35 - # include <libxml/parserInternals.h> 36 - # include <libxml/xmlIO.h> 37 - # include <libxml/xmlversion.h> 38 - # include <libxml/xpath.h> 39 - #endif 26 + #include <libxml/xmlerror.h> 27 + #include <libxml/tree.h> 28 + #include <libxml/xmlschemas.h> 29 + #include <libxml/schemasInternals.h> 30 + #include <libxml/hash.h> 31 + #include <libxml/parser.h> 32 + #include <libxml/parserInternals.h> 33 + #include <libxml/xmlIO.h> 34 + #include <libxml/xmlversion.h> 35 + #include <libxml/xpath.h> 40 36 41 37 #include "windef.h" 42 38 #include "winbase.h" ··· 48 44 49 45 #include "msxml_private.h" 50 46 51 - #ifdef HAVE_LIBXML2 52 - 53 47 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 54 - 55 - #if LIBXML_VERSION >= 20908 56 - #define XMLHASH_CONST const 57 - #else 58 - #define XMLHASH_CONST 59 - #endif 60 48 61 49 /* We use a chained hashtable, which can hold any number of schemas 62 50 * TODO: grow/shrink hashtable depending on load factor ··· 255 243 va_end(ap); 256 244 } 257 245 258 - #ifdef HAVE_XMLSCHEMASSETPARSERSTRUCTUREDERRORS 259 - static void parser_serror(void* ctx, xmlErrorPtr err) 246 + static void parser_serror(void* ctx, const xmlError* err) 260 247 { 261 248 LIBXML2_CALLBACK_SERROR(Schema_parse, err); 262 249 } 263 - #endif 264 250 265 251 static inline xmlSchemaPtr Schema_parse(xmlSchemaParserCtxtPtr spctx) 266 252 { 267 253 TRACE("(%p)\n", spctx); 268 254 269 255 xmlSchemaSetParserErrors(spctx, parser_error, parser_warning, NULL); 270 - #ifdef HAVE_XMLSCHEMASSETPARSERSTRUCTUREDERRORS 271 256 xmlSchemaSetParserStructuredErrors(spctx, parser_serror, NULL); 272 - #endif 273 - 274 257 return xmlSchemaParse(spctx); 275 258 } 276 259 ··· 290 273 va_end(ap); 291 274 } 292 275 293 - #ifdef HAVE_XMLSCHEMASSETVALIDSTRUCTUREDERRORS 294 - static void validate_serror(void* ctx, xmlErrorPtr err) 276 + static void validate_serror(void* ctx, const xmlError* err) 295 277 { 296 278 LIBXML2_CALLBACK_SERROR(Schema_validate_tree, err); 297 279 } 298 - #endif 299 280 300 281 static HRESULT schema_cache_get_item(IUnknown *iface, LONG index, VARIANT *item) 301 282 { ··· 318 299 * we probably need to validate the schema here. */ 319 300 svctx = xmlSchemaNewValidCtxt(schema); 320 301 xmlSchemaSetValidErrors(svctx, validate_error, validate_warning, NULL); 321 - #ifdef HAVE_XMLSCHEMASSETVALIDSTRUCTUREDERRORS 322 302 xmlSchemaSetValidStructuredErrors(svctx, validate_serror, NULL); 323 - #endif 324 303 325 304 if (tree->type == XML_DOCUMENT_NODE) 326 305 err = xmlSchemaValidateDoc(svctx, (xmlDocPtr)tree); ··· 755 734 /* Resource is loaded as raw data, 756 735 * need a null-terminated string */ 757 736 while (buf[datatypes_len - 1] != '>') datatypes_len--; 758 - datatypes_src = heap_alloc(datatypes_len + 1); 737 + datatypes_src = malloc(datatypes_len + 1); 759 738 memcpy(datatypes_src, buf, datatypes_len); 760 739 datatypes_src[datatypes_len] = 0; 761 740 ··· 769 748 void schemasCleanup(void) 770 749 { 771 750 xmlSchemaFree(datatypes_schema); 772 - heap_free(datatypes_src); 751 + free(datatypes_src); 773 752 xmlSetExternalEntityLoader(_external_entity_loader); 774 753 } 775 754 776 755 static LONG cache_entry_add_ref(cache_entry* entry) 777 756 { 778 757 LONG ref = InterlockedIncrement(&entry->ref); 779 - TRACE("(%p)->(%d)\n", entry, ref); 758 + TRACE("%p, refcount %ld.\n", entry, ref); 780 759 return ref; 781 760 } 782 761 783 762 static LONG cache_entry_release(cache_entry* entry) 784 763 { 785 764 LONG ref = InterlockedDecrement(&entry->ref); 786 - TRACE("(%p)->(%d)\n", entry, ref); 765 + TRACE("%p, refcount %ld.\n", entry, ref); 787 766 788 767 if (ref == 0) 789 768 { ··· 801 780 xmlSchemaFree(entry->schema); 802 781 } 803 782 804 - heap_free(entry); 783 + free(entry); 805 784 } 806 785 return ref; 807 786 } ··· 815 794 816 795 static inline schema_cache* impl_from_IXMLDOMSchemaCollection(IXMLDOMSchemaCollection* iface) 817 796 { 818 - return CONTAINING_RECORD((IXMLDOMSchemaCollection2 *)iface, schema_cache, IXMLDOMSchemaCollection2_iface); 797 + return CONTAINING_RECORD(iface, schema_cache, IXMLDOMSchemaCollection2_iface); 819 798 } 820 799 821 800 static inline schema_cache* unsafe_impl_from_IXMLDOMSchemaCollection(IXMLDOMSchemaCollection *iface) ··· 875 854 876 855 static cache_entry* cache_entry_from_xsd_doc(xmlDocPtr doc, xmlChar const* nsURI, MSXML_VERSION v) 877 856 { 878 - cache_entry* entry = heap_alloc(sizeof(cache_entry)); 857 + cache_entry* entry = malloc(sizeof(cache_entry)); 879 858 xmlSchemaParserCtxtPtr spctx; 880 859 xmlDocPtr new_doc = xmlCopyDoc(doc, 1); 881 860 ··· 897 876 { 898 877 FIXME("failed to parse doc\n"); 899 878 xmlFreeDoc(new_doc); 900 - heap_free(entry); 879 + free(entry); 901 880 entry = NULL; 902 881 } 903 882 xmlSchemaFreeParserCtxt(spctx); ··· 906 885 907 886 static cache_entry* cache_entry_from_xdr_doc(xmlDocPtr doc, xmlChar const* nsURI, MSXML_VERSION version) 908 887 { 909 - cache_entry* entry = heap_alloc(sizeof(cache_entry)); 888 + cache_entry* entry = malloc(sizeof(cache_entry)); 910 889 xmlSchemaParserCtxtPtr spctx; 911 890 xmlDocPtr new_doc = xmlCopyDoc(doc, 1), xsd_doc = XDR_to_XSD_doc(doc, nsURI); 912 891 ··· 929 908 FIXME("failed to parse doc\n"); 930 909 xmlFreeDoc(new_doc); 931 910 xmlFreeDoc(xsd_doc); 932 - heap_free(entry); 911 + free(entry); 933 912 entry = NULL; 934 913 } 935 914 xmlSchemaFreeParserCtxt(spctx); ··· 942 921 cache_entry* entry; 943 922 IXMLDOMDocument3* domdoc = NULL; 944 923 xmlDocPtr doc = NULL; 945 - HRESULT hr = DOMDocument_create(version, (void**)&domdoc); 924 + HRESULT hr = dom_document_create(version, (void **)&domdoc); 946 925 VARIANT_BOOL b = VARIANT_FALSE; 947 926 CacheEntryType type = CacheEntryType_Invalid; 948 927 ··· 957 936 hr = IXMLDOMDocument3_load(domdoc, url, &b); 958 937 if (hr != S_OK) 959 938 { 960 - ERR("IXMLDOMDocument3_load() returned 0x%08x\n", hr); 939 + ERR("load() returned %#lx.\n", hr); 961 940 if (b != VARIANT_TRUE) 962 941 { 963 942 FIXME("Failed to load doc at %s\n", debugstr_w(V_BSTR(&url))); ··· 986 965 return entry; 987 966 } 988 967 989 - static void cache_free(void* data, XMLHASH_CONST xmlChar* name /* ignored */) 968 + static void cache_free(void* data, const xmlChar* name /* ignored */) 990 969 { 991 970 cache_entry_release((cache_entry*)data); 992 971 } ··· 999 978 for (i = 0; i < cache->count; i++) 1000 979 if (xmlStrEqual(cache->uris[i], uri)) 1001 980 { 1002 - heap_free(cache->uris[i]); 981 + free(cache->uris[i]); 1003 982 return i; 1004 983 } 1005 984 ··· 1016 995 if (cache->count == cache->allocated) 1017 996 { 1018 997 cache->allocated *= 2; 1019 - cache->uris = heap_realloc(cache->uris, cache->allocated*sizeof(xmlChar*)); 998 + cache->uris = realloc(cache->uris, cache->allocated * sizeof(xmlChar*)); 1020 999 } 1021 1000 i = cache->count++; 1022 1001 } 1023 1002 else 1024 1003 i = cache_free_uri(cache, uri); 1025 1004 1026 - cache->uris[i] = heap_strdupxmlChar(uri); 1005 + cache->uris[i] = strdupxmlChar(uri); 1027 1006 xmlHashAddEntry(cache->cache, uri, entry); 1028 1007 } 1029 1008 ··· 1080 1059 continue; 1081 1060 } 1082 1061 1083 - entry = heap_alloc(sizeof(cache_entry)); 1062 + entry = malloc(sizeof(cache_entry)); 1084 1063 entry->type = CacheEntryType_NS; 1085 1064 entry->ref = 1; 1086 1065 entry->schema = NULL; ··· 1147 1126 { 1148 1127 schema_cache* This = impl_from_IXMLDOMSchemaCollection2(iface); 1149 1128 LONG ref = InterlockedIncrement(&This->ref); 1150 - TRACE("(%p)->(%d)\n", This, ref); 1129 + TRACE("%p, refcount %ld.\n", iface, ref); 1151 1130 return ref; 1152 1131 } 1153 1132 ··· 1155 1134 { 1156 1135 schema_cache* This = impl_from_IXMLDOMSchemaCollection2(iface); 1157 1136 LONG ref = InterlockedDecrement(&This->ref); 1158 - TRACE("(%p)->(%d)\n", This, ref); 1137 + TRACE("%p, refcount %ld.\n", iface, ref); 1159 1138 1160 - if (ref == 0) 1139 + if (!ref) 1161 1140 { 1162 1141 int i; 1163 1142 1164 1143 for (i = 0; i < This->count; i++) 1165 - heap_free(This->uris[i]); 1166 - heap_free(This->uris); 1144 + free(This->uris[i]); 1145 + free(This->uris); 1167 1146 xmlHashFree(This->cache, cache_free); 1168 - heap_free(This); 1147 + free(This); 1169 1148 } 1170 1149 1171 1150 return ref; ··· 1235 1214 } 1236 1215 else 1237 1216 { 1238 - heap_free(name); 1217 + free(name); 1239 1218 return E_FAIL; 1240 1219 } 1241 1220 ··· 1266 1245 BSTR xml; 1267 1246 1268 1247 IXMLDOMNode_get_xml(domnode, &xml); 1269 - DOMDocument_create(This->version, (void**)&domdoc); 1248 + dom_document_create(This->version, (void **)&domdoc); 1270 1249 IXMLDOMDocument_loadXML(domdoc, xml, &b); 1271 1250 SysFreeString(xml); 1272 1251 doc = xmlNodePtr_from_domnode((IXMLDOMNode*)domdoc, XML_DOCUMENT_NODE)->doc; ··· 1281 1260 if (!doc) 1282 1261 { 1283 1262 IXMLDOMNode_Release(domnode); 1284 - heap_free(name); 1263 + free(name); 1285 1264 return E_INVALIDARG; 1286 1265 } 1287 1266 type = cache_type_from_xmlDocPtr(doc); ··· 1308 1287 } 1309 1288 else 1310 1289 { 1311 - heap_free(name); 1290 + free(name); 1312 1291 return E_FAIL; 1313 1292 } 1314 1293 ··· 1318 1297 1319 1298 default: 1320 1299 FIXME("arg type is not supported, %s\n", debugstr_variant(&var)); 1321 - heap_free(name); 1300 + free(name); 1322 1301 return E_INVALIDARG; 1323 1302 } 1324 - heap_free(name); 1303 + free(name); 1325 1304 return S_OK; 1326 1305 } 1327 1306 ··· 1347 1326 1348 1327 name = uri ? xmlchar_from_wchar(uri) : xmlchar_from_wchar(emptyW); 1349 1328 entry = (cache_entry*) xmlHashLookup(This->cache, name); 1350 - heap_free(name); 1329 + free(name); 1351 1330 1352 1331 /* TODO: this should be read-only */ 1353 1332 if (entry && entry->doc) ··· 1367 1346 1368 1347 name = uri ? xmlchar_from_wchar(uri) : xmlchar_from_wchar(emptyW); 1369 1348 cache_remove_entry(This, name); 1370 - heap_free(name); 1349 + free(name); 1371 1350 return S_OK; 1372 1351 } 1373 1352 ··· 1388 1367 { 1389 1368 schema_cache* This = impl_from_IXMLDOMSchemaCollection2(iface); 1390 1369 1391 - TRACE("(%p)->(%i %p)\n", This, index, uri); 1370 + TRACE("%p, %ld, %p.\n", iface, index, uri); 1392 1371 1393 1372 if (!uri) 1394 1373 return E_POINTER; ··· 1403 1382 return S_OK; 1404 1383 } 1405 1384 1406 - static void cache_copy(void* data, void* dest, XMLHASH_CONST xmlChar* name) 1385 + static void cache_copy(void* data, void* dest, const xmlChar* name) 1407 1386 { 1408 1387 schema_cache* This = (schema_cache*) dest; 1409 1388 cache_entry* entry = (cache_entry*) data; ··· 1621 1600 1622 1601 HRESULT SchemaCache_create(MSXML_VERSION version, void** obj) 1623 1602 { 1624 - schema_cache* This = heap_alloc(sizeof(schema_cache)); 1603 + schema_cache* This = malloc(sizeof(schema_cache)); 1625 1604 if (!This) 1626 1605 return E_OUTOFMEMORY; 1627 1606 ··· 1631 1610 This->cache = xmlHashCreate(DEFAULT_HASHTABLE_SIZE); 1632 1611 This->allocated = 10; 1633 1612 This->count = 0; 1634 - This->uris = heap_alloc(This->allocated*sizeof(xmlChar*)); 1613 + This->uris = malloc(This->allocated * sizeof(xmlChar*)); 1635 1614 This->ref = 1; 1636 1615 This->version = version; 1637 1616 This->validateOnLoad = VARIANT_TRUE; ··· 1641 1620 *obj = &This->IXMLDOMSchemaCollection2_iface; 1642 1621 return S_OK; 1643 1622 } 1644 - 1645 - #else 1646 - 1647 - HRESULT SchemaCache_create(MSXML_VERSION version, void** obj) 1648 - { 1649 - MESSAGE("This program tried to use a SchemaCache object, but\n" 1650 - "libxml2 support was not present at compile time.\n"); 1651 - return E_NOTIMPL; 1652 - } 1653 - 1654 - #endif
+27 -32
dll/win32/msxml3/selection.c
··· 22 22 23 23 #define COBJMACROS 24 24 25 - #include "config.h" 26 - 27 25 #include <stdarg.h> 28 - #ifdef HAVE_LIBXML2 29 - # include <libxml/parser.h> 30 - # include <libxml/xmlerror.h> 31 - # include <libxml/xpath.h> 32 - # include <libxml/xpathInternals.h> 33 - #endif 26 + #include <libxml/parser.h> 27 + #include <libxml/xmlerror.h> 28 + #include <libxml/xpath.h> 29 + #include <libxml/xpathInternals.h> 34 30 35 31 #include "windef.h" 36 32 #include "winbase.h" ··· 51 47 * - supports IXMLDOMSelection 52 48 * 53 49 */ 54 - 55 - #ifdef HAVE_LIBXML2 56 50 57 51 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 58 52 ··· 161 155 { 162 156 domselection *This = impl_from_IXMLDOMSelection( iface ); 163 157 ULONG ref = InterlockedIncrement( &This->ref ); 164 - TRACE("(%p)->(%d)\n", This, ref); 158 + TRACE("%p, refcount %lu.\n", iface, ref); 165 159 return ref; 166 160 } 167 161 ··· 171 165 domselection *This = impl_from_IXMLDOMSelection( iface ); 172 166 ULONG ref = InterlockedDecrement(&This->ref); 173 167 174 - TRACE("(%p)->(%d)\n", This, ref); 168 + TRACE("%p, refcount %lu.\n", iface, ref); 175 169 if ( ref == 0 ) 176 170 { 177 171 xmlXPathFreeObject(This->result); 178 172 xmldoc_release(This->node->doc); 179 173 if (This->enumvariant) IEnumVARIANT_Release(This->enumvariant); 180 - heap_free(This); 174 + free(This); 181 175 } 182 176 183 177 return ref; ··· 238 232 { 239 233 domselection *This = impl_from_IXMLDOMSelection( iface ); 240 234 241 - TRACE("(%p)->(%d %p)\n", This, index, listItem); 235 + TRACE("%p, %ld, %p.\n", iface, index, listItem); 242 236 243 237 if(!listItem) 244 238 return E_INVALIDARG; ··· 474 468 { 475 469 enumvariant *This = impl_from_IEnumVARIANT( iface ); 476 470 ULONG ref = InterlockedIncrement( &This->ref ); 477 - TRACE("(%p)->(%d)\n", This, ref); 471 + TRACE("%p, refcount %lu.\n", iface, ref); 478 472 return ref; 479 473 } 480 474 ··· 483 477 enumvariant *This = impl_from_IEnumVARIANT( iface ); 484 478 ULONG ref = InterlockedDecrement(&This->ref); 485 479 486 - TRACE("(%p)->(%d)\n", This, ref); 480 + TRACE("%p, refcount %lu.\n", iface, ref); 487 481 if ( ref == 0 ) 488 482 { 489 483 if (This->own) IUnknown_Release(This->outer); 490 - heap_free(This); 484 + free(This); 491 485 } 492 486 493 487 return ref; ··· 502 496 enumvariant *This = impl_from_IEnumVARIANT( iface ); 503 497 ULONG ret_count = 0; 504 498 505 - TRACE("(%p)->(%u %p %p)\n", This, celt, var, fetched); 499 + TRACE("%p, %lu, %p, %p.\n", iface, celt, var, fetched); 506 500 507 501 if (fetched) *fetched = 0; 508 502 ··· 519 513 ret_count++; 520 514 } 521 515 522 - if (fetched) (*fetched)++; 516 + if (fetched) *fetched = ret_count; 523 517 524 518 /* we need to advance one step more for some reason */ 525 519 if (ret_count) ··· 535 529 IEnumVARIANT *iface, 536 530 ULONG celt) 537 531 { 538 - enumvariant *This = impl_from_IEnumVARIANT( iface ); 539 - FIXME("(%p)->(%u): stub\n", This, celt); 532 + FIXME("%p, %lu: stub\n", iface, celt); 533 + 540 534 return E_NOTIMPL; 541 535 } 542 536 543 537 static HRESULT WINAPI enumvariant_Reset(IEnumVARIANT *iface) 544 538 { 545 539 enumvariant *This = impl_from_IEnumVARIANT( iface ); 546 - FIXME("(%p): stub\n", This); 547 - return E_NOTIMPL; 540 + 541 + TRACE("%p\n", This); 542 + This->pos = 0; 543 + return S_OK; 548 544 } 549 545 550 546 static HRESULT WINAPI enumvariant_Clone( ··· 570 566 { 571 567 enumvariant *This; 572 568 573 - This = heap_alloc(sizeof(enumvariant)); 569 + This = malloc(sizeof(enumvariant)); 574 570 if (!This) return E_OUTOFMEMORY; 575 571 576 572 This->IEnumVARIANT_iface.lpVtbl = &EnumVARIANTVtbl; ··· 593 589 WCHAR *ptr; 594 590 int idx = 0; 595 591 596 - for(ptr = name; *ptr && isdigitW(*ptr); ptr++) 592 + for(ptr = name; *ptr >= '0' && *ptr <= '9'; ptr++) 597 593 idx = idx*10 + (*ptr-'0'); 598 594 if(*ptr) 599 595 return DISP_E_UNKNOWNNAME; 600 596 601 597 *dispid = DISPID_DOM_COLLECTION_BASE + idx; 602 - TRACE("ret %x\n", *dispid); 598 + TRACE("ret %lx\n", *dispid); 603 599 return S_OK; 604 600 } 605 601 ··· 608 604 { 609 605 domselection *This = impl_from_IXMLDOMSelection( (IXMLDOMSelection*)iface ); 610 606 611 - TRACE("(%p)->(%x %x %x %p %p %p)\n", This, id, lcid, flags, params, res, ei); 607 + TRACE("%p, %ld, %lx, %x, %p, %p, %p.\n", iface, id, lcid, flags, params, res, ei); 612 608 613 609 V_VT(res) = VT_DISPATCH; 614 610 V_DISPATCH(res) = NULL; ··· 760 756 xmlFree(arg2); 761 757 } 762 758 763 - static void query_serror(void* ctx, xmlErrorPtr err) 759 + static void query_serror(void* ctx, const xmlError* err) 764 760 { 765 761 LIBXML2_CALLBACK_SERROR(domselection_create, err); 766 762 } 767 763 768 764 HRESULT create_selection(xmlNodePtr node, xmlChar* query, IXMLDOMNodeList **out) 769 765 { 770 - domselection *This = heap_alloc(sizeof(domselection)); 766 + domselection *This = malloc(sizeof(domselection)); 771 767 xmlXPathContextPtr ctxt = xmlXPathNewContext(node->doc); 772 768 HRESULT hr; 773 769 ··· 777 773 if (!This || !ctxt || !query) 778 774 { 779 775 xmlXPathFreeContext(ctxt); 780 - heap_free(This); 776 + free(This); 781 777 return E_OUTOFMEMORY; 782 778 } 783 779 ··· 792 788 ctxt->error = query_serror; 793 789 ctxt->node = node; 794 790 registerNamespaces(ctxt); 791 + xmlXPathContextSetCache(ctxt, 1, -1, 0); 795 792 796 793 if (is_xpathmode(This->node->doc)) 797 794 { ··· 836 833 xmlXPathFreeContext(ctxt); 837 834 return hr; 838 835 } 839 - 840 - #endif
+16 -25
dll/win32/msxml3/stylesheet.c
··· 20 20 21 21 #define COBJMACROS 22 22 23 - #include "config.h" 24 - 25 23 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - # include <libxml/xmlerror.h> 29 - #endif 24 + #include <libxml/parser.h> 25 + #include <libxml/xmlerror.h> 30 26 31 27 #include "windef.h" 32 28 #include "winbase.h" ··· 100 96 list_remove(&par->entry); 101 97 SysFreeString(par->name); 102 98 SysFreeString(par->value); 103 - heap_free(par); 99 + free(par); 104 100 } 105 101 106 102 static void xsltemplate_set_node( xsltemplate *This, IXMLDOMNode *node ) ··· 143 139 { 144 140 xsltemplate *This = impl_from_IXSLTemplate( iface ); 145 141 ULONG ref = InterlockedIncrement( &This->ref ); 146 - TRACE("(%p)->(%d)\n", This, ref); 142 + TRACE("%p, refcount %lu.\n", iface, ref); 147 143 return ref; 148 144 } 149 145 ··· 152 148 xsltemplate *This = impl_from_IXSLTemplate( iface ); 153 149 ULONG ref = InterlockedDecrement( &This->ref ); 154 150 155 - TRACE("(%p)->(%d)\n", This, ref); 151 + TRACE("%p, refcount %lu.\n", iface, ref); 156 152 if ( ref == 0 ) 157 153 { 158 154 if (This->node) IXMLDOMNode_Release( This->node ); 159 - heap_free( This ); 155 + free( This ); 160 156 } 161 157 162 158 return ref; ··· 271 267 272 268 TRACE("(%p)\n", ppObj); 273 269 274 - This = heap_alloc( sizeof (*This) ); 270 + This = malloc(sizeof(*This)); 275 271 if(!This) 276 272 return E_OUTOFMEMORY; 277 273 ··· 321 317 { 322 318 xslprocessor *This = impl_from_IXSLProcessor( iface ); 323 319 ULONG ref = InterlockedIncrement( &This->ref ); 324 - TRACE("(%p)->(%d)\n", This, ref); 320 + TRACE("%p, refcount %lu.\n", iface, ref); 325 321 return ref; 326 322 } 327 323 ··· 330 326 xslprocessor *This = impl_from_IXSLProcessor( iface ); 331 327 ULONG ref = InterlockedDecrement( &This->ref ); 332 328 333 - TRACE("(%p)->(%d)\n", This, ref); 329 + TRACE("%p, refcount %lu.\n", iface, ref); 334 330 if ( ref == 0 ) 335 331 { 336 332 struct xslprocessor_par *par, *par2; ··· 344 340 xslprocessor_par_free(&This->params, par); 345 341 346 342 IXSLTemplate_Release(&This->stylesheet->IXSLTemplate_iface); 347 - heap_free( This ); 343 + free(This); 348 344 } 349 345 350 346 return ref; ··· 404 400 { 405 401 IXMLDOMDocument *doc; 406 402 407 - hr = DOMDocument_create(MSXML_DEFAULT, (void**)&doc); 403 + hr = dom_document_create(MSXML_DEFAULT, (void **)&doc); 408 404 if (hr == S_OK) 409 405 { 410 406 VARIANT_BOOL b; ··· 513 509 if (FAILED(hr)) 514 510 { 515 511 output_type = PROCESSOR_OUTPUT_NOT_SET; 516 - WARN("failed to get output interface, 0x%08x\n", hr); 512 + WARN("failed to get output interface, hr %#lx.\n", hr); 517 513 } 518 514 break; 519 515 default: ··· 563 559 IXSLProcessor *iface, 564 560 VARIANT_BOOL *ret) 565 561 { 566 - #ifdef HAVE_LIBXML2 567 562 xslprocessor *This = impl_from_IXSLProcessor( iface ); 568 563 ISequentialStream *stream = NULL; 569 564 HRESULT hr; ··· 650 645 651 646 *ret = hr == S_OK ? VARIANT_TRUE : VARIANT_FALSE; 652 647 return hr; 653 - #else 654 - FIXME("libxml2 is required but wasn't present at compile time\n"); 655 - return E_NOTIMPL; 656 - #endif 657 648 } 658 649 659 650 static HRESULT WINAPI xslprocessor_reset( IXSLProcessor *iface ) ··· 713 704 /* search for existing parameter first */ 714 705 LIST_FOR_EACH_ENTRY(cur, &This->params.list, struct xslprocessor_par, entry) 715 706 { 716 - if (!strcmpW(cur->name, p)) 707 + if (!wcscmp(cur->name, p)) 717 708 { 718 709 par = cur; 719 710 break; ··· 735 726 else 736 727 { 737 728 /* new parameter */ 738 - par = heap_alloc(sizeof(struct xslprocessor_par)); 729 + par = malloc(sizeof(struct xslprocessor_par)); 739 730 if (!par) return E_OUTOFMEMORY; 740 731 741 732 par->name = SysAllocString(p); 742 733 if (!par->name) 743 734 { 744 - heap_free(par); 735 + free(par); 745 736 return E_OUTOFMEMORY; 746 737 } 747 738 list_add_tail(&This->params.list, &par->entry); ··· 819 810 820 811 TRACE("(%p)\n", ppObj); 821 812 822 - This = heap_alloc( sizeof (*This) ); 813 + This = malloc(sizeof(*This)); 823 814 if(!This) 824 815 return E_OUTOFMEMORY; 825 816
+12 -24
dll/win32/msxml3/text.c
··· 21 21 22 22 #define COBJMACROS 23 23 24 - #include "config.h" 25 - 26 24 #include <stdarg.h> 27 - #ifdef HAVE_LIBXML2 28 - # include <libxml/parser.h> 29 - # include <libxml/parserInternals.h> 30 - # include <libxml/xmlerror.h> 31 - #endif 25 + #include <libxml/parser.h> 26 + #include <libxml/parserInternals.h> 27 + #include <libxml/xmlerror.h> 32 28 33 29 #include "windef.h" 34 30 #include "winbase.h" ··· 39 35 #include "msxml_private.h" 40 36 41 37 #include "wine/debug.h" 42 - 43 - #ifdef HAVE_LIBXML2 44 38 45 39 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 46 40 ··· 97 91 { 98 92 domtext *This = impl_from_IXMLDOMText( iface ); 99 93 ULONG ref = InterlockedIncrement( &This->ref ); 100 - TRACE("(%p)->(%d)\n", This, ref); 94 + TRACE("%p, refcount %lu.\n", iface, ref); 101 95 return ref; 102 96 } 103 97 ··· 107 101 domtext *This = impl_from_IXMLDOMText( iface ); 108 102 ULONG ref = InterlockedDecrement( &This->ref ); 109 103 110 - TRACE("(%p)->(%d)\n", This, ref); 104 + TRACE("%p, refcount %lu.\n", iface, ref); 111 105 if ( ref == 0 ) 112 106 { 113 107 destroy_xmlnode(&This->node); 114 - heap_free( This ); 108 + free(This); 115 109 } 116 110 117 111 return ref; ··· 674 668 IXMLDOMText *iface, 675 669 LONG offset, LONG count, BSTR *p) 676 670 { 677 - domtext *This = impl_from_IXMLDOMText( iface ); 678 671 HRESULT hr; 679 672 BSTR data; 680 673 681 - TRACE("(%p)->(%d %d %p)\n", This, offset, count, p); 674 + TRACE("%p, %ld, %ld, %p.\n", iface, offset, count, p); 682 675 683 676 if(!p) 684 677 return E_INVALIDARG; ··· 748 741 IXMLDOMText *iface, 749 742 LONG offset, BSTR p) 750 743 { 751 - domtext *This = impl_from_IXMLDOMText( iface ); 752 744 HRESULT hr; 753 745 BSTR data; 754 746 LONG p_len; 755 747 756 - TRACE("(%p)->(%d %s)\n", This, offset, debugstr_w(p)); 748 + TRACE("%p, %ld, %s.\n", iface, offset, debugstr_w(p)); 757 749 758 750 /* If have a NULL or empty string, don't do anything. */ 759 751 if((p_len = SysStringLen(p)) == 0) ··· 800 792 LONG len = -1; 801 793 BSTR str; 802 794 803 - TRACE("(%p)->(%d %d)\n", iface, offset, count); 795 + TRACE("%p, %ld, %ld.\n", iface, offset, count); 804 796 805 797 hr = IXMLDOMText_get_length(iface, &len); 806 798 if(hr != S_OK) return hr; ··· 843 835 IXMLDOMText *iface, 844 836 LONG offset, LONG count, BSTR p) 845 837 { 846 - domtext *This = impl_from_IXMLDOMText( iface ); 847 838 HRESULT hr; 848 839 849 - TRACE("(%p)->(%d %d %s)\n", This, offset, count, debugstr_w(p)); 840 + TRACE("%p, %ld, %ld, %s.\n", iface, offset, count, debugstr_w(p)); 850 841 851 842 hr = IXMLDOMText_deleteData(iface, offset, count); 852 843 ··· 860 851 IXMLDOMText *iface, 861 852 LONG offset, IXMLDOMText **txtNode) 862 853 { 863 - domtext *This = impl_from_IXMLDOMText( iface ); 864 854 LONG length = 0; 865 855 866 - TRACE("(%p)->(%d %p)\n", This, offset, txtNode); 856 + TRACE("%p, %ld, %p.\n", iface, offset, txtNode); 867 857 868 858 if (!txtNode || offset < 0) return E_INVALIDARG; 869 859 ··· 951 941 { 952 942 domtext *This; 953 943 954 - This = heap_alloc( sizeof *This ); 944 + This = malloc(sizeof(*This)); 955 945 if ( !This ) 956 946 return NULL; 957 947 ··· 962 952 963 953 return (IUnknown*)&This->IXMLDOMText_iface; 964 954 } 965 - 966 - #endif
+4
dll/win32/msxml3/uuid.c
··· 54 54 * XMLDSOControl DSOControl 55 55 * 56 56 */ 57 + 58 + #ifndef __REACTOS__ 59 + DEFINE_GUID(CLSID_XMLSchemaCache60, 0x88d96a07, 0xf192, 0x11d4, 0xa6, 0x5f, 0x00, 0x40, 0x96, 0x32, 0x51, 0xe5); 60 + #endif
+4 -4
dll/win32/msxml3/version.rc
··· 16 16 17 17 #define WINE_FILEDESCRIPTION_STR "Wine MSXML 3.0" 18 18 #define WINE_FILENAME_STR "msxml3.dll" 19 - #define WINE_FILEVERSION 8,90,1101,0 20 - #define WINE_FILEVERSION_STR "8.90.1101.0" 21 - #define WINE_PRODUCTVERSION 8,90,1101,0 22 - #define WINE_PRODUCTVERSION_STR "8.90.1101.0" 19 + #define WINE_FILEVERSION 8,110,7601,24402 20 + #define WINE_FILEVERSION_STR "8.110.7601.24402" 21 + #define WINE_PRODUCTVERSION 8,110,7601,24402 22 + #define WINE_PRODUCTVERSION_STR "8.110.7601.24402" 23 23 #define WINE_EXTRAVALUES VALUE "OLESelfRegister","" 24 24 25 25 #include "wine/wine_common_ver.rc"
+1 -10
dll/win32/msxml3/xdr.c
··· 18 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 19 19 */ 20 20 21 - 22 - #include "config.h" 23 - 24 21 #include <assert.h> 25 - #ifdef HAVE_LIBXML2 26 - # include <libxml/tree.h> 27 - #endif 22 + #include <libxml/tree.h> 28 23 29 24 #include "wine/debug.h" 30 25 31 26 /* Both XDR and XSD are valid XML 32 27 * We just convert the doc tree, no need for a parser. 33 28 */ 34 - 35 - #ifdef HAVE_LIBXML2 36 29 37 30 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 38 31 ··· 824 817 825 818 return xsd_doc; 826 819 } 827 - 828 - #endif /* HAVE_LIBXML2 */
+10 -36
dll/win32/msxml3/xmldoc.c
··· 20 20 21 21 #define COBJMACROS 22 22 23 - #include "config.h" 24 - 25 23 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - # include <libxml/xmlerror.h> 29 - #endif 24 + #include <libxml/parser.h> 25 + #include <libxml/xmlerror.h> 30 26 31 27 #include "windef.h" 32 28 #include "winbase.h" ··· 41 37 #include "wine/debug.h" 42 38 43 39 #include "msxml_private.h" 44 - 45 - #ifdef HAVE_LIBXML2 46 40 47 41 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 48 42 ··· 108 102 { 109 103 xmldoc *This = impl_from_IXMLDocument(iface); 110 104 ULONG ref = InterlockedIncrement(&This->ref); 111 - TRACE("(%p)->(%d)\n", This, ref); 105 + TRACE("%p, refcount %ld.\n", iface, ref); 112 106 return ref; 113 107 } 114 108 ··· 117 111 xmldoc *This = impl_from_IXMLDocument(iface); 118 112 LONG ref = InterlockedDecrement(&This->ref); 119 113 120 - TRACE("(%p)->(%d)\n", This, ref); 114 + TRACE("%p, refcount %ld.\n", iface, ref); 121 115 122 116 if (ref == 0) 123 117 { 124 118 xmlFreeDoc(This->xmldoc); 125 119 if (This->stream) IStream_Release(This->stream); 126 - heap_free(This); 120 + free(This); 127 121 } 128 122 129 123 return ref; ··· 143 137 static HRESULT WINAPI xmldoc_GetTypeInfo(IXMLDocument *iface, UINT iTInfo, 144 138 LCID lcid, ITypeInfo** ppTInfo) 145 139 { 146 - xmldoc *This = impl_from_IXMLDocument(iface); 147 - 148 - TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); 140 + TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo); 149 141 150 142 return get_typeinfo(IXMLDocument_tid, ppTInfo); 151 143 } ··· 154 146 LPOLESTR* rgszNames, UINT cNames, 155 147 LCID lcid, DISPID* rgDispId) 156 148 { 157 - xmldoc *This = impl_from_IXMLDocument(iface); 158 149 ITypeInfo *typeinfo; 159 150 HRESULT hr; 160 151 161 - TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, 152 + TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, 162 153 lcid, rgDispId); 163 154 164 155 if(!rgszNames || cNames == 0 || !rgDispId) ··· 179 170 DISPPARAMS* pDispParams, VARIANT* pVarResult, 180 171 EXCEPINFO* pExcepInfo, UINT* puArgErr) 181 172 { 182 - xmldoc *This = impl_from_IXMLDocument(iface); 183 173 ITypeInfo *typeinfo; 184 174 HRESULT hr; 185 175 186 - TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), 176 + TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid), 187 177 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 188 178 189 179 hr = get_typeinfo(IXMLDocument_tid, &typeinfo); 190 180 if(SUCCEEDED(hr)) 191 181 { 192 - hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDocument_iface, dispIdMember, wFlags, 193 - pDispParams, pVarResult, pExcepInfo, puArgErr); 182 + hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 194 183 ITypeInfo_Release(typeinfo); 195 184 } 196 185 ··· 597 586 598 587 static xmlDocPtr parse_xml(char *ptr, int len) 599 588 { 600 - #ifdef HAVE_XMLREADMEMORY 601 589 return xmlReadMemory(ptr, len, NULL, NULL, 602 590 XML_PARSE_NOERROR | XML_PARSE_NOWARNING | XML_PARSE_NOBLANKS); 603 - #else 604 - return xmlParseMemory(ptr, len); 605 - #endif 606 591 } 607 592 608 593 static HRESULT WINAPI xmldoc_IPersistStreamInit_Load( ··· 702 687 703 688 TRACE("(%p)\n", ppObj); 704 689 705 - doc = heap_alloc(sizeof (*doc)); 690 + doc = malloc(sizeof(*doc)); 706 691 if(!doc) 707 692 return E_OUTOFMEMORY; 708 693 ··· 718 703 TRACE("returning iface %p\n", *ppObj); 719 704 return S_OK; 720 705 } 721 - 722 - #else 723 - 724 - HRESULT XMLDocument_create(LPVOID *ppObj) 725 - { 726 - MESSAGE("This program tried to use an XMLDocument object, but\n" 727 - "libxml2 support was not present at compile time.\n"); 728 - return E_NOTIMPL; 729 - } 730 - 731 - #endif
+38 -49
dll/win32/msxml3/xmlelem.c
··· 20 20 21 21 #define COBJMACROS 22 22 23 - #include "config.h" 24 - 25 23 #include <stdarg.h> 26 - #ifdef HAVE_LIBXML2 27 - # include <libxml/parser.h> 28 - # include <libxml/xmlerror.h> 29 - #endif 24 + #include <libxml/parser.h> 25 + #include <libxml/xmlerror.h> 30 26 31 27 #include "windef.h" 32 28 #include "winbase.h" ··· 38 34 #include "wine/debug.h" 39 35 40 36 #include "msxml_private.h" 41 - 42 - #ifdef HAVE_LIBXML2 43 37 44 38 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 45 39 ··· 103 97 if (ref == 0) 104 98 { 105 99 if (This->own) xmlFreeNode(This->node); 106 - heap_free(This); 100 + free(This); 107 101 } 108 102 109 103 return ref; ··· 123 117 static HRESULT WINAPI xmlelem_GetTypeInfo(IXMLElement *iface, UINT iTInfo, 124 118 LCID lcid, ITypeInfo** ppTInfo) 125 119 { 126 - xmlelem *This = impl_from_IXMLElement(iface); 127 - HRESULT hr; 128 - 129 - TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); 130 - 131 - hr = get_typeinfo(IXMLElement_tid, ppTInfo); 120 + TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo); 132 121 133 - return hr; 122 + return get_typeinfo(IXMLElement_tid, ppTInfo); 134 123 } 135 124 136 125 static HRESULT WINAPI xmlelem_GetIDsOfNames(IXMLElement *iface, REFIID riid, 137 126 LPOLESTR* rgszNames, UINT cNames, 138 127 LCID lcid, DISPID* rgDispId) 139 128 { 140 - xmlelem *This = impl_from_IXMLElement(iface); 141 129 ITypeInfo *typeinfo; 142 130 HRESULT hr; 143 131 144 - TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, 132 + TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, 145 133 lcid, rgDispId); 146 134 147 135 if(!rgszNames || cNames == 0 || !rgDispId) ··· 162 150 DISPPARAMS* pDispParams, VARIANT* pVarResult, 163 151 EXCEPINFO* pExcepInfo, UINT* puArgErr) 164 152 { 165 - xmlelem *This = impl_from_IXMLElement(iface); 166 153 ITypeInfo *typeinfo; 167 154 HRESULT hr; 168 155 169 - TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), 156 + TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid), 170 157 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 171 158 172 159 hr = get_typeinfo(IXMLElement_tid, &typeinfo); 173 160 if(SUCCEEDED(hr)) 174 161 { 175 - hr = ITypeInfo_Invoke(typeinfo, &This->IXMLElement_iface, dispIdMember, wFlags, pDispParams, 176 - pVarResult, pExcepInfo, puArgErr); 162 + hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 177 163 ITypeInfo_Release(typeinfo); 178 164 } 179 165 ··· 246 232 value = xmlchar_from_wchar(V_BSTR(&PropertyValue)); 247 233 attr = xmlSetProp(This->node, name, value); 248 234 249 - heap_free(name); 250 - heap_free(value); 235 + free(name); 236 + free(value); 251 237 return (attr) ? S_OK : S_FALSE; 252 238 } 253 239 ··· 299 285 SysFreeString(attr_name); 300 286 } 301 287 302 - heap_free(xml_name); 288 + free(xml_name); 303 289 } 304 290 305 291 if (val) ··· 337 323 hr = S_OK; 338 324 339 325 done: 340 - heap_free(name); 326 + free(name); 341 327 return hr; 342 328 } 343 329 ··· 386 372 return E_INVALIDARG; 387 373 388 374 *p = type_libxml_to_msxml(This->node->type); 389 - TRACE("returning %d\n", *p); 375 + TRACE("returning %ld\n", *p); 390 376 return S_OK; 391 377 } 392 378 ··· 422 408 content = xmlchar_from_wchar(p); 423 409 xmlNodeSetContent(This->node, content); 424 410 425 - heap_free(content); 411 + free(content); 426 412 427 413 return S_OK; 428 414 } ··· 434 420 xmlelem *childElem = impl_from_IXMLElement(pChildElem); 435 421 xmlNodePtr child; 436 422 437 - TRACE("(%p)->(%p %d %d)\n", This, pChildElem, lIndex, lreserved); 423 + TRACE("%p, %p, %ld, %ld.\n", iface, pChildElem, lIndex, lreserved); 438 424 439 425 if (lIndex == 0) 440 426 child = xmlAddChild(This->node, childElem->node); ··· 502 488 503 489 *ppObj = NULL; 504 490 505 - elem = heap_alloc(sizeof (*elem)); 491 + elem = malloc(sizeof(*elem)); 506 492 if(!elem) 507 493 return E_OUTOFMEMORY; 508 494 ··· 599 585 ref = InterlockedDecrement(&This->ref); 600 586 if (ref == 0) 601 587 { 602 - heap_free(This); 588 + free(This); 603 589 } 604 590 605 591 return ref; ··· 637 623 638 624 static HRESULT WINAPI xmlelem_collection_put_length(IXMLElementCollection *iface, LONG v) 639 625 { 640 - xmlelem_collection *This = impl_from_IXMLElementCollection(iface); 641 - TRACE("(%p)->(%d)\n", This, v); 626 + TRACE("%p, %ld.\n", iface, v); 627 + 642 628 return E_FAIL; 643 629 } 644 630 ··· 753 739 IEnumVARIANT *iface, ULONG celt, VARIANT *rgVar, ULONG *fetched) 754 740 { 755 741 xmlelem_collection *This = impl_from_IEnumVARIANT(iface); 756 - xmlNodePtr ptr = This->current; 742 + HRESULT hr; 757 743 758 - TRACE("(%p)->(%d %p %p)\n", This, celt, rgVar, fetched); 744 + TRACE("%p, %lu, %p, %p.\n", iface, celt, rgVar, fetched); 759 745 760 746 if (!rgVar) 761 747 return E_INVALIDARG; 762 748 763 - /* FIXME: handle celt */ 764 - if (fetched) 765 - *fetched = 1; 749 + if (fetched) *fetched = 0; 766 750 767 - if (This->current) 768 - This->current = This->current->next; 769 - else 751 + if (!This->current) 770 752 { 771 753 V_VT(rgVar) = VT_EMPTY; 772 - if (fetched) *fetched = 0; 773 754 return S_FALSE; 774 755 } 775 756 776 - V_VT(rgVar) = VT_DISPATCH; 777 - return XMLElement_create(ptr, (LPVOID *)&V_DISPATCH(rgVar), FALSE); 757 + while (celt > 0 && This->current) 758 + { 759 + V_VT(rgVar) = VT_DISPATCH; 760 + hr = XMLElement_create(This->current, (void **)&V_DISPATCH(rgVar), FALSE); 761 + if (FAILED(hr)) return hr; 762 + This->current = This->current->next; 763 + if (fetched) ++*fetched; 764 + rgVar++; 765 + celt--; 766 + } 767 + if (!celt) return S_OK; 768 + V_VT(rgVar) = VT_EMPTY; 769 + return S_FALSE; 778 770 } 779 771 780 772 static HRESULT WINAPI xmlelem_collection_IEnumVARIANT_Skip( 781 773 IEnumVARIANT *iface, ULONG celt) 782 774 { 783 - xmlelem_collection *This = impl_from_IEnumVARIANT(iface); 784 - FIXME("(%p)->(%d): stub\n", This, celt); 775 + FIXME("%p, %lu: stub\n", iface, celt); 785 776 return E_NOTIMPL; 786 777 } 787 778 ··· 824 815 if (!node->children) 825 816 return S_FALSE; 826 817 827 - collection = heap_alloc(sizeof (*collection)); 818 + collection = malloc(sizeof(*collection)); 828 819 if(!collection) 829 820 return E_OUTOFMEMORY; 830 821 ··· 841 832 TRACE("returning iface %p\n", *ppObj); 842 833 return S_OK; 843 834 } 844 - 845 - #endif
+10 -33
dll/win32/msxml3/xmlparser.c
··· 19 19 */ 20 20 #define COBJMACROS 21 21 22 - #include "config.h" 23 - 24 22 #include <stdarg.h> 25 - #ifdef HAVE_LIBXML2 26 - # include <libxml/parser.h> 27 - # include <libxml/xmlerror.h> 28 - # include <libxml/HTMLtree.h> 29 - #endif 30 23 31 - #include "windef.h" 32 - #include "winbase.h" 33 - #include "winuser.h" 34 24 #include "ole2.h" 35 - #include "msxml6.h" 36 - 37 - #include "msxml_private.h" 38 25 39 26 #include "initguid.h" 40 27 #include "xmlparser.h" ··· 86 73 { 87 74 xmlparser *This = impl_from_IXMLParser( iface ); 88 75 ULONG ref = InterlockedIncrement( &This->ref ); 89 - TRACE("(%p)->(%d)\n", This, ref); 76 + TRACE("%p, refcount %lu.\n", iface, ref); 90 77 return ref; 91 78 } 92 79 ··· 95 82 xmlparser *This = impl_from_IXMLParser( iface ); 96 83 ULONG ref = InterlockedDecrement( &This->ref ); 97 84 98 - TRACE("(%p)->(%d)\n", This, ref); 85 + TRACE("%p, refcount %lu.\n", iface, ref); 99 86 if ( ref == 0 ) 100 87 { 101 88 if(This->input) ··· 104 91 if(This->nodefactory) 105 92 IXMLNodeFactory_Release(This->nodefactory); 106 93 107 - heap_free( This ); 94 + free(This); 108 95 } 109 96 110 97 return ref; ··· 240 227 static HRESULT WINAPI xmlparser_Load(IXMLParser *iface, BOOL bFullyAvailable, 241 228 IMoniker *pMon, LPBC pBC, DWORD dwMode) 242 229 { 243 - xmlparser *This = impl_from_IXMLParser( iface ); 244 - 245 - FIXME("(%p %d %p %p %d)\n", This, bFullyAvailable, pMon, pBC, dwMode); 230 + FIXME("%p, %d, %p, %p, %ld.\n", iface, bFullyAvailable, pMon, pBC, dwMode); 246 231 247 232 return E_NOTIMPL; 248 233 } ··· 268 253 static HRESULT WINAPI xmlparser_PushData(IXMLParser *iface, const char *pData, 269 254 ULONG nChars, BOOL fLastBuffer) 270 255 { 271 - xmlparser *This = impl_from_IXMLParser( iface ); 272 - 273 - FIXME("(%p %s %d %d)\n", This, debugstr_a(pData), nChars, fLastBuffer); 256 + FIXME("%p, %s, %lu, %d.\n", iface, debugstr_a(pData), nChars, fLastBuffer); 274 257 275 258 return E_NOTIMPL; 276 259 } ··· 298 281 static HRESULT WINAPI xmlparser_ParseEntity(IXMLParser *iface, const WCHAR *text, 299 282 ULONG len, BOOL fpe) 300 283 { 301 - xmlparser *This = impl_from_IXMLParser( iface ); 302 - 303 - FIXME("(%p %s %d %d)\n", This, debugstr_w(text), len, fpe); 284 + FIXME("%p, %s, %lu, %d.\n", iface, debugstr_w(text), len, fpe); 304 285 305 286 return E_NOTIMPL; 306 287 } ··· 308 289 static HRESULT WINAPI xmlparser_ExpandEntity(IXMLParser *iface, const WCHAR *text, 309 290 ULONG len) 310 291 { 311 - xmlparser *This = impl_from_IXMLParser( iface ); 312 - 313 - FIXME("(%p %s %d)\n", This, debugstr_w(text), len); 292 + FIXME("%p, %s, %ld.\n", iface, debugstr_w(text), len); 314 293 315 294 return E_NOTIMPL; 316 295 } ··· 335 314 336 315 static HRESULT WINAPI xmlparser_Run(IXMLParser *iface, LONG chars) 337 316 { 338 - xmlparser *This = impl_from_IXMLParser( iface ); 339 - 340 - FIXME("(%p %d)\n", This, chars); 317 + FIXME("%p, %ld.\n", iface, chars); 341 318 342 319 return E_NOTIMPL; 343 320 } ··· 373 350 { 374 351 xmlparser *This = impl_from_IXMLParser( iface ); 375 352 376 - TRACE("(%p %d)\n", This, flags); 353 + TRACE("%p, %lx.\n", iface, flags); 377 354 378 355 This->flags = flags; 379 356 ··· 440 417 441 418 TRACE("(%p)\n", ppObj); 442 419 443 - This = heap_alloc( sizeof(xmlparser) ); 420 + This = malloc(sizeof(xmlparser)); 444 421 if(!This) 445 422 return E_OUTOFMEMORY; 446 423
+50 -87
dll/win32/msxml3/xmlview.c
··· 16 16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 17 17 */ 18 18 19 - #include "config.h" 20 - 21 19 #include <stdarg.h> 22 20 23 21 #define COBJMACROS 24 - #define NONAMELESSUNION 25 - 26 - #ifdef HAVE_LIBXML2 27 - #include <libxml/parser.h> 28 - #endif 29 - 30 22 #include "windef.h" 31 23 #include "winbase.h" 32 24 #include "ole2.h" ··· 41 33 42 34 #include "wine/debug.h" 43 35 44 - #include "msxml_private.h" 45 - 46 - #ifdef HAVE_LIBXML2 36 + #include "msxml_dispex.h" 47 37 48 38 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 49 39 ··· 111 101 static ULONG WINAPI XMLView_Binding_AddRef(IBinding *iface) 112 102 { 113 103 Binding *This = impl_from_IBinding(iface); 114 - LONG ref = InterlockedIncrement(&This->ref); 104 + ULONG ref = InterlockedIncrement(&This->ref); 115 105 116 - TRACE("(%p)->(%d)\n", This, ref); 106 + TRACE("%p, refcount %lu.\n", iface, ref); 117 107 118 108 return ref; 119 109 } ··· 123 113 Binding *This = impl_from_IBinding(iface); 124 114 ULONG ref = InterlockedDecrement(&This->ref); 125 115 126 - TRACE("(%p)->(%d)\n", This, ref); 116 + TRACE("%p, refcount %lu.\n", iface, ref); 127 117 128 118 if(!ref) { 129 119 IBinding_Release(This->binding); 130 - heap_free(This); 120 + free(This); 131 121 } 132 122 return ref; 133 123 } ··· 158 148 IBinding *iface, LONG nPriority) 159 149 { 160 150 Binding *This = impl_from_IBinding(iface); 161 - TRACE("(%p)->(%d)\n", This, nPriority); 151 + TRACE("%p, %ld.\n", iface, nPriority); 162 152 163 153 return IBinding_SetPriority(This->binding, nPriority); 164 154 } ··· 198 188 { 199 189 Binding *bind; 200 190 201 - bind = heap_alloc_zero(sizeof(Binding)); 191 + bind = calloc(1, sizeof(Binding)); 202 192 if(!bind) 203 193 return E_OUTOFMEMORY; 204 194 ··· 240 230 IBindStatusCallback *iface) 241 231 { 242 232 BindStatusCallback *This = impl_from_IBindStatusCallback(iface); 243 - LONG ref = InterlockedIncrement(&This->ref); 233 + ULONG ref = InterlockedIncrement(&This->ref); 244 234 245 - TRACE("(%p)->(%d)\n", This, ref); 235 + TRACE("%p, refcount %lu.\n", iface, ref); 246 236 247 237 return ref; 248 238 } ··· 253 243 BindStatusCallback *This = impl_from_IBindStatusCallback(iface); 254 244 ULONG ref = InterlockedDecrement(&This->ref); 255 245 256 - TRACE("(%p)->(%d)\n", This, ref); 246 + TRACE("%p, refcount %lu.\n", iface, ref); 257 247 258 248 if(!ref) { 259 249 if(This->stream) 260 250 IStream_Release(This->stream); 261 251 IBindStatusCallback_Release(This->bsc); 262 252 IMoniker_Release(This->mon); 263 - heap_free(This); 253 + free(This); 264 254 } 265 255 return ref; 266 256 } ··· 272 262 IBinding *binding; 273 263 HRESULT hres; 274 264 275 - TRACE("(%p)->(%x %p)\n", This, dwReserved, pib); 265 + TRACE("%p, %lx, %p.\n", iface, dwReserved, pib); 276 266 277 267 hres = XMLView_Binding_Create(pib, &binding); 278 268 if(FAILED(hres)) { ··· 301 291 static HRESULT WINAPI XMLView_BindStatusCallback_OnLowResource( 302 292 IBindStatusCallback *iface, DWORD reserved) 303 293 { 304 - BindStatusCallback *This = impl_from_IBindStatusCallback(iface); 305 - FIXME("(%p)->(%x)\n", This, reserved); 294 + FIXME("%p, %lx.\n", iface, reserved); 306 295 return E_NOTIMPL; 307 296 } 308 297 ··· 311 300 ULONG ulStatusCode, LPCWSTR szStatusText) 312 301 { 313 302 BindStatusCallback *This = impl_from_IBindStatusCallback(iface); 314 - TRACE("(%p)->(%d %d %x %s)\n", This, ulProgress, ulProgressMax, 303 + TRACE("%p, %lu, %lu, %lu, %s.\n", iface, ulProgress, ulProgressMax, 315 304 ulStatusCode, debugstr_w(szStatusText)); 316 305 317 306 switch(ulStatusCode) { ··· 321 310 case BINDSTATUS_MIMETYPEAVAILABLE: 322 311 return S_OK; 323 312 default: 324 - FIXME("ulStatusCode: %d\n", ulStatusCode); 313 + FIXME("ulStatusCode: %lu\n", ulStatusCode); 325 314 return E_NOTIMPL; 326 315 } 327 316 } ··· 330 319 IBindStatusCallback *iface, HRESULT hresult, LPCWSTR szError) 331 320 { 332 321 BindStatusCallback *This = impl_from_IBindStatusCallback(iface); 333 - TRACE("(%p)->(%x %s)\n", This, hresult, debugstr_w(szError)); 322 + TRACE("%p, %#lx, %s.\n", iface, hresult, debugstr_w(szError)); 334 323 return IBindStatusCallback_OnStopBinding(This->bsc, hresult, szError); 335 324 } 336 325 ··· 360 349 return hres; 361 350 362 351 stgmedium.tymed = TYMED_ISTREAM; 363 - stgmedium.u.pstm = This->stream; 352 + stgmedium.pstm = This->stream; 364 353 stgmedium.pUnkForRelease = NULL; 365 354 366 355 hres = IBindStatusCallback_OnDataAvailable(This->bsc, ··· 402 391 if(FAILED(hres)) 403 392 return display_error_page(This); 404 393 405 - hres = DOMDocument_create(MSXML_DEFAULT, (void**)&xml); 394 + hres = dom_document_create(MSXML_DEFAULT, (void **)&xml); 406 395 if(FAILED(hres)) 407 396 return display_error_page(This); 408 397 ··· 436 425 } 437 426 438 427 /* TODO: fix parsing processing instruction value */ 439 - if((p = strstrW(V_BSTR(&var), hrefW))) { 428 + if((p = wcsstr(V_BSTR(&var), hrefW))) { 440 429 p += ARRAY_SIZE(hrefW) - 1; 441 430 if(*p!='\'' && *p!='\"') p = NULL; 442 431 else { 443 432 href = p+1; 444 - p = strchrW(href, *p); 433 + p = wcschr(href, *p); 445 434 } 446 435 } 447 436 if(p) { ··· 478 467 return display_error_page(This); 479 468 } 480 469 481 - hres = DOMDocument_create(MSXML_DEFAULT, (void**)&xsl); 470 + hres = dom_document_create(MSXML_DEFAULT, (void **)&xsl); 482 471 if(FAILED(hres)) { 483 472 VariantClear(&var); 484 473 IXMLDOMDocument3_Release(xml); ··· 524 513 DWORD size; 525 514 HRESULT hres; 526 515 527 - TRACE("(%p)->(%x %d %p %p)\n", This, grfBSCF, dwSize, pformatetc, pstgmed); 516 + TRACE("%p, %lx, %ld, %p, %p.\n", iface, grfBSCF, dwSize, pformatetc, pstgmed); 528 517 529 518 if(!This->stream) 530 519 return E_FAIL; 531 520 532 521 do { 533 - hres = IStream_Read(pstgmed->u.pstm, buf, sizeof(buf), &size); 522 + hres = IStream_Read(pstgmed->pstm, buf, sizeof(buf), &size); 534 523 IStream_Write(This->stream, buf, size, &size); 535 524 } while(hres==S_OK && size); 536 525 ··· 569 558 { 570 559 BindStatusCallback *bsc; 571 560 572 - bsc = heap_alloc_zero(sizeof(BindStatusCallback)); 561 + bsc = calloc(1, sizeof(BindStatusCallback)); 573 562 if(!bsc) 574 563 return E_OUTOFMEMORY; 575 564 ··· 615 604 Moniker *This = impl_from_IMoniker(iface); 616 605 LONG ref = InterlockedIncrement(&This->ref); 617 606 618 - TRACE("(%p)->(%d)\n", This, ref); 607 + TRACE("%p, refcount %lu.\n", iface, ref); 619 608 620 609 return ref; 621 610 } ··· 625 614 Moniker *This = impl_from_IMoniker(iface); 626 615 ULONG ref = InterlockedDecrement(&This->ref); 627 616 628 - TRACE("(%p)->(%d)\n", This, ref); 617 + TRACE("%p, refcount %lu.\n", iface, ref); 629 618 630 619 if(!ref) { 631 620 IMoniker_Release(This->mon); 632 - heap_free(This); 621 + free(This); 633 622 } 634 623 return ref; 635 624 } ··· 702 691 static HRESULT WINAPI XMLView_Moniker_Reduce(IMoniker *iface, IBindCtx *pbc, 703 692 DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced) 704 693 { 705 - Moniker *This = impl_from_IMoniker(iface); 706 - FIXME("(%p)->(%p %d %p %p)\n", This, pbc, dwReduceHowFar, ppmkToLeft, ppmkReduced); 694 + FIXME("%p, %p, %ld, %p, %p.\n", iface, pbc, dwReduceHowFar, ppmkToLeft, ppmkReduced); 707 695 return E_NOTIMPL; 708 696 } 709 697 ··· 834 822 { 835 823 Moniker *wrap; 836 824 837 - wrap = heap_alloc_zero(sizeof(Moniker)); 825 + wrap = calloc(1, sizeof(Moniker)); 838 826 if(!wrap) 839 827 return E_OUTOFMEMORY; 840 828 ··· 881 869 static ULONG WINAPI XMLView_PersistMoniker_AddRef(IPersistMoniker *iface) 882 870 { 883 871 XMLView *This = impl_from_IPersistMoniker(iface); 884 - LONG ref = InterlockedIncrement(&This->ref); 872 + ULONG ref = InterlockedIncrement(&This->ref); 885 873 886 - TRACE("(%p)->(%d)\n", This, ref); 874 + TRACE("%p, refcount %lu.\n", iface, ref); 887 875 888 876 return ref; 889 877 } ··· 893 881 XMLView *This = impl_from_IPersistMoniker(iface); 894 882 ULONG ref = InterlockedDecrement(&This->ref); 895 883 896 - TRACE("(%p)->(%d)\n", This, ref); 884 + TRACE("%p, refcount %lu.\n", iface, ref); 897 885 898 886 if(!ref) { 899 887 if(This->mon) 900 888 IMoniker_Release(This->mon); 901 889 IUnknown_Release(This->html_doc); 902 - heap_free(This); 890 + free(This); 903 891 } 904 892 return ref; 905 893 } ··· 937 925 IUnknown *unk; 938 926 HRESULT hres; 939 927 940 - TRACE("(%p)->(%x %p %p %x)\n", This, fFullyAvailable, pimkName, pibc, grfMode); 928 + TRACE("%p, %x, %p, %p, %lx.\n", iface, fFullyAvailable, pimkName, pibc, grfMode); 941 929 942 930 hres = IBindCtx_GetObjectParam(pibc, (LPOLESTR)XSLParametersW, &unk); 943 931 if(SUCCEEDED(hres)) { ··· 1136 1124 static HRESULT WINAPI XMLView_PersistHistory_SetPositionCookie( 1137 1125 IPersistHistory *iface, DWORD dwPositioncookie) 1138 1126 { 1139 - XMLView *This = impl_from_IPersistHistory(iface); 1140 - FIXME("(%p)->(%d)\n", This, dwPositioncookie); 1127 + FIXME("%p, %ld.\n", iface, dwPositioncookie); 1141 1128 return E_NOTIMPL; 1142 1129 } 1143 1130 ··· 1187 1174 static HRESULT WINAPI XMLView_OleCommandTarget_QueryStatus(IOleCommandTarget *iface, 1188 1175 const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) 1189 1176 { 1190 - XMLView *This = impl_from_IOleCommandTarget(iface); 1191 - FIXME("(%p)->(%p %x %p %p)\n", This, pguidCmdGroup, cCmds, prgCmds, pCmdText); 1177 + FIXME("%p, %p, %lu, %p, %p.\n", iface, pguidCmdGroup, cCmds, prgCmds, pCmdText); 1192 1178 return E_NOTIMPL; 1193 1179 } 1194 1180 ··· 1196 1182 const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, 1197 1183 VARIANT *pvaIn, VARIANT *pvaOut) 1198 1184 { 1199 - XMLView *This = impl_from_IOleCommandTarget(iface); 1200 - FIXME("(%p)->(%p %d %x %p %p)\n", This, pguidCmdGroup, 1185 + FIXME("%p, %p, %ld, %lx, %p, %p.\n", iface, pguidCmdGroup, 1201 1186 nCmdID, nCmdexecopt, pvaIn, pvaOut); 1202 1187 return E_NOTIMPL; 1203 1188 } ··· 1260 1245 1261 1246 static HRESULT WINAPI XMLView_OleObject_Close(IOleObject *iface, DWORD dwSaveOption) 1262 1247 { 1263 - XMLView *This = impl_from_IOleObject(iface); 1264 - FIXME("(%p)->(%x)\n", This, dwSaveOption); 1248 + FIXME("%p, %lx.\n", iface, dwSaveOption); 1265 1249 return E_NOTIMPL; 1266 1250 } 1267 1251 1268 1252 static HRESULT WINAPI XMLView_OleObject_SetMoniker(IOleObject *iface, 1269 1253 DWORD dwWhichMoniker, IMoniker *pmk) 1270 1254 { 1271 - XMLView *This = impl_from_IOleObject(iface); 1272 - FIXME("(%p)->(%x %p)\n", This, dwWhichMoniker, pmk); 1255 + FIXME("%p, %lx, %p.\n", iface, dwWhichMoniker, pmk); 1273 1256 return E_NOTIMPL; 1274 1257 } 1275 1258 1276 1259 static HRESULT WINAPI XMLView_OleObject_GetMoniker(IOleObject *iface, 1277 1260 DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk) 1278 1261 { 1279 - XMLView *This = impl_from_IOleObject(iface); 1280 - FIXME("(%p)->(%x %x %p)\n", This, dwAssign, dwWhichMoniker, ppmk); 1262 + FIXME("%p, %lx, %lx, %p.\n", iface, dwAssign, dwWhichMoniker, ppmk); 1281 1263 return E_NOTIMPL; 1282 1264 } 1283 1265 1284 1266 static HRESULT WINAPI XMLView_OleObject_InitFromData(IOleObject *iface, 1285 1267 IDataObject *pDataObject, BOOL fCreation, DWORD dwReserved) 1286 1268 { 1287 - XMLView *This = impl_from_IOleObject(iface); 1288 - FIXME("(%p)->(%p %x %x)\n", This, pDataObject, fCreation, dwReserved); 1269 + FIXME("%p, %p, %x, %lx.\n", iface, pDataObject, fCreation, dwReserved); 1289 1270 return E_NOTIMPL; 1290 1271 } 1291 1272 1292 1273 static HRESULT WINAPI XMLView_OleObject_GetClipboardData(IOleObject *iface, 1293 1274 DWORD dwReserved, IDataObject **ppDataObject) 1294 1275 { 1295 - XMLView *This = impl_from_IOleObject(iface); 1296 - FIXME("(%p)->(%x %p)\n", This, dwReserved, ppDataObject); 1276 + FIXME("%p, %lx, %p.\n", iface, dwReserved, ppDataObject); 1297 1277 return E_NOTIMPL; 1298 1278 } 1299 1279 ··· 1301 1281 LONG iVerb, LPMSG lpmsg, IOleClientSite *pActiveSite, 1302 1282 LONG lindex, HWND hwndParent, LPCRECT lprcPosRect) 1303 1283 { 1304 - XMLView *This = impl_from_IOleObject(iface); 1305 - FIXME("(%p)->(%d %p %p %d %p %p)\n", This, iVerb, lpmsg, 1284 + FIXME("%p, %ld, %p, %p, %ld, %p, %p.\n", iface, iVerb, lpmsg, 1306 1285 pActiveSite, lindex, hwndParent, lprcPosRect); 1307 1286 return E_NOTIMPL; 1308 1287 } ··· 1339 1318 static HRESULT WINAPI XMLView_OleObject_GetUserType(IOleObject *iface, 1340 1319 DWORD dwFormOfType, LPOLESTR *pszUserType) 1341 1320 { 1342 - XMLView *This = impl_from_IOleObject(iface); 1343 - FIXME("(%p)->(%x %p)\n", This, dwFormOfType, pszUserType); 1321 + FIXME("%p, %lx, %p.\n", iface, dwFormOfType, pszUserType); 1344 1322 return E_NOTIMPL; 1345 1323 } 1346 1324 1347 1325 static HRESULT WINAPI XMLView_OleObject_SetExtent(IOleObject *iface, 1348 1326 DWORD dwDrawAspect, SIZEL *psizel) 1349 1327 { 1350 - XMLView *This = impl_from_IOleObject(iface); 1351 - FIXME("(%p)->(%x %p)\n", This, dwDrawAspect, psizel); 1328 + FIXME("%p, %lx, %p.\n", iface, dwDrawAspect, psizel); 1352 1329 return E_NOTIMPL; 1353 1330 } 1354 1331 1355 1332 static HRESULT WINAPI XMLView_OleObject_GetExtent(IOleObject *iface, 1356 1333 DWORD dwDrawAspect, SIZEL *psizel) 1357 1334 { 1358 - XMLView *This = impl_from_IOleObject(iface); 1359 - FIXME("(%p)->(%x %p)\n", This, dwDrawAspect, psizel); 1335 + FIXME("%p, %lx, %p.\n", iface, dwDrawAspect, psizel); 1360 1336 return E_NOTIMPL; 1361 1337 } 1362 1338 ··· 1371 1347 static HRESULT WINAPI XMLView_OleObject_Unadvise( 1372 1348 IOleObject *iface, DWORD dwConnection) 1373 1349 { 1374 - XMLView *This = impl_from_IOleObject(iface); 1375 - FIXME("(%p)->(%d)\n", This, dwConnection); 1350 + FIXME("%p, %ld.\n", iface, dwConnection); 1376 1351 return E_NOTIMPL; 1377 1352 } 1378 1353 ··· 1387 1362 static HRESULT WINAPI XMLView_OleObject_GetMiscStatus( 1388 1363 IOleObject *iface, DWORD dwAspect, DWORD *pdwStatus) 1389 1364 { 1390 - XMLView *This = impl_from_IOleObject(iface); 1391 - FIXME("(%p)->(%d %p)\n", This, dwAspect, pdwStatus); 1365 + FIXME("%p, %ld, %p.\n", iface, dwAspect, pdwStatus); 1392 1366 return E_NOTIMPL; 1393 1367 } 1394 1368 ··· 1434 1408 1435 1409 TRACE("(%p)\n", ppObj); 1436 1410 1437 - This = heap_alloc_zero(sizeof(*This)); 1411 + This = calloc(1, sizeof(*This)); 1438 1412 if(!This) 1439 1413 return E_OUTOFMEMORY; 1440 1414 ··· 1447 1421 hres = CoCreateInstance(&CLSID_HTMLDocument, (IUnknown*)&This->IPersistMoniker_iface, 1448 1422 CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)&This->html_doc); 1449 1423 if(FAILED(hres)) { 1450 - heap_free(This); 1424 + free(This); 1451 1425 return hres; 1452 1426 } 1453 1427 1454 1428 *ppObj = &This->IPersistMoniker_iface; 1455 1429 return S_OK; 1456 1430 } 1457 - 1458 - #else 1459 - 1460 - HRESULT XMLView_create(void **ppObj) 1461 - { 1462 - MESSAGE("This program tried to use a XMLView object, but\n" 1463 - "libxml2 support was not present at compile time.\n"); 1464 - return E_NOTIMPL; 1465 - } 1466 - 1467 - #endif /* HAVE_LIBXML2 */
+7 -14
dll/win32/msxml3/xslpattern.h
··· 21 21 #ifndef __XSLPATTERN__ 22 22 #define __XSLPATTERN__ 23 23 24 - #ifndef __WINE_CONFIG_H 25 - #error You must include config.h to use this header 26 - #endif 27 - 28 - #ifndef HAVE_LIBXML2 29 - #error You must have libxml2 to use this header 30 - #endif 31 - 24 + #include <stdlib.h> 32 25 #include <libxml/tree.h> 33 26 #include <libxml/xmlstring.h> 34 27 #include <libxml/xpath.h> ··· 46 39 int err; 47 40 } parser_param; 48 41 49 - #define YYSTYPE xmlChar* 42 + #define XSLPATTERN_STYPE xmlChar* 50 43 #define YY_EXTRA_TYPE parser_param* 51 44 52 - int xslpattern_lex(xmlChar**, void*) DECLSPEC_HIDDEN; 53 - int xslpattern_lex_init(void**) DECLSPEC_HIDDEN; 54 - int xslpattern_lex_destroy(void*) DECLSPEC_HIDDEN; 55 - void xslpattern_set_extra(parser_param*, void*) DECLSPEC_HIDDEN; 56 - int xslpattern_parse(parser_param*, void*) DECLSPEC_HIDDEN; 45 + int xslpattern_lex(xmlChar**, void*); 46 + int xslpattern_lex_init(void**); 47 + int xslpattern_lex_destroy(void*); 48 + void xslpattern_set_extra(parser_param*, void*); 49 + int xslpattern_parse(parser_param*, void*); 57 50 58 51 59 52 #endif /* __XSLPATTERN__ */
+2 -8
dll/win32/msxml3/xslpattern.l
··· 19 19 */ 20 20 21 21 %{ 22 - #include "config.h" 23 - #include "wine/port.h" 24 - 25 - #ifdef HAVE_LIBXML2 26 - 27 22 #include "xslpattern.h" 28 23 #include "xslpattern.tab.h" 29 24 #include "wine/debug.h" ··· 31 26 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 32 27 33 28 #define SCAN xslpattern_get_extra(yyscanner) 29 + #define YYSTYPE XSLPATTERN_STYPE 34 30 35 31 #define YY_INPUT(tok_buf, tok_len, max) \ 36 32 do { \ ··· 152 148 153 149 %% 154 150 155 - xmlChar* XSLPattern_to_XPath(xmlXPathContextPtr, xmlChar const*) DECLSPEC_HIDDEN; 151 + xmlChar* XSLPattern_to_XPath(xmlXPathContextPtr, xmlChar const*); 156 152 xmlChar* XSLPattern_to_XPath(xmlXPathContextPtr ctxt, xmlChar const* xslpat_str) 157 153 { 158 154 parser_param p; ··· 181 177 } 182 178 183 179 } 184 - 185 - #endif /* HAVE_LIBXML2 */
+8 -8
dll/win32/msxml3/xslpattern.y
··· 19 19 */ 20 20 21 21 %{ 22 - #include "config.h" 23 - #include "wine/port.h" 24 - 25 - #ifdef HAVE_LIBXML2 26 22 #include "xslpattern.h" 27 23 #include <libxml/xpathInternals.h> 28 24 #include "wine/debug.h" 29 25 30 26 WINE_DEFAULT_DEBUG_CHANNEL(msxml); 31 27 28 + #ifdef __REACTOS__ 29 + #define YYSTYPE XSLPATTERN_STYPE 30 + #endif 32 31 33 32 static const xmlChar NameTest_mod_pre[] = "*[name()='"; 34 33 static const xmlChar NameTest_mod_post[] = "']"; ··· 44 43 45 44 static void xslpattern_error(parser_param* param, void const* scanner, char const* msg) 46 45 { 46 + param->err++; 47 47 FIXME("%s:\n" 48 48 " param {\n" 49 49 " yyscanner=%p\n" ··· 56 56 " }\n" 57 57 " scanner=%p\n", 58 58 msg, param->yyscanner, param->ctx, param->in, param->pos, 59 - param->len, param->out, ++param->err, scanner); 59 + param->len, param->out, param->err, scanner); 60 60 } 61 61 62 62 %} ··· 70 70 71 71 %start XSLPattern 72 72 73 - %pure-parser 73 + //%define api.prefix {xslpattern_} // __REACTOS__ 74 + %define api.pure 74 75 %parse-param {parser_param* p} 75 76 %parse-param {void* scanner} 76 77 %lex-param {yyscan_t* scanner} ··· 86 87 XSLPattern : Expr 87 88 { 88 89 p->out = $1; 90 + (void)xslpattern_nerrs; /* avoid unused variable warning */ 89 91 } 90 92 ; 91 93 ··· 750 752 ; 751 753 752 754 %% 753 - 754 - #endif /* HAVE_LIBXML2 */
+4 -10
media/doc/WINESYNC.txt
··· 134 134 dll/win32/msvcrt40 # Out of sync 135 135 dll/win32/msvfw32 # Synced to WineStaging-4.18 136 136 dll/win32/msvidc32 # Synced to WineStaging-4.0 137 - dll/win32/msxml # Synced to WineStaging-3.3 138 - dll/win32/msxml2 # Synced to WineStaging-3.3 139 - dll/win32/msxml3/domdoc # Synced to WineStaging-4.18 140 - dll/win32/msxml3/httpreq # Synced to WineStaging-4.18 141 - dll/win32/msxml3/saxreader # Synced to WineStaging-4.18 142 - dll/win32/msxml3/schema # Synced to Wine-6.14 143 - dll/win32/msxml3/xmldoc # Synced to WineStaging-4.18 144 - dll/win32/msxml3/xmlparser # Synced to WineStaging-4.18 145 - dll/win32/msxml3/xmlview # Synced to WineStaging-4.18 146 - dll/win32/msxml4 # Synced to WineStaging-3.3 137 + dll/win32/msxml # Synced to Wine-10.0 138 + dll/win32/msxml2 # Synced to Wine-10.0 139 + dll/win32/msxml3 # Synced to Wine-10.0 140 + dll/win32/msxml4 # Synced to Wine-10.0 147 141 dll/win32/msxml6 # Synced to WineStaging-3.3 148 142 dll/win32/nddeapi # Synced to WineStaging-3.3 149 143 dll/win32/netapi32 # Forked at Wine-1.3.34
+55 -50
sdk/include/psdk/msxml2.idl
··· 31 31 #define vi_progid(str) 32 32 #endif 33 33 34 + cpp_quote("#ifdef __ISAXXMLReader_INTERFACE_DEFINED__") 35 + cpp_quote("#undef __MSXML2_LIBRARY_DEFINED__") 36 + cpp_quote("#endif") 37 + 34 38 [ 35 39 uuid(f5078f18-c551-11d3-89b9-0000f81fe221), 36 40 version(3.0), ··· 75 79 interface ISAXErrorHandler; 76 80 interface ISAXLexicalHandler; 77 81 interface ISAXLocator; 78 - interface ISAXXMLReader; 79 82 interface ISAXXMLFilter; 83 + interface ISAXXMLReader; 80 84 81 85 interface IVBSAXAttributes; 82 86 interface IVBSAXContentHandler; ··· 133 137 } DOMNodeType; 134 138 cpp_quote("#endif") 135 139 140 + cpp_quote("#ifndef __msxml_som_enums__") 141 + cpp_quote("#define __msxml_som_enums__") 136 142 typedef enum _SOMITEMTYPE 137 143 { 138 144 SOMITEM_SCHEMA = 0x1000, ··· 260 266 SCHEMATYPEVARIETY_LIST = 1, 261 267 SCHEMATYPEVARIETY_UNION = 2, 262 268 } SCHEMATYPEVARIETY; 269 + cpp_quote("#endif /* __msxml_som_enums__ */") 263 270 264 271 [ 265 272 local, ··· 684 691 HRESULT getDeclaration( 685 692 [in] IXMLDOMNode* node, 686 693 [out,retval]ISchemaItem** item); 687 - }; 694 + } 688 695 689 696 [ 690 697 local, ··· 1258 1265 [id(DISPID_XMLDOM_PROCESSOR_SETSTARTMODE)] 1259 1266 HRESULT setStartMode( 1260 1267 [in] BSTR p, 1261 - [in] BSTR uri); 1268 + [in, defaultvalue("")] BSTR uri); 1262 1269 1263 1270 [propget, id(DISPID_XMLDOM_PROCESSOR_STARTMODE)] 1264 1271 HRESULT startMode([retval, out] BSTR *p); ··· 1286 1293 HRESULT addParameter( 1287 1294 [in] BSTR p, 1288 1295 [in] VARIANT var, 1289 - #ifndef __REACTOS__ 1290 - [in, defaultvalue(L"")] BSTR uri); 1291 - #else 1292 - [in] BSTR uri); 1293 - #endif 1296 + [in, defaultvalue("")] BSTR uri); 1294 1297 1295 1298 [id(DISPID_XMLDOM_PROCESSOR_ADDOBJECT)] 1296 1299 HRESULT addObject( ··· 1373 1376 1374 1377 [propput, id(14)] 1375 1378 HRESULT onreadystatechange([in] IDispatch *pReadyStateSink); 1376 - }; 1379 + } 1377 1380 1378 1381 [ 1379 1382 object, ··· 1747 1750 [default] interface IXMLDOMSchemaCollection2; 1748 1751 } 1749 1752 1753 + #ifdef __REACTOS__ 1750 1754 [ 1751 1755 uuid(88d96a07-f192-11d4-a65f-0040963251e5) 1752 1756 ] ··· 1754 1758 { 1755 1759 [default] interface IXMLDOMSchemaCollection2; 1756 1760 } 1761 + #endif 1757 1762 1758 1763 [ 1759 1764 helpstring("XML Schema Cache"), ··· 1901 1906 [in] int nQName, 1902 1907 [out] const WCHAR ** pValue, 1903 1908 [out] int * nValue); 1904 - }; 1909 + } 1905 1910 1906 1911 [ 1907 1912 object, ··· 1961 1966 HRESULT skippedEntity( 1962 1967 [in] const WCHAR * pName, 1963 1968 [in] int nName); 1964 - }; 1969 + } 1965 1970 1966 1971 [ 1967 1972 object, ··· 2001 2006 [in] int nPublicId, 2002 2007 [in] const WCHAR * pSystemId, 2003 2008 [in] int nSystemId); 2004 - }; 2009 + } 2005 2010 2006 2011 [ 2007 2012 object, ··· 2027 2032 [in] int nSystemId, 2028 2033 [in] const WCHAR * pNotationName, 2029 2034 [in] int nNotationName); 2030 - }; 2035 + } 2031 2036 2032 2037 [ 2033 2038 object, ··· 2040 2045 [in] const WCHAR * pPublicId, 2041 2046 [in] const WCHAR * pSystemId, 2042 2047 [out, retval] VARIANT * ret); 2043 - }; 2048 + } 2044 2049 2045 2050 [ 2046 2051 object, ··· 2063 2068 [in] ISAXLocator * pLocator, 2064 2069 [in] const WCHAR * pErrorMessage, 2065 2070 [in] HRESULT hrErrorCode); 2066 - }; 2071 + } 2067 2072 2068 2073 [ 2069 2074 object, ··· 2097 2102 HRESULT comment( 2098 2103 [in] const WCHAR * pChars, 2099 2104 [in] int nChars); 2100 - }; 2105 + } 2101 2106 2102 2107 [ 2103 2108 object, ··· 2117 2122 2118 2123 HRESULT getSystemId( 2119 2124 [out, retval] const WCHAR ** systemId); 2120 - }; 2125 + } 2121 2126 2122 2127 [ 2123 - local, 2124 - object, 2125 - uuid (a4f96ed0-f829-476e-81c0-cdc7bd2a0802) 2128 + local, 2129 + object, 2130 + uuid(a4f96ed0-f829-476e-81c0-cdc7bd2a0802) 2126 2131 ] 2127 2132 interface ISAXXMLReader : IUnknown 2128 2133 { ··· 2174 2179 [in] VARIANT varInput); 2175 2180 HRESULT parseURL( 2176 2181 [in] const WCHAR * url); 2177 - }; 2182 + } 2178 2183 2179 2184 [ 2180 2185 local, ··· 2187 2192 [out, retval] ISAXXMLReader ** pReader); 2188 2193 HRESULT putParent( 2189 2194 [in] ISAXXMLReader * reader); 2190 - }; 2195 + } 2191 2196 2192 2197 [ 2193 2198 object, ··· 2236 2241 2237 2242 [id(DISPID_SAX_ATTRIBUTES_GETVALUEFROMQNAME)] 2238 2243 HRESULT getValueFromQName( [in] BSTR QName, [out, retval] BSTR * value); 2239 - }; 2244 + } 2240 2245 2241 2246 [ 2242 2247 object, ··· 2283 2288 2284 2289 [id(DISPID_SAX_CONTENTHANDLER_SKIPPEDENTITY)] 2285 2290 HRESULT skippedEntity( [in, out] BSTR * name); 2286 - }; 2291 + } 2287 2292 2288 2293 [ 2289 2294 object, ··· 2316 2321 [in, out] BSTR * name, 2317 2322 [in, out] BSTR * publicId, 2318 2323 [in, out] BSTR * systemId); 2319 - }; 2324 + } 2320 2325 2321 2326 [ 2322 2327 object, ··· 2338 2343 [in, out] BSTR * publicId, 2339 2344 [in, out] BSTR * systemId, 2340 2345 [in, out] BSTR * notationName); 2341 - }; 2346 + } 2342 2347 2343 2348 [ 2344 2349 object, ··· 2353 2358 [in, out] BSTR * publicId, 2354 2359 [in, out] BSTR * systemId, 2355 2360 [out, retval] VARIANT * ret); 2356 - }; 2361 + } 2357 2362 2358 2363 [ 2359 2364 object, ··· 2380 2385 [in] IVBSAXLocator * locator, 2381 2386 [in, out] BSTR * errorMessage, 2382 2387 [in] LONG errorCode); 2383 - }; 2388 + } 2384 2389 2385 2390 [ 2386 2391 object, ··· 2410 2415 2411 2416 [id(DISPID_SAX_LEXICALHANDLER_COMMENT)] 2412 2417 HRESULT comment( [in, out] BSTR * chars); 2413 - }; 2418 + } 2414 2419 2415 2420 [ 2416 2421 object, ··· 2431 2436 2432 2437 [propget, id(DISPID_SAX_LOCATOR_SYSTEMID)] 2433 2438 HRESULT systemId( [out, retval] BSTR * systemId); 2434 - }; 2439 + } 2435 2440 2436 2441 [ 2437 2442 object, ··· 2446 2451 [propputref, id(DISPID_SAX_XMLFILTER_PARENT)] 2447 2452 HRESULT parent( [in] IVBSAXXMLReader * reader); 2448 2453 2449 - }; 2454 + } 2450 2455 2451 2456 [ 2452 2457 dual, ··· 2562 2567 2563 2568 [id(DISPID_MX_ATTRIBUTES_SETVALUE)] 2564 2569 HRESULT setValue([in] int index, [in] BSTR value); 2565 - }; 2570 + } 2566 2571 2567 2572 [ 2568 2573 local, ··· 2593 2598 2594 2599 [id(DISPID_MX_READER_CONTROL_SUSPEND)] 2595 2600 HRESULT suspend(); 2596 - }; 2601 + } 2597 2602 2598 2603 [ 2599 2604 object, ··· 2645 2650 2646 2651 [id(DISPID_MX_WRITER_FLUSH)] 2647 2652 HRESULT flush(); 2648 - }; 2653 + } 2649 2654 2650 2655 [ 2651 2656 local, ··· 2841 2846 [id(DISPID_NEWENUM), hidden, restricted, propget] 2842 2847 HRESULT _newEnum( 2843 2848 [out,retval] IUnknown** ppunk); 2844 - }; 2849 + } 2845 2850 2846 2851 [ 2847 2852 local, ··· 2875 2880 [id(DISPID_NEWENUM), hidden, restricted, propget] 2876 2881 HRESULT _newEnum( 2877 2882 [out,retval]IUnknown** ppunk); 2878 - }; 2883 + } 2879 2884 2880 2885 [ 2881 2886 local, ··· 2914 2919 HRESULT writeAnnotation( 2915 2920 [in] IUnknown* annotationSink, 2916 2921 [out,retval] VARIANT_BOOL* isWritten); 2917 - }; 2922 + } 2918 2923 2919 2924 [ 2920 2925 local, ··· 2960 2965 [id(DISPID_SOM_SCHEMALOCATIONS), propget] 2961 2966 HRESULT schemaLocations( 2962 2967 [out,retval] ISchemaStringCollection** schemaLocations); 2963 - }; 2968 + } 2964 2969 2965 2970 [ 2966 2971 local, ··· 2978 2983 [id(DISPID_SOM_MAXOCCURS), propget] 2979 2984 HRESULT maxOccurs( 2980 2985 [out,retval] VARIANT* maxOccurs); 2981 - }; 2986 + } 2982 2987 2983 2988 [ 2984 2989 object, ··· 3011 3016 [id(DISPID_SOM_ISREFERENCE), propget] 3012 3017 HRESULT isReference( 3013 3018 [out,retval] VARIANT_BOOL* reference); 3014 - }; 3019 + } 3015 3020 3016 3021 [ 3017 3022 local, ··· 3065 3070 [id(DISPID_SOM_ISREFERENCE), propget] 3066 3071 HRESULT isReference( 3067 3072 [out,retval] VARIANT_BOOL* reference); 3068 - }; 3073 + } 3069 3074 3070 3075 [ 3071 3076 local, ··· 3144 3149 [id(DISPID_SOM_PATTERNS), propget] 3145 3150 HRESULT patterns( 3146 3151 [out,retval] ISchemaStringCollection** patterns); 3147 - }; 3152 + } 3148 3153 3149 3154 [ 3150 3155 local, ··· 3178 3183 [id(DISPID_SOM_PROHIBITED), propget] 3179 3184 HRESULT prohibitedSubstitutions( 3180 3185 [out,retval] SCHEMADERIVATIONMETHOD* prohibited); 3181 - }; 3186 + } 3182 3187 3183 3188 [ 3184 3189 local, ··· 3196 3201 [id(DISPID_SOM_ATTRIBUTES), propget] 3197 3202 HRESULT attributes( 3198 3203 [out,retval] ISchemaItemCollection** attributes); 3199 - }; 3204 + } 3200 3205 3201 3206 [ 3202 3207 local, ··· 3210 3215 [id(DISPID_SOM_PARTICLES), propget] 3211 3216 HRESULT particles( 3212 3217 [out,retval] ISchemaItemCollection** particles); 3213 - }; 3218 + } 3214 3219 3215 3220 [ 3216 3221 local, ··· 3228 3233 [id(DISPID_SOM_PROCESSCONTENTS), propget] 3229 3234 HRESULT processContents( 3230 3235 [out,retval] SCHEMAPROCESSCONTENTS* processContents); 3231 - }; 3236 + } 3232 3237 3233 3238 [ 3234 3239 local, ··· 3250 3255 [id(DISPID_SOM_REFERENCEDKEY), propget] 3251 3256 HRESULT referencedKey( 3252 3257 [out,retval] ISchemaIdentityConstraint** key); 3253 - }; 3258 + } 3254 3259 3255 3260 [ 3256 3261 local, ··· 3268 3273 [id(DISPID_SOM_PUBLICIDENTIFIER), propget] 3269 3274 HRESULT publicIdentifier( 3270 3275 [out,retval] BSTR* uri); 3271 - }; 3276 + } 3272 3277 3273 3278 3274 3279 [ ··· 3283 3288 [default] interface IVBSAXXMLReader; 3284 3289 interface ISAXXMLReader; 3285 3290 interface IMXReaderControl; 3286 - }; 3291 + } 3287 3292 3288 3293 [ 3289 3294 uuid(7c6e29bc-8b8b-4c3d-859e-af6cd158be0f) ··· 3419 3424 interface IVBSAXDTDHandler; 3420 3425 interface IVBSAXErrorHandler; 3421 3426 interface IVBSAXLexicalHandler; 3422 - }; 3427 + } 3423 3428 3424 3429 [ 3425 3430 uuid(88d969c8-f192-11d4-a65f-0040963251e5),
+288 -495
sdk/include/psdk/msxml6.idl
··· 31 31 #define vi_progid(str) 32 32 #endif 33 33 34 - [ 35 - uuid(f5078f18-c551-11d3-89b9-0000f81fe221), 36 - version(6.0), 37 - helpstring("Microsoft XML, v6.0") 38 - ] 39 - library MSXML2 40 - { 41 - 42 - importlib("stdole2.tlb"); 43 - 44 34 interface IXMLDOMImplementation; 45 35 interface IXMLDOMNode; 46 36 interface IXMLDOMDocumentFragment; ··· 62 52 interface IXMLDOMEntityReference; 63 53 interface IXMLDOMParseError; 64 54 interface IXMLDOMParseErrorCollection; 55 + interface IXMLHTTPRequest2Callback; 56 + interface IXMLHTTPRequest3Callback; 65 57 interface IXTLRuntime; 66 58 interface IXSLTemplate; 67 59 interface IXSLProcessor; ··· 75 67 interface ISAXErrorHandler; 76 68 interface ISAXLexicalHandler; 77 69 interface ISAXLocator; 78 - interface ISAXXMLReader; 79 70 interface ISAXXMLFilter; 71 + interface ISAXXMLReader; 80 72 81 73 interface IVBSAXAttributes; 82 74 interface IVBSAXContentHandler; ··· 109 101 interface ISchemaIdentityConstraint; 110 102 interface ISchemaNotation; 111 103 112 - 113 - cpp_quote("#define DOMDocument DOMDocument2") 114 - cpp_quote("#define CLSID_DOMDocument CLSID_DOMDocument2") 104 + cpp_quote("#ifdef __ISAXXMLReader_INTERFACE_DEFINED__") 105 + cpp_quote("#undef __MSXML2_LIBRARY_DEFINED__") 106 + cpp_quote("#endif") 115 107 116 108 cpp_quote("#ifndef __MSXML_DOMNODETYPE_DEFINED") 117 109 cpp_quote("#define __MSXML_DOMNODETYPE_DEFINED") ··· 133 125 } DOMNodeType; 134 126 cpp_quote("#endif") 135 127 128 + cpp_quote("#ifndef __msxml_som_enums__") 129 + cpp_quote("#define __msxml_som_enums__") 136 130 typedef enum _SOMITEMTYPE 137 131 { 138 132 SOMITEM_SCHEMA = 0x1000, ··· 260 254 SCHEMATYPEVARIETY_LIST = 1, 261 255 SCHEMATYPEVARIETY_UNION = 2, 262 256 } SCHEMATYPEVARIETY; 257 + cpp_quote("#endif /* __msxml_som_enums__ */") 258 + 259 + typedef [v1_enum] enum _XHR_CRED_PROMPT 260 + { 261 + XHR_CRED_PROMPT_ALL, 262 + XHR_CRED_PROMPT_NONE, 263 + XHR_CRED_PROMPT_PROXY 264 + } XHR_CRED_PROMPT; 265 + 266 + typedef [v1_enum] enum _XHR_AUTH 267 + { 268 + XHR_AUTH_ALL, 269 + XHR_AUTH_NONE, 270 + XHR_AUTH_PROXY 271 + } XHR_AUTH; 272 + 273 + typedef [v1_enum] enum _XHR_PROPERTY 274 + { 275 + XHR_PROP_NO_CRED_PROMPT, 276 + XHR_PROP_NO_AUTH, 277 + XHR_PROP_TIMEOUT, 278 + XHR_PROP_NO_DEFAULT_HEADERS, 279 + XHR_PROP_REPORT_REDIRECT_STATUS, 280 + XHR_PROP_NO_CACHE, 281 + XHR_PROP_EXTENDED_ERROR, 282 + XHR_PROP_QUERY_STRING_UTF8, 283 + XHR_PROP_IGNORE_CERT_ERRORS, 284 + XHR_PROP_ONDATA_THRESHOLD, 285 + XHR_PROP_SET_ENTERPRISEID, 286 + XHR_PROP_MAX_CONNECTIONS 287 + } XHR_PROPERTY; 288 + 289 + typedef struct tagXHR_COOKIE 290 + { 291 + [ref, string] WCHAR *pwszUrl; 292 + [ref, string] WCHAR *pwszName; 293 + [unique, string] WCHAR *pwszValue; 294 + [unique, string] WCHAR *pwszP3PPolicy; 295 + FILETIME ftExpires; 296 + DWORD dwFlags; 297 + } XHR_COOKIE; 298 + 299 + typedef struct tagXHR_CERT 300 + { 301 + DWORD cbCert; 302 + [ref, size_is(cbCert)] BYTE *pbCert; 303 + } XHR_CERT; 263 304 264 305 [ 265 306 local, ··· 605 646 HRESULT getDeclaration( 606 647 [in] IXMLDOMNode* node, 607 648 [out,retval]ISchemaItem** item); 608 - }; 649 + } 609 650 610 651 [ 611 652 local, ··· 1263 1304 1264 1305 [propput, id(14)] 1265 1306 HRESULT onreadystatechange([in] IDispatch *pReadyStateSink); 1266 - }; 1307 + } 1308 + 1309 + typedef enum _SXH_SERVER_CERT_OPTION 1310 + { 1311 + SXH_SERVER_CERT_IGNORE_UNKNOWN_CA = 0x00000100, 1312 + SXH_SERVER_CERT_IGNORE_WRONG_USAGE = 0x00000200, 1313 + SXH_SERVER_CERT_IGNORE_CERT_CN_INVALID = 0x00001000, 1314 + SXH_SERVER_CERT_IGNORE_CERT_DATE_INVALID = 0x00002000, 1315 + SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = 1316 + (SXH_SERVER_CERT_IGNORE_UNKNOWN_CA | SXH_SERVER_CERT_IGNORE_WRONG_USAGE | 1317 + SXH_SERVER_CERT_IGNORE_CERT_CN_INVALID | SXH_SERVER_CERT_IGNORE_CERT_DATE_INVALID), 1318 + } SXH_SERVER_CERT_OPTION; 1267 1319 1268 1320 [ 1269 1321 object, ··· 1306 1358 } 1307 1359 1308 1360 [ 1361 + object, 1362 + uuid(e5d37dc0-552a-4d52-9cc0-a14d546fbd04), 1363 + ] 1364 + interface IXMLHTTPRequest2 : IUnknown 1365 + { 1366 + HRESULT Open([in, string, ref] const WCHAR *method, [in, string, ref] const WCHAR *url, 1367 + [in] IXMLHTTPRequest2Callback *callback, 1368 + [in, string, unique] const WCHAR *username, [in, string, unique] const WCHAR *password, 1369 + [in, string, unique] const WCHAR *proxyuser, [in, string, unique] const WCHAR *proxypassword); 1370 + 1371 + HRESULT Send([in, unique] ISequentialStream *body, [in] ULONGLONG length); 1372 + HRESULT Abort(); 1373 + HRESULT SetCookie([in, ref] const XHR_COOKIE *cookie, [out] DWORD *state); 1374 + HRESULT SetCustomResponseStream([in] ISequentialStream *stream); 1375 + HRESULT SetProperty([in] XHR_PROPERTY property, [in] ULONGLONG value); 1376 + HRESULT SetRequestHeader([in, string, ref] const WCHAR *header, [in, string, unique] const WCHAR *value); 1377 + HRESULT GetAllResponseHeaders([out, string] WCHAR **headers); 1378 + HRESULT GetCookie( [in, ref, string] const WCHAR *url, [in, unique, string] const WCHAR *name, 1379 + [in] DWORD flags, [out] ULONG *cookies_cnt, [out, size_is(,*cookies_cnt)] XHR_COOKIE **cookies); 1380 + HRESULT GetResponseHeader([in, string, ref] const WCHAR *header, [out, string] WCHAR **value); 1381 + }; 1382 + 1383 + [ 1384 + object, 1385 + uuid(a1c9feee-0617-4f23-9d58-8961ea43567c) 1386 + ] 1387 + interface IXMLHTTPRequest3 : IXMLHTTPRequest2 1388 + { 1389 + HRESULT SetClientCertificate([in] DWORD count, [in, unique, size_is(count)] const BYTE *hashes, 1390 + [in, string, unique] const WCHAR *pin); 1391 + }; 1392 + 1393 + [ 1394 + object, 1395 + uuid(a44a9299-e321-40de-8866-341b41669162), 1396 + pointer_default(ref) 1397 + ] 1398 + interface IXMLHTTPRequest2Callback : IUnknown 1399 + { 1400 + HRESULT OnRedirect([in] IXMLHTTPRequest2 *xhr, [in, string] const WCHAR *url); 1401 + HRESULT OnHeadersAvailable([in] IXMLHTTPRequest2 *xhr, [in] DWORD status, [in, string] const WCHAR *msg); 1402 + HRESULT OnDataAvailable([in] IXMLHTTPRequest2 *xhr, [in] ISequentialStream *stream); 1403 + HRESULT OnResponseReceived([in] IXMLHTTPRequest2 *xhr, [in] ISequentialStream *stream); 1404 + HRESULT OnError([in] IXMLHTTPRequest2 *xhr, [in] HRESULT error); 1405 + }; 1406 + 1407 + [ 1408 + object, 1409 + uuid(b9e57830-8c6c-4a6f-9c13-47772bb047bb) 1410 + ] 1411 + interface IXMLHTTPRequest3Callback : IXMLHTTPRequest2Callback 1412 + { 1413 + HRESULT OnServerCertificateReceived([in] IXMLHTTPRequest3 *xhr, [in] DWORD errors, 1414 + [in] DWORD count, [in, unique, size_is(count)] const XHR_CERT *certificates); 1415 + 1416 + HRESULT OnClientCertificateRequested([in] IXMLHTTPRequest3 *xhr, 1417 + [in] DWORD count, [in, string, unique, size_is(count)] const WCHAR **list); 1418 + }; 1419 + 1420 + [ 1309 1421 object, 1310 1422 dual, 1311 1423 oleautomation, ··· 1415 1527 HRESULT _newEnum( [retval, out] IUnknown **ppunk); 1416 1528 } 1417 1529 1418 - [ 1419 - uuid(F6D90F11-9C73-11D3-B32E-00C04F990BB4) 1420 - ] 1421 - coclass DOMDocument 1422 - { 1423 - [default] interface IXMLDOMDocument2; 1424 - [default, source] dispinterface XMLDOMDocumentEvents; 1425 - } 1426 - 1427 - [ 1428 - uuid(f5078f1b-c551-11d3-89b9-0000f81fe221) 1429 - ] 1430 - coclass DOMDocument26 1431 - { 1432 - [default] interface IXMLDOMDocument2; 1433 - [default, source] dispinterface XMLDOMDocumentEvents; 1434 - } 1435 - 1436 - [ 1437 - uuid(f5078f32-c551-11d3-89b9-0000f81fe221) 1438 - ] 1439 - coclass DOMDocument30 1440 - { 1441 - [default] interface IXMLDOMDocument2; 1442 - [default, source] dispinterface XMLDOMDocumentEvents; 1443 - } 1444 - 1445 - [ 1446 - uuid(88d969c0-f192-11d4-a65f-0040963251e5) 1447 - ] 1448 - coclass DOMDocument40 1449 - { 1450 - [default] interface IXMLDOMDocument2; 1451 - [default, source] dispinterface XMLDOMDocumentEvents; 1452 - } 1453 - 1454 - [ 1455 - helpstring("XML DOM Document 6.0"), 1456 - progid("Msxml2.DOMDocument.6.0"), 1457 - threading(both), 1458 - uuid(88d96a05-f192-11d4-a65f-0040963251e5) 1459 - ] 1460 - coclass DOMDocument60 1461 - { 1462 - [default] interface IXMLDOMDocument3; 1463 - [default, source] dispinterface XMLDOMDocumentEvents; 1464 - } 1465 - 1466 - [ 1467 - uuid(F6D90F12-9C73-11D3-B32E-00C04F990BB4) 1468 - ] 1469 - coclass FreeThreadedDOMDocument 1470 - { 1471 - [default] interface IXMLDOMDocument2; 1472 - [default, source] dispinterface XMLDOMDocumentEvents; 1473 - } 1474 - 1475 - [ 1476 - uuid(f5078f1c-c551-11d3-89b9-0000f81fe221) 1477 - ] 1478 - coclass FreeThreadedDOMDocument26 1479 - { 1480 - [default] interface IXMLDOMDocument2; 1481 - [default, source] dispinterface XMLDOMDocumentEvents; 1482 - } 1483 - 1484 - [ 1485 - uuid(f5078f33-c551-11d3-89b9-0000f81fe221) 1486 - ] 1487 - coclass FreeThreadedDOMDocument30 1488 - { 1489 - [default] interface IXMLDOMDocument2; 1490 - [default, source] dispinterface XMLDOMDocumentEvents; 1491 - } 1492 - 1493 - [ 1494 - uuid(88d969c1-f192-11d4-a65f-0040963251e5) 1495 - ] 1496 - coclass FreeThreadedDOMDocument40 1497 - { 1498 - [default] interface IXMLDOMDocument2; 1499 - [default, source] dispinterface XMLDOMDocumentEvents; 1500 - } 1501 - 1502 - [ 1503 - helpstring("Free threaded XML DOM Document 6.0"), 1504 - progid("Msxml2.FreeThreadedDOMDocument.6.0"), 1505 - threading(both), 1506 - uuid(88d96a06-f192-11d4-a65f-0040963251e5), 1507 - ] 1508 - coclass FreeThreadedDOMDocument60 1509 - { 1510 - [default] interface IXMLDOMDocument3; 1511 - [default, source] dispinterface XMLDOMDocumentEvents; 1512 - } 1513 - 1514 - [ 1515 - uuid(f6d90f16-9c73-11d3-b32e-00c04f990bb4) 1516 - ] 1517 - coclass XMLHTTP 1518 - { 1519 - [default] interface IXMLHTTPRequest; 1520 - } 1521 - 1522 - [ 1523 - uuid(f5078f1e-c551-11d3-89b9-0000f81fe221) 1524 - ] 1525 - coclass XMLHTTP26 1526 - { 1527 - [default] interface IXMLHTTPRequest; 1528 - } 1529 - 1530 - [ 1531 - uuid(f5078f35-c551-11d3-89b9-0000f81fe221) 1532 - ] 1533 - coclass XMLHTTP30 1534 - { 1535 - [default] interface IXMLHTTPRequest; 1536 - } 1537 - 1538 - [ 1539 - uuid(88d969c5-f192-11d4-a65f-0040963251e5) 1540 - ] 1541 - coclass XMLHTTP40 1542 - { 1543 - [default] interface IXMLHTTPRequest; 1544 - } 1545 - 1546 - [ 1547 - helpstring("XML HTTP 6.0"), 1548 - progid("Msxml2.XMLHTTP.6.0"), 1549 - threading(apartment), 1550 - uuid(88d96a0a-f192-11d4-a65f-0040963251e5) 1551 - ] 1552 - coclass XMLHTTP60 1553 - { 1554 - [default] interface IXMLHTTPRequest; 1555 - } 1556 - 1557 - [ 1558 - uuid(afba6b42-5692-48ea-8141-dc517dcf0ef1) 1559 - ] 1560 - coclass ServerXMLHTTP 1561 - { 1562 - [default] interface IServerXMLHTTPRequest; 1563 - } 1564 - 1565 - [ 1566 - uuid(afb40ffd-b609-40a3-9828-f88bbe11e4e3) 1567 - ] 1568 - coclass ServerXMLHTTP30 1569 - { 1570 - [default] interface IServerXMLHTTPRequest; 1571 - } 1572 - 1573 - [ 1574 - uuid(88d969c6-f192-11d4-a65f-0040963251e5) 1575 - ] 1576 - coclass ServerXMLHTTP40 1577 - { 1578 - [default] interface IServerXMLHTTPRequest2; 1579 - } 1580 - 1581 - [ 1582 - helpstring("Server XML HTTP 6.0"), 1583 - progid("Msxml2.ServerXMLHTTP.6.0"), 1584 - threading(apartment), 1585 - uuid(88d96a0b-f192-11d4-a65f-0040963251e5) 1586 - ] 1587 - coclass ServerXMLHTTP60 1588 - { 1589 - [default] interface IServerXMLHTTPRequest2; 1590 - } 1591 - 1592 - [ 1593 - uuid(373984c9-b845-449b-91e7-45ac83036ade) 1594 - ] 1595 - coclass XMLSchemaCache 1596 - { 1597 - [default] interface IXMLDOMSchemaCollection; 1598 - } 1599 - 1600 - [ 1601 - uuid(f5078f1d-c551-11d3-89b9-0000f81fe221) 1602 - ] 1603 - coclass XMLSchemaCache26 1604 - { 1605 - [default] interface IXMLDOMSchemaCollection; 1606 - } 1607 - 1608 - [ 1609 - uuid(f5078f34-c551-11d3-89b9-0000f81fe221) 1610 - ] 1611 - coclass XMLSchemaCache30 1612 - { 1613 - [default] interface IXMLDOMSchemaCollection; 1614 - } 1615 - 1616 - [ 1617 - uuid(88d969c2-f192-11d4-a65f-0040963251e5) 1618 - ] 1619 - coclass XMLSchemaCache40 1620 - { 1621 - [default] interface IXMLDOMSchemaCollection2; 1622 - } 1623 - 1624 - [ 1625 - helpstring("XML Schema Cache 6.0"), 1626 - progid("Msxml2.XMLSchemaCache.6.0"), 1627 - threading(both), 1628 - uuid(88d96a07-f192-11d4-a65f-0040963251e5) 1629 - ] 1630 - coclass XMLSchemaCache60 1631 - { 1632 - [default] interface IXMLDOMSchemaCollection2; 1633 - } 1634 - 1635 - [ 1636 - uuid(2933BF94-7B36-11d2-B20E-00C04F983E60) 1637 - ] 1638 - coclass XSLTemplate 1639 - { 1640 - [default] interface IXSLTemplate; 1641 - } 1642 - 1643 - [ 1644 - uuid(f5078f21-c551-11d3-89b9-0000f81fe221) 1645 - ] 1646 - coclass XSLTemplate26 1647 - { 1648 - [default] interface IXSLTemplate; 1649 - } 1650 - 1651 - [ 1652 - uuid(f5078f36-c551-11d3-89b9-0000f81fe221) 1653 - ] 1654 - coclass XSLTemplate30 1655 - { 1656 - [default] interface IXSLTemplate; 1657 - } 1658 - 1659 - [ 1660 - uuid(88d969c3-f192-11d4-a65f-0040963251e5) 1661 - ] 1662 - coclass XSLTemplate40 1663 - { 1664 - [default] interface IXSLTemplate; 1665 - } 1666 - 1667 - [ 1668 - helpstring("XSL Template 6.0"), 1669 - progid("Msxml2.XSLTemplate.6.0"), 1670 - threading(both), 1671 - uuid(88d96a08-f192-11d4-a65f-0040963251e5) 1672 - ] 1673 - coclass XSLTemplate60 1674 - { 1675 - [default] interface IXSLTemplate; 1676 - } 1677 - 1678 1530 /* 1679 1531 * Sax Interfaces 1680 1532 */ ··· 1761 1613 [in] int nQName, 1762 1614 [out] const WCHAR ** pValue, 1763 1615 [out] int * nValue); 1764 - }; 1616 + } 1765 1617 1766 1618 [ 1767 1619 object, ··· 1821 1673 HRESULT skippedEntity( 1822 1674 [in] const WCHAR * pName, 1823 1675 [in] int nName); 1824 - }; 1676 + } 1825 1677 1826 1678 [ 1827 1679 object, ··· 1861 1713 [in] int nPublicId, 1862 1714 [in] const WCHAR * pSystemId, 1863 1715 [in] int nSystemId); 1864 - }; 1716 + } 1717 + 1718 + [ 1719 + helpstring("Free Threaded XML HTTP Request class 6.0"), 1720 + progid("Msxml2.FreeThreadedXMLHTTP60.6.0"), 1721 + threading(both), 1722 + uuid(88d96a09-f192-11d4-a65f-0040963251e5) 1723 + ] 1724 + coclass FreeThreadedXMLHTTP60 1725 + { 1726 + [default] interface IXMLHTTPRequest2; 1727 + } 1865 1728 1866 1729 [ 1867 1730 object, ··· 1887 1750 [in] int nSystemId, 1888 1751 [in] const WCHAR * pNotationName, 1889 1752 [in] int nNotationName); 1890 - }; 1753 + } 1891 1754 1892 1755 [ 1893 1756 object, ··· 1900 1763 [in] const WCHAR * pPublicId, 1901 1764 [in] const WCHAR * pSystemId, 1902 1765 [out, retval] VARIANT * ret); 1903 - }; 1766 + } 1904 1767 1905 1768 [ 1906 1769 object, ··· 1923 1786 [in] ISAXLocator * pLocator, 1924 1787 [in] const WCHAR * pErrorMessage, 1925 1788 [in] HRESULT hrErrorCode); 1926 - }; 1789 + } 1927 1790 1928 1791 [ 1929 1792 object, ··· 1957 1820 HRESULT comment( 1958 1821 [in] const WCHAR * pChars, 1959 1822 [in] int nChars); 1960 - }; 1823 + } 1961 1824 1962 1825 [ 1963 1826 object, ··· 1977 1840 1978 1841 HRESULT getSystemId( 1979 1842 [out, retval] const WCHAR ** systemId); 1980 - }; 1981 - 1982 - [ 1983 - local, 1984 - object, 1985 - uuid(70409222-ca09-4475-acb8-40312fe8d145) 1986 - ] 1987 - interface ISAXXMLFilter : ISAXXMLReader 1988 - { 1989 - HRESULT getParent( 1990 - [out, retval] ISAXXMLReader ** pReader); 1991 - HRESULT putParent( 1992 - [in] ISAXXMLReader * reader); 1993 - }; 1843 + } 1994 1844 1995 1845 [ 1996 1846 local, ··· 2050 1900 } 2051 1901 2052 1902 [ 1903 + local, 1904 + object, 1905 + uuid(70409222-ca09-4475-acb8-40312fe8d145) 1906 + ] 1907 + interface ISAXXMLFilter : ISAXXMLReader 1908 + { 1909 + HRESULT getParent( 1910 + [out, retval] ISAXXMLReader ** pReader); 1911 + HRESULT putParent( 1912 + [in] ISAXXMLReader * reader); 1913 + } 1914 + 1915 + [ 2053 1916 object, 2054 1917 dual, 2055 1918 oleautomation, ··· 2096 1959 2097 1960 [id(DISPID_SAX_ATTRIBUTES_GETVALUEFROMQNAME)] 2098 1961 HRESULT getValueFromQName( [in] BSTR QName, [out, retval] BSTR * value); 2099 - }; 1962 + } 2100 1963 2101 1964 [ 2102 1965 object, ··· 2143 2006 2144 2007 [id(DISPID_SAX_CONTENTHANDLER_SKIPPEDENTITY)] 2145 2008 HRESULT skippedEntity( [in, out] BSTR * name); 2146 - }; 2009 + } 2147 2010 2148 2011 [ 2149 2012 object, ··· 2176 2039 [in, out] BSTR * name, 2177 2040 [in, out] BSTR * publicId, 2178 2041 [in, out] BSTR * systemId); 2179 - }; 2042 + } 2180 2043 2181 2044 [ 2182 2045 object, ··· 2198 2061 [in, out] BSTR * publicId, 2199 2062 [in, out] BSTR * systemId, 2200 2063 [in, out] BSTR * notationName); 2201 - }; 2064 + } 2202 2065 2203 2066 [ 2204 2067 object, ··· 2213 2076 [in, out] BSTR * publicId, 2214 2077 [in, out] BSTR * systemId, 2215 2078 [out, retval] VARIANT * ret); 2216 - }; 2079 + } 2217 2080 2218 2081 [ 2219 2082 object, ··· 2240 2103 [in] IVBSAXLocator * locator, 2241 2104 [in, out] BSTR * errorMessage, 2242 2105 [in] LONG errorCode); 2243 - }; 2106 + } 2244 2107 2245 2108 [ 2246 2109 object, ··· 2270 2133 2271 2134 [id(DISPID_SAX_LEXICALHANDLER_COMMENT)] 2272 2135 HRESULT comment( [in, out] BSTR * chars); 2273 - }; 2136 + } 2274 2137 2275 2138 [ 2276 2139 object, ··· 2291 2154 2292 2155 [propget, id(DISPID_SAX_LOCATOR_SYSTEMID)] 2293 2156 HRESULT systemId( [out, retval] BSTR * systemId); 2294 - }; 2157 + } 2295 2158 2296 2159 [ 2297 2160 object, ··· 2306 2169 [propputref, id(DISPID_SAX_XMLFILTER_PARENT)] 2307 2170 HRESULT parent( [in] IVBSAXXMLReader * reader); 2308 2171 2309 - }; 2172 + } 2310 2173 2311 2174 [ 2312 2175 dual, ··· 2422 2285 2423 2286 [id(DISPID_MX_ATTRIBUTES_SETVALUE)] 2424 2287 HRESULT setValue([in] int index, [in] BSTR value); 2425 - }; 2288 + } 2426 2289 2427 2290 [ 2428 2291 local, ··· 2453 2316 2454 2317 [id(DISPID_MX_READER_CONTROL_SUSPEND)] 2455 2318 HRESULT suspend(); 2456 - }; 2319 + } 2457 2320 2458 2321 [ 2459 2322 object, ··· 2505 2368 2506 2369 [id(DISPID_MX_WRITER_FLUSH)] 2507 2370 HRESULT flush(); 2508 - }; 2371 + } 2509 2372 2510 2373 [ 2511 2374 local, ··· 2701 2564 [id(DISPID_NEWENUM), hidden, restricted, propget] 2702 2565 HRESULT _newEnum( 2703 2566 [out,retval] IUnknown** ppunk); 2704 - }; 2567 + } 2705 2568 2706 2569 [ 2707 2570 local, ··· 2735 2598 [id(DISPID_NEWENUM), hidden, restricted, propget] 2736 2599 HRESULT _newEnum( 2737 2600 [out,retval]IUnknown** ppunk); 2738 - }; 2601 + } 2739 2602 2740 2603 [ 2741 2604 local, ··· 2774 2637 HRESULT writeAnnotation( 2775 2638 [in] IUnknown* annotationSink, 2776 2639 [out,retval] VARIANT_BOOL* isWritten); 2777 - }; 2640 + } 2778 2641 2779 2642 [ 2780 2643 local, ··· 2820 2683 [id(DISPID_SOM_SCHEMALOCATIONS), propget] 2821 2684 HRESULT schemaLocations( 2822 2685 [out,retval] ISchemaStringCollection** schemaLocations); 2823 - }; 2686 + } 2824 2687 2825 2688 [ 2826 2689 local, ··· 2838 2701 [id(DISPID_SOM_MAXOCCURS), propget] 2839 2702 HRESULT maxOccurs( 2840 2703 [out,retval] VARIANT* maxOccurs); 2841 - }; 2704 + } 2842 2705 2843 2706 [ 2844 2707 object, ··· 2871 2734 [id(DISPID_SOM_ISREFERENCE), propget] 2872 2735 HRESULT isReference( 2873 2736 [out,retval] VARIANT_BOOL* reference); 2874 - }; 2737 + } 2875 2738 2876 2739 [ 2877 2740 local, ··· 2925 2788 [id(DISPID_SOM_ISREFERENCE), propget] 2926 2789 HRESULT isReference( 2927 2790 [out,retval] VARIANT_BOOL* reference); 2928 - }; 2791 + } 2929 2792 2930 2793 [ 2931 2794 local, ··· 3004 2867 [id(DISPID_SOM_PATTERNS), propget] 3005 2868 HRESULT patterns( 3006 2869 [out,retval] ISchemaStringCollection** patterns); 3007 - }; 2870 + } 3008 2871 3009 2872 [ 3010 2873 local, ··· 3038 2901 [id(DISPID_SOM_PROHIBITED), propget] 3039 2902 HRESULT prohibitedSubstitutions( 3040 2903 [out,retval] SCHEMADERIVATIONMETHOD* prohibited); 3041 - }; 2904 + } 3042 2905 3043 2906 [ 3044 2907 local, ··· 3056 2919 [id(DISPID_SOM_ATTRIBUTES), propget] 3057 2920 HRESULT attributes( 3058 2921 [out,retval] ISchemaItemCollection** attributes); 3059 - }; 2922 + } 3060 2923 3061 2924 [ 3062 2925 local, ··· 3070 2933 [id(DISPID_SOM_PARTICLES), propget] 3071 2934 HRESULT particles( 3072 2935 [out,retval] ISchemaItemCollection** particles); 3073 - }; 2936 + } 3074 2937 3075 2938 [ 3076 2939 local, ··· 3088 2951 [id(DISPID_SOM_PROCESSCONTENTS), propget] 3089 2952 HRESULT processContents( 3090 2953 [out,retval] SCHEMAPROCESSCONTENTS* processContents); 3091 - }; 2954 + } 3092 2955 3093 2956 [ 3094 2957 local, ··· 3110 2973 [id(DISPID_SOM_REFERENCEDKEY), propget] 3111 2974 HRESULT referencedKey( 3112 2975 [out,retval] ISchemaIdentityConstraint** key); 3113 - }; 2976 + } 3114 2977 3115 2978 [ 3116 2979 local, ··· 3128 2991 [id(DISPID_SOM_PUBLICIDENTIFIER), propget] 3129 2992 HRESULT publicIdentifier( 3130 2993 [out,retval] BSTR* uri); 3131 - }; 3132 - 2994 + } 3133 2995 3134 2996 [ 3135 - uuid(079aa557-4a18-424a-8eee-e39f0a8d41b9) 2997 + uuid(f5078f18-c551-11d3-89b9-0000f81fe221), 2998 + version(6.0), 2999 + helpstring("Microsoft XML, v6.0") 3136 3000 ] 3137 - coclass SAXXMLReader 3001 + library MSXML2 3138 3002 { 3139 - [default] interface IVBSAXXMLReader; 3140 - interface ISAXXMLReader; 3141 - interface IMXReaderControl; 3142 - }; 3003 + 3004 + importlib("stdole2.tlb"); 3005 + 3006 + interface IXMLDOMNotation; 3007 + interface IXMLDOMEntity; 3008 + interface IXMLDOMEntityReference; 3009 + interface IXMLDOMParseError2; 3010 + interface IXMLDOMParseErrorCollection; 3011 + interface IXMLDOMSelection; 3012 + interface IXTLRuntime; 3013 + dispinterface XMLDOMDocumentEvents; 3014 + interface ISAXXMLFilter; 3015 + interface IVBSAXXMLFilter; 3016 + interface IMXReaderControl; 3017 + interface IMXSchemaDeclHandler; 3018 + interface IMXXMLFilter; 3019 + interface ISchemaElement; 3020 + interface ISchemaParticle; 3021 + interface ISchemaType; 3022 + interface ISchemaComplexType; 3023 + interface ISchemaAny; 3024 + interface ISchemaModelGroup; 3025 + interface ISchemaAttribute; 3026 + interface ISchemaAttributeGroup; 3027 + interface ISchemaIdentityConstraint; 3028 + interface ISchemaNotation; 3029 + 3030 + [hidden] typedef struct __msxml6_ReferenceRemainingTypes__ 3031 + { 3032 + enum tagDOMNodeType __tagDomNodeType__; 3033 + DOMNodeType __domNodeType__; 3034 + enum _SERVERXMLHTTP_OPTION __serverXmlHttpOptionEnum__; 3035 + SERVERXMLHTTP_OPTION __serverXmlHttpOption__; 3036 + enum _SXH_SERVER_CERT_OPTION __serverCertOptionEnum__; 3037 + SXH_SERVER_CERT_OPTION __serverCertOption__; 3038 + enum _SXH_PROXY_SETTING __proxySettingEnum__; 3039 + SXH_PROXY_SETTING __proxySetting__; 3040 + enum _SOMITEMTYPE __somItemTypeEnum__; 3041 + SOMITEMTYPE __somItemType__; 3042 + enum _SCHEMAUSE __schemaUseEnum__; 3043 + SCHEMAUSE __schemaUse__; 3044 + enum _SCHEMADERIVATIONMETHOD __schemaDerivationMethodEnum__; 3045 + SCHEMADERIVATIONMETHOD __schemaDerivationMethod__; 3046 + enum _SCHEMACONTENTTYPE __schemaContentTypeEnum__; 3047 + SCHEMACONTENTTYPE __schemaContentType__; 3048 + enum _SCHEMAPROCESSCONTENTS __schemaProcessContentsEnum__; 3049 + SCHEMAPROCESSCONTENTS __schemaProcessContents__; 3050 + enum _SCHEMAWHITESPACE __schemaWhitespaceEnum__; 3051 + SCHEMAWHITESPACE __schemaWhitespace__; 3052 + enum _SCHEMATYPEVARIETY __schemaTypeVarietyEnum__; 3053 + SCHEMATYPEVARIETY __schemaTypeVariety__; 3054 + } __msxml6_ReferenceRemainingTypes__; 3143 3055 3144 3056 [ 3145 - uuid(3124c396-fb13-4836-a6ad-1317f1713688) 3057 + helpstring("XML DOM Document 6.0"), 3058 + progid("Msxml2.DOMDocument.6.0"), 3059 + threading(both), 3060 + uuid(88d96a05-f192-11d4-a65f-0040963251e5) 3146 3061 ] 3147 - coclass SAXXMLReader30 3062 + coclass DOMDocument60 3148 3063 { 3149 - [default] interface IVBSAXXMLReader; 3150 - interface ISAXXMLReader; 3151 - interface IMXReaderControl; 3152 - }; 3064 + [default] interface IXMLDOMDocument3; 3065 + [default, source] dispinterface XMLDOMDocumentEvents; 3066 + } 3153 3067 3154 3068 [ 3155 - uuid(7c6e29bc-8b8b-4c3d-859e-af6cd158be0f) 3069 + helpstring("Free threaded XML DOM Document 6.0"), 3070 + progid("Msxml2.FreeThreadedDOMDocument.6.0"), 3071 + threading(both), 3072 + uuid(88d96a06-f192-11d4-a65f-0040963251e5), 3156 3073 ] 3157 - coclass SAXXMLReader40 3074 + coclass FreeThreadedDOMDocument60 3158 3075 { 3159 - [default] interface IVBSAXXMLReader; 3160 - interface ISAXXMLReader; 3076 + [default] interface IXMLDOMDocument3; 3077 + [default, source] dispinterface XMLDOMDocumentEvents; 3161 3078 } 3162 3079 3163 3080 [ ··· 3173 3090 } 3174 3091 3175 3092 [ 3176 - uuid(a4c23ec3-6b70-4466-9127-550077239978) 3177 - ] 3178 - coclass MXHTMLWriter 3179 - { 3180 - [default] interface IMXWriter; 3181 - 3182 - interface ISAXContentHandler; 3183 - interface ISAXErrorHandler; 3184 - interface ISAXDTDHandler; 3185 - interface ISAXLexicalHandler; 3186 - interface ISAXDeclHandler; 3187 - 3188 - interface IVBSAXContentHandler; 3189 - interface IVBSAXDeclHandler; 3190 - interface IVBSAXDTDHandler; 3191 - interface IVBSAXErrorHandler; 3192 - interface IVBSAXLexicalHandler; 3193 - } 3194 - 3195 - [ 3196 - uuid(853d1540-c1a7-4aa9-a226-4d3bd301146d) 3197 - ] 3198 - coclass MXHTMLWriter30 3199 - { 3200 - [default] interface IMXWriter; 3201 - 3202 - interface ISAXContentHandler; 3203 - interface ISAXDeclHandler; 3204 - interface ISAXDTDHandler; 3205 - interface ISAXErrorHandler; 3206 - interface ISAXLexicalHandler; 3207 - 3208 - interface IVBSAXContentHandler; 3209 - interface IVBSAXDeclHandler; 3210 - interface IVBSAXDTDHandler; 3211 - interface IVBSAXErrorHandler; 3212 - interface IVBSAXLexicalHandler; 3213 - } 3214 - 3215 - [ 3216 - uuid(88d969c9-f192-11d4-a65f-0040963251e5) 3093 + helpstring("XML Schema Cache 6.0"), 3094 + progid("Msxml2.XMLSchemaCache.6.0"), 3095 + threading(both), 3096 + uuid(88d96a07-f192-11d4-a65f-0040963251e5) 3217 3097 ] 3218 - coclass MXHTMLWriter40 3098 + coclass XMLSchemaCache60 3219 3099 { 3220 - [default] interface IMXWriter; 3221 - 3222 - interface ISAXContentHandler; 3223 - interface ISAXDeclHandler; 3224 - interface ISAXDTDHandler; 3225 - interface ISAXErrorHandler; 3226 - interface ISAXLexicalHandler; 3227 - 3228 - interface IVBSAXContentHandler; 3229 - interface IVBSAXDeclHandler; 3230 - interface IVBSAXDTDHandler; 3231 - interface IVBSAXErrorHandler; 3232 - interface IVBSAXLexicalHandler; 3100 + [default] interface IXMLDOMSchemaCollection2; 3233 3101 } 3234 3102 3235 3103 [ ··· 3256 3124 } 3257 3125 3258 3126 [ 3259 - uuid(fc220ad8-a72a-4ee8-926e-0b7ad152a020) 3260 - ] 3261 - coclass MXXMLWriter 3262 - { 3263 - [default] interface IMXWriter; 3264 - 3265 - interface ISAXContentHandler; 3266 - interface ISAXErrorHandler; 3267 - interface ISAXDTDHandler; 3268 - interface ISAXLexicalHandler; 3269 - interface ISAXDeclHandler; 3270 - 3271 - interface IVBSAXContentHandler; 3272 - interface IVBSAXDeclHandler; 3273 - interface IVBSAXDTDHandler; 3274 - interface IVBSAXErrorHandler; 3275 - interface IVBSAXLexicalHandler; 3276 - }; 3277 - 3278 - [ 3279 - uuid(3d813dfe-6c91-4a4e-8f41-04346a841d9c) 3280 - ] 3281 - coclass MXXMLWriter30 3282 - { 3283 - [default] interface IMXWriter; 3284 - 3285 - interface ISAXContentHandler; 3286 - interface ISAXDeclHandler; 3287 - interface ISAXDTDHandler; 3288 - interface ISAXErrorHandler; 3289 - interface ISAXLexicalHandler; 3290 - 3291 - interface IVBSAXContentHandler; 3292 - interface IVBSAXDeclHandler; 3293 - interface IVBSAXDTDHandler; 3294 - interface IVBSAXErrorHandler; 3295 - interface IVBSAXLexicalHandler; 3296 - }; 3297 - 3298 - [ 3299 - uuid(88d969c8-f192-11d4-a65f-0040963251e5), 3300 - ] 3301 - coclass MXXMLWriter40 3302 - { 3303 - [default] interface IMXWriter; 3304 - 3305 - interface ISAXContentHandler; 3306 - interface ISAXDeclHandler; 3307 - interface ISAXDTDHandler; 3308 - interface ISAXErrorHandler; 3309 - interface ISAXLexicalHandler; 3310 - 3311 - interface IVBSAXContentHandler; 3312 - interface IVBSAXDeclHandler; 3313 - interface IVBSAXDTDHandler; 3314 - interface IVBSAXErrorHandler; 3315 - interface IVBSAXLexicalHandler; 3316 - } 3317 - 3318 - [ 3319 3127 helpstring("MXXMLWriter 6.0"), 3320 3128 progid("Msxml2.MXXMLWriter.6.0"), 3321 3129 threading(both), ··· 3339 3147 } 3340 3148 3341 3149 [ 3342 - uuid(88d969d5-f192-11d4-a65f-0040963251e5) 3343 - ] 3344 - coclass MXNamespaceManager 3345 - { 3346 - [default] interface IVBMXNamespaceManager; 3347 - interface IMXNamespaceManager; 3348 - } 3349 - 3350 - [ 3351 - uuid(88d969d6-f192-11d4-a65f-0040963251e5) 3352 - ] 3353 - coclass MXNamespaceManager40 3354 - { 3355 - [default] interface IVBMXNamespaceManager; 3356 - interface IMXNamespaceManager; 3357 - } 3358 - 3359 - [ 3360 3150 helpstring("MXNamespaceManager 6.0"), 3361 3151 progid("Msxml2.MXNamespaceManager.6.0"), 3362 3152 threading(both), ··· 3369 3159 } 3370 3160 3371 3161 [ 3372 - uuid(4dd441ad-526d-4a77-9f1b-9841ed802fb0) 3162 + helpstring("SAXAttributes 6.0"), 3163 + progid("Msxml2.SAXAttributes.6.0"), 3164 + threading(both), 3165 + uuid(88d96a0e-f192-11d4-a65f-0040963251e5) 3373 3166 ] 3374 - coclass SAXAttributes 3167 + coclass SAXAttributes60 3375 3168 { 3376 3169 [default] interface IMXAttributes; 3377 3170 interface IVBSAXAttributes; ··· 3379 3172 } 3380 3173 3381 3174 [ 3382 - uuid(3e784a01-f3ae-4dc0-9354-9526b9370eba) 3175 + helpstring("XSL Template 6.0"), 3176 + progid("Msxml2.XSLTemplate.6.0"), 3177 + threading(both), 3178 + uuid(88d96a08-f192-11d4-a65f-0040963251e5) 3383 3179 ] 3384 - coclass SAXAttributes30 3180 + coclass XSLTemplate60 3385 3181 { 3386 - [default] interface IMXAttributes; 3387 - interface IVBSAXAttributes; 3388 - interface ISAXAttributes; 3182 + [default] interface IXSLTemplate; 3389 3183 } 3390 3184 3391 3185 [ 3392 - uuid(88d969ca-f192-11d4-a65f-0040963251e5), 3186 + helpstring("XML HTTP 6.0"), 3187 + progid("Msxml2.XMLHTTP.6.0"), 3188 + threading(apartment), 3189 + uuid(88d96a0a-f192-11d4-a65f-0040963251e5) 3393 3190 ] 3394 - coclass SAXAttributes40 3191 + coclass XMLHTTP60 3395 3192 { 3396 - [default] interface IMXAttributes; 3397 - interface IVBSAXAttributes; 3398 - interface ISAXAttributes; 3193 + [default] interface IXMLHTTPRequest; 3399 3194 } 3400 3195 3401 3196 [ 3402 - helpstring("SAXAttributes 6.0"), 3403 - progid("Msxml2.SAXAttributes.6.0"), 3404 - threading(both), 3405 - uuid(88d96a0e-f192-11d4-a65f-0040963251e5) 3197 + helpstring("Server XML HTTP 6.0"), 3198 + progid("Msxml2.ServerXMLHTTP.6.0"), 3199 + threading(apartment), 3200 + uuid(88d96a0b-f192-11d4-a65f-0040963251e5) 3406 3201 ] 3407 - coclass SAXAttributes60 3202 + coclass ServerXMLHTTP60 3408 3203 { 3409 - [default] interface IMXAttributes; 3410 - interface IVBSAXAttributes; 3411 - interface ISAXAttributes; 3204 + [default] interface IServerXMLHTTPRequest2; 3412 3205 } 3206 + 3207 + } /* Library MSXML */ 3413 3208 3414 3209 /* 3415 3210 * Error Codes ··· 3418 3213 cpp_quote("#define E_XML_NODTD 0xC00CE224") 3419 3214 cpp_quote("#define E_XML_INVALID 0xC00CE225") 3420 3215 cpp_quote("#define E_XML_BUFFERTOOSMALL 0xC00CE226") 3421 - 3422 - } /* Library MSXML */