mshtml: Add IHTMLXMLHttpRequest::responseXML() method implementation. (try 3)

Zhenbo Li litimetal at gmail.com
Wed Dec 2 19:34:36 CST 2015


Thanks for the reply.

2015-11-30 19:32 GMT+08:00 Jacek Caban <jacek at codeweavers.com>:
 >
 >
 >
 >  static BOOL doc_complete;
 >  static IHTMLDocument2 *notif_doc;
 > +static BOOL ILLEGAL_XML;
 >
 >
 > Using this global variable makes things harder to follow. Please add 
a new
 > argument to test_sync_xhr instead.
I used this variable to help me debug, and I should remove it before
sending to wine-devel
In fact, we can use expect_text to determine whether the xmldoc is legal.


 > +    hres = IXMLDOMDocument_loadXML(xmldoc, str, &vbool);
 > +    SysFreeString(str);
 > +    if(hres != S_OK || vbool != VARIANT_TRUE) {
 > +        ERR("loadXML failed: %08x, returning an cmpty xmldoc\n", hres);
 > +    }
 >
 >
 > ERR is not appropriate here. Please use WARN instead.
 >

 > +
 > +    hres = IXMLDOMDocument_QueryInterface(xmldoc, &IID_IObjectSafety,
 > (void**)&safety);
 > +    if(SUCCEEDED(hres)) {
 >
 >
 > Again, this error handling is more complicated than it needs to be. 
Please
 > use assert(hres == S_OK) instead.
 >
 > +        hres = IObjectSafety_SetInterfaceSafetyOptions(safety, NULL,
 > +            INTERFACESAFE_FOR_UNTRUSTED_CALLER |
 > INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACE_USES_SECURITY_MANAGER,
 > +            INTERFACESAFE_FOR_UNTRUSTED_CALLER |
 > INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACE_USES_SECURITY_MANAGER);
 > +        IObjectSafety_Release(safety);
 > +        if(FAILED(hres)) {
 >
 >
 > Same here.
Sorry, I should accept your advice earlier, as assert() can make the
code much more cleaner.


2015-12-01 7:07 GMT+08:00 Christopher Harrington 
<ironiridis+winehq at gmail.com>:
 >> +    hres = IXMLDOMDocument_loadXML(xmldoc, str, &vbool);
 >> +    SysFreeString(str);
 >> +    if(hres != S_OK || vbool != VARIANT_TRUE) {
 >> +        ERR("loadXML failed: %08x, returning an cmpty xmldoc\n", hres);
 >> +    }
 >>
 >>
 >> ERR is not appropriate here. Please use WARN instead.
 >
 >
 > Also "cmpty" possibly a typo for "empty"?
Of course it is. I'm wondering why I made this mistake...


---
  dlls/mshtml/tests/xmlhttprequest.c | 111 
+++++++++++++++++++++++++++++++++++++
  dlls/mshtml/xmlhttprequest.c       |  41 +++++++++++++-
  2 files changed, 150 insertions(+), 2 deletions(-)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-mshtml-Add-IHTMLXMLHttpRequest-responseXML-method-impl.txt
Type: text/x-patch
Size: 7527 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20151203/87e07f75/attachment-0001.bin>


More information about the wine-patches mailing list