Mathcad 15 wants to set a domdoc's MaxElementDepth property to 0 on startup, but it crashes if the setProperty call fails.
From: Andrew Nguyen arethusa26@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57493 --- dlls/msxml3/domdoc.c | 4 +++- dlls/msxml3/tests/domdoc.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 094447a9add..0a4914c9482 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -60,6 +60,7 @@ static const WCHAR PropertyAllowXsltScriptW[] = {'A','l','l','o','w','X','s','l' 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}; 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}; static const WCHAR PropertyValidateOnParse[] = L"ValidateOnParse"; +static const WCHAR PropertyMaxElementDepth[] = L"MaxElementDepth";
/* Anything that passes the test_get_ownerDocument() * tests can go here (data shared between all instances). @@ -3200,7 +3201,8 @@ static HRESULT WINAPI domdoc_setProperty( lstrcmpiW(p, PropertyResolveExternalsW) == 0 || lstrcmpiW(p, PropertyAllowXsltScriptW) == 0 || lstrcmpiW(p, PropertyNormalizeAttributeValuesW) == 0 || - lstrcmpiW(p, PropertyAllowDocumentFunctionW) == 0) + lstrcmpiW(p, PropertyAllowDocumentFunctionW) == 0 || + lstrcmpiW(p, PropertyMaxElementDepth) == 0) { /* Ignore */ FIXME("Ignoring property %s, value %s\n", debugstr_w(p), debugstr_variant(&value)); diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 8fec2cd9407..81f1235cd9b 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -13667,6 +13667,42 @@ todo_wine { IXMLDOMDocument2_Release(doc); }
+static void test_max_element_depth_values(void) +{ + IXMLDOMDocument2 *doc; + VARIANT var; + HRESULT hr; + + doc = create_document_version(60, &IID_IXMLDOMDocument2); + + /* The default max element depth value should be 256. */ + V_VT(&var) = VT_UI4; + V_UI4(&var) = 0xdeadbeef; + hr = IXMLDOMDocument2_getProperty(doc, _bstr_("MaxElementDepth"), &var); +todo_wine { + ok(hr == S_OK, "Failed to get property value, hr %#lx.\n", hr); + ok(V_VT(&var) == VT_I4, "Unexpected property value type, vt %d.\n", V_VT(&var)); + ok(V_I4(&var) == 256, "Unexpected property value.\n"); +} + + /* Changes to the depth value should be observable when subsequently retrieved. */ + V_VT(&var) = VT_I4; + V_I4(&var) = 32; + hr = IXMLDOMDocument2_setProperty(doc, _bstr_("MaxElementDepth"), var); + ok(hr == S_OK, "Failed to set property, hr %#lx.\n", hr); + + V_VT(&var) = VT_UI4; + V_UI4(&var) = 0xdeadbeef; + hr = IXMLDOMDocument2_getProperty(doc, _bstr_("MaxElementDepth"), &var); +todo_wine { + ok(hr == S_OK, "Failed to get property value, hr %#lx.\n", hr); + ok(V_VT(&var) == VT_I4, "Unexpected property value type, vt %d.\n", V_VT(&var)); + ok(V_I4(&var) == 32, "Unexpected property value.\n"); +} + + IXMLDOMDocument2_Release(doc); +} + typedef struct _namespace_as_attribute_t { const GUID *guid; const char *clsid; @@ -14273,6 +14309,7 @@ START_TEST(domdoc) test_validate_on_parse_values(); test_xsltemplate(); test_xsltext(); + test_max_element_depth_values();
if (is_clsid_supported(&CLSID_MXNamespaceManager40, &IID_IMXNamespaceManager)) {
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=150119
Your paranoid android.
=== debian11b (64 bit WoW report) ===
d2d1: d2d1.c:10856: Test failed: Didn't expect timeout.
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000016A00FC, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032 win.c:4070: Test failed: Expected active window 0000000006BB0182, got 0000000000000000. win.c:4071: Test failed: Expected focus window 0000000006BB0182, got 0000000000000000.
Report validation errors: mshtml:script crashed (c0000005)
This merge request was approved by Nikolay Sivov.