Commit 2b4f20b8 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Support VT_BSTR|VT_BYREF as reader input.

parent 19eecac7
......@@ -2472,9 +2472,12 @@ static HRESULT internal_parse(
switch(V_VT(&varInput))
{
case VT_BSTR:
hr = internal_parseBuffer(This, (const char*)V_BSTR(&varInput),
strlenW(V_BSTR(&varInput))*sizeof(WCHAR), vbInterface);
case VT_BSTR|VT_BYREF:
{
BSTR str = V_ISBYREF(&varInput) ? *V_BSTRREF(&varInput) : V_BSTR(&varInput);
hr = internal_parseBuffer(This, (const char*)str, strlenW(str)*sizeof(WCHAR), vbInterface);
break;
}
case VT_ARRAY|VT_UI1: {
void *pSAData;
LONG lBound, uBound;
......
......@@ -2512,6 +2512,7 @@ static void test_saxreader_properties(void)
ISAXXMLReader *reader;
HRESULT hr;
VARIANT v;
BSTR str;
hr = CoCreateInstance(&CLSID_SAXXMLReader, NULL, CLSCTX_INPROC_SERVER,
&IID_ISAXXMLReader, (void**)&reader);
......@@ -2659,6 +2660,13 @@ static void test_saxreader_properties(void)
hr = ISAXXMLReader_parse(reader, v);
EXPECT_HR(hr, S_OK);
/* VT_BSTR|VT_BYREF input type */
str = _bstr_("<?xml version=\"1.0\"?><element></element>");
V_VT(&v) = VT_BSTR|VT_BYREF;
V_BSTRREF(&v) = &str;
hr = ISAXXMLReader_parse(reader, v);
EXPECT_HR(hr, S_OK);
V_VT(&v) = VT_EMPTY;
V_BSTR(&v) = (void*)0xdeadbeef;
hr = ISAXXMLReader_getProperty(reader, _bstr_("xmldecl-version"), &v);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment