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

Nikolay Sivov bunglehead at gmail.com
Tue Mar 23 08:40:42 CDT 2010


On 3/23/2010 16:21, Dan Kegel wrote:
> Hi Eric,
> welcome to Wine!
> http://msdn.microsoft.com/en-us/library/ms221240.aspx
> says the only time those two functions disagree on valid bstr's
> is if there are embedded nul chars, in which case SysStringLength
> probably returns a larger value.
Hi Dan.

It's a quite obvious thing. You can use BSTR in place of any WCHAR based 
parameter,
keeping in mind that nul inside BSTR will be treated as end of string, 
and BSTR itself is always
nul-terminated. In this case embedded nulls aren't allowed for node 
names I suppose,
at least http://www.w3.org/TR/REC-xml/#NT-Name tells that it's not possible.

The problem here is that native implementation most likely allows this 
parameter to be WCHAR string,
and this is a case for ::loadXML() method (already fixed). It's not a 
big deal to fix it, with tests of course.
>    Are you quite, quite sure that
> your bstrs are valid?
>    
Most likely they are not, which indicates an application bug or our BSTR 
management deficiency,
I believe there was a discussion in bugzilla about some caching 
functionality for example we don't provide,
not sure it could be related, just as an example.

Eric, please show us a code you're using to create BSTR before passing 
it to msxml.

> (In general, the best way to answer questions like that
> is to add a test case to your patch, and make sure it
> passes on Windows as well as Wine before submitting
> to wine-patches.)
>    
I already asked for that.
> - Dan
>    




More information about the wine-devel mailing list