[PATCH] msxml3: put_output accepts DOMDocument destination

Jefferson Carpenter jeffersoncarpenter2 at gmail.com
Sun Apr 14 03:02:18 CDT 2019


Will write tests, thx.

On 4/14/2019 7:29 AM, Nikolay Sivov wrote:
> Hi, Jefferson. Please see comments below.
>> @@ -344,10 +355,10 @@ static HRESULT write_output_buffer(mxwriter 
>> *writer, const WCHAR *data, int len)
>>               if (!avail)
>>               {
>> -                IStream_Write(writer->dest, buff->data, 
>> buff->written, &written);
>> +                IStream_Write(writer->dest_stream, buff->data, 
>> buff->written, &written);
>>                   buff->written = 0;
>>                   if (src_len >= buff->allocated)
>> -                    IStream_Write(writer->dest, data, src_len, 
>> &written);
>> +                    IStream_Write(writer->dest_stream, data, src_len, 
>> &written);
>>                   else if (src_len)
>>                   {
>>                       memcpy(buff->data, data, src_len);
>> @@ -371,7 +382,7 @@ static HRESULT write_output_buffer(mxwriter 
>> *writer, const WCHAR *data, int len)
>>                   /* drain what we go so far */
>>                   if (buff->written)
>>                   {
>> -                    IStream_Write(writer->dest, buff->data, 
>> buff->written, &written);
>> +                    IStream_Write(writer->dest_stream, buff->data, 
>> buff->written, &written);
>>                       buff->written = 0;
>>                       avail = buff->allocated;
>>                   }
> I don't think this is a way to deal with that case. When writer output 
> is set to DOM document what will probably happen
> is a complete tree created and accumulated during SAX calls, and then 
> cloned back to said document on endDocument(). That means we'll simply
> have to skip over any writing call, both for existing stream or BSTR 
> path, and create nodes instead.
> 
>> +    case VT_DISPATCH:
>> +    {
>> +        IXMLDOMDocument *doc;
>> +        hr = IUnknown_QueryInterface(V_DISPATCH(&dest), 
>> &IID_IXMLDOMDocument, (void**)&doc);
>> +        if (hr == S_OK)
>> +        {
>> +            This->dest_type = MXWriterDestDocument;
>> +            This->dest_document = doc;
>> +            break;
>> +        }
>> +        FIXME("unhandled interface type for VT_DISPATCH destination\n");
>> +        return E_NOTIMPL;
>> +    }
> It's impossible to tell if this is correct without tests, e.g. 
> VT_UNKNOWN could also be passed with document pointer, it's valid in 
> VARIANT sense.
> 
> So please, if you're interested in working on this, first submit some 
> tests and ideally a bug report, if you can tell which application is 
> affected.
> 



More information about the wine-devel mailing list