[PATCH v3] msxml3: Don't unlink the XML declaration when saving document.
Dmitry Timoshkov
dmitry at baikal.ru
Fri Apr 16 05:55:36 CDT 2021
Nikolay Sivov <nsivov at codeweavers.com> wrote:
> This appears to break stuff, example test that we should probably anyway:
>
> ---
> {
> hr = IXMLDOMDocument_loadXML(doc, _bstr_("<?xml version=\"1.0\"
> standalone=\"yes\"?>\r\n<test/>\r\n"), &b);
> ok(hr == S_OK, "got 0x%08x\n", hr);
> ok(b == VARIANT_TRUE, "got %d\n", b);
>
> hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
> ok(hr == S_OK, "got 0x%08x\n", hr);
>
> V_VT(&var) = VT_UNKNOWN;
> V_UNKNOWN(&var) = (IUnknown*)stream;
> hr = IXMLDOMDocument_save(doc, var);
> ok(hr == S_OK, "got 0x%08x\n", hr);
>
> hr = GetHGlobalFromStream(stream, &global);
> ok(hr == S_OK, "got 0x%08x\n", hr);
>
> p = GlobalLock(global);
> p[GlobalSize(global)] = 0;
>
> ok(0, "output %s\n", wine_dbgstr_a(p));
> }
> ---
>
> Test failed: output "<?xml version=\"1.0\" standalone=\"yes\"?>\n<?xml
> version=\"1.0\" standalone=\"yes\"?>\n<test/>\n"
>
> This produces duplicate declaration after your change, but is fine with
> current wine.
Thanks. I've added your test case above and created a better patch that
passes this one as well.
--
Dmitry.
More information about the wine-devel
mailing list