[PATCH] dlls/msxml3: Using strlenW instead of SysStringLen to check node name length

Nikolay Sivov bunglehead at gmail.com
Mon Mar 22 15:44:50 CDT 2010


On 3/22/2010 23:26, Eric Lanz wrote:
> Hello,
>
> Decided to keep it simple for my first patch.  SysStringLen was returning 0 for bstrs from our updater application which caused the domdoc_createNode function to exit early even though the bstr actually contained a valid name.  It seems that other functions in this file use strlenW for this purpose which seems to always return the correct length.
>
> Eric
>    
Hi, Eric.

It's means that you don't really use BSTR in your program, or that your 
BSTR is broken. If it works on Windows it should work with Wine too of 
course. I already fixed similar bug in ::loadXML of IXMLDOMDocument.

You need to add a test for that (look at domdoc.c for '_loadXML' and 
'broken BSTR' keywords, there's one already).
Speaking about a patch - you should avoid a complexity of strlenW here:

> -        if (!name || SysStringLen(name) == 0) return E_FAIL;
> +        if (!name || strlenW(name) == 0) return E_FAIL;
>    
Just do:
>           if (!name || name[0] == 0) return E_FAIL;
>
>    





More information about the wine-devel mailing list