msxml3: Fix handling of feature values.

This commit is contained in:
Nikolay Sivov 2012-04-19 10:53:15 +04:00 committed by Alexandre Julliard
parent f27159a59f
commit 54df4811c6
2 changed files with 7 additions and 6 deletions

View File

@ -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

View File

@ -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);