[3/4] msxml3: Fix handling of feature values
Nikolay Sivov
nsivov at codeweavers.com
Thu Apr 19 01:58:38 CDT 2012
Fix handling of feature values
-------------- next part --------------
>From cf6f0e019ce07af83edac3854789b7d6338a47ad Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov at codeweavers.com>
Date: Thu, 19 Apr 2012 10:53:15 +0400
Subject: [PATCH 3/4] Fix handling of feature values
---
dlls/msxml3/saxreader.c | 6 ++++++
dlls/msxml3/tests/saxreader.c | 7 +------
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c
index e9ab841..936f583 100644
--- a/dlls/msxml3/saxreader.c
+++ b/dlls/msxml3/saxreader.c
@@ -288,6 +288,12 @@ static const WCHAR PropertyXMLDeclVersionW[] = {
static inline HRESULT set_feature_value(saxreader *reader, saxreader_feature feature, VARIANT_BOOL value)
{
+ /* handling of non-VARIANT_* values is version dependent */
+ if ((reader->version < MSXML4) && (value != VARIANT_TRUE))
+ value = VARIANT_FALSE;
+ if ((reader->version >= MSXML4) && (value != VARIANT_FALSE))
+ value = VARIANT_TRUE;
+
if (value == VARIANT_TRUE)
reader->features |= feature;
else
diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c
index 0c107af..5c768f4 100644
--- a/dlls/msxml3/tests/saxreader.c
+++ b/dlls/msxml3/tests/saxreader.c
@@ -2198,12 +2198,7 @@ static void test_saxreader_features(void)
value = 0xd;
hr = ISAXXMLReader_getFeature(reader, _bstr_(*name), &value);
EXPECT_HR(hr, S_OK);
- if (IsEqualGUID(entry->guid, &CLSID_SAXXMLReader40) ||
- IsEqualGUID(entry->guid, &CLSID_SAXXMLReader60))
- todo_wine
- ok(entry->value2 == value, "%s: got wrong value %x, expected %x\n", entry->clsid, value, entry->value2);
- else
- ok(entry->value2 == value, "%s: got wrong value %x, expected %x\n", entry->clsid, value, entry->value2);
+ ok(entry->value2 == value, "%s: got wrong value %x, expected %x\n", entry->clsid, value, entry->value2);
hr = ISAXXMLReader_putFeature(reader, _bstr_(*name), VARIANT_FALSE);
EXPECT_HR(hr, S_OK);
--
1.5.6.5
More information about the wine-patches
mailing list