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( ...@@ -2472,9 +2472,12 @@ static HRESULT internal_parse(
switch(V_VT(&varInput)) switch(V_VT(&varInput))
{ {
case VT_BSTR: case VT_BSTR:
hr = internal_parseBuffer(This, (const char*)V_BSTR(&varInput), case VT_BSTR|VT_BYREF:
strlenW(V_BSTR(&varInput))*sizeof(WCHAR), vbInterface); {
BSTR str = V_ISBYREF(&varInput) ? *V_BSTRREF(&varInput) : V_BSTR(&varInput);
hr = internal_parseBuffer(This, (const char*)str, strlenW(str)*sizeof(WCHAR), vbInterface);
break; break;
}
case VT_ARRAY|VT_UI1: { case VT_ARRAY|VT_UI1: {
void *pSAData; void *pSAData;
LONG lBound, uBound; LONG lBound, uBound;
......
...@@ -2512,6 +2512,7 @@ static void test_saxreader_properties(void) ...@@ -2512,6 +2512,7 @@ static void test_saxreader_properties(void)
ISAXXMLReader *reader; ISAXXMLReader *reader;
HRESULT hr; HRESULT hr;
VARIANT v; VARIANT v;
BSTR str;
hr = CoCreateInstance(&CLSID_SAXXMLReader, NULL, CLSCTX_INPROC_SERVER, hr = CoCreateInstance(&CLSID_SAXXMLReader, NULL, CLSCTX_INPROC_SERVER,
&IID_ISAXXMLReader, (void**)&reader); &IID_ISAXXMLReader, (void**)&reader);
...@@ -2659,6 +2660,13 @@ static void test_saxreader_properties(void) ...@@ -2659,6 +2660,13 @@ static void test_saxreader_properties(void)
hr = ISAXXMLReader_parse(reader, v); hr = ISAXXMLReader_parse(reader, v);
EXPECT_HR(hr, S_OK); 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_VT(&v) = VT_EMPTY;
V_BSTR(&v) = (void*)0xdeadbeef; V_BSTR(&v) = (void*)0xdeadbeef;
hr = ISAXXMLReader_getProperty(reader, _bstr_("xmldecl-version"), &v); 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